Avoid double superscript errors

Fixes #1633
This commit is contained in:
Enrico Forestieri 2021-02-05 01:03:09 +01:00
parent c1e38c4f6c
commit 5ed01cd616

View File

@ -509,9 +509,12 @@ void InsetMathScript::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
if (!nuc().empty())
if (!nuc().empty()) {
os << nuc();
else if (os.firstitem())
// Avoid double superscript errors (bug #1633)
if (os.latex() && hasUp() && nuc().back()->getChar() == '\'')
os << "{}";
} else if (os.firstitem())
LYXERR(Debug::MATHED, "suppressing {} when writing");
else
os << "{}";