# drawing directed graph

How can I draw an edge from (ab) to ($a^3$$b)? I tried using \Edge(ab)(a^3$$b$) like I did for drawing an edge from (b) to (e) but the same method didn't work.

I think it has something to do with using dollar signs.

\documentclass[a4paper]{article}
\usepackage[english]{babel}

\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}

\usepackage[colorinlistoftodos]{todonotes}

\usepackage{tkz-graph}

\usetikzlibrary{arrows}

\author{You}
\date{\today}

\begin{document}
\maketitle

\begin{center}
\begin{tikzpicture}

\Vertex[x=-1 ,y=-1]{e}

\Vertex[x=1 ,y=1]{$a^2$}

\Vertex[x=-1,y=1]{a}

\Vertex[x=1 ,y=-1]{$a^3$}

\Vertex[x=-3 ,y=-3]{b}

\Vertex[x=3 ,y=3]{$a^2$$b} \Vertex[x=-3 ,y=3]{a^3$$b$}

\Vertex[x=3 ,y=-3]{ab}

\Edge(e)(b)

\Edge(ab)($a^3$)

\end{tikzpicture}

\end{center}

\end{document}

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Nov 17 '14 at 14:41
• @Jubobs sure, sorry its my first post, thanks for the comment Nov 17 '14 at 14:54
• The answer is easily found in Tkz-graph documentation, page 21. You already have this document in your system: type texdoc tkz-graph from command line Nov 17 '14 at 15:29

If you add \SetVertexMath right after \begin{tikzpicture} you don't need to use $ in the vertices. This should allow you to reference them as you would other vertices. \documentclass[border=2mm]{standalone} \usepackage[utf8]{inputenc} \usepackage{tkz-graph} \usetikzlibrary{arrows,calc} \begin{document} \begin{tikzpicture} \SetVertexMath \Vertex[x=-1 ,y=-1]{e} \Vertex[x=1 ,y=1]{a^2} \Vertex[x=-1,y=1]{a} \Vertex[x=1 ,y=-1]{a^3} \Vertex[x=-3 ,y=-3]{b} \Vertex[x=3 ,y=3]{a^2b} \Vertex[x=-3 ,y=3]{a^3b} \Vertex[x=3 ,y=-3]{ab} \Edge(e)(b) \Edge(ab)(a^3) \end{tikzpicture} \end{document}  By the way, when using math you don't need $ around each variable. You can use $ once to enter math mode, then once again to exit. So, rather than $a^2b$, you would have $a^{2}b\$. The {} is to identify the argument in the exponent.