Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using tex-live on a Ubuntu machine. I got a customized graphics.cfg file (configuration file for the graphix package) that I'd like to use as default on my system.

I've tried to locate the graphics.cfg used on my system:

locate graphics.cfg

but I got many results:

/etc/texmf/tex/latex/config/graphics.cfg
/usr/share/doc/texlive-doc/latex/latex-graphics-companion/inputs/graphics.cfg
/usr/share/doc/texlive-doc-en/latex/latex-graphics-companion/inputs/graphics.cfg
/usr/share/texlive-base/graphics.cfg

Which file should I substitute with the desired one? Thanks for the help

P.s. I know that I might modify the one in my local tree, but I'm writing a tutorial and would like to write a section explaining how to modify it system-wide and user-wide.

share|improve this question
    
Compile a small document which uses graphicx and then check in the log-file the path of graphics.cfg. But you should really not change this one. It can be overwritten by updates. Make a copy in a similar path in another texmf-tree searched before the main tree (this can be one used system-wide). –  Ulrike Fischer May 9 '12 at 8:53
    
@UlrikeFischer: I don't think a document is required. kpsewhich graphics.cfg does the job nicely. Ok, under Windows a document might be easier for many people. –  Martin Scharrer May 9 '12 at 8:56
    
Sorry, but how is this different to your other recent question Where to save graphics.cfg file? Both is basically the same topic and should be put into one question. Note that you can edit and update your existing questions. –  Martin Scharrer May 9 '12 at 9:09
    
@Martin Yes kpsewhich works too. I didn't point to the log because I thouhgt it simpler or faster but because imho it is vital for a (La)TeX to realize that the log-file contains useful informations. Someone who doesn't know that the log-file contains the path to files obviously never has really looked at the file. –  Ulrike Fischer May 9 '12 at 9:19
    
@MartinScharrer this question is specific for the file used system-wide by tex-live. The other question is about the local three of each user. –  lucacerone May 9 '12 at 13:01
show 1 more comment

1 Answer

up vote 3 down vote accepted

Normally you shouldn't substitude anything, but place your file at a location where it can be found before the other files. I personally would put it at ~/texmf/tex/latex/config/graphics.cfg, but you might not have a local ~/texmf enabled.

Note that locate is the wrong tool for the job. Use TeX's own tool kpsewhich. It is the one used by TeX to find it's input files. For example for my installation (Ubuntu with manual install TeX Live) I get:

$ kpsewhich graphics.cfg
/usr/local/texlive/2011/texmf-dist/tex/latex/latexconfig/graphics.cfg

After you installed your version you can check with kpsewhich graphics.cfg if it is taken by TeX or if another is found first. Note that changes to a TEXMF tree usually requires updating the file database using mktexlsr aka. texhash. I always do texhash ~/texmf, just to be on the safe side.


Note that it is even possible to load a different version of the config file if you input it with a specific directory part, i.e. \input{latexconfig/graphics.cfg} inside a local graphics.cfg would load the original first. You would need to change the latexconfig dir to the one of your installation.

share|improve this answer
    
Thanks @Martin incidentally you have answered also my other question about the local tree. –  lucacerone May 9 '12 at 13:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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