From 576d3836cf8e5d31d75ddf5e1910373af58cf4cb Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Tue, 14 May 2024 13:54:00 +0200 Subject: [PATCH] Amend a716fb96b53447 (cherry picked from commit af59551b1b0c7d7e95c70ae4db156cba7ac0cefe) --- src/Paragraph.cpp | 1 + src/insets/InsetText.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index ec92fa21cf..22a75c7d19 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -1173,6 +1173,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams, && !textinset->text().isMainText() && inset->lyxCode() != BRANCH_CODE && !runparams.no_cprotect + && !inset->getLayout().noCProtect() : false; unsigned int count2 = basefont.latexWriteStartChanges(os, bparams, rp, running_font, diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 5552d479be..73813d9ee3 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -500,7 +500,7 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const // FIXME UNICODE // FIXME \protect should only be used for fragile // commands, but we do not provide this information yet. - if (!runparams.no_cprotect && hasCProtectContent(runparams.moving_arg)) { + if (!il.noCProtect() && !runparams.no_cprotect && hasCProtectContent(runparams.moving_arg)) { if (contains(runparams.active_chars, '^')) { // cprotect relies on ^ being on catcode 7 os << "\\begingroup\\catcode`\\^=7";