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:
/mwe.tex
/sub/mwefig.tex
File mwe.tex
contains the following:
\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 following code:
\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:
/sub'/mwefig'.pdf
So after compilation I have the following filetree (excluding aux and log files):
/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)
standalone
uses quotes around the file name to avoid issues with potential spaces and other special characters in them. However, Windows requires double quotes here but Linux (my main OS) requires single quotes. There is a test built in to use the correct quotes for the users OS. Could you check the version ofstandalone
. It should be fixed in v1.1 and later. See the bug report: bitbucket.org/martin_scharrer/standalone/issue/2/…standalone
is v1.1b. (The log file can be seen Test Log). Also, could you provide an example ofquote
option usage. I have tried including\standaloneconfig{convert={quote={"}}}
in either mwefig.tex and mwe.tex preamble. However upon compiling, an error is produced:! Package xkeyval Error: convert' undefined in families standalone.sty'.
.convert{quote{=}}}
trick. Since v1.2 is not in the CTAN archive I'm not much for using it, so I tried by overriding the build settinglatexoptions
byt addingbuild={latexoptions={-interaction=batchmode -shell-escape -jobname " \\buildjobname "}}
to the package options. This however, ends in a runaway argument. Can you provide a work-around?latexoptions
code: the double backslash is wrong. Try it with\noexpand\buildjobname
if you are using it as class option. Note that there is also a config file as explained by the manual.