Do not output LaTeX for a macro if the LaTeX part is empty.

This commit is contained in:
Enrico Forestieri 2023-06-11 12:45:48 -04:00 committed by Richard Kimberly Heck
parent 3be39de1f7
commit c33f2f50a0

View File

@ -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}