TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
\ovalbox{A} \\
\uparrow \downarrow \\
\ovalbox{B} \\
\uparrow \\

(The fancybox package is used here, so that \ovalbox{B} appears as a capital B in a box with curved corners.)

This is a crude sort of picture of a simple directed graph, and although all I need is something simple like this, I also was to be able to show an arrow pointing from \ovalbox{B} to itself, set to the right of \ovalbox{B}. How can I do that?

share|improve this question
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). Also, it's usually preferable to post a complete minimal document instead of a code fragment. – Alan Munn Apr 15 '12 at 19:16
For looking up symbols, see “How to look up a symbol?”. However, like Alan, I would suggest using TikZ for this sort of thing. The second tutorial in the manual (pgfmanual.pdf) should contain everything you need. Also see tex.stackexchange.com/questions/503/why-is-preferable-to – Caramdir Apr 15 '12 at 19:55
up vote 10 down vote accepted

I'm not sure the way you're doing this is ideal. I would suggest using the TikZ automata library:

\begin{tikzpicture}[every state/.style={draw,rectangle, rounded corners},node distance=2em]
\node[state] (A) {A};
\node[state] (B) [below=  of A] {B};
\node[state] (C) [below= of B] {C};
\path[thick,-to] (A.-105) edge (B.105)
                 (B) edge (C)
                 (B.75) edge (A.-75)
                 (B) edge [loop right] (B);

output of code

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.