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?