Symbolic link does not work in \includegraphics

695 views
Skip to first unread message

Filip Verhaeghe

unread,
Dec 20, 2011, 12:48:37 PM12/20/11
to LaTeX Users Group
Hi,

I can build Latex documents, and including (PDF) images using
\includegraphics works great when the image is directly available.
However, when I replace the image by a symbolic (soft) link to the
image, Latex cannot find the image. The same occurs when the image
included is part of a directory that is symbolically linked.

Is there something I could be doing wrong? Below a minimal example:

\documentclass[]{article}
\RequirePackage[pdftex]{graphicx}

\begin{document}

% In the following link, Signatures is a symbolic link to another
directory,
% and blank.pdf is present in that directory. Result:
%
% package pdftex.def Error: File `../Links/Signatures/blank.pdf' not
found.

\includegraphics[height=1.3cm]{../Links/Signatures/blank.pdf}

% Doing the same as above with the same directories but replacing the
% symbolic linked directory with an actual copy of the directory works
perfectly;
% it finds the file and inserts it.

\end{document}


I'm using MacTex on Mac OS X Lion. Latex report the following
version:
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)
restricted \write18 enabled.

Best regards,
Filip

Peter Flynn

unread,
Dec 20, 2011, 3:44:35 PM12/20/11
to latexus...@googlegroups.com
On Tue, Dec 20, 2011 at 5:48 PM, Filip Verhaeghe <f%unmann...@gtempaccount.com> wrote:
I can build Latex documents, and including (PDF) images using
\includegraphics works great when the image is directly available.
However, when I replace the image by a symbolic (soft) link to the
image, Latex cannot find the image. The same occurs when the image
included is part of a directory that is symbolically linked.

This seems to be a known behaviour:
http://tex.stackexchange.com/questions/12506/how-can-i-pass-a-shortcut-to-a-pdf-to-includegraphics
due to the way in which the graphicx package handles filenames.
 
Is there something I could be doing wrong?

Use the \graphicspath command instead, if you want to reference image files in other directories.

///Peter
 

Filip Verhaeghe

unread,
Dec 20, 2011, 5:31:23 PM12/20/11
to LaTeX Users Group
Thanks Peter. Unfortunately, that doesn't work either. In your linked
webpage, it seems symlinks work in Linux but in my testing it does not
seem to work in Mac OS X (Lion).

Filip.

On Dec 20, 9:44 pm, Peter Flynn <anglebrac...@gmail.com> wrote:
> On Tue, Dec 20, 2011 at 5:48 PM, Filip Verhaeghe <
>
> f%unmanned.a...@gtempaccount.com> wrote:
> > I can build Latex documents, and including (PDF) images using
> > \includegraphics works great when the image is directly available.
> > However, when I replace the image by a symbolic (soft) link to the
> > image, Latex cannot find the image. The same occurs when the image
> > included is part of a directory that is symbolically linked.
>
> This seems to be a known behaviour:http://tex.stackexchange.com/questions/12506/how-can-i-pass-a-shortcu...

Peter Flynn

unread,
Dec 21, 2011, 4:06:40 AM12/21/11
to latexus...@googlegroups.com
On Tue, Dec 20, 2011 at 10:31 PM, Filip Verhaeghe <f%unmann...@gtempaccount.com> wrote:
Thanks Peter. Unfortunately, that doesn't work either. In your linked
webpage, it seems symlinks work in Linux but in my testing it does not
seem to work in Mac OS X (Lion).

Very odd.
Reply all
Reply to author
Forward
0 new messages