Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

For my document I have an image folder that holds my images. For this example I will assume the following situation:

Original image path: ~/Matlab/filename.pdf
Image folder path: ~/Latex/images
Alias to image: ~/Latex/images/filename.pdf

I want to include the image by pointing to the alias of the image. In this way the image will be updated when Matlab updates filename.pdf in the ~/Matlab folder. I've tried it as follows:

\begin{figure}[!htpb] 
\centering 
\includegraphics[clip=true, trim=0 170 0 170, width=0.33\linewidth, angle=0]{images/filename.pdf} 
\caption{CAPTION} 
\label{fig:} 
\end{figure}

However, TexShop (I'm on a Mac) does not like this and produces the following error:

!pdfTeX error: /usr/texbin/pdflatex (file ./images/mountdiff.pdf): xpdf: reading PDF image failed
 ==> Fatal error occurred, no output PDF file produced!

How can I link to the file in the Matlab folder, without typing the whole path in the \includegraphics line. Typing the whole path is undesirable as it is much longer than the example suggests.

share|improve this question
1  
What do you mean with "alias to image"? It should be a symbol link (shell command line: ln -s ~/Matlab/filename.pdf ~/Latex/images/filename.pdf). –  Heiko Oberdiek Mar 31 '13 at 19:23
1  
Thank you @HeikoOberdiek Shortly after posting this question I found this out. But with alias I mean the file you get when you rightclick on a file and press Make Alias. Or when you hold opt+cmd during dragging. –  Bart Arondson Mar 31 '13 at 19:27

1 Answer 1

up vote 5 down vote accepted

Shortly after posting this question I found out that a symbolic link is not the same as an alias and tried using a symbolic link.
I've made a symbolic link in ~/Latex/images to the file in ~/Matlab by using SymbolicLinker (I'm not affiliated in any way). A symbolic link can also be made in Terminal as follows (file/folder names as given in the example):

cd ~/Latex/images  
ln -s ~/Matlab/filename.pdf filename.pdf

Then images/filename.pdf can be used regularly in \includegraphics.

share|improve this answer
2  
Yes; only applications using the user interfaces provided by Mac OS X can profit of Finder aliases. TeX Live programs know only about symbolic links, and Finder aliases are a very different thing. –  egreg Mar 31 '13 at 19:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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