Debian Codegraph @

texmf-dist/doc/latex/quiver/quiver-doc.tex

raw
1 \documentclass[12pt,a4paper]{article}
2
3 \usepackage[margin=2.5cm]{geometry}
4 \usepackage{microtype}
5
6 % For the date.
7 \usepackage[UKenglish]{isodate}
8
9 % For URLs.
10 \usepackage{hyperref}[pdfusetitle]
11 \hypersetup{colorlinks,urlcolor=blue}
12 \urlstyle{rm}
13
14 % For tables.
15 \usepackage{tabularray}
16
17 % For side-by-side examples.
18 \usepackage[skins,listings]{tcolorbox}
19 \tcbuselibrary{minted}
20 \newtcblisting{tikzexample}{
21 sidebyside,
22 center lower,
23 bicolor,
24 colbacklower=white,
25 sharp corners,
26 frame engine=empty
27 }
28
29 % The package in question.
30 \usepackage{quiver}
31
32 \newcommand{\quiver}{\textsf{quiver}}
33 \newcommand{\tcd}{\textsf{tikz-cd}}
34 \newcommand{\TikZ}{{\rm Ti{\it k}Z}}
35
36 \title{\textsf{quiver} \\ \small A modern commutative diagram editor}
37 \author{\normalsize \textsf{@varkor}}
38 \date{\cleanlookdateon\today}
39
40 \begin{document}
41
42 \maketitle
43
44 \begin{abstract}
45 The \textsf{quiver} package provides compatibility with the \textsf{quiver} commutative diagram editor.
46 \end{abstract}
47
48 \section{Usage}
49
50 The \quiver{} package is intended to be used in conjunction with the \url{https://q.uiver.app/} commutative diagram editor. It functions as a wrapper around the \tcd{} package that provides some extra \TikZ{} styles, which are used in diagrams exported by the editor. However, these styles may be used in isolation of the editor.
51
52 To use the \quiver{} package, add the following to the preamble of your document.
53
54 \begin{verbatim}
55 \usepackage{quiver}
56 \end{verbatim}
57
58 \section{\TikZ{} styles}
59
60 The \quiver{} package provides several styles that are useful in the rendering of commutative diagrams.
61
62 \subsection{The \texttt{curve} style}
63
64 The typical method of curving arrows in \tcd{} commutative diagrams is to use the \TikZ{} \texttt{bend left} and \texttt{bend right} styles, together with the \texttt{in} and \texttt{out} parameters. These styles facilitate the bending of paths with respect to an angle. However, it is often more convenient to bend a path with respect to a distance (namely, the height of the apex of the curve). This may be achieved with the \texttt{curve} style\footnotemark{}.
65 \footnotetext{The \texttt{curve} style is due to Andr\'eC (\url{https://tex.stackexchange.com/users/138900/andr\%C3\%A9c}).}
66
67 \begin{tikzexample}
68 \begin{tikzcd}
69 a \ar["f", rr, curve={height=-24pt}] && b
70 \end{tikzcd}
71 \end{tikzexample}
72
73 The \texttt{curve} style takes two (optional) named parameters.
74
75 \begin{itemize}
76 \item \texttt{height} specifies the height of the apex of the curve. It is a signed distance (default \texttt{0}).
77 \item \texttt{pos} specifies the position of the control point for the curve. It is a value between \texttt{0.0} and \texttt{1.0} (default \texttt{0.35}).
78 \end{itemize}
79
80 \begin{tikzexample}
81 \begin{tikzcd}
82 a \ar["f", rr, curve={height=-24pt, pos=0.2}] && b
83 \end{tikzcd}
84 \end{tikzexample}
85
86 \begin{tikzexample}
87 \begin{tikzcd}
88 a \ar["f", rr, curve={height=-24pt, pos=0.5}] && b
89 \end{tikzcd}
90 \end{tikzexample}
91
92 \begin{tikzexample}
93 \begin{tikzcd}
94 a \ar["f", rr, curve={height=-24pt, pos=0.8}] && b
95 \end{tikzcd}
96 \end{tikzexample}
97
98 \subsection{The \texttt{between} style}
99
100 The typical method of curving arrows in \tcd{} commutative diagrams is to use the \TikZ{} \texttt{shorten <} and \texttt{shorten >} styles. However, these styles do not interact well with curved paths. The \texttt{between} style addresses this shortcoming.
101
102 \begin{tikzexample}
103 \begin{tikzcd}
104 a \ar["f", rr, curve={height=-24pt}, between={0.3}{0.7}] && b
105 \end{tikzcd}
106 \end{tikzexample}
107
108 \subsection{Arrowhead and tail styles}
109
110 The \tcd{} package provides several arrowhead and tail styles. The \quiver{} package provides the following additional styles.
111
112 \begin{center}
113 \begin{tblr}{cc}
114 {\bf Style} & {\bf Appearance} \\
115 \texttt{tail reversed} &
116 % https://q.uiver.app/?q=WzAsMixbMCwwXSxbMSwwXSxbMCwxLCIiLDAseyJzdHlsZSI6eyJ0YWlsIjp7Im5hbWUiOiJhcnJvd2hlYWQifX19XV0=
117 \begin{tikzcd}[ampersand replacement=\&]
118 {} \& {}
119 \arrow[tail reversed, from=1-1, to=1-2]
120 \end{tikzcd}
121 \\
122 \texttt{2tail} &
123 % https://q.uiver.app/?q=WzAsMixbMCwwXSxbMSwwXSxbMCwxLCIiLDAseyJsZXZlbCI6Miwic3R5bGUiOnsidGFpbCI6eyJuYW1lIjoibW9ubyJ9fX1dXQ==
124 \begin{tikzcd}[ampersand replacement=\&]
125 {} \& {}
126 \arrow[Rightarrow, 2tail, from=1-1, to=1-2]
127 \end{tikzcd}
128 \\
129 \texttt{2tail reversed} &
130 % https://q.uiver.app/?q=WzAsMixbMCwwXSxbMSwwXSxbMCwxLCIiLDAseyJsZXZlbCI6Miwic3R5bGUiOnsidGFpbCI6eyJuYW1lIjoiYXJyb3doZWFkIn19fV1d
131 \begin{tikzcd}[ampersand replacement=\&]
132 {} \& {}
133 \arrow[Rightarrow, 2tail reversed, from=1-1, to=1-2]
134 \end{tikzcd}
135 \\
136 \texttt{no body} &
137 % https://q.uiver.app/?q=WzAsMixbMCwwXSxbMSwwXSxbMCwxLCIiLDAseyJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJub25lIn19fV1d
138 \begin{tikzcd}[ampersand replacement=\&]
139 {} \& {}
140 \arrow[no body, from=1-1, to=1-2]
141 \end{tikzcd}
142 \end{tblr}
143 \end{center}
144
145 \section{Version history}
146
147 The \quiver{} version number is tied to the editor version number. This is reflected in the history below: not every editor update corresponds to a package update.
148
149 \begin{center}
150 \begin{tblr}{colspec={ccX[c]},row{even}=black!5}
151 {\bf Version} & {\bf Date} & {\bf Release notes} \\
152 1.0.0 & 2020-11-10 & First public version. Imports necessary packages and defines the \texttt{curve} style. \\
153 1.0.1 & 2020-11-27 & Added the \texttt{tail reversed}, \texttt{2tail}, and \texttt{2tail reversed} styles. \\
154 1.1.0 & 2020-12-18 & Added a dependency. \\
155 1.2.0 & 2021-01-11 & Added the \texttt{no body} style. \\
156 1.5.5 & 2025-06-24 & Added the \texttt{between} style. \\
157 1.6.0 & 2025-09-20 & Fixed a warning with the \texttt{between} style in combination with \texttt{shift left} and \texttt{shift right}.
158 \end{tblr}
159 \end{center}
160
161 \end{document}