add pushout and pullback symbols

This commit is contained in:
Maximilian Keßler 2021-10-27 20:26:45 +02:00
parent 7116da1450
commit 64416f686e
2 changed files with 32 additions and 3 deletions

View file

@ -11,6 +11,7 @@ __HEADER__(Math figures with TikZ / pgfplots / xy)
\usetikzlibrary{calc, intersections, through, quotes, angles, babel, positioning, snakes}
\RequirePackage{tikz-cd} %Commutative diagrams
\RequirePackage{xparse}
%%for small diagrams, similar to tikz-cd
@ -20,3 +21,24 @@ __HEADER__(Math figures with TikZ / pgfplots / xy)
% \xyoption{all}
% here, but this messes with the catcode of the @ sign (which no package should do!)
% so that further parts in this package would get broken
\newcommand\pushoutsymbol{\tikz[baseline=0.5,scale=0.2]{
\draw[-] (0,0) --(0,1) -- (1,1);
\draw (1,0) circle (1.5pt);}
}
\newcommand\pullbacksymbol{\tikz[baseline=0.5,scale=0.2]{
\draw[-] (0,0) --(1,0) -- (1,1);
\draw (0,1) circle (1.5pt);}
}
% This is used in a tikzcd
\NewDocumentCommand\pushout{ O{dr} }{
\arrow[phantom, pos=0.45]{#1}{\pushoutsymbol}
}
% This is used in a tikzcd
\NewDocumentCommand\pullback{ O{dr} }{
\arrow[phantom, pos=0.45]{#1}{\pullbacksymbol}
}

View file

@ -10,7 +10,14 @@
\end{tikzcd}
\]
test2:
\begin{tikzpicture}
\draw (0,0) rectangle (10,10);
\end{tikzpicture}
\begin{tikzcd}
A \pushout & B \\
C & D
\end{tikzcd}
\begin{tikzcd}
A \pullback & B \\
C & D
\end{tikzcd}
\end{document}