0

I have a folder ~/texmf in which I keep locally generated packages useful in my work, or ones that I judiciously modify. I do this to protect against breaking things when I upgrade TeXLive on my Linux system - I always do upgrades/installs using vanilla versions available on texlive.org since the Debian packages are usually out of date.

One such package is saved as a subfolder under ~/texmf/tex/latex/local. Let us call it usefulpackage. Now, ~/texmf/tex/latex/local/usefulpackage/ has a subfolder called images. This contains some images of use in that package. In fact, usefulpackage is on GitHub as a private repo that I distribute to a few selected coworkers. usefulpackage/images contains a few sample files such as scan.png, header.eps, etc.

I was recently writing a document completely unrelated to usefulpackage, in which I had a subfolder called Figures. The subdirectory Figures contains several files, some of which have names that clash with names of some files in usefulpackage/images.

I generally set graphicspath: \graphicspath{{./Figures/}} in my LaTeX documents.

What has happened is that my compiled PDF has ended up with images from usefulpackage/images when that is clealy not my intent or even a desirable outcome.

Is there any way in which I can force LaTeX to override texmf with graphicspath? Clearly, I am doing two things the right way - have a local package saved in ~/texmf and am using graphicspath for an unrelated document. However, the two correct protocols are interacting in this insidious manner.

3
  • graphicx tries loading without graphics path first, putting images in your local texmf is similar to distributing them via ctan to texlive etc. best to give them package-specific names Jul 6 at 16:39
  • you can not use graphicspath and use \includegraphics{./Figures/file.png} then the local one will be used. Jul 6 at 16:40
  • Thanks. I want to accept this answer. I had to rename the files in the package. Jul 7 at 19:27
1

graphicx tries loading without graphics path first, putting images in your local texmf is similar to distributing them via ctan to texlive etc. best to give them package-specific names

Alternatively you can avoid using graphicspath and use \includegraphics{./Figures/file.png} then the local one will be used.

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.