]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
Keep dialog connected to cross-ref inset after Apply.
[lyx.git] / src / output_latex.cpp
index f690134a3c58eb97d638855f1c2bea8b10bf2682..fe504420645bf64770bebe3b0cad0a0216bbdbe5 100644 (file)
@@ -19,8 +19,6 @@
 #include "Font.h"
 #include "InsetList.h"
 #include "Language.h"
-#include "LaTeXFeatures.h"
-#include "Layout.h"
 #include "LyXRC.h"
 #include "OutputParams.h"
 #include "Paragraph.h"
@@ -37,7 +35,6 @@
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/lstrings.h"
-#include "support/lyxalgo.h"
 #include "support/textutils.h"
 #include "support/gettext.h"
 
@@ -352,6 +349,11 @@ static void finishEnvironment(otexstream & os, OutputParams const & runparams,
                                popLanguageName();
                        }
                }
+               if (data.style->latextype == LATEX_BIB_ENVIRONMENT)
+                       // bibliography needs a blank line after
+                       // each item for backref to function properly
+                       // (see #12041)
+                       os << '\n';
                state->nest_level_ -= 1;
                string const & name = data.style->latexname();
                if (!name.empty())
@@ -547,7 +549,7 @@ void getArgInsets(otexstream & os, OutputParams const & runparams, Layout::LaTeX
                        }
                }
        }
-       if (runparams.for_search) {
+       if (runparams.for_search && argnr > 1) {
                // Mark end of arguments for findadv() only
                os << "\\endarguments{}";
        }
@@ -602,8 +604,7 @@ void addArgInsets(Paragraph const & par, string const & prefix,
                string const name = prefix.empty() ?
                        arg->name() : split(arg->name(), ':');
                size_t const nr = convert<size_t>(name);
-               if (ilist.find(nr) == ilist.end())
-                       ilist[nr] = arg;
+               ilist.insert({nr, arg});
                Layout::LaTeXArgMap::const_iterator const lit =
                        latexargs.find(arg->name());
                if (lit != latexargs.end()) {
@@ -1670,6 +1671,15 @@ void latexParagraphs(Buffer const & buf,
                                        os << '\n' << '\n';
                                continue;
                        }
+               } else {
+                       // This is the last par
+                       Paragraph const & cpar = paragraphs.at(pit);
+                       if (!runparams.for_search && !cpar.empty()
+                           && cpar.isDeleted(0, cpar.size()) && !bparams.output_changes) {
+                               if (!cpar.parEndChange().deleted())
+                                       os << '\n' << '\n';
+                               continue;
+                       }
                }
 
                TeXEnvironmentData const data =