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. ๐pstricksorpstโ 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 specialtexlblattribute to a graph element, or by using thetexmodeattribute. ๐
-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โ Usepreview.styto 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 atikzpictureorpspictureenvironment. Useful when used with thedot2texipackage.--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.dot2texwill 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โ Usepdflatex(1)instead oflatex(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\rputcommand:
\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 filedot2tex.login 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 areutf8andlatin1.--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 usingpreview.sty. margin must be a valid TeX unit. By default margin is set to0pt.
๐ฆ SEE ALSO ๐ฆ
dot(1),latex(1)./usr/share/doc/dot2tex/usage.htmlโ Full documentation fordot2tex/usr/share/doc/dot2tex/examplesโ Example Graphviz dot files for use withdot2tex
๐ 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
- debian bookworm: dot2tex 2.11.3-3 ยท MIT
- debian trixie: dot2tex 2.11.3-8 ยท MIT
- ubuntu jammy: dot2tex 2.11.3-3 ยท MIT
- ubuntu noble: dot2tex 2.11.3-4 ยท MIT
- ubuntu questing: dot2tex 2.11.3-8
- ubuntu resolute: dot2tex 2.11.3-8build1 ยท MIT
- ubuntu stonking: dot2tex 2.12.0-2 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms