# workflow directory structure that plays nicely with latex

I really like using LaTeX for writing, both articles and for teaching. I find that it eliminates many of the hassles of using Word. I started trying to figure out how to write my own packages this past year and ran into many problems. One of those problems was figuring out a way to keep the .sty packages in a directory that I could easily access and that would be convenient for my workflow rather than what the LaTeX directory structure enforced.

The LaTeX search path includes two environment variables: TEXMFHOME and TEXMFLOCAL that determine where you would store .sty files to be recognized by LaTeX.1 If you follow the excellent instructions here, you can use the Linux program kpsewhich to find where those paths are. For me they were at /Users/<USERNAME>/Library/texmf and /Users/<USERNAME>/Library/texmf-local, respectively.

Since I generally have a file structure that I could export to any new computer, I don't want to have to remember to pull files from these directories. I would definitely forget to do this when I changed machines, and would probably only realize my mistake after IT wiped the machine. I want to be able to edit my .sty files in my own directory that would go with me. I realized that a very simple solution would just to have a symbolic link point my TEXMFHOME:2

ln -s ~/work/workflow/texmf /Users/<USERNAME>/Library/texmf


Now I can work and save the files in my own work directory, but LaTeX will recognize the file and use the style.

1. These instructions work on a Mac; I imagine they also work on Linux. Good luck on a Windows machine.

2. In retrospect, I probably should have pointed my TEXMFLOCAL directory to the file, not the TeX home directory. Live and learn.

#### Pingbacks

Pingbacks are open.