]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathScript.cpp
Cache icons of dynamic menu buttons
[lyx.git] / src / mathed / InsetMathScript.cpp
index 5d522bb9d38a4482aaf9d76704a8dac889cae9aa..c06291e31da6b888834c185b70a19d49b67c3bb3 100644 (file)
@@ -511,7 +511,7 @@ void InsetMathScript::write(TeXMathStream & os) const
 
        if (!nuc().empty()) {
                os << nuc();
-               // Avoid double superscript errors (bug #1633)
+               // Avoid double superscript errors (bug 1633)
                if (os.latex() && hasUp() && nuc().back()->getChar() == '\'')
                        os << "{}";
        } else if (os.firstitem())
@@ -529,8 +529,13 @@ void InsetMathScript::write(TeXMathStream & os) const
                    (up().size() == 1 && up().back()->asBraceInset() &&
                     up().back()->asBraceInset()->cell(0).empty())))
                        os << "^ {}";
-               else
+               else {
                        os << "^{" << up() << '}';
+                       // Avoid double superscript errors by writing an
+                       // empty group {} when a prime immediately follows
+                       if (os.latex())
+                               os.useBraces(true);
+               }
        }
 
        if (lock_ && !os.latex())