Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
$$ 
\begin{array}{c} 
\ovalbox{A} \\
\uparrow \downarrow \\
\ovalbox{B} \\
\uparrow \\
\ovalbox{C} 
\end{array} 
$$ 

(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
1  
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
add comment

1 Answer

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:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,automata}
\begin{document}
\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);
\end{tikzpicture}
\end{document}

output of code

share|improve this answer
add comment

Your Answer

 
discard

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.