Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The process for inserting references into a Latex document consists of running:

latex
bibtex
latex
latex

This is necessary because each step produces auxiliary files that the next step uses (i.e., the first latex command generates an .aux file with the citations need, the bibtex command generates a .bbl file, the third command incorporates these references into the document, and the fourth is necessary to ensure that the insertion of these references still produces correct formatting).

Is there an easier way to do this? This strange sequence of commands is difficult for a beginner and makes me wonder if other sequences of commands like this are necessary for other Latex-related tasks.

I'm hoping the sources I've come across are outdated. Is there a less quirky and error-prone way of including references in my articles?

share|improve this question
2  
If this is what your other "rant" was referring, in the current form this is not a TeX question, and actually not even a question. Just you venting your frustration. So perhaps you should revert to something that is an question. –  Peter Grill Mar 3 '13 at 7:11
2  
I can see why this question prompted a lot of downvotes, but, people, else we forget, there is this meta question: Voting on behaviour vs question content. @Nick, there is no need for inappropriate language here. People here tend to be very kind. Perhaps you can edit your initial question minus the ridicule. I think that is the reason for the unwarranted down votes. –  hpesoj626 Mar 3 '13 at 7:17
4  
Thanks. Just for the record -- Search this site for arara - the cool TeX automation tool -- github.com/cereda/arara. –  Harish Kumar Mar 3 '13 at 7:37
1  
@Nick, clarify in your edit about "these commands". Remember that in all SE sites, questions can be downvoted because of low quality. To all other users, I think there is enough of the downvoting for this question already. –  hpesoj626 Mar 3 '13 at 8:07
2  
@Nick, that comment was for the earlier statements like "P... ..f" and the likes in this post and in your deleted question. IMHO, offensive language must not have a place here. They are not constructive and merely incite hostility in other readers and distracts from the actual content of the question. I think you can put the responses that you had into perspective. Just imagine someone who is eager to help but saw your post in that kind of tone. As much as possible, we try to be very friendly in this site and we like people who come to ask question to stay and contribute to the community. –  hpesoj626 Mar 3 '13 at 8:44
show 7 more comments

1 Answer

up vote 10 down vote accepted

It seems excessive, but it has to do with the way LaTeX processes documents, especially things like references. For example, on the first pass in the following code there's no way for it to know what section number to use, since the label hasn't been defined yet. When you bring BibTeX (and other things, like SageTeX, or more complicated references) into the question, you may need even more passes.

See Section~\ref{key}.
...text...
\section{title}
\label{key}

There are solutions to your problem. If you're compiling from the command line, you could write an alias to execute these commands for you. However, a better solution would probably be Latexmk, which will take care of a lot of this stuff for you.

If you happen to be an emacs user, then the AucTeX mode, besides being incredibly helpful for writing, can also compile the document and prompt you to re-run things only when it's needed.

share|improve this answer
1  
Thanks for the kind and very thorough response. It perfectly answered the question. –  Nick Mar 3 '13 at 6:24
    
@Nick: Can you accept the answer please (clicking on the checkmark). –  Marco Daniel Mar 3 '13 at 10:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.