Correct ^ catcode for \cprotect

This commit is contained in:
Juergen Spitzmueller 2019-08-14 18:32:34 +02:00
parent 4c11ba11fd
commit 2746fdf7dd
3 changed files with 6 additions and 6 deletions

View File

@ -442,8 +442,8 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
os << "\\fcolorbox{" << params_.framecolor << "}{" << params_.backgroundcolor << "}"; os << "\\fcolorbox{" << params_.framecolor << "}{" << params_.backgroundcolor << "}";
else { else {
if (!cprotect.empty() && contains(runparams.active_chars, '^')) { if (!cprotect.empty() && contains(runparams.active_chars, '^')) {
// cprotect relies on ^ being ignored // cprotect relies on ^ being on catcode 7
os << "\\begingroup\\catcode`\\^=9"; os << "\\begingroup\\catcode`\\^=7";
needendgroup = true; needendgroup = true;
} }
os << cprotect << "\\fbox"; os << cprotect << "\\fbox";

View File

@ -462,8 +462,8 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
// commands, but we do not provide this information yet. // commands, but we do not provide this information yet.
if (hasCProtectContent(runparams.moving_arg)) { if (hasCProtectContent(runparams.moving_arg)) {
if (contains(runparams.active_chars, '^')) { if (contains(runparams.active_chars, '^')) {
// cprotect relies on ^ being ignored // cprotect relies on ^ being on catcode 7
os << "\\begingroup\\catcode`\\^=9"; os << "\\begingroup\\catcode`\\^=7";
needendgroup = true; needendgroup = true;
} }
os << "\\cprotect"; os << "\\cprotect";

View File

@ -681,8 +681,8 @@ void parStartCommand(Paragraph const & par, otexstream & os,
case LATEX_COMMAND: case LATEX_COMMAND:
if (par.needsCProtection(runparams.moving_arg)) { if (par.needsCProtection(runparams.moving_arg)) {
if (contains(runparams.active_chars, '^')) if (contains(runparams.active_chars, '^'))
// cprotect relies on ^ being ignored // cprotect relies on ^ being on catcode 7
os << "\\begingroup\\catcode`\\^=9"; os << "\\begingroup\\catcode`\\^=7";
os << "\\cprotect"; os << "\\cprotect";
} }
os << '\\' << from_ascii(style.latexname()); os << '\\' << from_ascii(style.latexname());