I have three files, the files main.tex and package.sty located in the same folder and a standalone file fig.tex located in a subfolder sub, using a command from package.sty. The problem is that standalone says it cannot build fig.pdf. I use standalone v1.1b. I give the option --shell-escape.
- Am I doing something wrong?
- If not, is there a way to still use the
buildnewoption, with a setup where astandalone-file in a subdirectory uses a file in a parent-directory?
The file main.tex
\documentclass{article}
\usepackage[mode=buildnew]{standalone}
\usepackage{tikz,package}
\begin{document}
\includestandalone{sub/fig}
\end{document}
The file package.sty
\newcommand{\foo}{b}
The file test.tex
\documentclass[tikz]{standalone}
\usepackage{../package}
\begin{document}
\begin{tikzpicture}
\node {$\foo$};
\end{tikzpicture}
\end{document}
Edit: One option seems to be to place a symbolic link to the package in the subfolder and then use the link. But this is not platform independent, and makes compilation more involved.
../in a\usepackagepath. However, without a link, can't you put simply your preamble in the same folder as the standalone input, and use\usepackage{<standalone-subfile-folder>/package}in your main and simply\usepackage{package}in the standalone ? – marsupilam Aug 11 '17 at 20:08latex-run for the figure is not allowed to create files in the parent folder. Solution would be to let the files be created in the figures directory. There supposedly is anbuildoption for that, to which you can passlatexcompiler options. However, currently I do not get it to work. – Heinrich Ody Aug 11 '17 at 20:35packageare in the same folder. Also, it makes the file structure somewhat confusing. – Heinrich Ody Aug 11 '17 at 20:51\usepackage{subfolder/package}to hide a bit this unpleasant involvment. – marsupilam Aug 11 '17 at 20:59\usepackage{}as I understand it. Whether above or below the current directory. You can add toTEXINPUTSto get TeX to look in an additional place, however. – cfr Aug 12 '17 at 12:52usepackage, but still it works. I mean, the filefig.texfigure with\usepackage{../foo}is compiled correctly. It does not work with nested compilation calls. Anyway, your suggestion withTEXINPUTSseems to work nicely. Thanks – Heinrich Ody Aug 12 '17 at 19:32