\\pagebreak is a fragile command in general

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

Fixes bug #10092.
(cherry picked from commit 86ee2699c30b63e5b4de3ad725519756d17aec2c)
This commit is contained in:
Jean-Marc Lasgouttes 2016-04-22 14:57:12 +02:00 committed by Richard Heck
parent dbd83603b0
commit b6552d017b
2 changed files with 5 additions and 1 deletions

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:

View File

@ -58,6 +58,8 @@ What's new
- InPreamble styles should be written to the premable as many times as the
user requests them, even if it results in duplicate commands.
- Correctly protect the \pagebreak command when needed (bug 10092).
* LYX2LYX