-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convenient syntax for inclusion arrows #32
Comments
Thanks @leahneukirchen! ❤️
You can use it inline like this --even if I wouldn't recommend it except for one-off usage: \documentclass{article}
\usepackage{commutative-diagrams}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{codi}
\obj{ A & B \\ C & D \\ };
\mor A f:{{Hooks[right]}->} B; % i.e. wrap the key in a group
\mor C f:[{Hooks[right]}->] D; % i.e. wrap the key in a keylist
\end{codi}
\end{document}
It definitely makes sense. Right now CoDi encodes almost no shortcuts implying stylistic preferences because i want to keep it very pliable, a framework almost. Of course it's not "ready for daily use" like this and it needs some readily available style packs for the occasional user. I'm not saying defaults because I'd rather have the occasional user ask for % This file is tikzlibrarycommutative-diagrams.styles.leah.code.tex
\usetikzlibrary{arrows.meta}
\pgfqkeys{/codi/arrows}{
C/.tip = {Hooks[right]},
} % This file is main.tex
\documentclass{article}
\usepackage{commutative-diagrams}
\usetikzlibrary{commutative-diagrams.styles.leah}
\begin{document}
\begin{codi}
\obj{ A & B \\ };
\mor A f:C-> B;
\end{codi}
\end{document} This should get you started on building your own reusable stylesheet! Unfortunately I'm not doing CT in my day-to-day right now so I doubt I can grok what would be "reasonable defaults for everyone" to put in a starter pack included in CoDi. I was hoping that perhaps some consensus could be reached collaborating with early adopters. |
Thanks, this works for me! |
I tried to do the equivalent of
A\arrow[hookrightarrow]B
in CoDi (which is great, btw!) and it was quite tricky. The hook is provided inarrows.meta
, but I couldn't figure out the syntax to useHooks[right]
inline. Instead, I had to define a key:Then I can use
\mor A C-> B;
.As this notation is quite common, do you think it makes sense to include this or a similar shortcut?
The text was updated successfully, but these errors were encountered: