commit c33f2f50a0e1e6eda36e8ae215ace6c93499bcc6
Author: Enrico Forestieri <[email protected]>
Date:   Sun Jun 11 12:45:48 2023 -0400

    Do not output LaTeX for a macro if the LaTeX part is empty.
---
 src/mathed/InsetMathMacroTemplate.cpp |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mathed/InsetMathMacroTemplate.cpp 
b/src/mathed/InsetMathMacroTemplate.cpp
index 949f161..555c4aa 100644
--- a/src/mathed/InsetMathMacroTemplate.cpp
+++ b/src/mathed/InsetMathMacroTemplate.cpp
@@ -1188,6 +1188,9 @@ int InsetMathMacroTemplate::write(TeXMathStream & os, 
bool overwriteRedefinition
        int num_lines = 0;
 
        if (os.latex()) {
+               if (definition().empty())
+                       return num_lines;
+
                if (optionals_ > 0) {
                        // macros with optionals use the xargs package, e.g.:
                        // \newcommandx{\foo}[2][usedefault, 
addprefix=\global,1=default]{#1,#2}
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to