///
void delCol(col_type) override {}
///
- docstring eolString(row_type, bool, bool, bool) const override
- { return docstring(); }
+ void eol(TeXMathStream &, row_type, bool, bool, bool) const override {}
///
docstring eocString(col_type, col_type) const override
{ return docstring(); }
}
-docstring InsetMathGrid::eolString(row_type row, bool fragile,
+void InsetMathGrid::eol(TeXMathStream & os, row_type row, bool fragile,
bool /*latex*/, bool last_eoln) const
{
docstring eol;
// only add \\ if necessary
if (eol.empty() && row + 1 == nrows() && (nrows() == 1 || !last_eoln))
- return docstring();
+ return;
- return (fragile ? "\\protect\\\\" : "\\\\") + eol;
+ os << (fragile ? "\\protect\\\\" : "\\\\") << eol;
}
row_type end_row, col_type end_col) const
{
MathEnsurer ensurer(os, false);
- docstring eol;
+ docstring eolstr;
// As of 2018 (with amendment in LaTeX 2021/06),
// \\ is a robust command and its protection
// is no longer necessary
os << eocString(col + nccols - 1, lastcol);
col += nccols;
}
- eol = eolString(row, fragile, os.latex(), last_eoln);
- os << eol;
+ eol(os, row, fragile, os.latex(), last_eoln);
// append newline only if line wasn't completely empty
// and the formula is not written on a single line
- bool const empty = emptyline && eol.empty();
+ bool const empty = emptyline && eolstr.empty();
if (!empty && nrows() > 1)
os << "\n";
}
// @TODO use end_row instead of nrows() ?
docstring const s = verboseHLine(rowinfo_[nrows()].lines);
if (!s.empty()) {
- if (eol.empty()) {
+ if (eolstr.empty()) {
if (fragile)
os << "\\protect";
os << "\\\\";
virtual int rightMargin() const { return 0; }
/// returns proper 'end of line' code for LaTeX
- virtual docstring eolString(row_type row, bool fragile, bool latex,
- bool last_eoln) const;
+ virtual void eol(TeXMathStream & os, 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 latex,
- bool last_eoln) const
+void InsetMathHull::eol(TeXMathStream & os, row_type row, bool fragile, bool latex,
+ bool last_eoln) const
{
- docstring res;
if (numberedType()) {
if (label_[row]) {
docstring const name =
latex ? escape(label_[row]->getParam("name"))
: label_[row]->getParam("name");
- res += "\\label{" + name + '}';
+ os << "\\label{" + name + '}';
}
if (type_ != hullMultline) {
if (numbered_[row] == NONUMBER)
- res += "\\nonumber ";
+ os << "\\nonumber ";
else if (numbered_[row] == NOTAG)
- res += "\\notag ";
+ os<< "\\notag ";
}
}
// Never add \\ on the last empty line of eqnarray and friends
last_eoln = false;
- return res + InsetMathGrid::eolString(row, fragile, latex, last_eoln);
+ InsetMathGrid::eol(os, row, fragile, latex, last_eoln);
}
void InsetMathHull::write(TeXMathStream & os) const
/// override to set to 0 for inline equation
int border() const override;
///
- docstring eolString(row_type row, bool fragile, bool latex,
- bool last_eoln) const override;
+ void eol(TeXMathStream & os, row_type row, bool fragile, bool latex,
+ bool last_eoln) const override;
private:
Inset * clone() const override;