I would like to know if it is possible to give a command that includestandalone would remember when building the pdf.
To explain a bit more, I like to put all my extra data like my standalone subfiles in a subfolder. I would like to do a plot with pgfplots from a CSV file itself in a subsubfolder (from the main). Therefore the structure is the following:
main.tex
Supplies/
|-standaloneplot.tex
|-Data/
|-file.csv
And the files are the file.csv:
# Coord_X, Coord_Y
0.0 , 1.0
1.0 , 2.0
the standaloneplot.tex:
\documentclass[]{standalone}
\providecommand{\PathS}{./}
\usepackage{tikz} %
\usepackage{pgfplots} %
\pgfplotsset{compat=newest} %
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel={Space }, %
ylabel={\PathS }
]
\addplot[ color=blue, ]
table[x=Coord_X, y=Coord_Y, ignore chars={\#}, col sep=comma]
{\PathS \detokenize{Data/file}.csv};
\end{axis}
\end{tikzpicture}
\end{document}
and the main.tex:
\documentclass{article}
\providecommand{\PathS}{./Supplies/}
\usepackage{standalone} %
\usepackage{tikz} %
\usepackage{pgfplots} %
\pgfplotsset{compat=newest} %
\begin{document}
the path is \PathS
\begin{figure}
\includestandalone[mode=build, width=0.5\linewidth]{\PathS standaloneplot.tex}
\caption{test}
\label{lab}
\end{figure}
\end{document}
I deal with this structure by defining a command in the main and in the standalone file. And it works correctly when I include the standalone file in a tex mode. This is, I think, close to the solution suggested here. But when I use the build mode it forgets this command, which seems natural from my understanding of this mode.
Thus, I would like to know if it possible to work-around this problem and keep this structure and the use of standalone in build mode and pgfplots.
Maybe there is a way not to forget a command before to build the standalone file or a way for standalone to act more like the tex mode.
Do you think it is possible?