I totally overlooked this piece of useful info.
It might be obvious for a TikZ power-user but it's tricky for anyone else.
This must be mentioned in the manual.
The simplest way to do it is
\documentclass{article}
\usepackage{commutative-diagrams}
\begin{document}
\begin{codi}[prompter]
\obj{ A & B \\ };
\mor A [name=foo,"f"]:-> B;
\draw [red] (foo) circle (1em);
\end{codi}
\end{document}
which yields
Note the prompter attached no generated name to the arrow's label.
This is due to the default behaviour being /codi/overwrite=false (i.e. if a name exists keep it and don't bother generating one). Since the name key comes before the label contents "f", the latter does not generate a name because one already exists.
The smart name generation behaviours for arrows and object are exactly the same, but the interfaces to override them are a bit different despite amounting to standard TikZ trickery. Let's clarify that!
I totally overlooked this piece of useful info. It might be obvious for a TikZ power-user but it's tricky for anyone else. This must be mentioned in the manual.
The simplest way to do it is
which yields
Note the
prompter
attached no generated name to the arrow's label. This is due to the default behaviour being/codi/overwrite=false
(i.e. if a name exists keep it and don't bother generating one). Since thename
key comes before the label contents"f"
, the latter does not generate a name because one already exists.The smart name generation behaviours for arrows and object are exactly the same, but the interfaces to override them are a bit different despite amounting to standard TikZ trickery. Let's clarify that!
Thanks to
@khjlai
for pointing this out. ❤️