I have a matrix and want to reference several nodes of this matrix. How do I add a line for some of the cells?
I came up with this:
\documentclass[12pt]{scrbook}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of nodes]
{1 & 2 & 3 & 4 & 5 \\};
\foreach \i in {0, 3}
{
\pgfmathsetmacro\iplusone{1+\i}
\pgfmathsetmacro\itimesfour{4*\i}
\draw (m-1-\iplusone .south) -- node [at end] {\itimesfour} +(0, -1);
};
\end{tikzpicture}
\end{document}
Which is a simplified version of what I want to do. However, this does not work and gives the error:
Package PGF Math Error: Unknown operator `s' or `so' (in '0.south').
I don't know where to start with this error at hand.
\pgfmathtruncatemacrootherwise you have a another.in the output:(m-1-0.0.south)(TikZ parses that as node namem-1-0and anchor0.southwhich it tries as an angle since no anchor is named0.south. Besides that, there is a spurious{right before the relative coordinate and\itemtimesfourshould be\itimesfour. – Qrrbrbirlbel Jul 02 '13 at 13:21