[OS X TeX] multiline label on TikZ path

Alan Munn amunn at msu.edu
Mon Jan 19 10:46:17 EST 2009

At 10:23 AM -0500 1/19/09, Art Werschulz wrote:
>Hi once again.
>I would like to have a multiline label on an edge appearing in a 
>TikZ path.  I guessed at the following syntax:
>    \begin{tikzpicture}[shorten >=1pt,on grid,auto,initial text=]
>      \node[state] (2) {$q_2$};
>      \path[->]
>      (2) edge [loop right] node {$0,\varepsilon\to0\\ 1,\varepsilon\to1$} ();
>    \end{tikzpicture}
>hoping that the labels $0,\varepsilon\to0$ and $1,\varepsilon\to1$ 
>would appear as separate labeling lines on the loop,
>but it didn't work; it was as if the \\ was not there.

Try putting it in an array environment.

\begin{tikzpicture}[shorten >=1pt,on grid,auto,initial text=]
      \node[state] (2) {$q_2$};
      (2) edge [loop right] node {$\begin{array}{c} 
0,\varepsilon\to0\\ 1,\varepsilon\to1\end{array}$} ();


P.S. It would help to post complete, runnable minimal examples (with 
\begin{document}\end{document} etc.  which also show which tikz 
libraries you are loading.
Alan Munn						amunn at msu.edu
Department of Linguistics
and Germanic, Slavic, Asian and African Languages		Tel. 
Michigan State University, East Lansing MI 48824 USA	Fax	517-432-2736
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20090119/be336e34/attachment.html>

More information about the MacOSX-TeX mailing list