LaTeX Minted package using custom output-directory=build

You need \usepackage[outputdir=build]{minted} to tell minted where the files went.


You can use currfile-abspath (a sub-package of currfile) to set minted's output directory automatically. Must be done before loading the minted package.

\usepackage{currfile-abspath}
\getabspath{\jobname.log}
\ifthenelse{\equal{\theabsdir}{\thepwd}}% using ifthen package
%\ifdefstrequal{\theabsdir}{\thepwd}% using etoolbox package
    {}{\PassOptionsToPackage{outputdir=\theabsdir}{minted}}

Apparently doesn't work reliably with MiKTeX, see https://github.com/gpoore/minted/issues/268

Tags:

Pdftex

Mac

Minted