X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeX.cpp;h=7d9810aef1a8b22e147c8d571191ec98145ae693;hb=4ed0312c51704780af1c452d3a82a84171b3725a;hp=917d129424613286280d9ee64061b6bcf40aa2b6;hpb=997f0621c5346bb623cf86713c4fe1be0c941104;p=lyx.git diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index 917d129424..7d9810aef1 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -401,11 +401,13 @@ int LaTeX::run(TeXErrors & terr) // After the bibliography was processed, we need more passes of LaTeX // in order to resolve the citations. We need to do this before the index // is being generated (since we need the correct pagination, see #2696). + // With bibliography environment, another LaTeX run might be needed + // as well to resolve citations. // Also, memoir (at least) writes an empty *idx file in the first place. // A further latex run is needed in that case as well. FileName const idxfile(changeExtension(file.absFileName(), ".idx")); - if (run_bibtex || (idxfile.exists() && idxfile.isFileEmpty())) { - while ((head.sumchange() || rerun || (scanres & RERUN)) + if (run_bibtex || (scanres & UNDEF_CIT) || (idxfile.exists() && idxfile.isFileEmpty())) { + while ((head.sumchange() || rerun || (scanres & RERUN) || (scanres & UNDEF_CIT)) && count < MAX_RUN) { // Yes rerun until message goes away, or until // MAX_RUNS are reached.