9

I love the TikZcd syntax to draw diagrams, and I want to use it to draw diagrams of field extensions ; this involves drawing arrows without tips. The only command I know to draw lines in tikzcd environments is \ar (or \arrow if I write it out), and I don't know how to adjust the \ar command so that it just draws straight lines from point A to point B (recall it is used in the following way : \ar[options]{rd}[options]{$\phi$} to render an arrow which goes right-down and put the symbol $\phi$ next to the arrow.

I tried simply putting TikZ commands, but they seem to have no effect (even though it compiles for most of the commands I've tried).

Any ideas?

  • Thanks for the edit, I always forget how to render this... – Patrick Da Silva Feb 28 '14 at 21:35
9

Section 1.2 of tikz-cd documentation details this; in particular, it sounds like you might want dash

screenshot

% arara: pdflatex
\documentclass{standalone}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
  A \arrow[dash]{r} & B
\end{tikzcd}
\end{document}

Following the comments, you can apply dash to every arrow for the current environment using

\begin{tikzcd}[every arrow/.append style={dash}]
  A \arrow{r} & B
\end{tikzcd}
  • Wow, how did I go through the whole document without seeing this. Thanks! – Patrick Da Silva Feb 28 '14 at 21:52
  • Do you know if I can make the [dash] option applied to the whole environment? Otherwise I have to type \ar[dash] all the time. – Patrick Da Silva Feb 28 '14 at 21:54
  • For some reason, this code is not working : \begin{tikzcd} K \arrow[dash]{d} \\ F \end{tikzcd}. I get the error "Package pgfkeys Error: I do not know the key '/tikz/dash' and I am going to i gnore it. Perhaps you misspelled it." – Patrick Da Silva Feb 28 '14 at 21:56
  • 1
    @PatrickDaSilva see my update about the whole environment – cmhughes Feb 28 '14 at 23:16
  • 2
    @cmhughes instead of dash one can also simply use -, as in \begin{tikzcd}[every arrow/.append style={-}] A \arrow{r} & B \end{tikzcd} (apparently the dash option is not available for the OP's version of the package, but I guess - will be.) – Gonzalo Medina Feb 28 '14 at 23:18
1

Adding to the above: If you want more flexibility than the "dash" type arrow there is also the "no head" command which removes the head from any type of arrow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.