+ otexstream ots(os, texrow);
+
+ // the real stuff
+ latexParagraphs(*this, text(), ots, runparams);
+
+ // Restore the parenthood
+ if (!master)
+ d->ignore_parent = false;
+ }
+ } else {
+ os << "% ";
+ if (output == FullSource)
+ os << _("Preview source code");
+ else if (output == OnlyPreamble)
+ os << _("Preview preamble");
+ else if (output == OnlyBody)
+ os << _("Preview body");
+ os << "\n\n";
+ if (runparams.flavor == OutputParams::LYX) {
+ ostringstream ods;
+ if (output == FullSource)
+ write(ods);
+ else if (output == OnlyPreamble)
+ params().writeFile(ods);
+ else if (output == OnlyBody)
+ text().write(ods);
+ os << from_utf8(ods.str());
+ } else if (runparams.flavor == OutputParams::HTML) {
+ writeLyXHTMLSource(os, runparams, output);
+ } else if (runparams.flavor == OutputParams::TEXT) {
+ if (output == OnlyPreamble) {
+ os << "% "<< _("Plain text does not have a preamble.");
+ } else
+ writePlaintextFile(*this, os, runparams);
+ } else if (params().isDocBook()) {
+ writeDocBookSource(os, absFileName(), runparams, output);
+ } else {
+ // latex or literate
+ d->texrow.reset();
+ d->texrow.newline();
+ d->texrow.newline();
+ otexstream ots(os, d->texrow);
+ if (master)
+ runparams.is_child = true;
+ writeLaTeXSource(ots, string(), runparams, output);
+ }