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 LaTeX General Guidelines show a conditional invocation of the graphicx package. I wanted to test this out. I did the following:

  1. Created a main.tex in which I LEFT OUT the big, complicated, conditional header linked above
  2. Included a myplot.pdf and myplot.eps in my working directory.
  3. Included a call to \includegraphics{myplot} in my main.tex.
  4. Ran TeXify. myplot.eps was plotted as desired.
  5. Ran PdfTeXify. myplot.pdf was plotted as desired.

Q: Considering that my steps above worked perfectly fine, what's the point of the big, complicated, conditional header?

Q: Do pdftex and dvips really need to be passed as options to \documentclass and \usepackage{graphicx}?

share|improve this question
1  
Your method is the approach recommended in the FAQ, see this answer. –  Lev Bishop Feb 27 '11 at 22:46

1 Answer 1

up vote 6 down vote accepted

This kind of conditional header is outdated (IMHO). I learned it as beginner as well and stopped using it with the same results as you. The graphicx package is normally very well capable to detect the output driver by itself. This is in most cases even better than hard coding it.

Because pdflatex is nowadays also used for DVI output simply checking for the existence of \pdfoutput is not enough anymore. If you need this use the ifpdf package which provides the \ifpdf switch. One reason to use it might be to define a different extension list with \DeclareGraphicsExtensions for DVI/PS or PDF output. I stopped supporting both formats with my documents years ago. Normally you chose your format in advance and stick with it. IMHO due to the modern eps-to-pdf packages there is not much reason to use DVI output nowadays.

Also: The linked document is a wikibook, i.e. everyone can edit it and therefore the quality can vary. Don't pay to much attention to such websites. There is a lot of outdated material on LaTeX in the WWW.

share|improve this answer
    
@Martin: thanks as always for the help. Yes, I suspected this was the case. No complicated headers for me then. –  lowndrul Feb 27 '11 at 22:44
    
@brianjd: As always you are very welcome. Please wait before accepting any answers to see what others have to say about this topic. –  Martin Scharrer Feb 27 '11 at 22:46
    
What is the best way to rewrite that example on Wikibooks? That is clearly outdated information. –  Caramdir Feb 27 '11 at 23:56
1  
@Martin, one reason to maintain a 'bilingual' workflow would be if you're writing an article and want to send a preprint to something like arXiv (which has a very tight size limit, so the better compression of PDF figures is a real help) and also submit to a journal (which often have PS-based workflows). –  Lev Bishop Feb 28 '11 at 1:11
2  
@brianjd: Martin was right, it's good if you don't immediately accept answers, but wait a day (or two). But please don't forget accepting later on! It shows that the answer helped you, and it assigns reputation points to the author of the answer (and to you!). Moreover, it looks better if the "accept rate" below your user name is more than 20%. –  Hendrik Vogt Mar 2 '11 at 10:26

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.