Quantcast
Channel: Specifying coordinates in tikzcd arrows with a foreach loop - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Specifying coordinates in tikzcd arrows with a foreach loop

$
0
0

I'm trying to use a foreach loop to draw a whole bunch of arrows in a tikzcd environment by using the foreach loop to specify coordinates but I can't get it to compile. Here's a minimal example of what I'm trying:

\documentclass{article}\usepackage{tikz-cd}\begin{document}\begin{tikzcd}  A & B & C \\  \foreach \x in {2,3}{    \arrow[from=1-1, to=1-\x]  }\end{tikzcd}\end{document}

Which should appear as an arrow from A to B and another from A to C. Instead I'm recieving this error:

ERROR: Undefined control sequence.

--- TeX said ---

pgf@sh@ns@\tikzcdmatrixname -1-\x

l.12 \end{tikzcd}

I think I could get it to work in a plain tikz environment but I'd like to use tikzcd if possible. Thanks for any help.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images