2

The \includegraphics command from graphicx automatically tries different extensions for the figures. For the purpose of automatically processing latex files, I'd like to be able to emulate this behavior using the kpathsea command, butthe options in the manual don't make it clear how to do this. Is it possible, or is there some other solution?

4

graphics doesn't do a "lookup with wildcard extension" it just loops through a known list of extensions and searches for each possibility in turn.

You can do the same on the commandline

For example

$ for e in png eps pdf; do kpsewhich example-image.$e; done

returns

/usr/local/texlive/2014/texmf-dist/tex/latex/mwe/example-image.png
/usr/local/texlive/2014/texmf-dist/tex/latex/mwe/example-image.eps
/usr/local/texlive/2014/texmf-dist/tex/latex/mwe/example-image.pdf

in my texlive 2014 setup, using a bash command line. Most other commandlines will offer a similar loop construct.

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.