Debian Codegraph @

texmf-dist/doc/generic/dcpic/eurotex2001.tex

raw
1 % $Id: eurotex2001-pqa-article.tex,v 1.9 2001/11/12 09:53:59 pedro Exp pedro $
2 \documentclass{europroc}
3 \usepackage[dvips]{graphicx}
4 \usepackage{dcpic,pictex}
5 \usepackage{calrsfs}
6 \usepackage{dsfont}
7 \usepackage{alltt}
8
9
10
11 \begin{document}
12
13 \title[DCpic]{DCpic, Commutative Diagrams in a (La)\TeX\ Document}
14 \author[Pedro Quaresma]{Pedro Quaresma\thanks{This work was partially
15 supported by the Portuguese Ministry of Science and Technology (MCT),
16 under the programme PRAXIS XXI.}\\ CISUC\\ Departamento de
17 Matem{\'a}tica, Universidade de Coimbra\\ 3001-454 COIMBRA, PORTUGAL}
18
19
20 \maketitle
21
22 \begin{abstract}
23 DCpic is a package of \TeX\ macros for graphing Commutative Diagrams
24 in a (La)\TeX\ or Con\TeX t document. Its distinguishing features
25 are: the use of \PiCTeX\ a powerful graphical engine, and a simple
26 specification syntax. A commutative diagram is described in
27 terms of its objects and its arrows. The objects are
28 textual elements and the arrows can have various straight or curved
29 forms.
30
31 We describe the syntax and semantics of the user's commands, and
32 present many examples of their use.
33 \end{abstract}
34
35 \keywords{Commutative Diagrams, (La)\TeX, \PiCTeX}
36
37 \section{Introduction}
38
39 \initial{3}{C}{\scshape ommutative Diagrams} (Diagramas Comutativos,
40 in Portuguese), are a kind of graphs which are widely used in Category
41 Theory~\cite{Herrlich73,MacLane71,Pierce98}, not only as a concise and
42 convenient notation but also for ``arrow chasing'', a powerful tool
43 for mathematical thought. For example, the fact that in a Category we
44 have arrow composition is easily expressed by the following
45 commutative diagram.
46
47 $$
48 \begindc{\commdiag}[30]
49 \obj(10,15){$A$}
50 \obj(25,15){$B$}
51 \obj(40,15){$C$}
52 \mor(10,15)(25,15){$f$}
53 \mor(25,15)(40,15){$g$}
54 \cmor((10,11)(11,7)(15,6)(25,6)(35,6)(39,7)(40,11))
55 \pup(25,3){$g\circ f$}
56 \enddc
57 $$
58
59 The word commutative means that the result from going throught the
60 path $f$ plus $g$ is equal to the result from going throught the path
61 $g\circ f$. Most of the graphs used in Category Theory are digraphs which
62 we can specify in terms of its objects, and its arrows.
63
64 The (La)\TeX\ approach to typesetting can be characterized as
65 ``logical design''~\cite{Knuth86,Lamport94,Otten99}, but commutative
66 diagrams are pieces of ``visual design'', and that, in our opinion is
67 the {\em piece de resistance} of commutative diagrams package
68 implementation in (La)\TeX. In a commutative diagrams package a user
69 seeks the simplest notation, a logical notation, with the most
70 powerful graphical engine possible, the visual part. The DCpic
71 package, along with the package by John
72 Reynolds~\cite{Feruglio94,Reynolds87}, has the simplest notation off
73 all the commutative diagrams packages described in the Feruglio
74 article~\cite{Feruglio94}. In terms of graphical capabilities the
75 \PiCTeX~\cite{Wichura87} package provides us with the best
76 \TeX-graphics engine, that is, without going to {\em Postscript}
77 specials.
78
79 The DCpic package depends only of \PiCTeX\ and \TeX,
80 which means that you can use it in all formats that are based on these
81 two. We have tested DCpic with \LaTeX, \TeX\ plain, pdf\LaTeX,
82 pdf\TeX~\cite{Thanh99}, and Con\TeX t~\cite{Otten99}; we are confident
83 that it can be used under many other formats.
84
85 The present version (3.1) of DCpic package is available in CTAN and in
86 the author's Web-page\footnote{http://www.mat.uc.pt/{\~{}}pedro/LaTeX/}.
87
88
89 \section{Constructing Commutative Diagrams}
90
91 DCpic depends on \PiCTeX, thus you must include an apropriate command
92 to load \PiCTeX\ and DCpic in your document,
93 e.g. ``{\tt $\backslash$usepackage\{dcpic,pictex\}}'', in a \LaTeX\ document.
94
95 A commutative diagram in DCpic is a ``picture'' in \PiCTeX, in which
96 we place our {\em objects} and {\em morphisms} (arrows). The user's
97 commands in DCpic are: {\tt begindc} and {\tt enddc} which establishe
98 the coordinate system where the objects will by placed; {\tt obj}, the
99 command which defines the place and the contents of each object; {\tt
100 mor}, and {\tt cmor}, the commands which define the morphisms, linear
101 and curved arrows, and its labels.
102
103 Now we will describe each of these commands in greater detail.
104
105 \subsection{The Diagram Environment}
106
107 The command {\tt begindc}, establishes a Cartesian coordinate system
108 with 1pt units,
109
110 \begin{alltt}
111 \(\backslash\)begindc[{\em<magnification factor>}] \dots \(\backslash\)enddc
112 \end{alltt}
113 such a small unit gives us a good control over the placement of the
114 graphical objects, but in most of the diagrams not involving curved
115 arrows such a ``fine grain'' is not desirable, so the optional
116 argument specifies a magnifying factor $m\in\mathds{N}$, with a default
117 value of 30. The advantage of this decision is twofold: we can define
118 the ``grain'' of the diagram, and we can adjust the size of the
119 diagram to the available space.
120 \begin{itemize}
121 \item a ``course grain'' diagram is specified almost as a table, with
122 the numbers giving us the lines and the columns were the objects will
123 be placed, the following diagram has the default magnification factor:
124
125 \begin{center}
126 \begin{tabular}{cc}
127 \begindc{\commdiag}[300]
128 \obj(1,1){$A$}
129 \obj(3,1){$B$}
130 \obj(3,3){$C$}
131 \mor(1,1)(3,1){$f$}[\atright,\solidarrow]
132 \mor(1,1)(3,3){$g$}
133 \mor(3,1)(3,3){$h$}[\atright,\solidarrow]
134 \enddc &\tt
135 \begin{tabular}[b]{l}
136 $\backslash$begindc\{$\backslash$commdiag\}\\
137 $\backslash$obj(1,1)\{\$A\$\}\\
138 $\backslash$obj(3,1)\{\$B\$\}\\
139 $\backslash$obj(3,3)\{\$C\$\}\\
140 $\backslash$mor(1,1)(3,1)\{\$f\$\}[$\backslash$atright,$\backslash$solidarrow]\\
141 $\backslash$mor(1,1)(3,3)\{\$g\$\}\\
142 $\backslash$mor(3,1)(3,3)\{\$h\$\}[$\backslash$atright,$\backslash$solidarrow]\\
143 $\backslash$enddc
144 \end{tabular}
145 \end{tabular}
146 \end{center}
147 \item a ``fine grain'' diagram is a bit harder to design but it gives
148 us a better control over the objects placement, the following diagram
149 has a magnification factor of three, this gives us the capability of
150 drawing the arrows $f$ and $f^\prime$ very close together:
151 \begin{center}
152 \begin{tabular}{cc}
153 \begindc{\commdiag}[30]
154 \obj(10,10){$A$}
155 \obj(30,10){$B$}
156 \obj(30,30){$C$}
157 \mor(10,9)(30,9){$f$}[\atright,\solidarrow]
158 \mor(10,11)(30,11){$f^\prime$}
159 \mor(10,10)(30,30){$g$}
160 \mor(30,10)(30,30){$h$}[\atright,\solidarrow]
161 \enddc &\tt
162 \begin{tabular}[b]{l}
163 $\backslash$begindc\{$\backslash$commdiag\}[30]\\
164 $\backslash$obj(10,10)\{\$A\$\}\\
165 $\backslash$obj(30,10)\{\$B\$\}\\
166 $\backslash$obj(30,30)\{\$C\$\}\\
167 $\backslash$mor(10,9)(30,9)\{\$f\$\}[$\backslash$atright,$\backslash$solidarrow]\\
168 $\backslash$mor(10,11)(30,11)\{\$f{\^{}}$\backslash$prime\$\}\\
169 $\backslash$mor(10,10)(30,30)\{\$g\$\}\\
170 $\backslash$mor(30,10)(30,30)\{\$h\$\}[$\backslash$atright,$\backslash$solidarrow]\\
171 $\backslash$enddc
172 \end{tabular}
173 \end{tabular}
174 \end{center}
175 \item the magnification factor gives us the capability of adapting the
176 size of the diagram to the available space, without having to
177 redesign the diagram, for example the specification of the
178 next two diagrams differs only in the magnification factor: 30 for
179 the first; and 25 for the second.
180 \begin{center}
181 \begin{tabular}{cc}
182 \begindc{\commdiag}[300]
183 \obj(1,1){$A$}
184 \obj(3,1){$B$}
185 \obj(3,3){$C$}
186 \mor(1,1)(3,1){$f$}[\atright,\solidarrow]
187 \mor(1,1)(3,3){$g$}
188 \mor(3,1)(3,3){$h$}[\atright,\solidarrow]
189 \enddc &
190 \begindc{\commdiag}[250]
191 \obj(1,1){$A$}
192 \obj(3,1){$B$}
193 \obj(3,3){$C$}
194 \mor(1,1)(3,1){$f$}[\atright,\solidarrow]
195 \mor(1,1)(3,3){$g$}
196 \mor(3,1)(3,3){$h$}[\atright,\solidarrow]
197 \enddc
198 \end{tabular}
199 \end{center}
200 \end{itemize}
201
202 Note that the magnification factor does not interfere with the size of
203 the objects, but only with the size of the diagram as a whole.
204
205 After establishing our ``drawing board'' we can begin placing our
206 ``objects'' on it, we have three commands to do so, the {\tt obj},
207 {\tt mor}, and {\tt cmor}, for objects, morphisms, and ``curved''
208 morphisms respectively.
209
210
211 \subsection{Objects}
212
213 Each object has a place and a content
214
215 \begin{alltt}
216 \(\backslash\)obj({\em<x>},{\em<y>})\{{\em<contents>}\}
217 \end{alltt}
218 the $x$ and $y$, integer values, will be multiplied by the magnifying
219 factor. The {\em contents} will be put in the centre of an ``hbox''
220 expanding to both sides of $(m\times x,m\times y)$.
221
222
223 \subsection{Linear Arrows}
224
225
226 Each linear arrow will have as mandatory arguments two pairs of
227 coordinates, the beginning and the ending points, and a label,
228
229 {\small\begin{alltt}
230 \(\backslash\)mor({\em<x1>},{\em<y1>})({\em<x2>},{\em<y2>})[{\em<d1>},{\em<d2>}]\{{\em<label>}\}[{\em<label placement>},{\em<arrow type>}]
231 \end{alltt}}%
232 \noindent the other arguments are opcional. The two pairs of coordinates should
233 coincide with the coordinates of two objects in the diagram, but no
234 verification of this fact is made. The line connecting the two points
235 is constructed in the following way: the beginning is given by a point
236 10pt away from the point $(m\times x_1,m\times y_1)$, likewise the end point is
237 10 points away from $(m\times x_2,m\times y_2)$. If the ``arrow type'' specifies
238 that, a tail, and a pointer (arrow) will be added. If the arrow is
239 horizontal (vertical) the label is placed in a ``hbox'' with centre
240 point, $(x_l,y_l)$, at a distance of 10 points plus a correction
241 factor depending of the ``hbox'' width (height) from the middle point
242 of the arrow. If the arrow is obliquos the point $(x_l,y_l)$, at a
243 distance of 10 points from the middle point of the arrow, will be the
244 bottom-right corner or the top-left corner of the ``hbox'' containing
245 the label, depending of the angle of the arrow, and the label
246 placement. In all cases the position of the
247 ``hbox'' is such that the contents of it will not interfere with the
248 line.
249
250 The distance from the point $(m\times x_1,m\times y_1)$ to the actual beginning of the
251 arrow may be modified by the user with the specification of $d_1$, the
252 same thing happens for the arrow actual ending in which case the
253 user-value will be $d_2$. The specification of $d_1$ and $d_2$ is
254 optional.
255
256 The placement of the label, to the left (default value), or to the
257 right, and the type of the arrow: a solid arrow (default value), a
258 dashed arrow, a line, an injection arrow, or an application arrow, are
259 the last optional arguments of this command.
260
261
262 \subsection{Quadratic Arrows}
263
264 The command that draws curved lines in DCpic uses the {\tt
265 setquadratic} command of \PiCTeX, this will imply a quadratic
266 curve specified by an odd-number of points,
267
268 {\small\begin{alltt}
269 \(\backslash\)cmor({\em<list of points>}){\textvisiblespace}{\em<arrow direction>}({\em<x>},{\em<y>})\{{\em<label>}\}[{\em<arrow type>}]
270 \end{alltt}}
271 \noindent the space after the list of points is mandatory. After drawing the
272 curved line we must put the tip of the arrow on it, at present it is
273 only possible to choose from: up, down, left, or right pointing arrow,
274 and we must explicitly specify what type we want. The next thing to
275 draw it is the arrow label, the placement of that label is determined
276 by the $x$, and $y$ values which give us the coordinates, after being
277 magnified, of the centre of the ``hbox'' that will contain the label
278 itself.
279
280 The arrow type is an optional argument, its default value is a solid
281 arrow, the other possible values are a dashed arrow and a line, in
282 this last case the arrow tip is omitted. The arrow type values are a
283 subset of those of the {\tt mor} command.
284
285 A rectangular curve with rounded corners is easy to specify and should
286 cater for most needs, with this in mind we give the following tip to
287 the user: to specify a rectangular, with rounded corners, curve we
288 choose the points which give us the {\em expanded chess-horse
289 movement}, that is, $(x,y)$, $(x\pm4,y\mp1)$, $(x\mp1,y\pm4)$, or
290 $(x,y)$,$(x\pm1,y\mp4)$, $(x\mp4,y\pm1)$, those sets of points will give us
291 the four corners of the rectangle; to form the whole line it is only
292 necessary to add an odd number of points joining the two (or more)
293 corners.
294
295
296 \section{Examples}
297
298 We now present some examples that give an idea of the DCpic package
299 capabilities. We will present here the diagrams, and in the appendix
300 the code which produced such diagrams.
301
302 \subsection{The Easy Ones}
303
304 The diagrams presented in this section are very easy to specify in the
305 DCpic syntax, just a couple of objects and the arrows joining them.
306
307 \begin{description}
308 \item[Push-out and Exponentials:]
309
310
311 $$
312 \begindc{\commdiag}[260]
313 \obj(1,1){$Z$}
314 \obj(1,3){$X$}
315 \obj(3,1){$Y$}
316 \obj(3,3){$P$}
317 \obj(5,5){$P^\prime$}
318 \mor(1,1)(1,3){$f$}
319 \mor(1,1)(3,1){$g$}[\atright,\solidarrow]
320 \mor(1,3)(3,3){$r$}[\atright,\solidarrow]
321 \mor(3,1)(3,3){$s$}
322 \mor(1,3)(5,5){$r^\prime$}
323 \mor(3,1)(5,5){$s^\prime$}[\atright,\solidarrow]
324 \mor(3,3)(5,5){$h$}[\atright,\dashArrow]
325 \enddc
326 \qquad
327 \begindc{\commdiag}[350]
328 \obj(1,3)[A]{$Z^Y\times Y$}
329 \obj(3,3)[B]{$Z$}
330 \obj(3,1)[C]{$X\times{}Y$}
331 \obj(4,1)[D]{$X$}
332 \obj(4,3)[E]{$Z^Y$}
333 \mor{A}{B}{$ev$}
334 \mor{C}{A}{$f\times{}\mathrm{id}$}
335 \mor{C}{B}{$\overline{f}$}[\atright,\dashArrow]
336 \mor{D}{E}{$f$}[\atright,\solidarrow]
337 \enddc
338 $$
339
340 \item[Function Restriction and the {\em CafeOBJ\/}
341 Cube~\cite{Diaconescu98}]
342
343 %\footnotetext{R. Diaconescu and K. Futatsugi, The CafeOBJ Report,
344 %World Scientific, 1998}
345
346 $$
347 \begindc{\commdiag}[280]
348 \obj(1,1){$X$}
349 \obj(1,3){$X^\prime$}
350 \obj(4,1){$Y$}
351 \obj(4,3){$Y^\prime$}
352 \mor(1,1)(4,1){$f$}
353 \mor(1,3)(1,1){}[\atright,\injectionarrow]
354 \mor(4,3)(4,1){}[\atright,\injectionarrow]
355 \mor(1,3)(4,3){$g=f|^{Y^\prime}_{X^\prime}$}
356 \enddc
357 \qquad
358 \begindc{\commdiag}[170]
359 \obj(1,1){MSA}
360 \obj(5,1){RWL}
361 \obj(3,3){OSA}
362 \obj(7,3){OSRWL}
363 \obj(1,4){HSA}
364 \obj(5,4){HSRWL}
365 \obj(3,6){HOSA}
366 \obj(7,6){HOSRWL}
367 \mor{MSA}{RWL}{}
368 \mor{MSA}{HSA}{}
369 \mor{MSA}{OSA}{}
370 \mor{RWL}{HSRWL}{}
371 \mor{RWL}{OSRWL}{}
372 \mor{OSA}{HOSA}{}
373 \mor{OSA}{OSRWL}{}
374 \mor{OSRWL}{HOSRWL}{}
375 \mor{HSA}{HSRWL}{}
376 \mor{HSA}{HOSA}{}
377 \mor{HOSA}{HOSRWL}{}
378 \mor{HSRWL}{HOSRWL}{}
379 \enddc
380 $$
381 \end{description}
382
383 \subsection{The Not so Easy}
384
385 The diagrams presented in this section are a bit harder to specify. We
386 have curved arrows, and also double arrows. The construction of the
387 former was already explained. The double arrow (and triple, and \dots)
388 is made with two distinct arrows drawn close to each other in a
389 diagram with a very ``fine grain'', that is, using a magnifying factor
390 of just 2 or 3.
391
392 All the diagrams were made completely within DCpic.
393
394 \begin{description}
395 \item[Equaliser, and a 3-Category:]
396
397 $$
398 \begindc{\commdiag}[20]
399 \obj(1,1){$Z$}
400 \obj(1,36){$\overline{ X}$}
401 \obj(36,36){$X$}
402 \obj(52,36){$Y$}
403 \mor(1,1)(1,36){$\overline{ h}$}[\atleft,\dashArrow]
404 \mor(1,1)(36,36){$h$}[\atright,\solidarrow]
405 \mor(1,36)(36,36){$e$}
406 \mor(36,37)(52,37)[80,80]{$f$}
407 \mor(36,35)(52,35)[80,80]{$g$}[\atright,\solidarrow]
408 \enddc
409 \qquad
410 \begindc{\commdiag}[30]
411 \obj(14,11){$A$}
412 \obj(39,11){$C$}
413 \obj(26,35){$B$}
414 \mor(14,11)(39,11){$h$}[\atright,\solidarrow]
415 \mor(14,11)(26,35){$f$}
416 \mor(26,35)(39,11){$g$}
417 \cmor((11,10)(10,10)(9,10)(5,11)(4,15)(5,19)(9,20)(13,19)(14,15))
418 \pdown(1,20){$id_A$}
419 \cmor((42,10)(43,10)(44,10)(48,11)(49,15)(48,19)(44,20)(40,19)(39,15))
420 \pdown(52,20){$id_C$}
421 \cmor((26,39)(27,43)(31,44)(35,43)(36,39)(35,36)(31,35))
422 \pleft(40,40){$id_B$}
423 \enddc
424 $$
425
426
427 \item[Isomorfisms:]
428
429 $$
430 \begindc{\commdiag}[30]
431 \obj(10,15){$A$}
432 \obj(40,15){$A$}
433 \obj(25,15){$B$}
434 \mor(10,15)(25,15){$f$}
435 \mor(25,15)(40,15){$g$}
436 \cmor((10,11)(11,7)(15,6)(25,6)(35,6)(39,7)(40,11)) \pup(25,3){$id_A$}
437 \obj(55,15){$B$}
438 \obj(85,15){$B$}
439 \obj(70,15){$A$}
440 \mor(55,15)(70,15){$g$}
441 \mor(70,15)(85,15){$f$}
442 \cmor((55,11)(56,7)(60,6)(70,6)(80,6)(84,7)(85,11)) \pup(70,3){$id_B$}
443 \enddc
444 $$
445
446
447 \item[Godement's ``five'' rules~\cite{Herrlich73}:]
448 %\footnotetext{H. Herrlich and G. Strecker, Category Theory, Allyn and
449 %Bacon Inc, 1973}
450
451 $$
452 \begindc{\commdiag}[70]
453 \obj(12,10)[A]{$\mathcal{A}$}
454 \obj(19,10)[B]{$\mathcal{B}$}
455 \obj(26,10)[C]{$\mathcal{C}$}
456 \obj(34,10)[D]{$\mathcal{D}$}
457 \obj(41,10)[E]{$\mathcal{E}$}
458 \obj(48,10)[F]{$\mathcal{F}$}
459 \mor(12,10)(19,10){$L$}
460 \mor(19,10)(26,10){$K$}
461 \mor(26,10)(34,10){$V\qquad\ $}
462 \mor(26,12)(34,12){$U$}
463 \mor(26,12)(34,12){$\downarrow\xi$}[\atright,\solidarrow]
464 \mor(26,8)(34,8){$\downarrow\eta$}
465 \mor(26,8)(34,8){$W$}[\atright,\solidarrow]
466 \mor(34,11)(41,11){$F$}
467 \mor(34,9)(41,9){$\downarrow\mu$}
468 \mor(34,9)(41,9){$H$}[\atright,\solidarrow]
469 \mor(41,10)(48,10){$G$}
470 \enddc
471 $$
472 \end{description}
473
474 \subsection{The others \dots}
475
476 It was already stated that some kinds of arrows are not supported in
477 DCpic, e.g., $\Rightarrow$, but we can put a \PiCTeX\ command inside a DCpic
478 diagram, so we can produce a diagram like the one that we will show
479 now. Its complete specification within DCpic is not possible, at least
480 for the moment.
481
482 \begin{description}
483 \item[Lax coproduct~\cite{Abramsky92}]
484
485 $$
486 \begindc{\commdiag}[30]
487 \obj(10,50){$A$}
488 \obj(50,50){$A\oplus B$}
489 \obj(90,50){$B$}
490 \obj(50,10){$C$}
491 \obj(50,37){$[\sigma,\tau]$}
492 \mor(10,50)(50,10){$f$}[\atright,\solidarrow]
493 \mor(10,50)(50,50)[100,160]{$inl$}
494 \mor(90,50)(50,50)[100,160]{$inr$}[\atright,\solidarrow]
495 \mor(90,50)(50,10){$g$}
496 \cmor((480,460)(440,300)(480,140)) \pdown(40,40){}[\solidline]
497 \cmor((520,460)(560,300)(520,140)) \pdown(60,42){$[f,g]$}[\solidline]
498 \arrow <6pt> [.2,.4] from 143 44 to 144 42
499 \arrow <6pt> [.2,.4] from 157 44 to 156 42
500 \setlinear
501 % primeira implica{\c c}{\~a}o (simples)
502 \plot 160 100 141 91 /
503 \plot 160 104 140 94 /
504 \arrow <8pt> [.4,.8] from 137 91 to 135 90
505 % segunda implica{\c c}{\~a}o (quebrada)
506 \plot 123 66 168 90 /
507 \plot 122 69 168 94 /
508 \plot 168 90 203 90 /
509 \plot 168 94 203 94 /
510 \arrow <8pt> [.4,.8] from 207 92 to 208 92
511 \arrow <8pt> [.4,.8] from 120 66 to 118 65
512 \obj(39,27)[inlfg]{\small $inl_{f,g}$}
513 \obj(63,34)[inrfg]{\small $inr_{f,g}$}
514 % terceira implica{\c c}{\~a}o (quebrada)
515 \plot 132 55 136 60 /
516 \plot 132 59 136 64 /
517 \plot 136 60 173 60 /
518 \plot 136 64 173 64 /
519 \arrow <8pt> [.4,.8] from 178 62 to 179 62
520 \arrow <8pt> [.4,.8] from 130 55 to 129 54
521 \obj(45,17){$\sigma$}
522 \obj(50,18){$\tau$}
523 \enddc
524 $$
525 %\footnotetext{Handbook of Logic in Computer Science, Volume 1, Clarendon
526 %Press, Oxford, 1992, pg. 511}
527
528 \end{description}
529
530 \section{DCpic compared}
531
532 If one took the Feruglio article~\cite{Feruglio94} about typesetting
533 commutative diagrams in (La)\TeX\ we can say that:
534
535 \begin{itemize}
536 \item the graphical capabilities of DCpic are among the
537 best. Excluding packages which use Postscript specials the DCpic
538 package is the best among available packages.
539 \item the specification syntax is one of the simplest, the package by
540 John Reynolds has a very similar syntax.
541 \end{itemize}
542
543 We did not try to take any measure of computational performance.
544
545 The following diagram is one of the test-diagrams used by Feruglio, as
546 we can see DCpic performs very well, drawing the complete diagram
547 based on a very simple specification.
548
549 \newcommand{\barraA}{\vrule height2em width0em depth0em}
550 \newcommand{\barraB}{\vrule height1.6em width0em depth0em}
551
552 \centerline{
553 \begindc{\commdiag}[350]
554 \obj(1,1){$G$}
555 \obj(3,1){$G_{r^*}$}
556 \obj(5,1){$H$}
557 \obj(2,2){$\Sigma^G$}
558 \obj(6,2){$\Sigma^H$}
559 \obj(1,3){$L_m$}
560 \obj(3,3){$K_{r,m}$}
561 \obj(5,3){$R_{m^*}$}
562 \obj(1,5){$L$}
563 \obj(3,5){$L_r$}
564 \obj(5,5){$R$}
565 \obj(2,6){$\Sigma^L$}
566 \obj(6,6){$\Sigma^R$}
567 \mor(1,1)(2,2){$\lambda^G$}
568 \mor(3,1)(1,1){$i_5$}[\atleft,\aplicationarrow]
569 \mor(3,1)(5,1){$r^*$}[\atright,\solidarrow]
570 \mor(5,1)(6,2){$\lambda^H$}[\atright,\dashArrow]
571 \mor(2,2)(6,2){$\varphi^{r^*}$}[\atright,\solidarrow]
572 \mor(1,3)(1,1){$m$}[\atright,\solidarrow]
573 \mor(1,3)(1,5){$i_2$}[\atleft,\aplicationarrow]
574 \mor(3,3)(1,3)[140,100]{$i_3\quad$}[\atright,\aplicationarrow]
575 \mor(3,3)(5,3)[140,100]{$r$}
576 \mor(3,3)(3,5){$i_4$}[\atright,\aplicationarrow]
577 \mor(3,3)(3,1){$\stackrel{\displaystyle m}{\barraB}$}
578 \mor(5,3)(5,5){$i_6$}[\atright,\aplicationarrow]
579 \mor(5,3)(5,1){$\stackrel{\displaystyle m^*}{\barraA}$}
580 \mor(1,5)(2,6){$\lambda^L$}
581 \mor(3,5)(1,5){$i_1\quad$}[\atright,\aplicationarrow]
582 \mor(3,5)(5,5){$r$}
583 \mor(5,5)(6,6){$\lambda^R$}[\atright,\solidarrow]
584 \mor(2,6)(2,2){$\varphi^m$}[\atright,\solidarrow]
585 \mor(2,6)(6,6){$\varphi^r$}
586 \mor(6,6)(6,2){$\varphi^{m^*}$}
587 \enddc
588 }
589
590
591 \section{Conclusions}
592
593 We think that DCpic performs well in the ``commutative diagrams
594 arena'', it is easy to use, with its commands we can produce
595 the most usual types of commutative diagrams, and if we accept the use
596 of \PiCTeX\ commands, we are capable of producing any kind of
597 diagram. It is also a (La)\TeX -only package, that is, the file
598 produced by DCpic does not contain any Postscript special, neither
599 any special font, which in terms of portability is an advantage.
600
601 The author and his colleagues in the Mathematics Department of Coimbra
602 University have been using the (now) old version (2.1) of DCpic for
603 some time with much success, some of the missing capabilities of the
604 older version were incorporated in the new version (3.1), and the
605 missing capabilities of the new version will be taken care in future
606 versions.
607
608 %\bibliographystyle{plain}
609
610 %\bibliography{pedro}
611
612 \newcommand{\noopsort}[1]{} \newcommand{\singleletter}[1]{#1}
613 \begin{thebibliography}{10}
614
615 \bibitem{Abramsky92}
616 S.~Abramsky, Dov Gabbay, and T.~Maibaum, editors.
617 \newblock {\em Handbook of Logic in Computer Science}, volume~1 of {\em Oxford
618 Science Publications}.
619 \newblock Claredon Press, Oxford, 1992.
620
621 \bibitem{Diaconescu98}
622 R{\~a}zvan Diaconescu and Kokichi Futatsugi.
623 \newblock {\em CafeOBJ Report: The Language, Proof Techniques, and
624 Methodologies for Object-Oriented Algebraic Specification}, volume~6 of {\em
625 AMAST series in Computing}.
626 \newblock World Scientific, 1998.
627
628 \bibitem{Feruglio94}
629 {Gabriel Valiente} Feruglio.
630 \newblock Typesetting commutative diagrams.
631 \newblock {\em TUGboat}, 15(4):466--484, 1994.
632
633 \bibitem{Herrlich73}
634 Horst Herrlich and George Strecker.
635 \newblock {\em Category Theory}.
636 \newblock Allyn and Bacon Inc., 1973.
637
638 \bibitem{Knuth86}
639 Donald~E. Knuth.
640 \newblock {\em The TeXbook}.
641 \newblock Addison-Wesley Publishing Company, Reading,Massachusetts, 1986.
642
643 \bibitem{Lamport94}
644 Leslie Lamport.
645 \newblock {\em {\LaTeX}: A Document Preparation System}.
646 \newblock Addison-Wesley Publishing Company, Reading, Massachusetts, 2nd
647 edition, 1994.
648
649 \bibitem{MacLane71}
650 S.~MacLane.
651 \newblock {\em Categories for the Working Mathematician}.
652 \newblock Springer-Verlag, New York, 1971.
653
654 \bibitem{Otten99}
655 Ton Otten and Hans Hagen.
656 \newblock {\em Con\TeX t an excursion}.
657 \newblock Pragma ADE, Hasselt, 1999.
658
659 \bibitem{Pierce98}
660 Benjamin Pierce.
661 \newblock {\em Basic Category Theory for Computer Scientists}.
662 \newblock Foundations of Computing. The MIT Press, London, England, 1998.
663
664 \bibitem{Reynolds87}
665 John Reynolds.
666 \newblock {\em User's Manual for Diagram Macros}.
667 \newblock http://www.cs.cmu.edu/{\~{}}jcr/, 1987.
668 \newblock {\tt diagmac.doc}.
669
670 \bibitem{Thanh99}
671 {H\`{a}n Th{$\acute{\hat{\mathrm e}}$}} Th\`{a}nh, Sebastian Rahtz, and Hans
672 Hagen.
673 \newblock {\em The pdfTeX manual}, 1999.
674
675 \bibitem{Wichura87}
676 Michael Wichura.
677 \newblock {\em The {\PiCTeX} Manual}.
678 \newblock M. Pfeffer \& Co., New York, 1987.
679
680 \end{thebibliography}
681
682 \section{Appendix: The DCpic Specifications}
683
684 \begin{description}
685
686 \item[Push-out:] {\ }
687
688 {\footnotesize
689 \begin{verbatim}
690 \begindc{\commdiag}[260]
691 \obj(1,1){$Z$}
692 \obj(1,3){$X$}
693 \obj(3,1){$Y$}
694 \obj(3,3){$P$}
695 \obj(5,5){$P^\prime$}
696 \mor(1,1)(1,3){$f$}
697 \mor(1,1)(3,1){$g$}[\atright,\solidarrow]
698 \mor(1,3)(3,3){$r$}[\atright,\solidarrow]
699 \mor(3,1)(3,3){$s$}
700 \mor(1,3)(5,5){$r^\prime$}
701 \mor(3,1)(5,5){$s^\prime$}[\atright,\solidarrow]
702 \mor(3,3)(5,5){$h$}[\atright,\dashArrow]
703 \enddc
704 \end{verbatim}
705 }
706
707
708 \item[Exponentials:] {\ }
709
710 {\footnotesize
711 \begin{verbatim}
712 \begindc{\commdiag}[300]
713 \obj(1,3){$Z^Y\times Y$}
714 \obj(3,3){$Z$}
715 \obj(3,1){$X\times{}Y$}
716 \obj(4,1){$X$}
717 \obj(4,3){$Z^Y$}
718 \mor(1,3)(3,3)[20,10]{$ev$}
719 \mor(3,1)(1,3){$f\times{}\mathrm{id}$}
720 \mor(3,1)(3,3){$\overline{f}$}[\atright,\dashArrow]
721 \mor(4,1)(4,3){$f$}[\atright,\solidarrow]
722 \enddc
723 \end{verbatim}
724 }
725
726 \item[Function Restriction:] {\ }
727
728 {\footnotesize
729 \begin{verbatim}
730 \begindc{\commdiag}[280]
731 \obj(1,1){$X$}
732 \obj(1,3){$X^\prime$}
733 \obj(3,1){$Y$}
734 \obj(3,3){$Y^\prime$}
735 \mor(1,1)(3,1){$f$}
736 \mor(1,3)(1,1){}[\atright,\injectionarrow]
737 \mor(3,3)(3,1){}[\atright,\injectionarrow]
738 \mor(1,3)(3,3){$g=f|^{Y^\prime}_{X^\prime}$}
739 \enddc
740 \end{verbatim}
741 }
742
743 \item[{\em CafeOBJ\/} Cube:] {\ }
744
745 {\footnotesize
746 \begin{verbatim}
747 \begindc{\commdiag}[170]
748 \obj(1,1){MSA}
749 \obj(5,1){RWL}
750 \obj(3,3){OSA}
751 \obj(7,3){OSRWL}
752 \obj(1,4){HSA}
753 \obj(5,4){HSRWL}
754 \obj(3,6){HOSA}
755 \obj(7,6){HOSRWL}
756 \mor(1,1)(5,1)[15,15]{}
757 \mor(1,1)(1,4){}
758 \mor(1,1)(3,3){}
759 \mor(5,1)(5,4){}
760 \mor(5,1)(7,3){}
761 \mor(3,3)(3,6){}
762 \mor(3,3)(7,3)[15,22]{}
763 \mor(7,3)(7,6){}
764 \mor(1,4)(5,4)[15,22]{}
765 \mor(1,4)(3,6){}
766 \mor(3,6)(7,6)[17,26]{}
767 \mor(5,4)(7,6){}
768 \enddc
769 \end{verbatim}
770 }
771
772
773 \item[Equaliser:] {\ }
774
775 {\footnotesize
776 \begin{verbatim}
777 \begindc{\commdiag}[20]
778 \obj(1,1){$Z$}
779 \obj(1,36){$\overline{ X}$}
780 \obj(36,36){$X$}
781 \obj(52,36){$Y$}
782 \mor(1,1)(1,36){$\overline{ h}$}[\atleft,\dashArrow]
783 \mor(1,1)(36,36){$h$}[\atright,\solidarrow]
784 \mor(1,36)(36,36){$e$}
785 \mor(36,37)(52,37)[8,8]{$f$}
786 \mor(36,35)(52,35)[8,8]{$g$}[\atright,\solidarrow]
787 \enddc
788 \end{verbatim}
789 }
790
791
792 \item[A 3-Category:] {\ }
793
794 {\footnotesize
795 \begin{verbatim}
796 \begindc{\commdiag}[30]
797 \obj(14,11){$A$}
798 \obj(39,11){$C$}
799 \obj(26,35){$B$}
800 \mor(14,11)(39,11){$h$}[\atright,\solidarrow]
801 \mor(14,11)(26,35){$f$}
802 \mor(26,35)(39,11){$g$}
803 \cmor((11,10)(10,10)(9,10)(5,11)(4,15)(5,19)(9,20)(13,19)(14,15))
804 \pdown(1,20){$id_A$}
805 \cmor((42,10)(43,10)(44,10)(48,11)(49,15)(48,19)(44,20)(40,19)(39,15))
806 \pdown(52,20){$id_C$}
807 \cmor((26,39)(27,43)(31,44)(35,43)(36,39)(35,36)(31,35)) \pleft(40,40){$id_B$}
808 \enddc
809 \end{verbatim}
810 }
811
812 \item[Isomorfisms:] {\ }
813
814 {\footnotesize
815 \begin{verbatim}
816 \begindc{\commdiag}[30]
817 \obj(10,15){$A$}
818 \obj(40,15){$A$}
819 \obj(25,15){$B$}
820 \mor(10,15)(25,15){$f$}
821 \mor(25,15)(40,15){$g$}
822 \cmor((10,11)(11,7)(15,6)(25,6)(35,6)(39,7)(40,11)) \pup(25,3){$id_A$}
823 \obj(55,15){$B$}
824 \obj(85,15){$B$}
825 \obj(70,15){$A$}
826 \mor(55,15)(70,15){$g$}
827 \mor(70,15)(85,15){$f$}
828 \cmor((55,11)(56,7)(60,6)(70,6)(80,6)(84,7)(85,11)) \pup(70,3){$id_B$}
829 \enddc
830 \end{verbatim}
831 }
832
833
834
835 \item[Godement's ``five'' rules:] {\ }
836
837 {\footnotesize
838 \begin{verbatim}
839 \begindc{\commdiag}[70]
840 \obj(12,10){$\mathcal{A}$}
841 \obj(19,10){$\mathcal{B}$}
842 \obj(26,10){$\mathcal{C}$}
843 \obj(34,10){$\mathcal{D}$}
844 \obj(41,10){$\mathcal{E}$}
845 \obj(48,10){$\mathcal{F}$}
846 \mor(12,10)(19,10){$L$}
847 \mor(19,10)(26,10){$K$}
848 \mor(26,10)(34,10){$V\qquad\ $}
849 \mor(26,12)(34,12){$U$}
850 \mor(26,12)(34,12){$\downarrow\xi$}[\atright,\solidarrow]
851 \mor(26,8)(34,8){$\downarrow\eta$}
852 \mor(26,8)(34,8){$W$}[\atright,\solidarrow]
853 \mor(34,11)(41,11){$F$}
854 \mor(34,9)(41,9){$\downarrow\mu$}
855 \mor(34,9)(41,9){$H$}[\atright,\solidarrow]
856 \mor(41,10)(48,10){$G$}
857 \enddc
858 \end{verbatim}
859 }
860
861 \item[Lax coproduct:] Guess how.
862
863 \item[DCpic and the others:] {\ }
864
865 {\footnotesize
866 \begin{verbatim}
867
868 \begindc{\commdiag}[350]
869 \obj(1,1){$G$}
870 \obj(3,1){$G_{r^*}$}
871 \obj(5,1){$H$}
872 \obj(2,2){$\Sigma^G$}
873 \obj(6,2){$\Sigma^H$}
874 \obj(1,3){$L_m$}
875 \obj(3,3){$K_{r,m}$}
876 \obj(5,3){$R_{m^*}$}
877 \obj(1,5){$L$}
878 \obj(3,5){$L_r$}
879 \obj(5,5){$R$}
880 \obj(2,6){$\Sigma^L$}
881 \obj(6,6){$\Sigma^R$}
882 \mor(1,1)(2,2){$\lambda^G$}
883 \mor(3,1)(1,1){$i_5$}[\atleft,\aplicationarrow]
884 \mor(3,1)(5,1){$r^*$}[\atright,\solidarrow]
885 \mor(5,1)(6,2){$\lambda^H$}[\atright,\dashArrow]
886 \mor(2,2)(6,2){$\varphi^{r^*}$}[\atright,\solidarrow]
887 \mor(1,3)(1,1){$m$}[\atright,\solidarrow]
888 \mor(1,3)(1,5){$i_2$}[\atleft,\aplicationarrow]
889 \mor(3,3)(1,3)[140,100]{$i_3\quad$}[\atright,\aplicationarrow]
890 \mor(3,3)(5,3)[140,100]{$r$}
891 \mor(3,3)(3,5){$i_4$}[\atright,\aplicationarrow]
892 \mor(3,3)(3,1){$\stackrel{\displaystyle m}{\barraB}$}
893 \mor(5,3)(5,5){$i_6$}[\atright,\aplicationarrow]
894 \mor(5,3)(5,1){$\stackrel{\displaystyle m^*}{\barraA}$}
895 \mor(1,5)(2,6){$\lambda^L$}
896 \mor(3,5)(1,5){$i_1\quad$}[\atright,\aplicationarrow]
897 \mor(3,5)(5,5){$r$}
898 \mor(5,5)(6,6){$\lambda^R$}[\atright,\solidarrow]
899 \mor(2,6)(2,2){$\varphi^m$}[\atright,\solidarrow]
900 \mor(2,6)(6,6){$\varphi^r$}
901 \mor(6,6)(6,2){$\varphi^{m^*}$}
902 \enddc
903 \end{verbatim}
904 }
905
906 \end{description}
907
908
909 \end{document}
910
911
912
913 %%% Local Variables:
914 %%% mode: latex
915 %%% TeX-master: t
916 %%% End: