[LyX/2.4.x] \cprotect amendment

Juergen Spitzmueller spitz at lyx.org
Sat Jun 22 18:04:15 UTC 2024


commit 59648b5d35e1ef318677326cb20cccc9acc2cca0
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Jun 22 13:38:47 2024 +0200

    \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.
    
    (cherry picked from commit 8659924abd7026aa97a36bd99efeb11705ff7190)
---
 src/output_latex.cpp | 5 ++++-
 status.24x           | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index 9b504a72cb..7dc3347ed1 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -1000,7 +1000,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();
diff --git a/status.24x b/status.24x
index fddec2b074..f44e7a6839 100644
--- a/status.24x
+++ b/status.24x
@@ -67,6 +67,8 @@ What's new
 
 - Fix some cases where beamer breaks with the new cprotect mechanism.
 
+- Fix case where new cprotect mechanism breaks with caption.
+
 - Update acknowledgments handling in aastex63 layout 
   (cf. https://journals.aas.org/aastexguide/#acknowledgments)
 
@@ -76,6 +78,7 @@ What's new
 
 - Remove redundant code from preamble of double column Hebrew documents (bug 12919)
 
+
 * USER INTERFACE
 
 - Fix crash when deleting rows or columns from table.
@@ -102,7 +105,6 @@ What's new
 
 - Put new citation after selected item rather than at end of list (bug 12940).
 
-
 - fix overflow of appendix red frame in document-bottom grey area.
 
 
@@ -121,6 +123,7 @@ What's new
 
 - Fix crash when passing unknown value to textstyle-update
 
+
 * DOCUMENTATION AND LOCALIZATION
 
 


More information about the lyx-cvs mailing list