commit 4ce2a0c07c9e5cfb9955abedee064236585ea326
Author: Enrico Forestieri <[email protected]>
Date: Thu May 1 12:44:08 2025 +0200
Remove spaces after '%' when input is for maxima
Maxima prefixes with the %-sign many mathematical constants.
LyX can do this only for \pi and not for the imaginary unit 'i'
or the Euler's number 'e' because there is no way to distinguish
such constants from mere variables. In mathed one can prefix
those constants with a %-sign but LyX adds a space after it,
preventing Maxima from recognizing them.
---
src/mathed/MathExtern.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp
index c4291f7cb5..43ae76f0af 100644
--- a/src/mathed/MathExtern.cpp
+++ b/src/mathed/MathExtern.cpp
@@ -1120,6 +1120,10 @@ namespace {
int preplen = comm_left.length();
int headlen = header.length();
+ // remove spaces after '%' sign
+ while (expr.find(from_ascii("% ")) != docstring::npos)
+ expr = subst(expr, from_ascii("% "), from_ascii("%"));
+
string out;
for (int i = 0; i < 100; ++i) { // at most 100 attempts
// try to fix missing '*' the hard way
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs