\\pagebreak is a fragile command in general

As such, it shall be protected in moving arguments, such as sections.

Fixes bug #10092.
This commit is contained in:
Jean-Marc Lasgouttes 2016-04-22 14:57:12 +02:00 committed by Richard Heck
parent 282fe102f3
commit 7628f0bf97

View File

@ -212,13 +212,15 @@ ColorCode InsetNewpage::ColorName() const
}
void InsetNewpage::latex(otexstream & os, OutputParams const &) const
void InsetNewpage::latex(otexstream & os, OutputParams const & runparams) const
{
switch (params_.kind) {
case InsetNewpageParams::NEWPAGE:
os << "\\newpage{}";
break;
case InsetNewpageParams::PAGEBREAK:
if (runparams.moving_arg)
os << "\\protect";
os << "\\pagebreak{}";
break;
case InsetNewpageParams::CLEARPAGE: