I have a few personal class and style files that I keep in a Git repository as they change often. On UNIX-based systems, I simply insert a symbolic link in my texmf tree that points to these files:

ln -sf /path/to/GitRepository/someClass.cls /path/to/texmf-local/tex/latex/

This way, LaTeX always uses the most recent version of the class file. However, my attempts to create a similar setup on Windows with MiKTeX have failed.

Using a Windows shortcut produces a "file not found" error during LaTeX compilation:

! LaTeX Error: File `homework.cls' not found.

Also, pdflatex completely fails to understand a Cygwin symlink:

! LaTeX Error: Missing

See the LaTeX manual or LaTeX
Companion for explanation. Type  H
<return>  for immediate help.  ...    

l.1 ! '<'symlink'>'��.

Is there any way to achieve the effect of symbolically linking files into a texmf tree on Windows using MiKTeX?

Windows XP is the version I encounter most often.


You could maybe do something with NTFS junction points, which seem to perform essentially the same function as symlinks to directories. This is unfortunately not going to work for the precise file path you mention above, but you could put a junction point for your entire package at $TEXMFROOT/tex/latex/<packagename>/ — speaking of which, shouldn't you have been putting those symlinks in $TEXMFROOT/tex/latex/misc/ as it is? (Yeah, I was looking at the TDS spec recently...)

The only other suggestion I have is looking into a Cygwin build of MiKTeX (hey, if it can be built on *nix, why not on Cygwin?), but I suspect that that might not be terribly convenient, due to issues integrating with non-Cygwin GUI tools and/or lack of support by GUI tools for a win32 ui but *nix everything else. Of course, if you weren't using any GUI tools to run TeX anyway, it's probably not much of a problem ;-).


Usually you have a Makefile or similar installation procedure which copies the files to the correct locations. I don't know of any possible symbolic link replacements for Windows XP; starting with Vista, Windows supports symbolic links natively.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.