DOT2TEX(1)

โœจ DOT2TEX โ€” the manual, but make it cute โœจ

okay bestie, so this is the manual page for dot2tex, aka the Graphviz โ†’ LaTeX glow-up machine ๐Ÿ’… it lives in the General Commands Manual, and it's about to become your new obsession.


๐ŸŒธ NAME ๐ŸŒธ

dot2tex โ€” Graphviz to LaTeX converter ๐Ÿฆ‹


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

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

like, three whole ways to slide in โœจ pick your fave.


๐Ÿ’– DESCRIPTION ๐Ÿ’–

This manual page documents briefly the dot2tex command. (briefly, because we have places to be ๐Ÿ’…)

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 whole purpose of dot2tex is to give graphs a more LaTeX look and feel. Main character energy for your figures. 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. โœจ

๐ŸŒˆ USAGE ๐ŸŒˆ

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. (yes bestie, it's giving pipe-friendly ๐Ÿ‘‘)

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.


๐Ÿ’… OPTIONS ๐Ÿ’…

A summary of options is included below. strap in, there's a lot of them and every single one is iconic ๐ŸŽ€

  • -h, --help โ€” Display help message. ๐Ÿซถ
  • -f fmt, --format fmt โ€” Set output format. The following values of fmt are supported:
    • pgf โ€” PGF/TikZ. Default. ๐Ÿ‘‘
    • pstricks or pst โ€” Use PSTricks.
    • tikz โ€” TikZ format.
  • -t mode, --texmode mode โ€” Text mode. Specify how text is converted.
    • verbatim โ€” Text is displayed with all special TeX chars escaped (default).
    • math โ€” Output all text in math mode $$.
    • raw โ€” 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. ๐Ÿ’–
  • -s, --straightedges โ€” 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. ๐Ÿšซ
  • -o filename, --output filename โ€” Write output to file.
  • -d, --duplicate โ€” Duplicate the xdot output. Uses the drawing information embedded in the xdot output to draw nodes and edges.
  • --template filename โ€” Use template from file. See the HTML documentation for more details.
  • -V, --version โ€” Print version information and exit. bye bestie โœŒ๏ธ
  • -w, --switchdraworder โ€” Switch drawing order of nodes and edges. By default edges are drawn before nodes.
  • -c, --crop โ€” Use preview.sty to crop the graph. Currently only implemented for the PGF/TikZ backend.
  • --figonly โ€” Output the graph without a document preamble. Useful if the graph is to be included in a master document.
  • --codeonly โ€” Output only the drawing commands, without wrapping it in a tikzpicture or pspicture environment. Useful when used with the dot2texi package.
  • --preproc โ€” 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. ๐Ÿ”ฅ
  • --cache โ€” 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. (efficiency queen ๐Ÿงš)
  • --autosize โ€” Preprocess the graph and run Graphviz on the output. Equivalent to:
dot2tex --preproc dot-file | dot2tex
  • --prog program โ€” Set graph layout program to use when the input is in plain dot format. Allowed values: dot (default), neato, circo, fdp, twopi.
  • --usepdflatex โ€” Use pdflatex(1) instead of latex(1) for preprocessing the graph.
  • --nominsize โ€” Ignore minimum node sizes during preprocessing.
  • --valignmode mode โ€” Vertical alignment of node labels, where mode can have the values:
    • center โ€” Labels are placed in the middle of the node (default).
    • dot โ€” Use the coordinate given by the xdot output from Graphviz.
  • --alignstr str โ€” 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.

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

The following options are used by the output templates. ๐ŸŽ€

  • -e encoding, --encoding encoding โ€” Set text encoding. Supported encodings are utf8 and latin1.
  • --docpreamble TeXcode โ€” Insert TeX code in the document preamble.
  • --figpreamble TeXcode โ€” Insert TeX code in the figure preamble.
  • --figpostamble TeXcode โ€” Insert TeX code in the figure postamble.
  • --graphstyle style โ€” Sets the <<graphstyle>> tag.
  • --margin margin โ€” Set margin around the graph when using preview.sty. margin must be a valid TeX unit. By default margin is set to 0pt.

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

  • 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

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

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).


and that's the whole thing bestie, fr fr. this page is from November 11, 2006 โ€” vintage, lowkey iconic, and still slaying. mwah ๐Ÿ’‹

๐Ÿ“ฆ where this page comes from