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:

\includegraphics[clip=true, trim=0 170 0 170, width=0.33\linewidth, angle=0]{images/filename.pdf} 

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.

  • 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). Mar 31, 2013 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. Mar 31, 2013 at 19:27

1 Answer 1


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.

  • 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, 2013 at 19:47

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.