Skip to content

Gnuplot can't find the file when $aux_dir is set #1334

Open
@jdujava

Description

@jdujava

Brief outline of the bug

When compiling via latexmk with nontrivial $aux_dir, the ___.gnuplot file is put under aux_dir. Because the invocation of gnuplot tries to find it in project root directory, it can not produce ___.table.

There is a following workaround, namely manually changing directory to aux_dir before calling gnuplot

\pgfkeys{/pgf/plot/gnuplot call={cd `aux_dir` && gnuplot}}

However, this is rather impractical.

Is there a possibility to implement something like remembering full path of ___.gnuplot file (or relative path to root of project), and automatically changing directory before invoking gnuplot? This would have the advantage of automatically working with packages like robust-externalize, which can put (some) files in different directories.

Minimal working example (MWE)

# .latexmkrc
$aux_dir = '.aux';
$pdflatex = 'pdflatex --shell-escape';
% example.tex
\documentclass[a4paper,12pt]{article}

\usepackage{tikz}

%% Without following line, invocation of gnuplot will not find ___.gnuplot file
% \pgfkeys{/pgf/plot/gnuplot call={cd .aux && gnuplot}}

\begin{document}

\section{Minimal Working Example}

\begin{tikzpicture}[domain=0:4]
    \draw[domain=-3.141:3.141,smooth] plot[parametric,id=parametric-example] function{t*cos(t),t*sin(t)};
\end{tikzpicture}

\end{document}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions