+ runparams.isLastPar = nextpit == paragraphs.end();
+
+ bool const maintext = text.isMainText();
+ // we are at the beginning of an inset and CJK is already open;
+ // we count inheritation levels to get the inset nesting right.
+ if (pit == paragraphs.begin() && !maintext
+ && (cjk_inherited_ > 0 || open_encoding_ == CJK)) {
+ cjk_inherited_ += 1;
+ open_encoding_ = none;
+ }
+
+ if (runparams.verbatim) {
+ int const dist = distance(paragraphs.begin(), pit);
+ Font const outerfont = text.outerFont(dist);
+
+ // No newline if only one paragraph in this lyxtext
+ if (dist > 0) {
+ os << '\n';
+ texrow.newline();
+ }
+
+ /*bool need_par = */ pit->latex(bparams, outerfont,
+ os, texrow, runparams, start_pos, end_pos);
+ return nextpit;
+ }
+
+ // FIXME This check should not really be needed.
+ // Perhaps we should issue an error if it is.
+ Layout const style = text.inset().forcePlainLayout() ?
+ bparams.documentClass().plainLayout() : pit->layout();