I'm having problems compiling the following code:



\ifcsname info#1Img\endcsname%
\ifcsname info#1Ref\endcsname


\newInfo[./images/myimage.eps]{Test}{Information content}



It says ./images/myimage.eps not found (regardless of the name, type, absolute/relative path, etc).

If you, however, replace line 21 by \includegraphics[width=\linewidth]{./images/myimage.eps}, then it displays the image correctly.

  • Remove the file extension, i.e. use it as ./images/myimage – user31729 Oct 1 '17 at 15:04
  • You should expand \csuse{info#1Img} before executing \includegraphics. But I can't understand several parts of the code which appear to do nothing useful at all. In particular, what's the purpose of \nullfont#3\normalfont? – egreg Oct 1 '17 at 15:13

In order to get the automatic conversion from EPS to PDF the file name in the argument to \includegraphics should be explicit, so you can change the code into

  \ifcsname info#1Img\endcsname

Some comments: your example code misses \makeatletter and \makeatother, because you want to define commands with @ in their name. By the way \edef\@creatingInfo{1} is exactly the same as \def\@creatingInfo{1}, just less efficient.

Moreover, several parts of the code seem to do nothing at all, probably because the shown code is just an excerpt. But


is something I can't understand at all. Why typesetting the file name in \nullfont, so nothing appears?

Finally, never use the pdftex option for graphicx.

  • Thank you for your comments. the \nullfont#3\normalfont is essential for my package. It forces latex to evaluate several commands (which are stored inside other commands) without printing the output. That's why there is the distinction between \@creatingInfo and \@printingInfo – Benedict Oct 14 '17 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.