Open tobiasdiez opened 4 years ago
This proposal would break the following, not completely unreasonable construction,
\begin{tikzcd}
A \to B \ar[r] & B \to D
\end{tikzcd}
which I would say is not acceptable.
You are right, this code would no longer work. But why do you think somebody would use normal arrows (\to
) in a commutative diagram?
@tobiasdiez For instance, because some arrows don't need a label and/or should be shorter. I'm not saying it's the best (or even a good) way to do it, but it's something some people will do, with really confusing results. Consider also the possibility that an object of the diagram is A_\to
, or the user in the habit of writing \overset\to v
instead of \vec v
; or even the possibility that some command defined in terms of \to
or \mapsto
is used inside {tikzcd}
.
This change would make the package's behaviour less predictable.
Ok, I understand. These examples feel a bit artificial to me, but I also see that as a package maintainer you have to consider these edge cases.
Would you consider adding a package option, that enables the to
shortcut or do you think it's really not something for this package? (Both would be fine for me of course. With my two recent PRs I just thought about contributing back some of my changes that I implemented to make my life easier.)
This PR enables
\to
and\mapsto
as shortcuts for the common latex arrows. Thus, the following worksAdvantages:
\to
and\mapsto
are used for the arrowsI've marked this as a draft PR, as the following points still need to be done but I wanted to get early feedback:
\mapsto
i.e.\mapsto[r]
instead of\mapsto{r}
. Any advice on how to do this?