\protect substack in fragile context

(\cprotect'ion not needed then).
This commit is contained in:
Juergen Spitzmueller 2021-12-27 11:37:59 +01:00
parent 3e4c831f1e
commit 596b2d16ee
2 changed files with 2 additions and 1 deletions

View File

@ -4125,7 +4125,6 @@ bool Paragraph::needsCProtection(bool const fragile) const
if (!im || im->cell(0).empty())
continue;
switch(im->cell(0)[0]->lyxCode()) {
case MATH_SUBSTACK_CODE:
case MATH_ENV_CODE:
case MATH_XYMATRIX_CODE:
// these need cprotection

View File

@ -100,6 +100,8 @@ void InsetMathSubstack::infoize(odocstream & os) const
void InsetMathSubstack::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
if (os.fragile())
os << "\\protect";
os << "\\substack{";
bool open = os.startOuterRow();
InsetMathGrid::write(os);