mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-13 03:40:34 +00:00
Fix bug #8889 by always issuing \protect in fragile environments.
(cherry picked from commit 3c1969574f
)
This commit is contained in:
parent
e09faf7ce6
commit
64be8c6553
@ -120,6 +120,8 @@ void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const
|
|||||||
void InsetMathPhantom::write(WriteStream & os) const
|
void InsetMathPhantom::write(WriteStream & os) const
|
||||||
{
|
{
|
||||||
MathEnsurer ensurer(os);
|
MathEnsurer ensurer(os);
|
||||||
|
if (os.fragile())
|
||||||
|
os << "\\protect";
|
||||||
switch (kind_) {
|
switch (kind_) {
|
||||||
case phantom:
|
case phantom:
|
||||||
os << "\\phantom{";
|
os << "\\phantom{";
|
||||||
|
@ -704,8 +704,8 @@ void MathMacro::write(WriteStream & os) const
|
|||||||
// normal mode
|
// normal mode
|
||||||
LASSERT(macro_, /**/);
|
LASSERT(macro_, /**/);
|
||||||
|
|
||||||
// optional arguments make macros fragile
|
// Always protect macros in a fragile environment
|
||||||
if (optionals_ > 0 && os.fragile())
|
if (os.fragile())
|
||||||
os << "\\protect";
|
os << "\\protect";
|
||||||
|
|
||||||
os << "\\" << name();
|
os << "\\" << name();
|
||||||
|
@ -65,6 +65,8 @@ What's new
|
|||||||
|
|
||||||
- Fix bug where depth of pasted text was incorrectly set (bug 8891).
|
- Fix bug where depth of pasted text was incorrectly set (bug 8891).
|
||||||
|
|
||||||
|
- Fix clash between \protect and \ensuremath (bug 8889).
|
||||||
|
|
||||||
|
|
||||||
* USER INTERFACE
|
* USER INTERFACE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user