I have been using tikz-graph to draw graphs representing two-part protocols. Now I'd like to add comments to some nodes of the graph (multiline text, to the side of the vertex).
I'm not sure how to do that. I have been adding labels to vertices and putting them outside with LabelOut
, but then I can't do multiline text. This is a toy/minimalistic example:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{tkz-graph}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\begin{document}
\begin{tikzpicture}
\SetUpEdge[lw = 1.5pt,
color=black,
labelstyle = {sloped}]
\SetVertexNoLabel
\GraphInit[vstyle=Art]
\tikzset{EdgeStyle/.style={post}}
\tikzset{node distance = 6 cm}
\SetVertexMath
% Two top symbols, displayed as two invisible
% vertices with visible labels:
{\tikzset{VertexStyle/.style = {color=white,text=black}}
\SetVertexLabel
\Vertex[L=\alpha]{P}
\SetVertexLabel
\Vertex[position={right of=P}, L={\beta}]{X}}
\tikzset{node distance = 1 cm}
{\SetVertexLabel
%%%
%%% HERE: in the next line the label can't be split in two lines...
\Vertex[LabelOut,Lpos=180,position={below of=P}, L={the protocol starts here}]{X1}
}
\tikzset{node distance = 2 cm}
\SO(X1){X2}
\SO(X2){X3}
\tikzset{node distance = 6 cm}
\EA(X1){A1}
\EA(X2){A2}
\Edge[label={220 ESMTP}](X1)(A1)
\Edge[label={EHLO client-host}](A1)(X2)
\Edge[label={250 DSN}](X2)(A2)
\Edge[label={mail from: email-address}](A2)(X3)
\end{tikzpicture}
\end{document}
What wold be the usual, easy way to do what I'm trying to do?