Graphics, Figures & TablesIncluding pictures in subdirs with standalone pack.

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
KarolisK
Posts: 13
Joined: Sat Jun 18, 2011 3:36 pm

Including pictures in subdirs with standalone pack.

Post by KarolisK »

After using standalone package extensively, I ran into one problem, which I cannot solve. The problem is that I need to include a TikZ picture in main files subdirectory. What is more I want to build it with standalone mode = buildnew. Consider the following filetree:

Code: Select all

/mwe.tex
/sub/mwefig.tex
File mwe.tex contains the following:

Code: Select all

\documentclass{article}
\usepackage{standalone}
\usepackage{tikz,pgfplots}
\standaloneconfig{mode=buildnew}
\pgfplotsset{compat=newest}

\begin{document}
Time is money!

\includestandalone{sub/mwefig}

\end{document}
And the file mwefig.tex contains the code:

Code: Select all

\documentclass{standalone}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}

\begin{document}

\begin{tikzpicture}
\draw (0,0) circle (2);
\end{tikzpicture}

\end{document}
After execution of mwe.tex I would expect mwefig.tex to be built, which would result in mwefig.pdf file created in /sub/ directory, which could then be used for later compilations.

What I rather get is a warning: Package standalone Warning: Graphic 'sub/mwefig.pdf' could not be build. Even though, the main PDF is produced containing the required graphics.

I also noticed, the mwefig.pdf file is actually created, however in a separate directory and with different name:

Code: Select all

/sub'/mwefig'.pdf
So after compilation I have the following filetree (excluding aux and log files):

Code: Select all

    
/mwe.tex
/mwe.pdf
/sub/mwefig.tex
/sub'/mwefig'.pdf
I am probably using something wrong, so if anyone could give any hints on how to solve this problem I would be very grateful. (Note: --enable-write18 is enabled, MikTex 2.9)
Last edited by KarolisK on Mon May 20, 2013 5:43 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

KarolisK
Posts: 13
Joined: Sat Jun 18, 2011 3:36 pm

Re: Including pictures in subdirs with standalone pack.

Post by KarolisK »

Solved. Migrating from v1.1b to v1.2 solved the problem.
Post Reply