# Name clash, “\ifpdf is already defined” between JHEP3.cls and ifpdf.sty [closed]

You might be interested that there seems to be a clash between JHEP3.cls version 3.1.5 (from http://jhep.sissa.it/jhep/help/JHEP/TeXclass/tools_JHEPlog.html) and the ifpdf package. I think both packages use variable \ifpdf, which clashes.

When I compile:

\documentclass{JHEP3}
\usepackage{graphics}

\author{Kuba}
\date{14/12/2012}
\abstract{ble}
\title{ble}
\keywords{ble bel}
\preprint{10932}

\begin{document} ble ble \end{document}


I get

Package ifpdf Error: Name clash, \ifpdf is already defined.


However, when I replace all \ifpdf in JHEP3.cls to \ifpddf, all \pdftrue to \pddftrue, and all \pdffalse to \pddffalse, it works fine!

I will also write to inform JHEP.

Including \let\ifpdf\relax (as suggested in Package ifpdf Error) does not help, because an error message like Extra \fi \begin{document} appears.

Do you have another/better idea, how to deal with this?

-

## closed as too localized by cgnieder, Kurt, Thorsten, Martin Schröder, Stefan Kottwitz♦Dec 16 '12 at 0:20

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Could those voting to close please leave a comment stating why you think the question should be closed? –  Vivi Dec 15 '12 at 1:25
Please contact the author of JHEP3.cls. –  Martin Schröder Dec 15 '12 at 7:32
Now that the question has been changed (and an actual question is asked) I think the question should stay open. –  cgnieder Dec 15 '12 at 8:15
I think the question is too localized because it seems to be caused by a deficiency or incompatibility of the class to that package which could be easily fixed. Besides that, name clashes are a common problem and there are known fixes, so the question is probably a duplicate, and in this version, specific to a class, a very localized one. If it's meaningful to reopen for allowing adding more answers, just put a reopen vote. If anybody knows a canonical question with good answers about name clashes, it would be great to add a link here. –  Stefan Kottwitz Dec 16 '12 at 0:19

Yes, \ifpdf is defined both in the class file and in the package ifpdf that is loaded by graphics.cfg. Workaround:

\RequirePackage{ifpdf}
\documentclass{JHEP3}


Then \ifpdf will be overwritten by the class, but with a similar meaning (the class is wrong for negative numbers of \pdfoutput). But the warning of ifpdf is not triggered and the package will not be loaded again later, because the package is already loaded.

-

Your example document compiles fine for me, probabably because it does not contain \usepackage{ifpdf}. Other than that, you are right, the JHEP3 class does define \ifpdf. Just don't use package ifpdf with this class. If you have to use some package that loads ifpdf, then insert \let\ifpdf\relax before that, or even directly after the \documentclass{JHEP3}.

-