Make pgfplots able to deal with (import) relative paths
Brought to you by:
cfeuersaenger,
ludewich
Hi,
this feature request is essentially the same as import input pgfplots with relative paths on http://tex.stackexchange.com/.
The problem is pointed out by the following MWE, provided a local subdirectory subdir
is previously created:
\documentclass{article} \usepackage{pgfplots} \usepackage{import} \usepackage{filecontents} % \begin{filecontents*}{subdir/subfoo.tex} \begin{tikzpicture} \begin{axis} \addplot file {data.dat}; % \addplot file {subdir/data.dat}; \end{axis} \end{tikzpicture} \end{filecontents*} % \begin{filecontents*}{subdir/data.dat} 0 1 1 10 2 100 \end{filecontents*} % \pgfplotsset{compat=newest} % \begin{document} \inputfrom{subdir/}{subfoo} \end{document}
With the absolute path:
\addplot file {subdir/data.dat};
the compilation of this file would be OK but it fails in case of relative path:
\addplot file {data.dat};
I've added an answer to ![the tex.sx question][http://tex.stackexchange.com/questions/38412/import-input-pgfplots-with-relative-paths/241971#241971]. It's just a workaround but could maybe be used as a first step...