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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to do something like



Maybe this isn't the best example, but do control-flow solutions exist in LaTeX to let us do something depending on how we compile?

share|improve this question
up vote 8 down vote accepted

The ifpdf package.

Although for your specific example of wanting to include graphics.eps or graphics.pdf it's better to \usepackage{graphicx} and not specify an extension, i.e. \includegraphics{graphics}. See this FAQ answer.

share|improve this answer
perfect, thanks! – Noli Sep 8 '10 at 5:55

Your Answer


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.