]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewpage.cpp
Revert "Do not crash is release mode if we stumble across an unrealized font."
[lyx.git] / src / insets / InsetNewpage.cpp
index 15d45f071a2157625e3a07ec8feb6be827af843e..b369ce1b7e7d915f66aa675fd4f88e056219eac9 100644 (file)
@@ -20,6 +20,7 @@
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "output_xhtml.h"
+#include "texstream.h"
 #include "Text.h"
 #include "TextMetrics.h"
 
@@ -47,7 +48,6 @@ InsetNewpage::InsetNewpage(InsetNewpageParams const & params)
 
 void InsetNewpageParams::write(ostream & os) const
 {
-       string command;
        switch (kind) {
        case InsetNewpageParams::NEWPAGE:
                os << "newpage";
@@ -213,13 +213,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: