TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using standalone sub-directories do not seem to work properly.


\usepackage[subpreambles,mode=buildnew]{standalone} %standalone tikz



\usepackage[subpreambles,mode=buildnew]{standalone} %standalone tikz


Will fail. The figure will be inserted in the document but no pdf will be generated. Compilation states:

  Description Resource    Path    Location    Type Graphic
  '../fig/MAP/ray-casting.pdf' could not be
  build.  thesis_main.tex /Thesis/src line 60 Texlipse Build Error

The files are at the fitting locations and the document is produced but no pdf for the figure in the latter case. I like to keep figures separated. Is there a way to do this and use standalone?

share|improve this question
I just found out that simple paths like \includestandalone{fig/standalonepic} work fine. More complicated ones (.. or subdirectories are problematic) – Martin May 6 '12 at 14:46
I'm not sure I understand your folder structure. Why don't you put the standalone files inside of a subfolder that is inside of the folder containing your .tex file? It looks like you are currently trying to go up a directory (from where the .tex file is) and then down into a figure folder (that is on the same level as the folder containing your .tex file). – JohnReed May 6 '12 at 17:16
@JohnReed: Yeah that's it. I adoptded this structure once and stuck with it but my current workaround is exactly what you suggest. Subfolders (fig/map) would be handy though since I can then keep one figure folder for every chapter, but as I said your suggestion works – Martin May 6 '12 at 17:27
@JohnReed Can you make your comment a brief answer just for the housekeeping reasons? Thanks. – percusse May 9 '12 at 23:57
@percusse I understand wanting to have answers to the question being posted as answers, but I really don't think that my comment answers the question (especially since they already know that my suggestion works). It sounds like their problem might possibly be a bug in the standalone package, in which case, somebody with more in-depth knowledge of TeX's internals will need to help. I'm pretty sure that the package author is a mod on this site... – JohnReed May 10 '12 at 0:24
up vote 8 down vote accepted

Creating files in directories containing .. is prohibited by LaTeX for security reasons. Otherwise a package could rewrite e.g. your ssh login config or something like this. It would still work with the PDF build in the current directory, though. I will try to add some detection for this and to chose a suitable directory.

If you are under Linux try to use symbolic links to your directories. Also, you can set the TEXINPUTS environment variable to the directories with your images: TEXTINPUTS=.:DIR1:DIR2: the .: at the beginning and the trailing : is important. Under Windows use ; instead of :. In this case the PDFs are build in the document directory.

share|improve this answer

Your Answer


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.