I'm using WinEdt 5.5 with miktex. I have a problem getting dot2texi.sty to work for me. This style calls the external dot2tex script to convert .dot files to .tex using a system() command, but the problem is that it is unable to find the .dot files. When I call texify.exe from the command line, as
there are no problems and everything works fine. dot2texi then reports this:texify.exe --pdf --tex-option=--shell-escape "D:/MyFiles/UvA/Scriptie/report/test.tex"
But when I call it from winedt, the dot2texi script reports:Opening dot2tex stream test-dot2tex-fig1.dot
system(dot2tex --figonly -ftikz -o test-dot2tex-fig1.tex test-dot2tex-
fig1.dot)...executed.
Package dot2texo Info: test-dot2tex-fig1.dot converted on input line 21.
(test-dot2tex-fig1.tex)
I think this happens because the paths passed to the style file when executing pdftexify from winedt are relative paths, but when it calls the external program, this program is started in the directory where the script is located, and not the path where the .dot files are located at. So what I really need is to be able to start the system() command in texify.exe's current working directory.system(dot2tex --figonly -ftikz -o C:/temp/test-dot2tex-fig1.tex test-
dot2tex-fig1.dot)...executed.
Package dot2texi Warning: Conversion of test-dot2tex-fig1.dot failed..
Package dot2texi Warning: Please convert test-dot2tex-fig1.dot manually.
I'm not at all familiar with .sty type files, but I did some snooping and minor hacking of the code anyway. The relevant lines of code are:
Code: Select all
% Option for setting an output directory
\DeclareOptionX{outputdir}[]{\def\dtt@outputdir{#1}}
\def\dtt@outputdir{}
\DeclareOptionX{debug}{\dtt@debugtrue}
(...)
\ifdtt@ShellEscape
\IfFileExists{\dtt@outputdir\dtt@figname.dot}{%
\immediate\write18{dot2tex \dtt@output\space
\dtt@format\space
\dtt@tikzedgelabels\space
\dtt@straightedges\space
\dtt@styleonly\space
\dtt@autosizeopt\space
\dtt@debugstr\space
\dtt@procprog\space
\dtt@mathmode\space
\dtt@graphstyle\space
-o \dtt@outputdir\dtt@figname.tex \dtt@options\space \dtt@outputdir\dtt@figname.dot}
\IfFileExists{\dtt@outputdir\dtt@figname.tex}{%
\PackageInfo{dot2texo}{\dtt@outputdir\dtt@figname.dot converted}
}
{\PackageWarningNoLine{dot2texi}
{Conversion of \dtt@outputdir\dtt@figname.dot failed.}}}
{
\PackageInfo{dot2texo}{File \dtt@outputdir\dtt@figname.dot not found}
}
\fi
and switches "%P\%N%T".--pdf --tex-option=--shell-escape
I'd greatly appreciate any help you might give me. For completeness, this is the original .tex file:
Code: Select all
\documentclass{article}
\usepackage[]{dot2texi}
\usepackage{tikz}
%%%<
%\usepackage[active,tightpage]{preview}
%\setlength\PreviewBorder{0pt}%
%\PreviewEnvironment{tikzpicture}
%%%>
\usetikzlibrary{shapes,arrows}
\begin{document}
\begin{dot2tex}%[pgf]
digraph D
{
rankdir=LR;
ranksep=0.2;
node [shape=circle];
G -> r -> a -> p -> h -> v -> i -> z;
}
\end{dot2tex}
\end{document}