7

In my use of tikz-cd, the down, right and left arrows (\ar{d},\ar{r}, \ar{l} respectively) work fine, but I seem to have no uparrow (nor any up right arrow or up left arrow). When I have \ar{u}, I get the error "No shape named tikz@f@1-0-1 found". Can anyone help me with this?

\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzcd}
A\ar{u}\\
B
\end{tikzcd}

\end{document}

Replace that u with an l,r or d and it works.

user44400
  • 131
user27575
  • 123
  • 1
  • 5

1 Answers1

5

Of course \ar{u} will produce an error with your code since there's no node to go upwards from "A"; as soon as you add a node above "A" you can use an upwards arrow:

\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzcd}
C \\
A\ar{u}\\
B
\end{tikzcd}

\end{document}

enter image description here

If you just want the arrow pointing upwards from "A" but without ant label at the end, you still have to declare a node with empty contents:

\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzcd}
{} \\
A\ar{u}\\
B
\end{tikzcd}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128