Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jdujava opened this issue May 21, 2024 · 1 comment
Open

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

jdujava opened this issue May 21, 2024 · 1 comment

Comments

@jdujava
Copy link

jdujava commented May 21, 2024

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}
@muzimuzhi
Copy link
Member

@user202729's answer to TeX-SX question "Access value of -output-directory" may help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants