# tikz-cd equivalent to the xy-pic command \ar@{-}

How do I make the diagram

X - Y -> Z

with tikz-cd?

With xy-pic, I would enter

\xymatrix{ X \ar@{-}[r] & Y \ar[r] & Z }

I tried

\begin{tikzcd} X \ar[no head]{r} & Y \ar{r} & Z \end{tikzcd}

but it didn't work.

Note that

\begin{tikzcd} X \ar[two heads]{r} & Y \ar{r} & Z \end{tikzcd}

produces

X ->> Y -> Z

"as it should".

In other words:

What is the tikz-cd equivalent to the xy-pic command \ar@{-}?

EDIT. Peter Jansson kindly asked me to provide a Minimal Working Example (MWE). So here is what works:

\documentclass{article}
\usepackage[all]{xy}
\usepackage{tikz-cd}
\begin{document}
$$\xymatrix{ X \ar@{-}[r] & Y\ar[r] & Z}$$
$$\begin{tikzcd} X \ar[two heads]{r} & Y \ar{r} & Z \end{tikzcd}$$
\end{document}


Here is what doesn't work:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
$$\begin{tikzcd} X \ar[no head]{r} & Y \ar{r} & Z \end{tikzcd}$$
\end{document}


I get the error message

! Package pgfkeys Error:
I do not know the key '/tikz/no head'
and I am going to ignore it.
Perhaps you misspelled it.


This doesn't surprise me because I just tried to guess at a possible command. But I hope that there is a simple way to do this.

-
Please provide a Minimal Working Example (MWE) that clearly shows your problem. This should start with \documentclass and end with \end{document}. – Peter Jansson Feb 2 '13 at 9:59
– Claudio Fiandrino Feb 2 '13 at 10:19
Dear @ClaudioFiandrino: Thank you very much!!! – Pierre-Yves Gaillard Feb 2 '13 at 10:28
Dear @PeterJansson: Thanks for your suggestion. I made an edit. – Pierre-Yves Gaillard Feb 2 '13 at 10:33

Just use the optional argument to \ar that allows for specifying the arrow's shape, shift and whatnot:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
$\begin{tikzcd} X \ar[-]{r} & Y \ar{r} & Z \end{tikzcd}$
\end{document}


Never use  in LaTeX.

-
Dear egreg: Thanks a lot! How did you figure that out? Is there a list of all the possible optional arguments you can use in this situation? – Pierre-Yves Gaillard Feb 2 '13 at 11:54
@Pierre-YvesGaillard The official documentation. – Manuel Feb 2 '13 at 13:12