0

I'm trying to get a nice dir structure for my project but I'm having lots of trouble with externalization. I've read many questions but the most accurate for my case is this question. The problem is that when using just the ./build output dir works fine but no with sub-directories .build/Pictures for example.

My main compilation scheme is:

xelatex -synctex=1 -interaction=nonstopmode --shell-escape --output-directory=./build %.tex

I'm trying to get a sub-directory dedicated for tikz externalization outputs inside ./build this way.

\tikzset{%
    external/system call={%
        xelatex \tikzexternalcheckshellescape --output-directory ./build/Pictures/ -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"%
    },
    /pgf/images/include external/.code={%
        \includegraphics{build/Pictures/#1}%
    }
}

I noticed that:

  • Using only ./build directory works
  • When adding ./build/Pictures it searches the pdf file on root (I found that it worked when I copied-pasted the PDF on root)

Why does it work when using a single level but no with multiple levels?

MWE

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\tikzset{%
  external/system call={xelatex \tikzexternalcheckshellescape --halt-on-error --interaction=batchmode --output-directory=./build/Pictures --jobname "\image" "\texsource"},
  /pgf/images/include external/.code={%
    \includegraphics{build/Pictures/#1}%
  },
}
\begin{document}

Hello im having trouble

\begin{tikzpicture} \draw (0,0) rectangle (1,1); \end{tikzpicture}

\end{document}

  • I never use --output-directory. If I want to keep the source folder clean, I use l3build to move all files before the compilation to a dedicated build folder. See also https://tex.stackexchange.com/a/673007/2388 – Ulrike Fischer Apr 09 '23 at 10:25

0 Answers0