mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Correct ^ catcode for \cprotect
This commit is contained in:
parent
4c11ba11fd
commit
2746fdf7dd
@ -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";
|
||||||
|
@ -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";
|
||||||
|
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user