# Referring to tikz matrix coordinates using pgf mathematics operations

I would like to use pgf's math operations to refer to matrix coodinates in tikz. This works for the second coordinate, but apparently miraculously:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows}
\begin{document}
$$\begin{tikzpicture} [description/.style={fill=white,inner sep=2pt},baseline=(current bounding box.center)] \matrix (m) [matrix of math nodes, row sep=1em, column sep=1.5em, text height=1.5ex, text depth=0.25ex] { 0 & \Omega^k_X & Z k k & Z k {k-1} & \cdots & Z k 1 & Z k 0 & 0\phantom .\\ 0 & \Lambda^k \mathcal E^\vee & Z k k & Z k {k-1} & \cdots & Z k 1 & Z k 0 & 0.\\ }; \foreach \a in {2,3,...,8} { \pgfmathsetmacro{\myresult}{\a-1} \draw[->] (m-1-\myresult) -- (m-1-\a); \draw[->] (m-2-\myresult) -- (m-2-\a); }; \end{tikzpicture}$$
\end{document}

The following, however, fails spectacularly.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows}
\begin{document}
$$\begin{tikzpicture} [description/.style={fill=white,inner sep=2pt},baseline=(current bounding box.center)] \matrix (m) [matrix of math nodes, row sep=1em, column sep=1.5em, text height=1.5ex, text depth=0.25ex] { 0 \\ \Omega^k_X \\ Z k k \\ Z k {k-1} \\ cdots \\ Z k 1 \\ Z k 0 \\ }; \foreach \a in {2,3,...,7} { \pgfmathsetmacro{\myresult}{\a-1} \draw[->] (m-\myresult-1) -- (m-\a-1); }; \end{tikzpicture}$$
\end{document}

Apparently, this is because \myresult is 1.0, 2.0, etc, and tikz does not like. An otherwise fruitless google search turned up \pgfmathfloatint, but tikz barfs on \usetikzlibrary{fpu}. Is there any way to turn 1.0 into 1?

-
You should post always complete, compilable examples so that people can simple cut&paste the code and run it for themselves. Otherwise people have to guess which packages you are using. This is especially true for TikZ which has many libraries. –  Martin Scharrer Mar 30 '11 at 20:03
Will do, thanks for the advice. –  Josh Guffin Mar 30 '11 at 20:17