#include "MetricsInfo.h"
#include "OutputParams.h"
#include "output_xhtml.h"
+#include "texstream.h"
#include "Text.h"
#include "TextMetrics.h"
void InsetNewpageParams::write(ostream & os) const
{
- string command;
switch (kind) {
case InsetNewpageParams::NEWPAGE:
os << "newpage";
dim.asc = defaultRowHeight();
dim.des = defaultRowHeight();
dim.wid = mi.base.textwidth;
- // Cache the inset dimension.
- setDimCache(mi, dim);
}
}
-int InsetNewpage::latex(odocstream & os, OutputParams const &) const
+void InsetNewpage::latex(otexstream & os, OutputParams const & runparams) const
{
switch (params_.kind) {
case InsetNewpageParams::NEWPAGE:
- os << "\\newpage{}";
+ os << "\\newpage" << termcmd;
break;
case InsetNewpageParams::PAGEBREAK:
- os << "\\pagebreak{}";
+ if (runparams.moving_arg)
+ os << "\\protect";
+ os << "\\pagebreak" << termcmd;
break;
case InsetNewpageParams::CLEARPAGE:
- os << "\\clearpage{}";
+ os << "\\clearpage" << termcmd;
break;
case InsetNewpageParams::CLEARDOUBLEPAGE:
- os << "\\cleardoublepage{}";
+ os << "\\cleardoublepage" << termcmd;
break;
default:
- os << "\\newpage{}";
+ os << "\\newpage" << termcmd;
break;
}
- return 0;
}
-int InsetNewpage::plaintext(odocstream & os, OutputParams const &) const
+int InsetNewpage::plaintext(odocstringstream & os,
+ OutputParams const &, size_t) const
{
os << '\n';
return PLAINTEXT_NEWLINE;
}
-docstring InsetNewpage::contextMenu(BufferView const &, int, int) const
+string InsetNewpage::contextMenuName() const
{
- return from_ascii("context-newpage");
+ return "context-newpage";
}