From aecee9ae85086ef18c3174541bc9ab74aa5f0f21 Mon Sep 17 00:00:00 2001 From: Yann Salmon Date: Sat, 26 Aug 2017 14:35:44 +0200 Subject: [PATCH] Ugly workaround for latex -outdir As mentioned by https://github.com/kjellmf/dot2tex/issues/52, dot2tex fails when the tex document is compiled with a -outdir CLI switch because it is not informed that the .dot file was output in a different place, as dot2texi \writes will implicitly go there. This ugly hack allows to load dot2texi with a [inputdir=./build/] option that should be set to match the latex -outdir. --- dot2texi.sty | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dot2texi.sty b/dot2texi.sty index 9111b94..4014e01 100644 --- a/dot2texi.sty +++ b/dot2texi.sty @@ -102,6 +102,8 @@ % Option for setting an output directory \DeclareOptionX{outputdir}[]{\def\dtt@outputdir{#1}} \def\dtt@outputdir{} +\DeclareOptionX{inputdir}[]{\def\dtt@inputdir{#1}} +\def\dtt@inputdir{} \DeclareOptionX{debug}{\dtt@debugtrue} \newcommand\setoutputdir[1]{\def\dtt@outputdir{#1}} @@ -292,7 +294,7 @@ \dtt@mathmode\space \dtt@graphstyle\space \dtt@cacheopt\space - -o \dtt@figname.tex \dtt@options\space \dtt@figname.dot} + -o \dtt@inputdir\dtt@figname.tex \dtt@options\space \dtt@inputdir\dtt@figname.dot} \IfFileExists{\dtt@figname.tex}{% \PackageInfo{dot2texo}{\dtt@figname.dot converted} }