#include "Buffer.h"
#include "BufferParams.h"
#include "Encoding.h"
+#include "Font.h"
#include "InsetList.h"
#include "Language.h"
#include "Layout.h"
{
LYXERR(Debug::LATEX, "TeXOnePar... " << &*pit << " '"
<< everypar << "'");
+
BufferParams const & bparams = buf.params();
- ParagraphList const & paragraphs = text.paragraphs();
+ // 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();
+ ParagraphList const & paragraphs = text.paragraphs();
ParagraphList::const_iterator const priorpit =
pit == paragraphs.begin() ? pit : boost::prior(pit);
ParagraphList::const_iterator const nextpit =
pit == paragraphs.end() ? pit : boost::next(pit);
+ if (style.inpreamble)
+ return nextpit;
+
OutputParams runparams = runparams_in;
runparams.isLastPar = nextpit == paragraphs.end();
open_encoding_ = none;
}
- if (runparams.verbatim) {
+ if (text.inset().getLayout().isPassThru()) {
int const dist = distance(paragraphs.begin(), pit);
Font const outerfont = text.outerFont(dist);
- // No newline if only one paragraph in this lyxtext
+ // No newline before first paragraph in this lyxtext
if (dist > 0) {
os << '\n';
texrow.newline();
+ if (!text.inset().getLayout().parbreakIsNewline()) {
+ os << '\n';
+ texrow.newline();
+ }
}
- /*bool need_par = */ pit->latex(bparams, outerfont,
- os, texrow, runparams, start_pos, end_pos);
+ 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();
+ if (style.pass_thru) {
+ int const dist = distance(paragraphs.begin(), pit);
+ Font const outerfont = text.outerFont(dist);
+ pit->latex(bparams, outerfont, os, texrow,
+ runparams, start_pos, end_pos);
+ os << '\n';
+ texrow.newline();
+ if (!style.parbreak_is_newline) {
+ os << '\n';
+ texrow.newline();
+ } else if (nextpit != paragraphs.end()) {
+ Layout const nextstyle = text.inset().forcePlainLayout() ?
+ bparams.documentClass().plainLayout() : nextpit->layout();
+ if (nextstyle.name() != style.name()) {
+ os << '\n';
+ texrow.newline();
+ }
+ }
+
+ return nextpit;
+ }
// This paragraph's language
Language const * const par_language = pit->getParLanguage(bparams);
// FIXME UNICODE
os << from_utf8(everypar);
- bool need_par = pit->latex(bparams, outerfont,
- os, texrow, runparams, start_pos, end_pos);
+ pit->latex(bparams, outerfont, os, texrow,
+ runparams, start_pos, end_pos);
// Make sure that \\par is done with the font of the last
// character if this has another size as the default.
if (style.resfont.size() != font.fontInfo().size()
&& nextpit != paragraphs.end()
&& !is_command) {
- if (!need_par)
- os << '{';
+ os << '{';
os << "\\" << from_ascii(font.latexSize()) << " \\par}";
- } else if (need_par) {
- os << "\\par}";
} else if (is_command) {
os << '}';
if (runparams.encoding != prev_encoding) {