Closed morfismo closed 10 months ago
perhaps there's another way that only uses tikz/arrows? (no need for tikzcd) I just couldn't find it
Hi @morfismo! Thanks for your interest (and sorry for the delay)!
At the moment commutative-diagrams
is lacking a library of default styles beyond the ones provided by arrows.meta
.
To piggyback on tikz-cd
your solution is perfectly fine, but there's a simpler way using commutative-diagrams
internals:
\pgfqkeys{/codi}{every arrow/.append style={/ektropi/add=/tikz/commutative diagrams}}
% this makes CoDi expose all keys defined in /tikz/commutative diagrams in the scope available to its arrows
This affords you what I think you wanted to write:
\documentclass{article}
\usepackage{commutative-diagrams}
\usepackage{tikz-cd}
\pgfqkeys{/codi}{every arrow/.append style={/ektropi/add=/tikz/commutative diagrams}}
\begin{document}
\begin{codi}
\obj{0 & A & B & C & |(0')| 0\\};
\mor 0 -> A f:->,hook B g:->> C -> (0');
\end{codi}
\end{document}
This is very close to a mechanism I originally devised to implement "mix-and-match" style libraries.
In any case, given the popularity of tikz-cd
this will make a great addition to the manual! 🤩
LMK what you think and whether you need further help!
seems like a good alternative, thank you
Is there an existing issue for this?
Original problem
Create arbitrary arrow tips using tikzcd styles directly.
For example to create an arrow that starts like (_____ ... (head is "hook")
you can't use
A [->, hook] B
since hook style is not found
Solution is to invoke the style directly from tikzcd. you need to use
and then the "hook" style from tikzcd is applied to the arrow head. This solution is not mentioned on the manual, and often head/tips on commutative diagrams are needed beyond simple > or >>
there are many many head/tip styles on page 3-4 from tikz-doc manual that can be used here![arrows](https://user-images.githubusercontent.com/4128748/170910961-be447752-58f6-4b74-a57b-79e0250c48fb.png)
took me about an hour to find out how, should be a note perhaps in the manual
Proposed solution
add small example on manual explaining how to call styles from tikzcd
Alternatives considered
I gave the solution on the issue text, I guess tikzcd needs to be loaded?
Additional context
No response