X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathMacro.cpp;h=d2c35c7e5bea913e1d857fc319871945de87d0db;hb=d9082639080b9de993742bd352f92e5183058cf5;hp=24409512e1ba7344d39031a195e8bdc6537aa32a;hpb=99fb1c7003395bf08d5523d2a8367729424de047;p=lyx.git diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp index 24409512e1..d2c35c7e5b 100644 --- a/src/mathed/InsetMathMacro.cpp +++ b/src/mathed/InsetMathMacro.cpp @@ -169,7 +169,7 @@ public: /// void mathematica(MathematicaStream & ms) const override { ms << mathMacro_->cell(idx_); } /// - void mathmlize(MathStream & ms) const override { ms << mathMacro_->cell(idx_); } + void mathmlize(MathMLStream & ms) const override { ms << mathMacro_->cell(idx_); } /// void htmlize(HtmlStream & ms) const override { ms << mathMacro_->cell(idx_); } /// @@ -1133,7 +1133,7 @@ bool InsetMathMacro::folded() const } -void InsetMathMacro::write(WriteStream & os) const +void InsetMathMacro::write(TeXMathStream & os) const { mode_type mode = currentMode(); MathEnsurer ensurer(os, mode == MATH_MODE, true, mode == TEXT_MODE); @@ -1214,8 +1214,11 @@ void InsetMathMacro::write(WriteStream & os) const } // add space if there was no argument - if (first) + // or add braces if we have optionals but none are present and [ follows + if (first) { os.pendingSpace(true); + os.useBraces(d->optionals_ > 0); + } // write \(no)limits modifiers if relevant writeLimits(os); @@ -1240,7 +1243,7 @@ void InsetMathMacro::mathematica(MathematicaStream & os) const } -void InsetMathMacro::mathmlize(MathStream & ms) const +void InsetMathMacro::mathmlize(MathMLStream & ms) const { // macro_ is 0 if this is an unknown macro LATTEST(d->macro_ || d->displayMode_ != DISPLAY_NORMAL);