From: Stefan Schimanski Date: Fri, 21 Dec 2007 20:43:50 +0000 (+0000) Subject: * add \protect in front of macro with optional arguments because they are fragile X-Git-Tag: 1.6.10~6854 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=992ae20115c7cffc8a7de0995e1e32536e13a09a;p=features.git * add \protect in front of macro with optional arguments because they are fragile git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22243 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 5e8b478459..0d985a7f72 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -553,6 +553,10 @@ void MathMacro::write(WriteStream & os) const // normal mode BOOST_ASSERT(macro_); + // optional arguments make macros fragile + if (optionals_ > 0 && os.fragile()) + os << "\\protect"; + os << "\\" << name(); bool first = true; idx_type i = 0;