A blog by Rob J Hyndman 

Twitter Gplus RSS

Maintaining local LaTeX files

Published on 14 August 2009

If you use LaTeX, then you prob­a­bly have a bib file — a data base of all the papers and books that you have cited. It is much more effi­cient to keep one data­base in one loca­tion, than have mul­ti­ple copies of it float­ing around your hard drive. (Or even worse, have dif­fer­ent bib files cre­ated for dif­fer­ent papers.) You might also have a few of your own style files, and again it is best to keep these in a cen­tral loca­tion and not have dupli­cates all over the place. So you need a cen­tral place to store these files where LaTeX will find them.

You could store your local files inside C:\Program Files\MiKTeX 2.7, but then when you upgrade to v2.8, you will have to go and find them and copy them to pre­vent them being lost. A bet­ter solu­tion is to cre­ate your own direc­tory. But it is impor­tant that your own direc­tory has the same tree struc­ture as C:\Program Files\MiKTeX 2.7.

My own local direc­tory is called C:\localtexmf. A few ver­sions ago, that is the only name it could have so I’ve stuck with it. Now you can call it what­ever you like. Within that direc­tory, it is impor­tant to have the fol­low­ing file structure:

C:\localtexmf\bibtex con­tains .bib and .bst files.

C:\localtexmf\tex\latex\ con­tains .sty and .cls files.

You will also need to reg­is­ter your local latex tree. Just go to MiK­TeX set­tings and click on the Roots tab. Then enter the new direc­tory as follows:

To add your local tree to the list, click Add, browse to C:\localtexmf (or what­ever name you’ve cho­sen) and click OK.

The only other thing to remem­ber is to refresh your file­name data­base every time you add a new file to the local tree.


Related Posts:


 
Tags: ,
No Comments  comments