]> git.lyx.org Git - features.git/commitdiff
Fix bug #11787.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Tue, 17 Mar 2020 05:33:44 +0000 (01:33 -0400)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:54 +0000 (15:48 +0200)
Make sure we are actually at the end of the document before issuing
\maketitle because we are at the end of the document.

src/output_latex.cpp

index 4aa797b98b8c91ab7ce93a38e4a7cfb2ef4a22c5..1185e2d6e343149dbb0e7eddbb740958c9bed6ea 100644 (file)
@@ -1688,8 +1688,11 @@ void latexParagraphs(Buffer const & buf,
                        //os << '\n';
        }
 
-       // It might be that we only have a title in this document
-       if (was_title && !already_title) {
+       // It might be that we only have a title in this document.
+       // But if we're in a branch, this is not the end of
+       // the document. (There may be some other checks of this
+       // kind that are needed.)
+       if (was_title && !already_title && !runparams.inbranch) {
                if (tclass.titletype() == TITLE_ENVIRONMENT) {
                        os << "\\end{" << from_ascii(tclass.titlename())
                           << "}\n";