Skip to content

Commit

Permalink
Ugly workaround for latex -outdir
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ysalmon authored Aug 26, 2017
1 parent d2e6990 commit aecee9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dot2texi.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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}
}
Expand Down

0 comments on commit aecee9a

Please sign in to comment.