From 7af6575cf6cd764b8b567b358907ac9a7a8e322b Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Tue, 17 Mar 2020 01:33:44 -0400 Subject: [PATCH] Fix bug #11787. 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 4aa797b98b..1185e2d6e3 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -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"; -- 2.39.5