}
-docstring InsetMathGrid::eolString(row_type row, bool fragile, bool last_eoln) const
+docstring InsetMathGrid::eolString(row_type row, bool fragile, bool latex,
+ bool last_eoln) const
{
docstring eol;
ModeSpecifier specifier(os, TEXT_MODE);
os << eocString(col, lastcol);
}
- eol = eolString(row, os.fragile(), last_eoln);
+ eol = eolString(row, os.fragile(), os.latex(), last_eoln);
os << eol;
// append newline only if line wasn't completely empty
// and the formula is not written on a single line
/// returns y offset of cell compared to inset
int cellYOffset(idx_type idx) const;
/// returns proper 'end of line' code for LaTeX
- virtual docstring eolString(row_type row, bool fragile, bool last_eoln) const;
+ virtual docstring eolString(row_type row, bool fragile, bool latex,
+ bool last_eoln) const;
/// returns proper 'end of column' code for LaTeX
virtual docstring eocString(col_type col, col_type lastcol) const;
/// splits cells and shifts right part to the next cell
}
-docstring InsetMathHull::eolString(row_type row, bool fragile, bool last_eoln) const
+docstring InsetMathHull::eolString(row_type row, bool fragile, bool latex,
+ bool last_eoln) const
{
docstring res;
if (numberedType()) {
- if (label_[row] && numbered_[row])
- res += "\\label{" +
- escape(label_[row]->getParam("name")) + '}';
+ if (label_[row] && numbered_[row]) {
+ docstring const name =
+ latex ? escape(label_[row]->getParam("name"))
+ : label_[row]->getParam("name");
+ res += "\\label{" + name + '}';
+ }
if (!numbered_[row] && (type_ != hullMultline))
res += "\\nonumber ";
}
// Never add \\ on the last empty line of eqnarray and friends
last_eoln = false;
- return res + InsetMathGrid::eolString(row, fragile, last_eoln);
+ return res + InsetMathGrid::eolString(row, fragile, latex, last_eoln);
}
bool getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const;
///
- docstring eolString(row_type row, bool fragile, bool last_eoln) const;
+ docstring eolString(row_type row, bool fragile, bool latex,
+ bool last_eoln) const;
private:
virtual Inset * clone() const;