:::: MENU ::::

TeX tip: Storing files in multiple folders

See, here’s a TeX tip already. I have a somewhat strange filing system on my computer. It’s marked by a number of behaviors that don’t work smoothly with TeX – storing images in their own folder, keeping one giant references file instead of different ones for each paper, putting the main tex file in a folder by project rather than file type. So, this means that for any given TeX file, the .cls file that formats it, the references file where it’s bibliography is stored, and the .tex file itself will be in 3 different folders. TeX doesn’t like that. It’s not easy to reference or include files in other folders within one’s TeX document. So, I make symlinks for the files that live elsewhere. Symlinks are possible only on Mac (not Windows), and you can create them in Terminal. So, fire it up and navigate to the folder where your .tex file lives. Then use

ln -s [directory_with_file_you_want_to_include]/filename .

Note that space and period at the end. Those are important; they create the symlink instead of an alias. LaTeX actually doesn’t care if you use an Alias instead of a symlink, but Subversion does. If you’re using Subversion for version control (say you’re writing a paper in LaTeX with your colleagues), Subversion will follow symlinks and update your project accordingly.

For example, I’m writing a CSCW paper with Sean and Jude that uses my “references.bib” file. That file is stored in “/Documents/endnote files/references.bib”. I have a symlink in “/Documents/ResearchProjects/KNOWSI/CSCW 2008” for the references.bib file, and when I add citations, Subversion knows to grab the real file and commit that to our Subversion project. Cool, huh?

More about Subversion. Note: I recommend TortoiseSVN on PC for managing Subversion projects. I’m still hunting for a good Mac GUI (good = one that works!) I’ve tried Finder scripts, svnX, and RapidSVN with no success.

So, what do you think ?

You must be logged in to post a comment.