From 8659924abd7026aa97a36bd99efeb11705ff7190 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 22 Jun 2024 13:38:47 +0200 Subject: [PATCH] \cprotect amendment \cprotect'ed insets do not need forced local font switch; in fact files with this break in compilation. E.g. a caption with an URL containing the char '#' and caption text set to a secondary language. --- src/output_latex.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 49dbd2d07a..f6026a6da6 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -1001,7 +1001,10 @@ void TeXOnePar(Buffer const & buf, && (prev_language->rightToLeft() != par_language->rightToLeft())); bool const localswitch = (runparams_in.find_effective() - || text.inset().forceLocalFontSwitch() + // \cprotect'ed insets do not need, and actually + // break with, local switches + || (text.inset().forceLocalFontSwitch() + && !text.inset().needsCProtection(maintext, runparams.moving_arg)) || (using_begin_end && text.inset().forcePlainLayout()) || in_polyglossia_rtl_env) && !text.inset().forceParDirectionSwitch(); -- 2.39.5