summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/dot2texi
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/dot2texi
Initial commit
Diffstat (limited to 'macros/latex/contrib/dot2texi')
-rw-r--r--macros/latex/contrib/dot2texi/README27
-rw-r--r--macros/latex/contrib/dot2texi/dot2texi.pdfbin0 -> 140767 bytes
-rw-r--r--macros/latex/contrib/dot2texi/dot2texi.sty288
-rw-r--r--macros/latex/contrib/dot2texi/dot2texi.tex535
-rw-r--r--macros/latex/contrib/dot2texi/examples/d2tpstexamples.pdfbin0 -> 16124 bytes
-rw-r--r--macros/latex/contrib/dot2texi/examples/d2tpstexamples.tex44
-rw-r--r--macros/latex/contrib/dot2texi/examples/d2ttikzexamples.pdfbin0 -> 36420 bytes
-rw-r--r--macros/latex/contrib/dot2texi/examples/d2ttikzexamples.tex86
-rw-r--r--macros/latex/contrib/dot2texi/examples/docgraphs.pdfbin0 -> 65014 bytes
-rw-r--r--macros/latex/contrib/dot2texi/examples/docgraphs.tex307
-rw-r--r--macros/latex/contrib/dot2texi/examples/docgraphsorig.pdfbin0 -> 68584 bytes
-rw-r--r--macros/latex/contrib/dot2texi/gpl.txt284
12 files changed, 1571 insertions, 0 deletions
diff --git a/macros/latex/contrib/dot2texi/README b/macros/latex/contrib/dot2texi/README
new file mode 100644
index 0000000000..3d98c43c7c
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/README
@@ -0,0 +1,27 @@
+This package allows you to include graphs in the DOT graph description language
+in your LaTeX documents. The dot2tex[1] tool is used to invoke Graphviz[2] for
+graph layout, and to transform the output from Graphviz to LaTeX code.
+The generated code relies on the TikZ and PGF package or the PSTricks package.
+
+Licensed under the GPL.
+Author: Kjell Magne Fauske
+
+Dot2tex can be downloaded from: http://www.fauskes.net/code/dot2tex/download/
+or CTAN: http://www.ctan.org/tex-archive/help/Catalogue/entries/dot2tex.html
+It is also available as binary packages for Debian and OpenSUSE.
+
+New in version 3.0
+------------------
+
+- Added the outputdir option. Allows you to specify where to put
+ generated files.
+- Added the file environment option. Allows you to set the file name of
+ a generated graph.
+- Added the tikzedgelabels environment option.
+- Added the straightedges environment option.
+- Added the graphstyle environment option.
+- Added the mathmode environment option.
+- Added the experimental scale environment option.
+
+[1] http://www.fauskes.net/code/dot2tex/
+[2] http://www.graphviz.org/
diff --git a/macros/latex/contrib/dot2texi/dot2texi.pdf b/macros/latex/contrib/dot2texi/dot2texi.pdf
new file mode 100644
index 0000000000..276afd7f15
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/dot2texi.pdf
Binary files differ
diff --git a/macros/latex/contrib/dot2texi/dot2texi.sty b/macros/latex/contrib/dot2texi/dot2texi.sty
new file mode 100644
index 0000000000..d52796df84
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/dot2texi.sty
@@ -0,0 +1,288 @@
+%% dot2texi.sty
+%% Copyright (c) 2007-2008, Kjell Magne Fauske
+%%
+%% Author: Kjell Magne Fauske <km@fauskes.net>
+%% http://www.fauskes.net
+%%
+%% Defines the dot2tex environment for encapsulating graphs described
+%% using the Grahviz[1] DOT-language. The dot2tex[2] command line tool is
+%% used to convert output from Graphviz' graph layot tools to TikZ and
+%% PGF, or PSTricks code. The package will automate this process if
+%% shell-escape is enabled.
+%%
+%% This code is adapted from the packages dottex[3] and gnuplottex[4],
+%% written by Lars Kotthoff. The platform detection code is from the
+%% ifplatform[5] package.
+%%
+%% [1] http://www.graphviz.org/
+%% [2] http://www.fauskes.net/code/dot2tex/
+%% [3] http://http://www.ctan.org/tex-archive/help/Catalogue/entries/dottex.html
+%% [4] http://www.ctan.org/tex-archive/help/Catalogue/entries/gnuplottex.html
+%% [5] http://www.ctan.org/tex-archive/help/Catalogue/entries/ifplatform.html
+
+%% Copyright (c) 2005, Lars Kotthoff <metalhead@metalhead.ws>
+%%
+%% Large portions copied from pdftex,
+%% Copyright (c) 2001-3, Radhakrishnan CV <cvr@river-valley.com>
+%% Rajagopal CV <cvr3@river-valley.com>
+%% http://www.river-valley.com
+%%
+%% River Valley Technologies, Floor III, SJP Buildings, Cotton Hills
+%% Trivandrum, India 695014
+%%
+%% Tel: +91 471 233 7501
+%%
+%% Antoine Chambert-Loir
+%% <chambert@math.polytechnique.fr>
+%% http://www.math.polytechnique.fr/\protect \unhbox \voidb@x \penalty \@M \ {}chambert
+%%
+%% Ecole polytechnique, Palaiseau Cedex, France
+%%
+%% This program is free software; you can redistribute it and/or
+%% modify it under the terms of the GNU General Public License
+%% as published by the Free Software Foundation; either version 2
+%% of the License, or (at your option) any later version.
+%%
+%% This program is distributed in the hope that it will be useful,
+%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%% GNU General Public License for more details.
+%%
+%% You should have received a copy of the GNU General Public License
+%% along with this program (gpl.txt); if not, write to the Free
+%% Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+%% MA 02111-1307, USA.
+%%
+
+%% Copyright (C) 2007 by Will Robertson & Johannes Große
+
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{dot2texi}[2008/05/07 v3.0p1 Run dot2tex from LaTeX]
+\RequirePackage{moreverb}
+\RequirePackage{xkeyval}[2005/02/22]
+
+%
+% fix for new moreverb according to the author of this file as state in
+% https://groups.google.com/forum/?fromgroups#!topic/dot2tex-users/kbjZGRVT5SY
+% fix included by Norbert Preining, renamed the version to v3.0p1
+\@ifundefined{verbatim@out}{\newwrite\verbatim@out}{}%
+%
+\newif\ifdtt@ShellEscape
+%\newif\ifmiktex \miktexfalse
+\newif\ifdtt@ForceShellEscape \dtt@ForceShellEscapefalse
+\newif\ifdtt@debug \dtt@debugfalse
+\newif\ifdtt@autosize \dtt@autosizefalse
+% Options related to shell escape
+\DeclareOptionX{shell}{\dtt@ShellEscapetrue}
+\DeclareOptionX{noshell}{\dtt@ShellEscapefalse}
+\DeclareOptionX{forceshell}{\dtt@ForceShellEscapetrue\dtt@ShellEscapetrue}
+\DeclareOptionX{miktex}{} % dummy (for backwards compatability)
+
+% Options for setting output format
+\DeclareOptionX{pgf}{\def\dtt@format{-fpgf}}
+\DeclareOptionX{tikz}{\def\dtt@format{-ftikz}}
+\DeclareOptionX{pstricks}{\def\dtt@format{-fpstricks}}
+\def\dtt@format{-ftikz} % default output format
+
+
+\DeclareOptionX{autosize}{\def\dtt@autosizeopt{--autosize}}
+\def\dtt@autosizeopt{}
+
+% Options for setting the graph layout program
+\DeclareOptionX{dot}{\def\dtt@procprog{--prog=dot}}
+\DeclareOptionX{neato}{\def\dtt@procprog{--prog=neato}}
+\DeclareOptionX{circo}{\def\dtt@procprog{--prog=circo}}
+\DeclareOptionX{fdp}{\def\dtt@procprog{--prog=fdp}}
+\DeclareOptionX{twopi}{\def\dtt@procprog{--prog=twopi}}
+\def\dtt@procprog{}
+
+% Option for setting an output directory
+\DeclareOptionX{outputdir}[]{\def\dtt@outputdir{#1}}
+\def\dtt@outputdir{}
+\DeclareOptionX{debug}{\dtt@debugtrue}
+
+\newcommand\setoutputdir[1]{\def\dtt@outputdir{#1}}
+
+\ExecuteOptionsX{shell}
+
+\ProcessOptionsX\relax
+
+
+%% The platform detection code is copied from the ifplatform package
+%% avaialable from: http://tug.ctan.org/tex-archive/macros/latex/contrib/ifplatform/
+%% Copyright (C) 2007 by Will Robertson & Johannes Große
+\newif\ifdtt@ShellEscapeEnabled
+\newif\ifwindows
+\edef\ip@file{\jobname.w18}
+\edef\ip@sig{write18-test-\the\year\the\month\the\day\the\time}
+\edef\ip@win{'\ip@sig'}
+\def\ip@read@file{%
+ \newread\instream
+ \openin\instream=\ip@file
+ \@tempcnta=\endlinechar
+ \endlinechar=-1
+ \read\instream to\@tempa
+ \endlinechar=\@tempcnta
+ \closein\instream}
+\immediate\write18{echo \ip@win >"\ip@file"}
+\IfFileExists{\ip@file}{\dtt@ShellEscapeEnabledtrue}{\dtt@ShellEscapeEnabledfalse}
+\ifdtt@ShellEscapeEnabled
+ \ip@read@file
+ \ifx\@tempa\ip@sig
+ \windowsfalse
+ \else
+ \ifx\@tempa\ip@win
+ \windowstrue
+ \fi
+ \fi
+ \immediate\write18{\ifwindows del \else rm -- \fi "\ip@file"}
+\fi
+
+\ifdtt@ForceShellEscape
+ \PackageInfo{dot2texi}
+ {ForceShellEscape enabled}
+\fi
+
+\ifdtt@ShellEscapeEnabled
+ \PackageInfo{dot2texi}
+ {Automatically converting dot/neato files}
+\else
+ \PackageWarningNoLine{dot2texi}
+ {Shell escape not enabled.\MessageBreak
+ You'll need to convert the graphs yourself.}
+\fi
+\newcounter{dtt@fignum}
+\def\dtt@figname{\dtt@outputdir\jobname-dot2tex-fig\thedtt@fignum}
+
+
+%%%%%%%%%%%%%%%%% dot2tex code
+% Most of the code is from dottex.sty and gnuplottex.sty
+
+% Options
+\def\dtt@debugstr{}
+\ifdtt@debug
+ \PackageInfo{dot2texi}{Dot2tex debugging enabled}
+ \def\dtt@debugstr{--debug}
+\fi
+
+\define@choicekey*{dtt}{prog}[\progval\nr]{dot,neato,circo,fdp,twopi}[dot]{%
+ \def\dtt@procprog{--prog=\progval}}
+\define@choicekey*{dtt}{format}[\outputval\nr]{tikz,pgf,pstricks}[tikz]{%
+ \def\dtt@format{--format=\outputval}}
+\define@key{dtt}{options}[]{%
+ \def\dtt@options{#1}
+}
+\def\dtt@options{}
+
+\define@key{dtt}{outputdir}[]{%
+ \def\dtt@outputdir{#1}
+}
+\define@key{dtt}{file}[]{%
+ \def\dtt@figname{\dtt@outputdir#1}
+}
+
+\define@key{dtt}{shell}[]{\dtt@ShellEscapetrue}
+\define@key{dtt}{noshell}[]{\dtt@ShellEscapefalse}
+% graph layout
+\define@key{dtt}{dot}[]{\def\dtt@procprog{--prog=dot}}
+\define@key{dtt}{neato}[]{\def\dtt@procprog{--prog=neato}}
+\define@key{dtt}{circo}[]{\def\dtt@procprog{--prog=circo}}
+\define@key{dtt}{fdp}[]{\def\dtt@procprog{--prog=fdp}}
+\define@key{dtt}{twopi}[]{\def\dtt@procprog{--prog=twopi}}
+% output formats
+\define@key{dtt}{pgf}[]{\def\dtt@format{--format=pgf}}
+\define@key{dtt}{tikz}[]{\def\dtt@format{--format=tikz}}
+\define@key{dtt}{pstricks}[]{\def\dtt@format{--format=pstricks}}
+% command line shortcuts
+\define@key{dtt}{styleonly}[]{\def\dtt@styleonly{--styleonly}}
+\def\dtt@styleonly{}
+\define@key{dtt}{codeonly}[]{\def\dtt@output{--codeonly}}
+\def\dtt@output{--figonly}
+\define@key{dtt}{autosize}[]{\def\dtt@autosizeopt{--autosize}}
+\define@key{dtt}{noautosize}[]{\def\dtt@autosizeopt{}}
+
+\define@key{dtt}{straightedges}[]{\def\dtt@straightedges{--straightedges}}
+\def\dtt@straightedges{}
+\define@key{dtt}{tikzedgelabels}[]{\def\dtt@tikzedgelabels{--tikzedgelabels}}
+\def\dtt@tikzedgelabels{}
+
+\define@key{dtt}{mathmode}[]{\def\dtt@mathmode{-tmath}}
+\def\dtt@mathmode{}
+
+\define@key{dtt}{graphstyle}[]{\def\dtt@graphstyle{--graphstyle="#1"}}
+\def\dtt@graphstyle{}
+
+\define@key{dtt}{scale}[]{\def\dtt@graphstyle{--graphstyle="scale=#1,transform shape"}}
+
+\newif\ifdtt@writetofile \dtt@writetofiletrue
+
+\def\dottotexverbatimwrite#1{%
+ \def\BeforeStream{
+ \message{Opening dot2tex stream #1}%
+ }%
+ \@bsphack
+ \immediate\openout \verbatim@out #1
+ \BeforeStream%
+ \let\do\@makeother\dospecials
+ \catcode`\^^M\active
+ \def\verbatim@processline{%
+ \immediate\write\verbatim@out
+ {\the\verbatim@line}}%
+ \verbatim@start%
+}
+
+\def\enddottotexverbatimwrite{%
+ \immediate\closeout\verbatim@out
+ \@esphack
+ \catcode`\\0
+ \catcode`\{1
+ \catcode`\}2
+ \catcode`\$3
+ \catcode`\&4
+ \catcode`\^^M5
+ \catcode`\#6
+ \catcode`\^7
+ \catcode`\_8
+ \catcode`\~9% Added this one
+ \catcode`\ 10
+ \catcode`\%14}
+
+\newenvironment{dot2tex}[1][]{\stepcounter{dtt@fignum}%
+ \setkeys{dtt}{#1}
+ \ifdtt@ForceShellEscape
+ \dtt@ShellEscapetrue
+ \fi
+ \xdef\dottotexCutFile{\dtt@figname.dot}
+ \dottotexverbatimwrite{\dottotexCutFile}}
+ {\enddottotexverbatimwrite%
+ \dottotexgraphicsinclude}
+
+\long\gdef\dottotexgraphicsprocess{%
+ \ifdtt@ShellEscape
+ \IfFileExists{\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@figname.tex \dtt@options\space \dtt@figname.dot}
+ \IfFileExists{\dtt@figname.tex}{%
+ \PackageInfo{dot2texo}{\dtt@figname.dot converted}
+ }
+ {\PackageWarningNoLine{dot2texi}
+ {Conversion of \dtt@figname.dot failed.}}}{}
+ \fi
+}
+
+\long\gdef\dottotexgraphicsinclude{\dottotexgraphicsprocess%
+ \IfFileExists{\dtt@figname.tex}{{\input{\dtt@figname}}}
+ {\PackageWarningNoLine{dot2texi}
+ {Please convert \dtt@figname.dot manually}}
+}
+
+\endinput
diff --git a/macros/latex/contrib/dot2texi/dot2texi.tex b/macros/latex/contrib/dot2texi/dot2texi.tex
new file mode 100644
index 0000000000..c4890e68af
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/dot2texi.tex
@@ -0,0 +1,535 @@
+\documentclass[a4paper]{ltxdoc}
+
+\usepackage[outputdir={docgraphs/}]{dot2texi}
+\usepackage{paralist}
+\usepackage{tikz,hyperref}
+\usetikzlibrary{shapes,arrows,automata}
+\usetikzlibrary{decorations.pathmorphing}
+\usetikzlibrary{decorations.footprints}
+\newcommand\packagename{\texttt{dot2texi}}
+
+\title{The \texttt{dot2texi} package}
+\author{Kjell Magne Fauske\\\footnotesize{\url{http://www.fauskes.net/}}}
+\date{Version 3.0}
+\begin{document}
+\maketitle
+
+\section{Introduction}
+
+The \packagename\ package allows you to embed graphs written the DOT description language directly in your document. The dot2tex\footnote{Available from: \url{http://www.fauskes.net/code/dot2tex/}}\footnote{and \url{http://www.ctan.org/tex-archive/help/Catalogue/entries/dot2tex.html}} tool is used to transform the output from Graphviz to \LaTeX\ code using either the TikZ and PGF package, or the PSTricks package. The generated code can then be included directly in you document. This package can automate the process if shell escape is enabled.
+\\
+
+\noindent
+This package is derived from the dottex\footnote{\url{http://www.ctan.org/tex-archive/help/Catalogue/entries/dottex.html}} and gnuplottex\footnote{\url{http://www.ctan.org/tex-archive/help/Catalogue/entries/gnuplottex.html}} packages written by Lars Kotthoff.
+
+\section{Requirements}
+
+To run \packagename\ the following packages are required:
+\begin{itemize}
+ \item \texttt{xkeyval} version 2.3 or later required.
+ \item \texttt{moreverb}
+ \item PGF or PSTricks
+\end{itemize}
+In addition, the following external tools are required:
+\begin{itemize}
+ \item Graphviz
+ \item dot2tex ( Version 2.7.0 or later recommended). The dot2texi package assumes that dot2tex is installed somewhere on the system path.
+\end{itemize}
+
+
+\noindent
+For automatic creating of code, \TeX\ must be configured to allow calling of external programs. This feature is a potential security risk and is therefore usually disabled by default. You can enable this feature by specifying an option to \TeX\ when compiling the document. For \texttt{pdflatex} the option is \verb|--shell-escape|. On some systems the option is called \verb|--enable-write18|.
+
+\section{Support}
+
+If you have any questions or comments, send an email to \url{kjellmf@gmail.com} or use the mailing list available at \url{http://groups.google.com/group/dot2tex-users/}.
+
+\section{Usage}
+
+The package is loaded by writing \cmd{\usepackage\{dot2texi\}} in the document preamble.
+
+\section{Package options}
+
+The following package options are recognized:
+
+\begin{description}
+\item[\oarg{shell}] Use shell escape to automatically generate \TeX code using do2tex. This is the default behavior.
+\item[\oarg{noshell}] Disable shell escape. Note that you can locally enable and disable shell escape for each \texttt{dot2tex} environment.
+\item[\oarg{forceshell}] Force shell escape. Will run \texttt{dot2tex} on graphs even if they locally use the \oarg{noshell} option.
+\item[\oarg{miktex}] MikTeX compatibility mode.
+\item[\oarg{debug}] Invoke \texttt{dot2tex} in debug mode.
+\item[\oarg{autosize}] Invoke \texttt{dot2tex} with the \texttt{--autosize} option. Will preprocess the graph using the preview package and adjust node and edge label sizes so that they fit the LaTeX output.
+\item[\oarg{outputdir=dir}] Set a directory where the generated graph code will be stored. The default is to put the files in the current directory. The \emph{outputdir} value should have a trailing slash to ensure that it is interpreted as a directory. Example:
+\begin{verbatim}
+\usepackage[outputdir={docgraphs/}]
+...
+\end{verbatim}
+\end{description}
+
+\subsection{Output format}
+
+\begin{description}
+\item[\oarg{tikz}] Use the tikz output format. This is the default output format.
+\item[\oarg{pgf}] Use the pgf output format.
+\item[\oarg{pstricks}] Use the pstricks output format.
+\end{description}
+
+\subsection{Graph layout}
+Set the default graph layout tool
+\begin{description}
+\item[\oarg{dot}] Hierarchical layout
+\item[\oarg{neato}] Spring model layot
+\item[\oarg{circo}] Circular layout
+\item[\oarg{fdp}] Spring model layout
+\item[\oarg{twopi}] Radial layout
+\end{description}
+
+\section{Macros}
+
+\DescribeMacro{\setoutputdir}
+Set a directory where the generated graph code will be stored. Does the same as the \oarg{outputdir} package option. Useful if you want to organize your graphs in different directories. Example:
+\begin{verbatim}
+\documentclass{report}
+\usepackage{dot2texi}
+\begin{document}
+...
+\chapter{Chapter A}
+\setoutputdir{chapA/}
+....
+\chapter{Chapter B}
+\setoutputdir{chapB/}
+...
+\end{document}
+\end{verbatim}
+
+
+
+\section{The \texttt{dot2tex} environment}
+\DescribeEnv{dot2tex}
+The \packagename\ package defines the \texttt{dot2tex} environment. The contents of the environment will be written to file during compilation. If shell escape is enabled the \texttt{dot2tex} tool and Graphviz will then be run on the saved file. This process generates \LaTeX\ code that will be included automatically during compilation.
+
+\subsection{Environment options}
+
+Most of the package options can also be used in the dot2tex environment. They will then locally override the package options.
+
+\begin{description}
+\item[\oarg{shell}] Enable shell escape for the current graph.
+\item[\oarg{noshell}] Disable shell escape for the current graph.
+\end{description}
+Output formats:
+\begin{description}
+\item[\oarg{tikz}] Use the tikz output format.
+\item[\oarg{pgf}] Use the pgf output format.
+\item[\oarg{pstricks}] Use the pstricks output format.
+\item[\oarg{format=outputformat}] Set output format. Allowed values are {\verb#tikz|pgf|pstricks#}.
+\end{description}
+Graph layout:
+\begin{description}
+\item[\oarg{dot}] Hierarchical layout
+\item[\oarg{neato}] Spring model layot
+\item[\oarg{circo}] Circular layout
+\item[\oarg{fdp}] Spring model layout
+\item[\oarg{twopi}] Radial layout
+\item[\oarg{prog=layouttool}] Set program to use for graph layout. Allowed values are {\verb#dot|neato|circo|fdp|twopi#}.
+\end{description}
+Files:
+\begin{description}
+\item[\oarg{outputdir=dir}] Locally override the \oarg{outputdir} package option value.
+\item[\oarg{file=filename}] Set the base name of the generated \texttt{dot} and \texttt{tex} file. The name is generated automatically, but this option lets you override the default file name. Example:
+\begin{verbatim}
+\begin{dot2tex}[file=mygraph]
+...
+\end{dot2tex}
+\end{verbatim}
+Compiling the above code will generate the files \texttt{mygraph.dot} and \texttt{mygraph.tex}. Note that the \texttt{dot} and \texttt{tex} extensions are added automatically. Here is another example:
+\begin{verbatim}
+\begin{dot2tex}[file=graphs/minimal]
+...
+\end{dot2tex}
+\end{verbatim}
+The above code will generate the files \texttt{minimal.dot} and \texttt{minimal.tex} in the \texttt{graphs} directory.
+
+\emph{Note:} If the file name contains spaces or other special characters use:
+\begin{verbatim}
+\begin{dot2tex}[file="name with spaces"]
+...
+\end{verbatim}
+
+\emph{Note:} If the \oarg{outputdir} option is set, its value will be prepended.
+\end{description}
+Options:
+\begin{description}
+\item[\oarg{options=opts}] Pass additional command line options to \texttt{dot2tex}. See the dot2tex documentation\footnote{\url{http://www.fauskes.net/code/dot2tex/documentation/}} for available options.
+
+\emph{Note}. If opts contains an equal sign,=, you have to put opts inside curly brackets. Example:
+\begin{verbatim}
+\begin{dot2tex}[options=--graphstyle "scale=0.25"]
+graph G {
+...
+}
+\end{dot2tex}
+\end{verbatim}
+The above code will not work because opts i parsed incorrectly. Instead you have to write:
+\begin{verbatim}
+\begin{dot2tex}[options={--graphstyle "scale=0.25"}]
+graph G {
+...
+}
+\end{dot2tex}
+\end{verbatim}
+\item[\oarg{autosize}] Run \texttt{dot2tex} with the \texttt{--autosize} option.
+\item[\oarg{noautosize}] Locally override the package \oarg{autosize} option.
+\item[\oarg{codeonly}] Run \texttt{dot2tex} with the \texttt{--codeonly} option. The generated code will then not be wrapped inside a \texttt{tikzpicture} or \texttt{pspicture} environment. Note that this option requires \texttt{dot2tex} version 2.7.0 or later.
+\item[\oarg{graphstyle=style}] Set the \texttt{<<graphstyle>>} template variable. For the default templates the style value will be inserted as:
+\begin{verbatim}
+...
+\begin{tikzpicture}[<<graphstyle>>]
+...
+\end{tikzpicture}
+..
+\end{verbatim}
+Use this option to set styles that affect all of the graph. Example:
+\begin{verbatim}
+...
+\begin{dot2tex}[graphstyle={scale=0.5,transform shape}]
+...
+\end{dot2tex}
+...
+\end{verbatim}
+The above style value will scale down the graph to half its size.
+
+\emph{Note:} Use curly braces around the style value to avoid confusing the xkeyval parser.
+
+\item[\oarg{mathmode}] Run \texttt{dot2tex} with tex mode set to math. This means that labels are interpreted as math.
+
+\item[\oarg{scale=factor}] Scale the graph by a factor.
+
+\emph{Note:} This is an experimental feature. Currently writing \texttt{scale=0.5} is equivalent to \texttt{graphstyle=\{scale=0.5,transform shape\}}. Will not work for the pstricks output format or if the \texttt{codeonly} option is used.
+
+\item[\oarg{straightedges}] Run \texttt{dot2tex} with the \texttt{--straightedges} option.
+\item[\oarg{styleonly}] Run \texttt{dot2tex} with the \texttt{--styleonly} option. Only works with the \texttt{tikz} output format. Uses only styles when drawing nodes. No draw or shape option is added.
+
+\item[\oarg{tikzedgelabels}] Run \texttt{dot2tex} with the \texttt{--tikzedgelabels} option.
+
+\end{description}
+
+\noindent
+\emph{Warning:} All of the options are passed to dot2tex as command line options. If an option is given multiple times, the last one will win. One side effect of this is that you can't use both the \texttt{scale} and \texttt{graphstyle} at the same time. Example:
+\begin{verbatim}
+...
+\begin{dot2tex}[scale=0.5,graphstyle={shorten >=5pt}]
+...
+\end{dot2tex}
+...
+\end{verbatim}
+In the above code the \texttt{graphstyle} option will win. If you interchange the options, the \texttt{graphstyle} option will have no effect.
+
+\section{Examples}
+\begin{center}
+\begin{dot2tex}[prog=neato,mathmode]
+digraph G {
+ node [shape="circle"];
+ a_1 -> a_2 -> a_3 -> a_4 -> a_1;
+}
+\end{dot2tex}
+\end{center}
+\noindent
+The minimal code required to generate the above graph is:
+
+\begin{verbatim}
+\documentclass{article}
+\usepackage{dot2texi}
+
+\usepackage{tikz}
+\usetikzlibrary{shapes,arrows}
+
+\begin{document}
+\begin{dot2tex}[neato,mathmode]
+ digraph G {
+ node [shape="circle"];
+ a_1 -> a_2 -> a_3 -> a_4 -> a_1;
+ }
+\end{dot2tex}
+
+\end{document}
+\end{verbatim}
+
+\noindent
+Now an example that uses several TikZ features:
+
+\begin{center}
+\tikzstyle{ball} = [shape=circle, minimum size=.5cm]
+\begin{dot2tex}[straightedges,fdp,styleonly]
+graph G {
+ node [style="ball, ball color =green", label=""];
+ edge [style="decorate,decoration=zigzag, green,thick"];
+ a_1 -- c -- a_2;
+ c [style="ball, ball color=black"];
+ edge [style="decorate,decoration=snake, blue"];
+ node [style="ball, ball color = red", label=""];
+ a_3 -- c -- a_4 --a_3;
+}
+\end{dot2tex}
+\end{center}
+
+
+\begin{verbatim}
+\documentclass{article}
+\usepackage{dot2texi}
+
+\usepackage{tikz}
+\usetikzlibrary{shapes,arrows}
+\usetikzlibrary{decorations.pathmorphing}
+
+\begin{document}
+\tikzstyle{ball} = [shape=circle, minimum size=.5cm]
+\begin{dot2tex}[straightedges,fdp,styleonly]
+graph G {
+ node [style="ball, ball color =green", label=""];
+ edge [style="decorate,decoration=zigzag, green,thick"];
+ a_1 -- c -- a_2;
+ c [style="ball, ball color=black"];
+ edge [style="decorate,decoration=snake, blue"];
+ node [style="ball, ball color = red", label=""];
+ a_3 -- c -- a_4 --a_3;
+}
+\end{dot2tex}
+\end{document}
+\end{verbatim}
+
+\noindent
+The next example shows that the \oarg{codeonly} environment option is useful when you want to adjust and annotate the generated graph. Note that you manually have to wrap the code inside a figure environment, but this gives you a lot of flexibility. When using the \texttt{tikz} output format, you can later access the nodes.
+
+% Define layers
+\pgfdeclarelayer{background}
+\pgfdeclarelayer{foreground}
+\pgfsetlayers{background,main,foreground}
+% The scale option is useful for adjusting spacing between nodes.
+% Note that this works best when straight lines are used to connect
+% the nodes.
+\begin{tikzpicture}[>=latex',scale=0.8]
+ % set node style
+ \tikzstyle{n} = [draw,shape=circle,minimum size=2em,
+ inner sep=0pt,fill=red!20]
+ \begin{dot2tex}[dot,codeonly,styleonly,options=-s -tmath]
+ digraph G {
+ node [style="n"];
+ A_1 -> B_1; A_1 -> B_2; A_1 -> B_3;
+ B_1 -> C_1; B_1 -> C_2;
+ B_2 -> C_2; B_2 -> C_3;
+ B_3 -> C_3; B_3 -> C_4;
+ }
+ \end{dot2tex}
+ % annotations
+ \node[left=1em] at (C_1.west) (l3) {Level 3};
+ \node at (l3 |- B_1) (l2){Level 2};
+ \node at (l3 |- A_1) (l1) {Level 1};
+ % Draw lines to separate the levels. First we need to calculate
+ % where the middle is.
+ \path (l3) -- coordinate (l32) (l2) -- coordinate (l21) (l1);
+ \draw[dashed] (C_1 |- l32) -- (l32 -| C_4);
+ \draw[dashed] (C_1 |- l21) -- (l21 -| C_4);
+ \draw[<->,red] (A_1) to[out=-120,in=90] (C_2);
+ % Highlight the A_1 -> B_1 -> C_2 path. Use layers to draw
+ % behind everything.
+ \begin{pgfonlayer}{background}
+ \draw[rounded corners=2em,line width=3em,blue!20,cap=round]
+ (A_1.center) -- (B_1.west) -- (C_2.center);
+ \end{pgfonlayer}
+\end{tikzpicture}
+
+\begin{verbatim}
+\documentclass{article}
+\usepackage{tikz}
+\usetikzlibrary{arrows,shapes}
+\usepackage{dot2texi}
+\begin{document}
+% Define layers
+\pgfdeclarelayer{background}
+\pgfdeclarelayer{foreground}
+\pgfsetlayers{background,main,foreground}
+
+% The scale option is useful for adjusting spacing between nodes.
+% Note that this works best when straight lines are used to connect
+% the nodes.
+\begin{tikzpicture}[>=latex',scale=0.8]
+ % set node style
+ \tikzstyle{n} = [draw,shape=circle,minimum size=2em,
+ inner sep=0pt,fill=red!20]
+ \begin{dot2tex}[dot,tikz,codeonly,styleonly,options=-s -tmath]
+ digraph G {
+ node [style="n"];
+ A_1 -> B_1; A_1 -> B_2; A_1 -> B_3;
+ B_1 -> C_1; B_1 -> C_2;
+ B_2 -> C_2; B_2 -> C_3;
+ B_3 -> C_3; B_3 -> C_4;
+ }
+ \end{dot2tex}
+ % annotations
+ \node[left=1em] at (C_1.west) (l3) {Level 3};
+ \node at (l3 |- B_1) (l2){Level 2};
+ \node at (l3 |- A_1) (l1) {Level 1};
+ % Draw lines to separate the levels. First we need to calculate
+ % where the middle is.
+ \path (l3) -- coordinate (l32) (l2) -- coordinate (l21) (l1);
+ \draw[dashed] (C_1 |- l32) -- (l32 -| C_4);
+ \draw[dashed] (C_1 |- l21) -- (l21 -| C_4);
+ \draw[<->,red] (A_1) to[out=-120,in=90] (C_2);
+ % Highlight the A_1 -> B_1 -> C_2 path. Use layers to draw
+ % behind everything.
+ \begin{pgfonlayer}{background}
+ \draw[rounded corners=2em,line width=3em,blue!20,cap=round]
+ (A_1.center) -- (B_1.west) -- (C_2.center);
+ \end{pgfonlayer}
+\end{tikzpicture}
+\end{document}
+\end{verbatim}
+
+\noindent
+The next example uses the \texttt{automata} library to create a nice looking state machine:
+\begin{center}
+\begin{tikzpicture}[
+ every state/.style={draw=blue!50,very thick,fill=blue!20}]
+\begin{dot2tex}[styleonly,codeonly,neato,tikzedgelabels]
+digraph G {
+ node [style="state"];
+ edge [lblstyle="auto",topath="bend left"];
+ A [style="state, initial"];
+ A -> B [label=2];
+ A -> D [label=7];
+ B -> A [label=1];
+ B -> B [label=3,topath="loop above"];
+ B -> C [label=4];
+ C -> F [label=5];
+ F -> B [label=8];
+ F -> D [label=7];
+ D -> E [label=2];
+ E -> A [label="1,6"];
+ F [style="state,accepting"];
+}
+\end{dot2tex}
+\end{tikzpicture}
+\end{center}
+
+\begin{verbatim}
+\documentclass{article}
+\usepackage{dot2texi}
+\usepackage{tikz}
+\usetikzlibrary{automata,shapes}
+\begin{document}
+\begin{tikzpicture}[
+ every state/.style={draw=blue!50,very thick,fill=blue!20}]
+\begin{dot2tex}[styleonly,codeonly,neato]
+digraph G {
+ d2ttikzedgelabels = true;
+ node [style="state"];
+ edge [lblstyle="auto",topath="bend left"];
+ A [style="state, initial"];
+ A -> B [label=2];
+ A -> D [label=7];
+ B -> A [label=1];
+ B -> B [label=3,topath="loop above"];
+ B -> C [label=4];
+ C -> F [label=5];
+ F -> B [label=8];
+ F -> D [label=7];
+ D -> E [label=2];
+ E -> A [label="1,6"];
+ F [style="state,accepting"];
+}
+\end{dot2tex}
+\end{tikzpicture}
+\end{document}
+\end{verbatim}
+
+\noindent
+Another example of using the special \texttt{topath} attribute. Note the use of the \texttt{graphstyle} option to shorten the edges.
+
+\begin{center}
+\begin{dot2tex}[circo,graphstyle={shorten >=1pt,shorten <=1pt}]
+digraph G {
+ mindist = 0.5;
+ node [shape="circle"];
+ a -> b [topath="bend right"];
+ c -> b [topath="bend left"];
+ c -> a [topath="out=10,in=-90"];
+ b -> b [topath="loop above"];
+}
+\end{dot2tex}
+\end{center}
+\begin{verbatim}
+\documentclass{article}
+\usepackage{dot2texi}
+
+\usepackage{tikz}
+\usetikzlibrary{shapes,arrows}
+
+\begin{document}
+\begin{dot2tex}[circo,graphstyle={shorten >=1pt,shorten <=1pt}]
+digraph G {
+ mindist = 0.5;
+ node [shape="circle"];
+ a -> b [topath="bend right"];
+ c -> b [topath="bend left"];
+ c -> a [topath="out=10,in=-90"];
+ b -> b [topath="loop above"];
+}
+\end{dot2tex}
+
+\end{document}
+\end{verbatim}
+\section{Tips and tricks}
+
+\begin{itemize}
+\item Generating the graphs can be quite time consuming. The \texttt{shell} and \texttt{noshell} environment options are very useful when working with documents with many graphs.
+\item Use the \texttt{outputdir} package option to organize your files.
+\end{itemize}
+
+\subsection{External files}
+
+Sometimes it is practical to keep a dot graph in a separate file, for instance when the graph is automatically generated. Dot2tex version 2.8 or later supports an inclusion mechanism similar to \LaTeX's. If a graph contains only the line \verb|\input{filename.dot}| it will load \texttt{filename.dot} and convert it. Here is an example:
+
+\begin{verbatim}
+...
+\begin{dot2tex}
+\input{externalgraph.dot}
+\end{dot2tex}
+..
+\end{verbatim}
+
+
+\section{Changelog}
+
+\begin{itemize}
+\item Version 3.0 (2008-05-07)
+\begin{itemize}
+ \item Updated documentation examples to use PGF 2.00.
+ \item Added the experimental \texttt{scale} environment option.
+ \item Added the \texttt{graphstyle} environment option.
+ \item Added the \texttt{mathmode} environment option.
+ \item Added the \texttt{tikzedgelabels} environment option.
+ \item Added the \texttt{straightedges} environment option.
+ \item Added the \texttt{outputdir} option and \texttt{$\backslash$setoutputdir} macro.
+ \item Added the \texttt{file} environment option.
+\end{itemize}
+
+\item Version 2.0 (2007-12-09)
+ \begin{itemize}
+ \item Updated documentation.
+ \item It is now not necessary for Windows users to specify the \texttt{miktex} option. Platform is now detected automatically.
+ \item Added the \texttt{forceshell} package option.
+ \item Added the \texttt{codeonly} environment option.
+ \item Added the \texttt{styleonly} environment option.
+ \item Added the \texttt{autosize} and \texttt{noautosize} option.
+ \end{itemize}
+\item Version 1.0. Initial release
+\end{itemize}
+
+\section*{Acknowledgements}
+
+Thanks to Lars Kotthoff for writing the excellent dottex and gnuplottex packages. The platform detection code is based on the ifplatform\footnote{\url{http://www.ctan.org/tex-archive/help/Catalogue/entries/ifplatform.html}} package written by Will Robertson and Johannes Gro{\ss}e.
+
+Thanks to all users for valuable feedback and suggestions! A special thanks to Rolf Niepraschk for pointing me to the dottex and ifplatform packages.
+
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/dot2texi/examples/d2tpstexamples.pdf b/macros/latex/contrib/dot2texi/examples/d2tpstexamples.pdf
new file mode 100644
index 0000000000..4df1b0b515
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/examples/d2tpstexamples.pdf
Binary files differ
diff --git a/macros/latex/contrib/dot2texi/examples/d2tpstexamples.tex b/macros/latex/contrib/dot2texi/examples/d2tpstexamples.tex
new file mode 100644
index 0000000000..b2c7877bad
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/examples/d2tpstexamples.tex
@@ -0,0 +1,44 @@
+\documentclass[a4paper]{article}
+\usepackage{pstricks}
+\usepackage{pstricks-add}
+
+\usepackage[pstricks]{dot2texi}
+
+\begin{document}
+
+\begin{dot2tex}[mathmode,autosize]
+digraph G{
+ d2toptions="--nominsize";
+ a -> b;
+ a -> c;
+ b -> d;
+ d -> a;
+}
+\end{dot2tex}
+
+\begin{dot2tex}[dot]
+graph G {
+ node [shape=circle];
+ 1 -- 2;
+ 1 -- 5;
+ 2 -- 5;
+ 2 -- 4;
+ 2 -- 3;
+ 3 -- 4;
+}
+\end{dot2tex}
+
+\begin{dot2tex}[circo]
+digraph G {
+ graph [mindist=0.5];
+ node [texmode="math", fixedsize=true, shape=circle, width=0.4];
+ c -> n_1 [style="arrows=->"];
+ c -> n_2 [style="arrows=->>"];
+ c -> n_3 [style="arrows=-<"];
+ c -> n_4 [style="arrows=-*"];
+ c -> n_5 [style="arrows=-{]}"];
+ c -> n_6 [style="arrows=-o"];
+ c -> n_7 [style="arrows=-H"];
+}
+\end{dot2tex}
+\end{document}
diff --git a/macros/latex/contrib/dot2texi/examples/d2ttikzexamples.pdf b/macros/latex/contrib/dot2texi/examples/d2ttikzexamples.pdf
new file mode 100644
index 0000000000..dac129be61
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/examples/d2ttikzexamples.pdf
Binary files differ
diff --git a/macros/latex/contrib/dot2texi/examples/d2ttikzexamples.tex b/macros/latex/contrib/dot2texi/examples/d2ttikzexamples.tex
new file mode 100644
index 0000000000..d9875314ab
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/examples/d2ttikzexamples.tex
@@ -0,0 +1,86 @@
+\documentclass[a4paper]{article}
+\usepackage{tikz}
+\usetikzlibrary{shapes,automata,snakes,backgrounds}
+\usepackage{dot2texi}
+
+\begin{document}
+
+\begin{figure}
+\centering
+\begin{dot2tex}[circo]
+digraph G {
+ mindist = 0.5;
+ node [shape="circle"];
+ a -> b [topath="bend right"];
+ c -> b [topath="bend left"];
+ c -> a [topath="out=10,in=-90"];
+ b -> b [topath="loop above"];
+}
+\end{dot2tex}
+\caption{Simple graph with custom paths}
+\end{figure}
+
+\begin{dot2tex}[neato,tikzedgelabels]
+graph G {
+ node [shape=circle,style="fill=red!20"];
+ edge [lblstyle="fill=black!10,inner sep=1pt,sloped"];
+ K -- F [label="120"];
+ H -- S [label="650"];
+ H -- M [label="780"];
+ D -- B [label="490"];
+ D -- M [label="600"];
+ B -- M [label="580"];
+ H -- N [label="600"];
+ F -- H [label="490"];
+ S -- B [label="630"];
+ S -- N [label="210"];
+ S -- M [label="230"];
+ F --M [label="100"];
+ M -- K [label="test"];
+}
+\end{dot2tex}
+
+\begin{dot2tex}[neato,tikz]
+digraph G {
+ d2tfigpreamble = "\tikzstyle{every state}= \
+ [draw=blue!50,very thick,fill=blue!20]";
+ node [style="state"];
+ edge [lblstyle="auto",topath="bend left"];
+ A [style="state, initial"];
+ A -> B [label=2];
+ A -> D [label=7];
+ B -> A [label=1];
+ B -> B [label=3,topath="loop above"];
+ B -> C [label=4];
+ C -> F [label=5];
+ F -> B [label=8];
+ F -> D [label=7];
+ D -> E [label=2];
+ E -> A [label="1,6"];
+ F [style="state,accepting"];
+}
+\end{dot2tex}
+
+\begin{dot2tex}[straightedges,fdp]
+graph G {
+ node [shape=circle, fixedsize=True, width="0.2",
+ style="ball color =green", label=""];
+ edge [style="snake=zigzag, green"];
+ a_1 -- c -- a_2;
+ c [style="ball color=black"];
+ edge [style="snake=snake, blue"];
+ node [style="ball color = red", label=""];
+ a_3 -- c -- a_4 --a_3;
+}
+\end{dot2tex}
+
+\begin{dot2tex}[mathmode,autosize]
+digraph G {
+ node [shape=circle];
+ a_1 [texlbl="$x^2+\frac{\sin y}{y^2+\cos \beta}+\gamma_3$"];
+ a_1 -> a_2 [label=" ", texlbl="$x_1+x_3^2+z+c+v~~$"];
+ a_2 -> a_1;
+}
+\end{dot2tex}
+
+\end{document}
diff --git a/macros/latex/contrib/dot2texi/examples/docgraphs.pdf b/macros/latex/contrib/dot2texi/examples/docgraphs.pdf
new file mode 100644
index 0000000000..b8006f894d
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/examples/docgraphs.pdf
Binary files differ
diff --git a/macros/latex/contrib/dot2texi/examples/docgraphs.tex b/macros/latex/contrib/dot2texi/examples/docgraphs.tex
new file mode 100644
index 0000000000..4411549071
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/examples/docgraphs.tex
@@ -0,0 +1,307 @@
+% Examples from the dot2tex documentation
+\documentclass[a4paper]{article}
+\usepackage{tikz}
+\usetikzlibrary{shapes,automata,snakes,backgrounds,arrows}
+
+\usepackage[pgf,outputdir={docgraphs/}]{dot2texi}
+
+\usepackage[active,tightpage]{preview}
+
+\begin{document}
+
+
+\begin{preview}%
+\begin{tabular}{cc}%
+\begin{dot2tex}[mathmode,pgf]
+digraph G {
+ a_1-> a_2 -> a_3 -> a_1;
+}
+\end{dot2tex}
+&\begin{dot2tex}[pgf]
+digraph G {
+ a_1-> a_2 -> a_3 -> a_1;
+}
+\end{dot2tex}
+\end{tabular}%
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[pgf]
+digraph G {
+ a_1 [texlbl="$\frac{\gamma}{x^2}$"];
+ a_1-> a_2 -> a_3 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[pgf]
+digraph G {
+ a_1 [texlbl="$\frac{\gamma}{2x^2+y^3}$"];
+ a_1 -> a_2 -> a_3 -> a_1
+ node [texmode="math"];
+ a_1 -> b_1 -> b_2 -> a_3;
+ b_1 [label="\\frac{\\gamma}{x^2}"];
+ node [texmode="verbatim"]
+ b_4 [label="\\beta"]
+ a_3 -> b_4 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[pgf,autosize]
+digraph G {
+ a_1 [texlbl="$\frac{\gamma}{2x^2+y^3}$"];
+ a_1 -> a_2 -> a_3 -> a_1
+ node [texmode="math"];
+ a_1 -> b_1 -> b_2 -> a_3;
+ b_1 [label="\\frac{\\gamma}{x^2}"];
+ node [texmode="verbatim"]
+ b_4 [label="\\beta"]
+ a_3 -> b_4 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[pgf]
+digraph G {
+ node0 [label="{left|right}", shape=record];
+ node1 [shape=rectangle, label="node 1"];
+ node0 -> node1;
+ rankdir=LR;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[pgf,options=--valignmode dot]
+digraph G {
+ node0 [label="{left|right}", shape=record];
+ node1 [shape=rectangle, label="node 1"];
+ node0 -> node1;
+ rankdir=LR;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[pgf]
+digraph G {
+ d2toptions="--valignmode=dot";
+ d2tgraphstyle="anchor=base";
+ node0 [label="{left|right}", shape=record];
+ node1 [shape=rectangle, label="node 1"];
+ node0 -> node1;
+ rankdir=LR;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[pgf]
+digraph G {
+ d2toptions="--valignmode=dot";
+ d2tgraphstyle="anchor=base";
+ node [fontsize=10];
+ node0 [label="{left|right}", shape=record];
+ node1 [shape=rectangle, label="node 1"];
+ node0 -> node1;
+ rankdir=LR;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[mathmode]
+digraph G {
+ node [shape=circle];
+ a_1 [texlbl="$x^2+\frac{\sin y}{y^2+\cos \beta}+\gamma_3$"];
+ a_1 -> a_2 [label=" ", texlbl="$x_1+x_3^2+z+c+v~~$"];
+ a_2 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[mathmode,autosize]
+digraph G {
+ node [shape=circle];
+ a_1 [texlbl="$x^2+\frac{\sin y}{y^2+\cos \beta}+\gamma_3$"];
+ a_1 -> a_2 [label=" ", texlbl="$x_1+x_3^2+z+c+v~~$"];
+ a_2 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[mathmode,autosize]
+digraph G {
+ node [shape=rectangle];
+ a_1 [margin="0"];
+ a_2 [margin="0.7,0.4"];
+ a_3 [width="2",height="1"];
+ a_1-> a_2 -> a_3 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}
+digraph G {
+ d2toptions="-tmath --autosize --nominsize";
+ node [shape=rectangle];
+ a_1 [margin="0"];
+ a_2 [margin="0.7,0.4"];
+ a_3 [width="2",height="1"];
+ a_1-> a_2 -> a_3 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[fdp,straightedges]
+graph G {
+ node [shape=circle, fixedsize=True, width="0.2",
+ style="ball color =green", label=""];
+ edge [style="snake=zigzag, green"];
+ a_1 -- c -- a_2;
+ c [style="ball color=black"];
+ edge [style="snake=snake, blue"];
+ node [style="ball color = red", label=""];
+ a_3 -- c -- a_4 --a_3;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[circo,mathmode,shell]
+digraph G {
+ graph [mindist=0.5];
+ node [fixedsize=true, shape=circle, width=0.4, style="fill=green!20"];
+ c -> n_1 [style="-stealth"];
+ c -> n_2 [style="-to"];
+ c -> n_3 [style="-latex"];
+ c -> n_4 [style="-diamond"];
+ c -> n_5 [style="-o"];
+ c -> n_6 [style="{-]}"];
+ c -> n_7 [style="-triangle 90"];
+ c -> n_8 [style="-hooks"];
+ c -> n_9 [style="->>"];
+ c [style="fill=red!80"];
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}
+digraph G {
+ node [shape=circle];
+ a -> b [label="label",lblstyle="draw=red,cross out"];
+ b -> c [label="test",lblstyle="below=0.5cm,rotate=20,fill=blue!20"];
+ a [label="aa",lblstyle="blue"];
+ b [lblstyle="font=\Huge"];
+ c [label="ccc", lblstyle="red,rotate=90"];
+ label="Graph label";
+ lblstyle="draw,fill=red!20";
+ rankdir=LR;
+ }
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[tikz,circo]
+digraph G {
+ mindist = 0.5;
+ node [shape="circle"];
+ a -> b [topath="bend right"];
+ c -> b [topath="bend left"];
+ c -> a [topath="out=10,in=-90"];
+ b -> b [topath="loop above"];
+ }
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[tikz,neato,tikzedgelabels,styleonly]
+digraph G {
+ d2tfigpreamble = "\tikzstyle{every state}= \
+ [draw=blue!50,very thick,fill=blue!20]";
+ node [style="state"];
+ edge [lblstyle="auto",topath="bend left"];
+ A [style="state, initial"];
+ A -> B [label=2];
+ A -> D [label=7];
+ B -> A [label=1];
+ B -> B [label=3,topath="loop above"];
+ B -> C [label=4];
+ C -> F [label=5];
+ F -> B [label=8];
+ F -> D [label=7];
+ D -> E [label=2];
+ E -> A [label="1,6"];
+ F [style="state,accepting"];
+ }
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[mathmode,shell]
+digraph G {
+ d2tfigpreamble="\Huge";
+ a_1-> a_2 -> a_3 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+\begin{preview}
+\begin{dot2tex}[tikz,shell,prog=neato,mathmode]
+digraph G {
+ node [shape="circle"];
+ a_1 -> a_2 -> a_3 -> a_4 -> a_1;
+}
+\end{dot2tex}
+\end{preview}
+
+% Define layers
+\pgfdeclarelayer{background}
+\pgfdeclarelayer{foreground}
+\pgfsetlayers{background,main,foreground}
+% The scale option is useful for adjusting spacing between nodes.
+% Note that this works best when straight lines are used to connect
+% the nodes.
+\begin{preview}
+\begin{tikzpicture}[>=latex',scale=0.8]
+ % set node style
+ \tikzstyle{n} = [draw,shape=circle,minimum size=2em,
+ inner sep=0pt,fill=red!20]
+ \begin{dot2tex}[dot,tikz,codeonly,options=-s --styleonly -tmath]
+ digraph G {
+ node [style="n"];
+ A_1 -> B_1; A_1 -> B_2; A_1 -> B_3;
+ B_1 -> C_1; B_1 -> C_2;
+ B_2 -> C_2; B_2 -> C_3;
+ B_3 -> C_3; B_3 -> C_4;
+ }
+ \end{dot2tex}
+ % annotations
+ \node[left=1em] at (C_1.west) (l3) {Level 3};
+ \node at (l3 |- B_1) (l2){Level 2};
+ \node at (l3 |- A_1) (l1) {Level 1};
+ % Draw lines to separate the levels. First we need to calculate
+ % where the middle is.
+ \path (l3) -- coordinate (l32) (l2) -- coordinate (l21) (l1);
+ \draw[dashed] (C_1 |- l32) -- (l32 -| C_4);
+ \draw[dashed] (C_1 |- l21) -- (l21 -| C_4);
+ \draw[<->,red] (A_1) to[out=-120,in=90] (C_2);
+ % Highlight the A_1 -> B_1 -> C_2 path. Use layers to draw
+ % behind everything.
+ \begin{pgfonlayer}{background}
+ \draw[rounded corners=2em,line width=3em,blue!20,cap=round]
+ (A_1.center) -- (B_1.west) -- (C_2.center);
+ \end{pgfonlayer}
+\end{tikzpicture}
+\end{preview}
+
+\end{document}
diff --git a/macros/latex/contrib/dot2texi/examples/docgraphsorig.pdf b/macros/latex/contrib/dot2texi/examples/docgraphsorig.pdf
new file mode 100644
index 0000000000..abc0d3b454
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/examples/docgraphsorig.pdf
Binary files differ
diff --git a/macros/latex/contrib/dot2texi/gpl.txt b/macros/latex/contrib/dot2texi/gpl.txt
new file mode 100644
index 0000000000..0203e5220e
--- /dev/null
+++ b/macros/latex/contrib/dot2texi/gpl.txt
@@ -0,0 +1,284 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS \ No newline at end of file