]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
Fix 18 memory leaks
[lyx.git] / src / output_latex.cpp
index 33c6c7e80aa3c05044167c3474eb8062a3360b50..a479b2803ec885382374c6c7d3f325270b06aa9e 100644 (file)
@@ -1259,17 +1259,26 @@ void TeXOnePar(Buffer const & buf,
 void latexParagraphs(Buffer const & buf,
                     Text const & text,
                     otexstream & os,
-                    OutputParams const & runparams_in,
+                    OutputParams const & runparams,
                     string const & everypar)
 {
-       OutputParams runparams = runparams_in;
        LASSERT(runparams.par_begin <= runparams.par_end,
                { os << "% LaTeX Output Error\n"; return; } );
 
        BufferParams const & bparams = buf.params();
+       BufferParams const & mparams = buf.masterParams();
 
        bool const maintext = text.isMainText();
        bool const is_child = buf.masterBuffer() != &buf;
+       bool const multibib_child = maintext && is_child
+                       && mparams.multibib == "child";
+
+       if (multibib_child && mparams.useBiblatex())
+               os << "\\newrefsection";
+       else if (multibib_child && mparams.useBibtopic()) {
+               os << "\\begin{btUnit}\n";
+               runparams.openbtUnit = true;
+       }
 
        // Open a CJK environment at the beginning of the main buffer
        // if the document's language is a CJK language
@@ -1443,6 +1452,11 @@ void latexParagraphs(Buffer const & buf,
                if (state->cjk_inherited_ == 0)
                        state->open_encoding_ = CJK;
        }
+
+       if (multibib_child && mparams.useBibtopic()) {
+               os << "\\end{btUnit}\n";
+               runparams.openbtUnit = false;
+       }
 }