I recently bumped into a small problem while using the tikz-cd
package. It was about the positioning of the labels attached to certain arrows. One of the users in chat was friendly enough to point out to me that the positioning can be manually controlled using pos=<fraction>
.
Upon implementing this fix, I discovered that the behavior as I varied my input for <fraction>
was quite remarkable and counter-intuitive. I would have naively expected for the fraction to correspond, in the obvious way, to the fraction of arrow-length. Some experimenting shows that, for straight arrows, this indeed seems to be the case. However, for bent arrows it doesn't seem so simple. As a (minimal working) example, consider the following:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}
A \arrow[r,bend left=30,"\pi" pos=<fraction>]&B
\end{tikzcd}
\]
\end{document}
Inserting .4 and .6 for <fraction>
yields the following two outputs:
which certainly do not correspond to the label being placed 40% and 60% along the length of the arrow. My (obvious) question is: What do the numbers represent? How are they used to determine where to place the labels (especially in the apparently non-trivial bent-arrow case)?
Best Answer
The maintainer of the package has responded to a message about this problem---it turns out to be intended behavior.
Original answer
I would consider that a bug and would advice you to report this. You can use the following example:
I would report it to
tikz-cd
as this seems not to be a problem of TikZ itself. Just see this (sorry, ugly) code: