diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index 046b679152..f60b09043b 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -15,6 +15,7 @@ #include "DispatchResult.h" #include "FuncRequest.h" #include "FuncStatus.h" +#include "InsetMathBrace.h" #include "InsetMathFont.h" #include "InsetMathScript.h" #include "InsetMathSymbol.h" @@ -547,8 +548,16 @@ void InsetMathScript::write(WriteStream & os) const if (hasDown() /*&& down().size()*/) os << "_{" << down() << '}'; - if (hasUp() /*&& up().size()*/) - os << "^{" << up() << '}'; + if (hasUp() /*&& up().size()*/) { + // insert space if up() is empty or an empty brace inset + // (see bug 8305) + if (os.latex() && (up().size() == 0 || + (up().size() == 1 && up().back()->asBraceInset() && + up().back()->asBraceInset()->cell(0).empty()))) + os << "^ {}"; + else + os << "^{" << up() << '}'; + } if (lock_ && !os.latex()) os << "\\lyxlock "; diff --git a/status.20x b/status.20x index b69d477762..9f07dc6962 100644 --- a/status.20x +++ b/status.20x @@ -116,6 +116,9 @@ What's new - Fix LaTeX output of IPA tone symbols. +- Fix support for mhchem upward arrows, which in mathed are rendered as + empty (brace insets) superscripts (bug 8305). + * USER INTERFACE