2

I have a clean install of texlive. While trying to compile any document which uses either the graphics, graphix, or the xcolor packages, I get errors that the compiler can't find the corresponding .def file.

pdftex.def - if I am using pdflatex
xetex.def - if I'm using xelatex

I have downloaded the graphics-def package from CTAN, and copied the .def files to /texmf-dist/tex/latex/graphics, but I had no luck. Maybe I don't know where the files are supposed to go.

The only thing that worked was putting the .def files in the same directory as my .tex program.

This is surely a path error. Where do I put the def files so that the packages can find them?
EDIT: I'm using Windows and TeXStudio. (Although I'm getting the same errors when I compile via command line)

  • I don't know if you're using e.g. Linux. At least with Ubuntu, you have to edit the /etc/environment file to add the path of TeXLive. Mine is /usr/local/texlive/2016/bin/x86_64-linux. It's strange, though, that you could compile a file, given what you've just said. – user101590 Jul 28 '16 at 5:47
  • @JBFWP286 I'm sorry, I forgot to mention the OS. I am using Windows 8. The strange thing is, I can compile the program when the .def file is in the same directory as myfile.tex. So I assume I'm unable to locate the general path where the .def file should exist. – ChaoticTwist Jul 28 '16 at 5:54
  • Thanks for your edit. Exactly, there are problems with your PATH. It seems you must have those files inside C:\some-path\texlive\2016\texmf-dist\tex\latex\graphics-def, as I don't really know the full path you installed TeXLive. – user101590 Jul 28 '16 at 5:55
  • @JBFWP286 As a matter of fact, I do have those files in ..\texlive\2015\texmf-dist\tex\latex\graphics-def – ChaoticTwist Jul 28 '16 at 5:57
  • See if you can include the path to your TeXLive (C:\texlive\2015) in your PATH environment variable. See itechtics.com/customize-windows-environment-variables to know how to do so. Then, try to compile again and see if that works. – user101590 Jul 28 '16 at 6:00
0

Here is just for the records.

Thanks @JosephWright for your help! It was painful.

Remember to download TeXLive from a verified site: http://tug.org/texlive/acquire-netinstall.html

Here's the ISO one: https://www.tug.org/texlive/acquire-iso.html

Hope that helps!!!

1

Graphics drivers were recently reorganised. For a manual installation, the contents of the graphics-def package has to be installed in(texmf root)/tex/latex/graphics-def/.

However the best solution is to use:

  • TeX Live Package Manager (tlmgr) for TeX Live,
  • TeX Live Utility for MacTeX,
  • MiKTeX Package Manager (mpm) for MiKTeX.
  • I tried to compile with XeLaTeX some (old) Japanese text which once worked just fine but not with the current installation. What exactly should I do with the MiKTeX Package Manager? I get a xetex.def not found with beamer. – Matsmath Aug 6 '16 at 17:27
  • 1
    Ask MPM (both as admin abd as user) to install graphics-def. – Bernard Aug 6 '16 at 17:42

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.