Fix bug #8889 by always issuing \protect in fragile environments.

(cherry picked from commit 3c1969574f)
This commit is contained in:
Enrico Forestieri 2014-02-22 10:30:55 -05:00 committed by Richard Heck
parent e09faf7ce6
commit 64be8c6553
3 changed files with 6 additions and 2 deletions

View File

@ -120,6 +120,8 @@ void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const
void InsetMathPhantom::write(WriteStream & os) const
{
MathEnsurer ensurer(os);
if (os.fragile())
os << "\\protect";
switch (kind_) {
case phantom:
os << "\\phantom{";

View File

@ -704,8 +704,8 @@ void MathMacro::write(WriteStream & os) const
// normal mode
LASSERT(macro_, /**/);
// optional arguments make macros fragile
if (optionals_ > 0 && os.fragile())
// Always protect macros in a fragile environment
if (os.fragile())
os << "\\protect";
os << "\\" << name();

View File

@ -65,6 +65,8 @@ What's new
- Fix bug where depth of pasted text was incorrectly set (bug 8891).
- Fix clash between \protect and \ensuremath (bug 8889).
* USER INTERFACE