mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
Fix bug #8889 by always issuing \protect in fragile environments.
This commit is contained in:
parent
270201ed67
commit
3c1969574f
@ -240,6 +240,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{";
|
||||
|
@ -707,8 +707,8 @@ void MathMacro::write(WriteStream & os) const
|
||||
// we should be ok to continue even if this fails.
|
||||
LATTEST(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();
|
||||
|
Loading…
Reference in New Issue
Block a user