20

I need a little help here. Until now, what I need is to compile a LaTeX into a PDF with BibTeX references I need to execute the next sequence:

1. pdflatex document.tex
2. bibtex document.tex
3. pdflatex document.tex
4. pdflatex document.tex

And for glossaries I need to:

5. pdflatex document.tex
6. makeglossaries document
7. pdflatex document
8. pdflatex document

And even in some places I've read that step 5 and 6 need to be repeated in some circumstances, but I didn't understand them well.

So my question is what is the sequence of step to create the PDF with BibTeX and with a glossary? I need to automate this so, in what specific circumstances do I need to re-execute any of the steps?

Marvin
  • 147
mjsr
  • 3,425
  • 1
    I think this question has already been answered on this site. For example, http://tex.stackexchange.com/questions/64/tools-for-automating-document-compilation – TH. Dec 10 '10 at 01:16
  • that question don't consider glossaries, i want to know the best sequence of step including the Glossary generation – mjsr Dec 10 '10 at 01:21

1 Answers1

17

It's not really as complicated as you think. Just do:

 1. pdflatex document
 2. bibtex document
 3. makeglossaries document
 4. pdflatex document
 5. pdflatex document

It doesn't matter if you do step 3 before step 2 either.

Next you might want to take a look at the link TH posted if you're looking for a tool to automate the workflow.

imnothere
  • 14,215
  • 2
    with this command sequence i ended up with wrong page references... – jrast Jan 03 '14 at 08:40
  • 1
    @jrast run pdflatex again to get the page references updated. – imnothere Jan 04 '14 at 10:15
  • 2
    Actually I had to run this sequence: pdflatex -> bibtex -> makeglossaries -> pdflatex -> bibtex -> makeglossaries -> pdflatex -> pdflatex. Maybe because my glossarie is before the sections? – jrast Jan 04 '14 at 23:22
  • 1
    @jrast Pdflatex -> bibtex -> makeglossaries -> pdflatex -> pdflatex -> pdflatex (and at times yet another pdflatex...) would have done it just fine. – imnothere Jan 05 '14 at 00:34
  • No, it don't matter how many times i run pdflatex at the end, the references stay the same (i gave up after 5 runs). And in my opinion they can't change because they are read out of the .gls file which is only written by makeglossaries. – jrast Jan 05 '14 at 12:56