+ } else if (runparams.flavor == OutputParams::TEXT) {
+ bool dummy;
+ // FIXME Handles only one paragraph, unlike the others.
+ // Probably should have some routine with a signature like them.
+ writePlaintextParagraph(*this,
+ text().paragraphs()[par_begin], os, runparams, dummy);
+ } else if (params().isDocBook()) {
+ docbookParagraphs(text(), *this, os, runparams);
+ } else {
+ // If we are previewing a paragraph, even if this is the
+ // child of some other buffer, let's cut the link here,
+ // so that no concurring settings from the master
+ // (e.g. branch state) interfere (see #8101).
+ if (!master)
+ d->ignore_parent = true;
+ // We need to validate the Buffer params' features here
+ // in order to know if we should output polyglossia
+ // macros (instead of babel macros)
+ LaTeXFeatures features(*this, params(), runparams);
+ params().validate(features);
+ runparams.use_polyglossia = features.usePolyglossia();
+ TexRow texrow;
+ texrow.reset();
+ texrow.newline();
+ texrow.newline();
+ // latex or literate
+ 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 {