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.

Is there a clever way to cause the unix make command to run a tex variant as many times as are required to resolve all references? I've used tex for a long time, and I still don't know which of all those extra files (.aux, .log, etc) should be checked, so I usually just run (pdf)latex 3 times, but that is slow for a 400 page document. I am thinking that a fragment such as the line below might be a starting point ... maybe I should just string 3 or so of these together?

(pdflatex oar | grep -vq 'here were undefined references')
share|improve this question
    
Also have a look at the answers on a related question about automating document compilation –  Juan A. Navarro Jan 5 '11 at 12:08
add comment

3 Answers 3

up vote 8 down vote accepted

I've used in the past this Makefile, from Yannick Copin.

But, I guess latexmk also has some advantage over make (although I like using custom Makefile).

share|improve this answer
    
@Yannick: Thanks. I like make because I'm doing a lot of extra things in there, besides the *tex work. Maybe I should use latexmk and make together, though. –  dank Jan 5 '11 at 11:53
1  
@dan, definitely, having make use latexmk to build *tex documents is the way to go. –  Juan A. Navarro Jan 5 '11 at 12:00
    
@dan Yes, I also use custom Makefile for compiling extra stuff (like Asymptote code) and calling external program, e.g. pdfnup. Never tried to combine latexmk and make, though. –  chl Jan 5 '11 at 12:13
add comment

You also get an undefined reference, when it is an unknown one ...

You can delete the time stamp line from the logfile and then build the md5 sum or whatever. When it didn't change then you have no changes in the document. You can also speedup your compilation time, when you do not build a pdf in the first or two run: pdflatex -draftmode ..., then only the aux|idx|...-files will be created to get correct labels/references.

share|improve this answer
    
Thanks, I didn't know about -draftmode. It speeds up my compilation by 10 percent. –  dank Jan 5 '11 at 11:51
    
+1 for -draftmode . –  lockstep Jan 5 '11 at 11:51
    
(+1) All good things to know, thx. –  chl Jan 5 '11 at 12:23
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.