]> git.lyx.org Git - features.git/commitdiff
\\pagebreak is a fragile command in general
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 22 Apr 2016 12:57:12 +0000 (14:57 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 13 May 2016 16:05:00 +0000 (18:05 +0200)
As such, it shall be protected in moving arguments, such as sections.

Fixes bug #10092.
(cherry picked from commit 86ee2699c30b63e5b4de3ad725519756d17aec2c)

src/insets/InsetNewpage.cpp
status.22x

index 5e98428fcdcd7dfd060adacbc189325229719fd5..418bf8b3614e6f4b6d61fe486c1bed9df3efec68 100644 (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:
index 87f15fa13c7ed20cd9436f906add3a009bf491f9..ad9c82e0d1e56b15e881646f31e569f98b4f1cba 100644 (file)
@@ -47,7 +47,7 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
-
+- Correctly protect the \pagebreak command when needed (bug 10092).
 
 * LYX2LYX