Skip to content

Instantly share code, notes, and snippets.

@pbelmans
Created November 30, 2016 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbelmans/20feef4708b72736187c1deef724cd9c to your computer and use it in GitHub Desktop.
Save pbelmans/20feef4708b72736187c1deef724cd9c to your computer and use it in GitHub Desktop.
\documentclass[12pt]{standalone}
\usepackage{tikz-cd}
\usetikzlibrary{decorations.markings}
\makeatletter
\tikzcdset{
open/.code={\tikzcdset{hook, circled};},
closed/.code={\tikzcdset{hook, slashed};},
open'/.code={\tikzcdset{hook', circled};},
closed'/.code={\tikzcdset{hook', slashed};},
circled/.code={\tikzcdset{markwith={\draw (0,0) circle (.375ex);}};},
slashed/.code={\tikzcdset{markwith={\draw[-] (-.4ex,-.4ex) -- (.4ex,.4ex);}};},
markwith/.code={
\pgfutil@ifundefined{tikz@library@decorations.markings@loaded}%
{\pgfutil@packageerror{tikz-cd}{You need to say %
\string\usetikzlibrary{decorations.markings} to use arrow with markings}{}}{}%
\pgfkeysalso{/tikz/postaction={/tikz/decorate,
/tikz/decoration={
markings,
mark = at position 0.5 with
{#1}}}}},
}
\makeatother
\begin{document}
\begin{tikzcd}[sep = large]
A \ar[r, circled, "j"] \ar[dr, closed] & B \ar[r, closed, "i"] & C \ar[dl, closed']\\
F \ar[u, closed] \ar[r, markwith={\arrow{stealth}}]& D & E \ar[l, closed'] \ar[u, open'] \ar[ull, crossing over, closed']
\end{tikzcd}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment