I need to compile a standalone (TikZ) file located in a subdirectory, like the example in this thread :
Using the given files, I can compile both
mwefig.tex from main directory with the following lines, respectively :
pdflatex -shell-escape mwe.tex % whole document pdflatex -shell-escape -output-dir sub sub/mwefig.tex % figure only
However, if I add
convert to mwefig.tex :
compiling the main document mwe.tex still compiles mwefig.tex and generate a PNG file, but
compiling the figure only (with the same command) fails.
In fact, the failure comes from the internal compilation of mwefig.tex, that pdflatex searches in main directory (
LaTeX Error: File `mwefig.tex' not found). If I manually type
tex/mwefig.tex at the prompt, the
.png are generated in the main directory.
As this internal compilation works whithout
convert, I think this should work with
Of course, if I compile from
sub/, it works. However, my real use case implies the inclusion of files relative to main directory in