# Tikz picture contains overlaps of objects and arrows

I'm new at using the TikZ package to make commutative diagrams. I'm trying to draw a triangle with an arrow between each pair of objects. Here's the code I'm using now:

\documentclass{article}
\usepackage{amsmath,amssymb,tikz}
\newcommand{\QQ}{\mathbb{Q}}
\begin{document}
\begin{tikzpicture}
\node (Q) {$\QQ$};
\node (tQ) [below of=Q] {$\QQ\otimes\QQ$};
\node (cQ) [right of=tQ] {$\QQ\times\QQ$};
\draw[->] (Q) to node {$i$} (cQ);
\draw[->] (tQ) to node [swap] {$m$} (Q);
\draw[<-] (cQ) to node [swap] {$\iota$} (tQ);
\end{tikzpicture}
\end{document}


(\QQ is a command I've defined to produce \mathbb{Q}, since it saves me typing.) The diagram compiles fine, but the objects and arrows overlap quite badly on the bottom line: the right- and left-most \mathbb{Q} in the nodes on the bottom line touch, and the arrow is superimposed over them. How can I fix this so that the diagram can be more readable?

-
The easiest way out is to add \begin{tikzpicture}[node distance=2cm]. But this would affect all nodes in that particular TikZ picture placed by to command. See the positioning library in the manual. – percusse Feb 19 '12 at 20:22
Thanks, that helps a lot- the nodes are now readable. If you make that an answer, I will accept it. – KReiser Feb 19 '12 at 20:28

The easiest way out is to add \begin{tikzpicture}[node distance=2cm]. But this would affect all nodes in that particular TikZ picture placed by to command.

For more specific solutions, the positioning library is a very powerful tool. (see page 185 in the manual v2.10)

-

you can use the positioning tikzlibrary and the above or right

\documentclass{article}
\usepackage{amsmath,amssymb,tikz}
\usetikzlibrary{positioning}
\newcommand{\QQ}{\mathbb{Q}}
\begin{document}
\begin{tikzpicture}
\node (Q) {$\QQ$};
\node (tQ) [below =5em of Q] {$\QQ\otimes\QQ$};
\node (cQ) [right =5em of tQ] {$\QQ\times\QQ$};
\draw[->] (Q) to node[ above] {$i$} (cQ);
\draw[->] (tQ) to node [right] {$m$} (Q);
\draw[<-] (cQ) to node [above] {$\iota$} (tQ);
\end{tikzpicture}
\end{document}

-