DOKK / manpages / debian 11 / dot2tex / dot2tex.1.en
DOT2TEX(1) General Commands Manual DOT2TEX(1)

dot2tex - Graphviz to LaTeX converter

dot2tex [--prog graphviz-command] [options] dot-file > tex-file
dot2tex [options] xdot-file > tex-file
graphviz-command -txdot dot-file | dot2tex [options] > tex-file

This manual page documents briefly the dot2tex command.

dot2tex is a tool for converting graphs generated by Graphviz to formats suitable for use with LaTeX. Currently dot2tex generates code for PSTricks and PGF/TikZ.

The purpose of dot2tex is to give graphs a more LaTeX look and feel. This is accomplished by:

  • Typesetting labels with LaTeX, allowing mathematical notation.
  • Using native PSTricks and PGF/TikZ commands for drawing arrows, edges and nodes.
  • Using backend specific styles to customize the output.

Input data is read from standard input if no inputfile is specified. Output is written to standard output unless a destination file is set with the -o option.

dot2tex relies on the xdot format generated by Graphviz. dot2tex will automatically run dot(1) on the input data if it is in the plain dot format. If you want to use other layout tools like neato(1) and circo(1), use the --prog option.

A summary of options is included below.

Display help message.
Set output format. The following values of fmt are supported:
PGF/TikZ. Default.
Use PSTricks.
TikZ format.
Text mode. Specify how text is converted.
Text is displayed with all special TeX chars escaped (default).
Output all text in math mode $$.
Output text without any processing.

Note that you can locally override the text mode by assigning a special texlbl attribute to a graph element, or by using the texmode attribute.
Draw edges using straight lines. Graphviz uses bezier curves to draw straight edges. Use this option to force the use of line to operations instead of curves. Does not work in duplicate mode.
Write output to file.
Duplicate the xdot output. Uses the drawing information embedded in the xdot output to draw nodes and edges.
Use template from file. See the HTML documentation for more details.
Print version information and exit.
Switch drawing order of nodes and edges. By default edges are drawn before nodes.
Use preview.sty to crop the graph. Currently only implemented for the PGF/TikZ backend.
Output the graph without a document preamble. Useful if the graph is to be included in a master document.
Output only the drawing commands, without wrapping it in a tikzpicture or pspicture environment. Useful when used with the dot2texi package.
Preprocess the graph through LaTeX using the preview package. Will generate a new dot file where the height and widths of nodes and edge labels are set based on the results from preview.
Enables output caching. dot2tex will check if the input graph has been processed before. If it has not changed the graph will not be converted.
Preprocess the graph and run Graphviz on the output. Equivalent to:

dot2tex --preproc dot-file | dot2tex

Set graph layout program to use when the input is in plain dot format. Allowed values: dot (default), neato, circo, fdp, twopi.
Use pdflatex(1) instead of latex(1) for preprocessing the graph.
Ignore minimum node sizes during preprocessing.
Vertical alignment of node labels, where mode can have the values:
Labels are placed in the middle of the node (default).
Use the coordinate given by the xdot output from Graphviz.
Used to pass a default alignment string to the PSTricks \rput command:

\rput[alignstr] ...

Only works for the PSTricks format. PGF/TikZ users can instead pass an anchor=... style using the graphstyle option.

Bypass Graphviz' edge label placement and use PGF/TikZ instead (tikz and pgf formats only).
Use TikZ only styles when drawing nodes. No draw or shape option is added (tikz format only).
Wrap node code in a scope environment with tikzoptions as parameter (tikz format only).
Wrap edge code in a scope environment with tikzoptions as parameter (tikz format only).
Write detailed debug information to the file dot2tex.log in the current directory.
Generate code compatible with PGF 1.18 and earlier.

The following options are used by the output templates.

Set text encoding. Supported encodings are utf8 and latin1.
Insert TeX code in the document preamble.
Insert TeX code in the figure preamble.
Insert TeX code in the figure postamble.
Sets the <<graphstyle>> tag.
Set margin around the graph when using preview.sty. margin must be a valid TeX unit. By default margin is set to 0pt.

dot(1), latex(1).

/usr/share/doc/dot2tex/usage.html
Full documentation for dot2tex
/usr/share/doc/dot2tex/examples
Example Graphviz dot files for use with dot2tex

dot2tex was written by Kjell Magne Fauske <kjellmf@gmail.com>

This manual page was written by Peter Collingbourne <peter@pcc.me.uk>, for the Debian project (but may be used by others).

November 11, 2006