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

I tried the following codesnipped:

\tikzstyle{every node} = [draw, align=center,circle, scale = 0.5, thick]
\tikz\node (n1) {N1}; &
\tikz\node (n2) {N2}; \\
\tikz\node (n3) {N3};& 
\tikz\node (n4) {N4}; \\
\tikz\node (n5) {N5}; & 
\tikz\node (n6) {N6}; & 
\tikz\node (n7) {N7};\\

\path<1>[blue,->] (n1.south) edge [out= 60, in= 135] (n2.north west);
\path<2>[red,->] (n1.south) edge [out=-70, in=-110] (n3.south);

i does not behave as i expect it to. The paths do not get placed at the nodes but rather somewhere strange.

enter image description here

How can i fix this and still arrange the notes neatly like they are arranged now?

share|improve this question
are you sure this has anything to do with beamer? I tried your code in an article and got the same 'unexpected' result... – cmhughes Jan 25 '13 at 18:35
The reason is due to a few problems. First tabular inside a tikzpicture should not work due to various text resets. So you need to take the tabular out. But then you still need to reference each individual tikzpicture and those require the remember picture,overlay mechanism or you can search for tikzmark word on this site. Lastly you might be better off if you just use a matrix node with one tikzpicture in one shot. – percusse Jan 25 '13 at 20:26
up vote 4 down vote accepted

I think this is the perfect job for a matrix of nodes. Be warned however that inserting tikz matrices in a beamer frame require the [fragile] option.

This is the code:

\tikzstyle{every node} = [draw, align=center,circle, scale = 0.5, thick]
\node[draw=none, matrix of nodes, row sep=1em, column sep=1em] (N) {
N1 &    & N2 \\
   & N3 & N4 \\
N5 & N6 & N7 \\
\path<1>[blue,->] (N-1-1.south) edge [out= 60, in= 135] (N-1-3.north west);
\path<2>[red,->]  (N-1-1.south) edge [out=-70, in=-110] (N-2-2.south);

And this the result:


Note that the code only gives a name (N) to the \matrix node. Automatically all the cells of the matrix have also a name, which is the name of the matrix followed by the row and column number.

You can also give particular names to some of the nodes, using the following syntax:

\node[draw=none, matrix of nodes, row sep=1em, column sep=1em] (N) {
|(N1)| N1 &           & |(N2)| N2 \\
          & |(N3)| N3 & |(N4)| N4 \\
|(N5)| N5 & |(N6)| N6 & |(N7)| N7 \\
\path<1>[blue,->] (N1.south) edge [out= 60, in= 135] (N2.north west);
\path<2>[red,->]  (N1.south) edge [out=-70, in=-110] (N3.south);

In each cell you can specify anything between | and that is passed to the \node being built. You can use this also to pass [options].

share|improve this answer
If you switch to ampersand replacement=\& and use \& as the column separator you can skip the fragile requirement. – percusse Jan 26 '13 at 1:38

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.