summaryrefslogtreecommitdiffstats
path: root/answer_sheet/quiver.sty
diff options
context:
space:
mode:
diffstat (limited to 'answer_sheet/quiver.sty')
-rw-r--r--answer_sheet/quiver.sty36
1 files changed, 36 insertions, 0 deletions
diff --git a/answer_sheet/quiver.sty b/answer_sheet/quiver.sty
new file mode 100644
index 0000000..57d154b
--- /dev/null
+++ b/answer_sheet/quiver.sty
@@ -0,0 +1,36 @@
1% *** quiver ***
2% A package for drawing commutative diagrams exported from https://q.uiver.app.
3%
4% This package is currently a wrapper around the `tikz-cd` package, importing necessary TikZ
5% libraries, and defining a new TikZ style for curves of a fixed height.
6%
7% Version: 1.0.1
8% Authors:
9% - varkor (https://github.com/varkor)
10% - AndréC (https://tex.stackexchange.com/users/138900/andr%C3%A9c)
11
12\NeedsTeXFormat{LaTeX2e}
13\ProvidesPackage{quiver}[2020/11/27 quiver]
14
15% `tikz-cd` is necessary to draw commutative diagrams.
16\RequirePackage{tikz-cd}
17% `calc` is necessary to draw curved arrows.
18\usetikzlibrary{calc}
19% `pathmorphing` is necessary to draw squiggly arrows.
20\usetikzlibrary{decorations.pathmorphing}
21
22% A TikZ style for curved arrows of a fixed height, due to AndréC.
23\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
24 .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
25 and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
26 .. (\tikztotarget)\tikztonodes}},
27 settings/.code={\tikzset{quiver/.cd,#1}
28 \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
29 quiver/.cd,pos/.initial=0.35,height/.initial=0}
30
31% TikZ arrowhead/tail styles.
32\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
33\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
34\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
35
36\endinput