pgf-tikz / pgfplots

pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
http://pgfplots.sourceforge.net/
198 stars 34 forks source link

Make pgfplots able to deal with (import) relative paths #279

Open pgf-tikz-bot opened 9 years ago

pgf-tikz-bot commented 9 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/45/ Author: denisbitouze Timestamp: 2015-03-09 10:06:05.357000

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};
pgf-tikz-bot commented 9 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/45/#b683 Author: vser Timestamp: 2015-05-03 17:46:34.244000

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...