commit fc02eece787262330d1f926dcdffb923cf420bed
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Sat Sep 6 15:58:48 2025 +0200
Fixup f284b588: finer control of primes
Fix cases where primes are forced to appear to the right of
super/subscripts.
An empty {} will be inserted only when both a superscript and a
subscript have been used.
---
src/mathed/InsetMathScript.cpp | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp
index 3e685a1496..2affedfb40 100644
--- a/src/mathed/InsetMathScript.cpp
+++ b/src/mathed/InsetMathScript.cpp
@@ -522,18 +522,15 @@ void InsetMathScript::writeMath(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 (hasDown() /*&& !down().empty()*/) {
os << "_{" << down() << '}';
- if (os.latex())
+ // Avoid double superscript errors by writing an
+ // empty group {} when a prime immediately follows
+ if (os.latex() && hasUp())
os.useBraces(true);
}
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs