# How can I pass a shortcut to a .pdf to \includegraphics{}?

I'd like to pass shortcuts to \includegraphics.

I have the following project structure

/project/report/main.tex
/project/report/myplotshortcut
/project/code/r/output/myplot.pdf


And file:

% main.tex
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\inlcudegraphics{myplotshortcut}
\end{docuemnt}


where myplotshortcut is a shortcut to myplot.pdf.

Things work fine when I pass myplot.pdf directly. The shortcut seems to break things. There's no mention of a "pass shortcut" option in the graphicx manual. HOWEVER, in my post Project directory organization: where does the output go it was mentioned that I should include dynamic links. My understanding is that (basically) symlinks are to Linux as shortcuts are to Windows.

Q: Does what I've posted above work fine with symlinks (as suggested in that linked post)?

Q: If it does, how can I set up a similar architecture using Windows shortcuts?

UPDATE: I figured out how to make an actual symlink using the mklink function from the command line. Still no dice. Doesn't seem to make a difference.

-
Wouldn't it be easier just to point the graphicx package to /project/code/r/output/ by using the \graphicspath{} command? – Alan Munn Mar 3 '11 at 2:46
Windows has NTFS junctions which are similar to symlinks. – Ben Alpert Mar 3 '11 at 2:55
@Alan: for modularity's sake, I'm trying to get main.tex to only call on files from within its working directory (as suggested in that post I linked). However, what the responder suggested doesn't seem to work. – lowndrul Mar 3 '11 at 3:01
"My understanding is that (basically) symlinks are to Linux as shortcuts are to Windows." Thats true: Symlinks are as awesome as Linux and shortcuts are as ... as Windows. Note that symlinks are resolved at the file system layer, i.e. much deeper than shortcuts which I think are resolved in the application layer and are basically just special files holding the linked path. – Martin Scharrer Mar 3 '11 at 7:35
@Ben, Martin: Windows also has Unix-style symlinks (in addition to junctions and hard links, not as a replacement). Windows shortcuts (*.lnk files) are interpreted by the GUI shell and correspond to *.desktop files often found on Linux desktop environments (e.g. Gnome or KDE). – Philipp Mar 3 '11 at 13:12

Q: Does what I've posted above work fine with symlinks [under Unix/Linux] (as suggested in that linked post)?

A: Yes, as long as the symlink has the proper extension: So
myplotshortcut.pdf -> /project/code/r/output/myplot.pdf works fine, but
myplotshortcut -> /project/code/r/output/myplot.pdf doesn't, which is due to the way the graphics/x packag(s) work.

Q: If it does, how can I set up a similar architecture using Windows shortcuts?

A: With a shortcut it wont work because (La)TeX doesn't support them. You can use mklink on NTFS file systems (i.e. under Win 7, Vista, 2k, NT etc. but not under older FAT-based Windows versions) like you already pointed out, but I will need to add the correct extension also in this case!

-
Yes, that did work. I had tested things out, adding a .pdf extension in the shortcut case but not the symlink case. That was the trick. – lowndrul Mar 3 '11 at 15:13