# Tikzcd package error: arrow direction argument

I'm having problems to run the tikzcd package on my system. The following code:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
S\arrow[r] & S \\
\end{tikzcd}
\end{document}


Gives the following errors:

tikz-cd: Arrow direction argument must contain only the characters u, d, l, r. S \arrow[r] S

pgfkeys: I do not know the key '/tikz/r' and I am going to ignore it. Perhaps you misspelled it. \end{tikzcd}

I'm using Ubuntu 14.04 and the distributions seem to be updated. For instance command tex --version gives:

TeX 3.1415926 (TeX Live 2013/Debian)
kpathsea version 6.1.1
Copyright 2013 D.E. Knuth.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.


and none of the answers of other questions is working for me.

• I get a different error, which stems from not having & after the arrow. Check for invisible characters in the input. – egreg Sep 30 '17 at 16:08
• Oh, I see, now! You have TeX Live 2013 and tikz-cd at the time didn't accept that syntax. You should update to TeX Live 2017, but I'm not sure Ubuntu 14.04 offers it. Better to install the “vanilla” distribution. – egreg Sep 30 '17 at 16:14

TeX Live 2013/Debian only provides a version of tikz-cd that doesn't support that syntax for arrows. On my TeX Live 2013 (not Debian) I have version 0.9b, but probably the Debian one was frozen before its release.

If I compile with TeX Live 2012 (tikz-cd version 0.3c) I indeed get

! Package tikz-cd Error: Arrow direction argument must contain only the charact
ers u, d, l, r.

See the tikz-cd package documentation for explanation.
Type  H <return>  for immediate help.
...

l.6 S \arrow[r] &
S


This disappears when tikz-cd has a later version number, provided it is based on PGF version 3.0.0 or later.

You can use the “old” syntax: \arrow{r}, but you should definitely get an up-to-date version of the TeX system.