From b6938386a2a34492ba23444d26877fef554acf64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Fri, 28 Nov 2008 12:54:29 +0000 Subject: [PATCH] * LaTeX.cpp (run): - perform an additional bibtex cycle if requested (e.g. by Biblatex) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27724 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LaTeX.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index 3569ba87f5..8a74b61ea0 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -245,7 +245,7 @@ int LaTeX::run(TeXErrors & terr) deplog(head); // reads the latex log head.update(); - // 0.5 + // 1 // At this point we must run external programs if needed. // makeindex will be run if a .idx file changed or was generated. // And if there were undefined citations or changes in references @@ -291,7 +291,7 @@ int LaTeX::run(TeXErrors & terr) updateBibtexDependencies(head, bibtex_info); } - // 1 + // 2 // we know on this point that latex has been run once (or we just // returned) and the question now is to decide if we need to run // it any more. This is done by asking if any of the files in the @@ -301,7 +301,7 @@ int LaTeX::run(TeXErrors & terr) // run latex once more and // update the dependency structure // -> if not changed: - // we does nothing at this point + // we do nothing at this point // if (rerun || head.sumchange()) { rerun = false; @@ -322,9 +322,24 @@ int LaTeX::run(TeXErrors & terr) } else { LYXERR(Debug::DEPEND, "Dep. file has NOT changed"); } + + // 3 + // rerun bibtex? + // Complex bibliography packages such as Biblatex require + // an additional bibtex cycle sometimes. + if (scanres & UNDEF_CIT) { + // Here we must scan the .aux file and look for + // "\bibdata" and/or "\bibstyle". If one of those + // tags is found -> run bibtex and set rerun = true; + // no checks for now + LYXERR(Debug::LATEX, "Running BibTeX."); + message(_("Running BibTeX.")); + updateBibtexDependencies(head, bibtex_info); + rerun |= runBibTeX(bibtex_info); + } - // 1.5 - // The inclusion of files generated by external programs like + // 4 + // The inclusion of files generated by external programs such as // makeindex or bibtex might have done changes to pagenumbering, // etc. And because of this we must run the external programs // again to make sure everything is redone correctly. @@ -347,7 +362,7 @@ int LaTeX::run(TeXErrors & terr) if (head.haschanged(glofile)) rerun |= runMakeIndexNomencl(file, ".glo", ".gls"); - // 2 + // 5 // we will only run latex more if the log file asks for it. // or if the sumchange() is true. // -> rerun asked for: -- 2.39.2