Is it possible to use the verbatim environment (i.e. \begin{verbatim}...\end{verbatim}) in a dot2tex node? If so, please could you provide a MWE?
Update: this is the closest I've got so far:
digraph g {
d2tdocpreamble = "\usepackage{varwidth} \usepackage{verbatim} \renewcommand{\familydefault}{\sfdefault}";
graph [ rankdir = "TB" ];
node [ style="rounded,bold,filled" fillcolor="azure" shape = "box" ];
assume_git [ texlbl="\begin{varwidth}{30em}We'll assume that Git is to be used for source control; so as a precaution against accidentally checking in temporary files used by Vim or OS X, enter the following at the command prompt:\\\verb|echo '*.swp' >> .gitignore|\\\verb|echo '.DS\_Store' >> .gitignore|\end{varwidth}" ];
START -> assume_git;
}
And this is the output from turning it into a PDF via the command dot2tex --crop --margin 1em --autosize dot2tex_test_006_mwe.dot > dot2tex_test_006_mwe.tex; pdflatex dot2tex_test_006_mwe.tex:

This is unsatisfactory in at least two ways:
instead of
\\\verb|echo '*.swp' >> .gitignore|\\\verb|echo '.DS\_Store' >> .gitignore|I would much prefer to have been able to use
\begin{verbatim} echo '*.swp' >> .gitignore echo '.DS_Store' >> .gitignore \end{verbatim}to avoid the need for unnecessary markup for every newline in the code block, but the latter generated the following errors:
ERROR Failed to process input Traceback (most recent call last): File "build/bdist.macosx-10.6-universal/egg/dot2tex/dot2tex.py", line 2928, in main s = conv.convert(dotdata) File "build/bdist.macosx-10.6-universal/egg/dot2tex/dot2tex.py", line 794, in convert return self.do_preview_preproc() File "build/bdist.macosx-10.6-universal/egg/dot2tex/dot2tex.py", line 1105, in do_preview_preproc hp,dp,wt = pp.texdims[name] KeyError: 'assume_git' This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts 2011_5) restricted \write18 enabled. entering extended mode (./dot2tex_test_006_mwe.tex LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, czech, slovak, dutch, ukenglish, usenglishmax, basque, french, german-x-2009-06-19, ngerman-x-2009-06-19, german, ngerman, swissgerman, italian, polish, portuguese, spanish, catalan, galician, loaded. ) *The
\\\verb|...|approach in the MWE does not render the code verbatim. Even my short example has the following problems:- in order to avoid error messages, I had to add a backslash in front of the underscore, but now the backslash is rendered. So I need a way to render just an underscore;
- the straight single quote marks around
*.swpand.DS\_Storehave been replaced by right single quote marks; - one member of each pair of greater-than signs has disappeared.
echo "It's explained on dot2tex man page"; echo 'digraph G {a_0 [texlbl="\verb|XY|"] a_1 [texlbl="$x$"] a_0 -> a_1}' > tmp.dot ; dot2tex tmp.dot > tmp.tex; pdflatex tmp– Marc van Dongen Jun 28 '12 at 7:23man dot2texdoesn't work for me - although I used easy_install, so wasn't expecting it to work - but I can't see any documentation in the latest ZIP file either (dot2tex-2.8.7.zip) that includes your example. Please could you tell me more about where you found that explanation? Thanks. – sampablokuper Jun 28 '12 at 13:23echo 'digraph G {a_0 [texlbl="\begin{verbatim}XY\end{verbatim}"] a_1 [texlbl="$x$"] a_0 -> a_1}' > tmp.dot ; dot2tex tmp.dot > tmp.tex; pdflatex tmpand also this:echo 'digraph G {d2tdocpreamble = "\usepackage{verbatim}"; a_0 [texlbl="\begin{verbatim}XY\end{verbatim}"] a_1 [texlbl="$x$"] a_0 -> a_1}' > tmp.dot ; dot2tex tmp.dot > tmp.tex; pdflatex tmpfail with the message ! LaTeX Error: Something's wrong--perhaps a missing \item. So I'd be grateful for a fuller answer :) – sampablokuper Jun 29 '12 at 11:15\begin{verbatim} ... \end{verbatim}pair (or equivalent), instead of having to use\verb|foo|\\\verb|bar|, because the more lines the block contains, the more cumbersome the latter becomes. – sampablokuper Jun 29 '12 at 11:38