commit 22290f734c53de8e57ee28d78beed8f8eeddb428
Author: Enrico Forestieri <[email protected]>
Date:   Sun Oct 19 15:10:28 2025 +0200

    Fix bug #13239
    
    Size commands have no effect in math mode, so avoid introducing
    spurious insets and avoid harmless compilation warnings such as
    "Command \huge invalid in math mode".
    
    (cherry picked from commit e53759ccc009998e6cc3991ea49c55f4058317cf)
---
 src/mathed/InsetMathNest.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index a6b8e237a8..fd5abbc39f 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -644,7 +644,8 @@ void InsetMathNest::handleFont2(Cursor & cur, docstring 
const & arg)
                }
        }
 
-       if (support::contains(arg, from_ascii("size"))) {
+       if (support::contains(arg, from_ascii("size")) &&
+           currentMode() != MATH_MODE) {
                switch(font.fontInfo().size()) {
                case TINY_SIZE:
                        im = from_ascii("tiny");
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to