2

I'm using the to path option for the first time in tikzcd, and run into the problem that the labels for my arrows do not show up:

\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usetikzlibrary{cd}

\begin{document}

\begin{tikzcd}
 & B \\
 A \arrow[ru,"c",to path={--(\tikztotarget.west)}]&
 \end{tikzcd}

\end{document}

This just gives A and B, with an arrow, but I do not see the label?

  • Don't show snippets. Make a complete example, this makes it much easier to test your code. – Ulrike Fischer Jul 27 '17 at 8:30
2

You need to add \tikztonodes somewhere, to determine where nodes should be placed.

\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usetikzlibrary{cd}

\begin{document}

\begin{tikzcd}
 & B \\
 A \arrow[ru,"c",to path={--(\tikztotarget.west) \tikztonodes}]&
 \end{tikzcd}

\end{document}

enter image description here

  • Ah oke thanks. Can I add multiple tikztnodes? And if so, which one will be used? – user2520938 Jul 27 '17 at 8:34
  • @user2520938 Just tried, you'll get duplicate labels if you have more than one \tikztonodes. – Torbjørn T. Jul 27 '17 at 8:40

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.