commit 596b2d16ee6e9534e39fe58d10b1c4ad66cac620
Author: Juergen Spitzmueller <[email protected]>
Date:   Mon Dec 27 11:37:59 2021 +0100

    \protect substack in fragile context
    
    (\cprotect'ion not needed then).
---
 src/Paragraph.cpp                |    1 -
 src/mathed/InsetMathSubstack.cpp |    2 ++
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index f09143a..17c68fa 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4125,7 +4125,6 @@ bool Paragraph::needsCProtection(bool const fragile) const
                if (!im || im->cell(0).empty())
                        continue;
                switch(im->cell(0)[0]->lyxCode()) {
-               case MATH_SUBSTACK_CODE:
                case MATH_ENV_CODE:
                case MATH_XYMATRIX_CODE:
                        // these need cprotection
diff --git a/src/mathed/InsetMathSubstack.cpp b/src/mathed/InsetMathSubstack.cpp
index ed90338..11678b5 100644
--- a/src/mathed/InsetMathSubstack.cpp
+++ b/src/mathed/InsetMathSubstack.cpp
@@ -100,6 +100,8 @@ void InsetMathSubstack::infoize(odocstream & os) const
 void InsetMathSubstack::write(TeXMathStream & os) const
 {
        MathEnsurer ensurer(os);
+       if (os.fragile())
+               os << "\\protect";
        os << "\\substack{";
        bool open = os.startOuterRow();
        InsetMathGrid::write(os);
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to