You are here: Matthew KENWORTHY > Nelse > Using bibtex and texmf

Using bibtex and texmf


I've had several small bibtex files for many years scattered across many directories, and this has led to confusion and madness. To resolve this issue, I've gone and decided to use a single bibtex file for all my references, just as Saint Knuth (probably) intended.

But, it's still wasteful to have all these files duplicated across the directory tree, and soft linking seems a bit nuts to me.

Thankfully the Unix gurus solved this problem many years ago, and there's a standard directory structure for all your latex files.

Just use kpsepath tex to show the current paths that are scanned for files.

On a Mac, create the directory texmf/ in your Library/ directory and follow this structure:

./bibtex
        /bib
        /bst
./tex
     /latex
     /latex/aastex52
     /latex/astronat
     /latex/astronat/apj
     /latex/astronat/mnras
     /latex/emulateapj

This tree must have a prescribed structure. Put BibTeX files (.bib) in ~/texmf/bibtex/bib/ and put macro (.sty) files in ~/texmf/tex/latex/packagename/ (but replace packagename with the name of your macro package). Okay, so my big bibtex file lives in bibtex/bib/kenworthy.bib and custom style files in bst. This is all automatically found with subsequent latex programs, very nice.

NOTE when you add new files, remember to rerun texhash in the base directory.

cd texmf/
texhash .
texhash: Updating /home/mattk/texmf/./ls-R... 
texhash: Done.

Links: