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've just made a minor alteration to a file from a TeX package. I copied it into my local texmf tree and made the change there. When I tried kpsewhich <filename> to test that it was finding my local version, it returned the original one and not the new one. In actual fact, the original file was from my local texmf tree already so I renamed the old one something simple. Now kpsewhich <filename> returned the system version of the file. To check that the file was there, I tried kpsewhich -all <filename> and got the correct two versions of the file: my modified one and the system one (in that order). If I try this with another file that I know exists in both places, then kpsewhich <filename> returns my local file.

Here's the various invocations and their results:

~% kpsewhich pgfsys-pdftex.def
/usr/local/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
~% kpsewhich -all pgfsys-pdftex.def 
/Users/stacey/Library/texmf/tex/latex/bzr/pgfsys-pdftex.def
/usr/local/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
~% kpsewhich tqft.sty              
/Users/stacey/Library/texmf/tex/latex/bzr/tqft.sty
~% kpsewhich -all tqft.sty
/Users/stacey/Library/texmf/tex/latex/bzr/tqft.sty
/usr/local/texlive/2012/texmf-dist/tex/latex/tqft/tqft.sty

Is it something special about the .def extension? Is there some command that I forgot to run? Are there some other options to kpsewhich that will help me debug this?

share|improve this question
1  
kpsewhich doesn't search first the complete local tree and then the global tree but first one path in the local tree, then this path in the global tree, then the second path in the local tree and so on. So put the file in /Users/stacey/Library/texmf/tex/generic/ –  Ulrike Fischer Nov 1 '12 at 12:16
    
I didn't know that! Thanks - it works. –  Loop Space Nov 1 '12 at 12:25
2  
@UlrikeFischer Good point! You could make this to an answer or Andrew. We could close as too localized, however I guess the explanation of this issue could help other users who just google instead of reading the kpathsea manual. –  Stefan Kottwitz Nov 1 '12 at 13:02
add comment

1 Answer

up vote 12 down vote accepted

kpsewhich (and kpathsea generally) doesn't search first the complete local tree and then the global tree but use a sort of zigzag road: first one path in the local tree is searched, then this path in the global tree, then the second path in the local tree and so on.

The exact road depends on the engine, e.g. the road is different for latex and xelatex, and the settings in texmf.cnf. The details can be found in the kpathsea manual.

This zigzag is useful. E.g. you can have engine dependant configuration files: you can have a hyphen.cfg in your local tree in tex/xelatex and another in the global tree in tex/latex, and xelatex will use the local one and latex the other.

So put your file in /Users/stacey/Library/texmf/tex/generic/ so that it lays in the same subpath than the global one.

share|improve this answer
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.