]> 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 1178a3b45954c1d5f192636816e2e7c1af3ffd11..fe504420645bf64770bebe3b0cad0a0216bbdbe5 100644 (file)
@@ -35,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"
 
@@ -350,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())
@@ -545,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{}";
        }
@@ -1667,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 =