The general problem seems to be that latexmk does not seem to work together with graphicx' \graphicspath
directive.
I have the following directory structure:
├── working.tex
├── non-working.tex
├── latexmk
└── figures
└── graph.dot
Running latexmk -r latexmk -norc working.tex
compiles just fine, creates a figures/graph.pdf
and an output pdf.
But running latexmk -r latexmk -norc non-working.tex
yields the following error:
! LaTeX Error: File `graph' not found.
And it also does not say
Latexmk: applying rule 'cusdep dot pdf figures/graph'...
Rule 'cusdep dot pdf figures/graph': File changes, etc:
Non-existent destination files:
'figures/graph.pdf'
as the working run does.
For completeness:
$ latexmk --version
Latexmk, John Collins, 10 Nov 2013. Version 4.39
Thanks for the help.
latexmk:
# Use "bin" as output directory
$out_dir = "bin";
# Build pdf with pdflatex
$pdf_mode = 1;
# Additional options for pdflatex
$pdflatex = "pdflatex -shell-escape %O %S";
# Use pdflatex recorder functionality
$recorder = 1;
# Custom dependency to convert dot files to pdfs
add_cus_dep('dot', 'pdf', 0, 'dot2pdf');
sub dot2pdf {
system("dot -Tpdf \"$_[0].dot\" > \"$_[0].pdf\"");
}
working.tex:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{figures/graph}
\end{document}
non-working.tex:
\documentclass{article}
\usepackage{graphicx}
\graphicspath{{figures/}}
\begin{document}
\includegraphics{graph}
\end{document}
figures/graph.dot:
digraph A {
Test
}