]> git.lyx.org Git - features.git/commitdiff
Correct ^ catcode for \cprotect
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 14 Aug 2019 16:32:34 +0000 (18:32 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:43 +0000 (15:48 +0200)
src/insets/InsetBox.cpp
src/insets/InsetText.cpp
src/output_latex.cpp

index 86e35f745f69bfbc3739e068d3e73a1834a02a3a..3ed3a9c6137765b4cf008863ad932b614bf675c7 100644 (file)
@@ -442,8 +442,8 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
                                os << "\\fcolorbox{" << params_.framecolor << "}{" << params_.backgroundcolor << "}";
                        else {
                                if (!cprotect.empty() && contains(runparams.active_chars, '^')) {
-                                       // cprotect relies on ^ being ignored
-                                       os << "\\begingroup\\catcode`\\^=9";
+                                       // cprotect relies on ^ being on catcode 7
+                                       os << "\\begingroup\\catcode`\\^=7";
                                        needendgroup = true;
                                }
                                os << cprotect << "\\fbox";
index d264b2f59fdc3a088207887dd62d943c3b72793c..f2073f6cdff9ae9d9c81c4a254b11b694cbadfde 100644 (file)
@@ -462,8 +462,8 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
                        //    commands, but we do not provide this information yet.
                        if (hasCProtectContent(runparams.moving_arg)) {
                                if (contains(runparams.active_chars, '^')) {
-                                       // cprotect relies on ^ being ignored
-                                       os << "\\begingroup\\catcode`\\^=9";
+                                       // cprotect relies on ^ being on catcode 7
+                                       os << "\\begingroup\\catcode`\\^=7";
                                        needendgroup = true;
                                }
                                os << "\\cprotect";
index ad4db9b5270b75f2821706dc5928eda1642d3784..d320e0efe694f606f5bb2b5a9168889cb7cb316f 100644 (file)
@@ -681,8 +681,8 @@ void parStartCommand(Paragraph const & par, otexstream & os,
        case LATEX_COMMAND:
                if (par.needsCProtection(runparams.moving_arg)) {
                        if (contains(runparams.active_chars, '^'))
-                               // cprotect relies on ^ being ignored
-                               os << "\\begingroup\\catcode`\\^=9";
+                               // cprotect relies on ^ being on catcode 7
+                               os << "\\begingroup\\catcode`\\^=7";
                        os << "\\cprotect";
                }
                os << '\\' << from_ascii(style.latexname());