]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
Check return value of regex_match instead of looking at first match
[lyx.git] / src / output_latex.cpp
index b6ed0cec18d886ecdc9a7d7bcc0880197eac2202..a479b2803ec885382374c6c7d3f325270b06aa9e 100644 (file)
@@ -1266,9 +1266,19 @@ void latexParagraphs(Buffer const & buf,
                { 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
@@ -1361,6 +1371,15 @@ void latexParagraphs(Buffer const & buf,
                        was_title = false;
                }
 
+               if (layout.isCommand() && !layout.latexname().empty()
+                   && layout.latexname() == bparams.multibib) {
+                       if (runparams.openbtUnit)
+                               os << "\\end{btUnit}\n";
+                       if (!bparams.useBiblatex()) {
+                               os << '\n' << "\\begin{btUnit}\n";
+                               runparams.openbtUnit = true;
+                       }
+               }
 
                if (!layout.isEnvironment() && par->params().leftIndent().zero()) {
                        // This is a standard top level paragraph, TeX it and continue.
@@ -1393,6 +1412,9 @@ void latexParagraphs(Buffer const & buf,
                }
        }
 
+       if (maintext && !is_child && runparams.openbtUnit)
+               os << "\\end{btUnit}\n";
+
        // if "auto end" is switched off, explicitly close the language at the end
        // but only if the last par is in a babel or polyglossia language
        string const lang_end_command = runparams.use_polyglossia ?
@@ -1430,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;
+       }
 }