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.

When I have TikZ images or I include .png graphics, I need to use pdflatex instead of plain vanilla latex. (That is, I need to use pdflatex all the time, rather than just when I want to produce the final pdf).

Sometimes I forget that my current document (or one \included in it) contains one of these things. The compilation using latex doesn't work. The errors I get out when this happens don't seem to be meaningful: they don't just say "No such file image.eps" or "latex can't work TikZ" or the like. Is there anyway I can make these kinds of errors more transparent?

I've often spent ages fiddling with insignificant other bits of code, because I haven't realised it's the image that is messing up the compilation... Beamer also sometimes messes up in latex, but I normally spot that one...

share|improve this question
5  
Is there a reason why you don't just always use pdflatex? –  Caramdir Aug 1 '10 at 10:44
    
I was led to believe that latex compiles quicker, and it's the default for AucTeX in emacs (I know I could change that, but I'm lazy) –  Seamus Aug 1 '10 at 13:10
1  
To put that statement to test, I compiled the paper from complang.tuwien.ac.at/anton/latex-bench with latex and pdflatex. latex takes around 0.64s, while pdflatex takes around 0.75s. So you are correct, but I do not think the difference really matters. Also the historic comparison is quite interesting: ftp.complang.tuwien.ac.at/franz/latex-bench –  Caramdir Aug 1 '10 at 16:32
2  
For the whole LaTeX source (latex source2e.tex) it's 2.8s vs 3.1s. –  Caramdir Aug 1 '10 at 16:39
3  
Typically latex + dvips + ps2pdf is much slower than simply using pdflatex. –  Jukka Suomela Aug 1 '10 at 21:47
show 3 more comments

2 Answers

up vote 8 down vote accepted

You can use the ifpdf package to test at the beginning of your document whether you're running with pdflatex and, if not, make latex crash with a more meaningful error message.

share|improve this answer
    
Ideally, redefine the appropriate macros to insert blanks (similar to the draft option …). –  Konrad Rudolph Aug 1 '10 at 19:13
add comment

If you have both includedimage.png and includedimage.eps in the same directory and your LaTeX code doesn't specify the extension, i.e. it says \includegraphics{includedimage}, then latex will pick up the .eps file and pdflatex will use the .png. Even if you don't feel like converting your .png, you could just use a blank placeholder image in .eps format so that latex will also compile correctly. (If you do feel like converting them but don't currently have an easy way to do it, I recommend ImageMagick convert as an excellent free utility.)

share|improve this answer
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.