]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
GuiBox.cpp: fix this issue: horizontal box alignment is only possible without inner...
[lyx.git] / src / output_latex.cpp
index 3c760c24d21cf8422bef06deb767a5e5dc6050e4..9db5a6f59fd1828ad8ade94b2f550d735c27aab2 100644 (file)
@@ -345,14 +345,22 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
 {
        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();
 
@@ -375,16 +383,11 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
                        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();
-
        // This paragraph's language
        Language const * const par_language = pit->getParLanguage(bparams);
        // The document's language
@@ -605,8 +608,8 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
 
        // 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.
@@ -627,11 +630,8 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
        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) {