~ubuntu-branches/debian/wheezy/texlive-extra/wheezy

« back to all changes in this revision

Viewing changes to texmf-dist/tex/latex/barr/diagram.tex

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2009-02-11 01:03:48 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090211010348-k24xg2kidg7g5aks
Tags: 2007.dfsg.16-1
blacklist barr (diagram.tex), nocommercial license (Closes: #514742)
(RC->medium)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%  This should appear in a file named diagram.tex
2
 
%         Copyright 1988,1989 Michael Barr
3
 
%         Department of Mathematics and Statistics
4
 
%         McGill University
5
 
%         805 Sherbrooke St., W
6
 
%         Montreal, Quebec, Canada
7
 
%         H3P 1S4
8
 
%
9
 
%         barr@triples.math.mcgill.ca
10
 
%
11
 
%         All commercial rights reserved.  May be freely distributed
12
 
%         and used with the following exceptions:
13
 
%         1. No commercial use without explicit permission.
14
 
%         2. It may not be used by any employee of a telephone
15
 
%         company.
16
 
%         3. It may not be distributed without this notice.
17
 
%
18
 
%         Last revised 91-05-04
19
 
 
20
 
% Ascii character test:
21
 
%  32:     33: !   34: "   35: #   36: $   37: %   38: &   39: '
22
 
%  40: (   41: )   42: *   43: +   44: ,   45: -   46: .   47: /
23
 
%  48: 0   49: 1   50: 2   51: 3   52: 4   53: 5   54: 6   55: 7
24
 
%  56: 8   57: 9   58: :   59: ;   60: <   61: =   62: >   63: ?
25
 
%  64: @   65: A   66: B   67: C   68: D   69: E   70: F   71: G
26
 
%  72: H   73: I   74: J   75: K   76: L   77: M   78: N   79: O
27
 
%  80: P   81: Q   82: R   83: S   84: T   85: U   86: V   87: W
28
 
%  88: X   89: Y   90: Z   91: [   92: \   93: ]   94: ^   95: _
29
 
%  96: `   97: a   98: b   99: c  100: d  101: e  102: f  103: g
30
 
% 104: h  105: i  106: j  107: k  108: l  109: m  110: n  111: o
31
 
% 112: p  113: q  114: r  115: s  116: t  117: u  118: v  119: w
32
 
% 120: x  121: y  122: z  123: {  124: |  125: }  126: ~
33
 
 
34
 
 
35
 
\makeatletter
36
 
 
37
 
\def\diagram{\m@th\leftwidth=\z@ \rightwidth=\z@ \topheight=\z@
38
 
\botheight=\z@ \setbox\@picbox\hbox\bgroup}
39
 
 
40
 
\def\enddiagram{\egroup\wd\@picbox\rightwidth\unitlength
41
 
\ht\@picbox\topheight\unitlength \dp\@picbox\botheight\unitlength
42
 
\hskip\leftwidth\unitlength\box\@picbox}
43
 
 
44
 
\def\bfig{\begin{diagram}}
45
 
\def\efig{\end{diagram}}
46
 
\newcount\wideness \newcount\leftwidth \newcount\rightwidth
47
 
\newcount\highness \newcount\topheight \newcount\botheight
48
 
 
49
 
\def\ratchet#1#2{\ifnum#1<#2 \global #1=#2 \fi}
50
 
 
51
 
\def\putbox(#1,#2)#3{%
52
 
\horsize{\wideness}{#3} \divide\wideness by 2
53
 
{\advance\wideness by #1 \ratchet{\rightwidth}{\wideness}}
54
 
{\advance\wideness by -#1 \ratchet{\leftwidth}{\wideness}}
55
 
\vertsize{\highness}{#3} \divide\highness by 2
56
 
{\advance\highness by #2 \ratchet{\topheight}{\highness}}
57
 
{\advance\highness by -#2 \ratchet{\botheight}{\highness}}
58
 
\put(#1,#2){\makebox(0,0){$#3$}}}
59
 
 
60
 
\def\putlbox(#1,#2)#3{%
61
 
\horsize{\wideness}{#3}
62
 
{\advance\wideness by #1 \ratchet{\rightwidth}{\wideness}}
63
 
{\ratchet{\leftwidth}{-#1}}
64
 
\vertsize{\highness}{#3} \divide\highness by 2
65
 
{\advance\highness by #2 \ratchet{\topheight}{\highness}}
66
 
{\advance\highness by -#2 \ratchet{\botheight}{\highness}}
67
 
\put(#1,#2){\makebox(0,0)[l]{$#3$}}}
68
 
 
69
 
\def\putrbox(#1,#2)#3{%
70
 
\horsize{\wideness}{#3}
71
 
{\ratchet{\rightwidth}{#1}}
72
 
{\advance\wideness by -#1 \ratchet{\leftwidth}{\wideness}}
73
 
\vertsize{\highness}{#3} \divide\highness by 2
74
 
{\advance\highness by #2 \ratchet{\topheight}{\highness}}
75
 
{\advance\highness by -#2 \ratchet{\botheight}{\highness}}
76
 
\put(#1,#2){\makebox(0,0)[r]{$#3$}}}
77
 
 
78
 
 
79
 
\def\adjust[#1]{} % For compatibility
80
 
 
81
 
\newcount \coefa
82
 
\newcount \coefb
83
 
\newcount \coefc
84
 
\newcount\tempcounta
85
 
\newcount\tempcountb
86
 
\newcount\tempcountc
87
 
\newcount\tempcountd
88
 
\newcount\xext
89
 
\newcount\yext
90
 
\newcount\xoff
91
 
\newcount\yoff
92
 
\newcount\gap%
93
 
\newcount\arrowtypea
94
 
\newcount\arrowtypeb
95
 
\newcount\arrowtypec
96
 
\newcount\arrowtyped
97
 
\newcount\arrowtypee
98
 
\newcount\height
99
 
\newcount\width
100
 
\newcount\xpos
101
 
\newcount\ypos
102
 
\newcount\run
103
 
\newcount\rise
104
 
\newcount\arrowlength
105
 
\newcount\halflength
106
 
\newcount\arrowtype
107
 
\newdimen\tempdimen
108
 
\newdimen\xlen
109
 
\newdimen\ylen
110
 
\newsavebox{\tempboxa}%
111
 
\newsavebox{\tempboxb}%
112
 
\newsavebox{\tempboxc}%
113
 
 
114
 
\newdimen\w@dth
115
 
 
116
 
\def\setw@dth#1#2{\setbox\z@\hbox{\m@th$#1$}\w@dth=\wd\z@
117
 
\setbox\@ne\hbox{\m@th$#2$}\ifnum\w@dth<\wd\@ne \w@dth=\wd\@ne \fi
118
 
\advance\w@dth by 1.2em}
119
 
 
120
 
%The definitions below look more elaborate than they need to be.
121
 
%The reason is that an empty asscript will still cause extra vertical
122
 
%spacing and the only way to avoid ugly extra space seems to be using
123
 
%some such method as this.
124
 
 
125
 
\def\t@^#1_#2{\allowbreak\def\n@one{#1}\def\n@two{#2}\mathrel
126
 
{\setw@dth{#1}{#2}
127
 
\mathop{\hbox to \w@dth{\rightarrowfill}}\limits
128
 
\ifx\n@one\empty\else ^{\box\z@}\fi
129
 
\ifx\n@two\empty\else _{\box\@ne}\fi}}
130
 
%\def\t@^#1_#2{\mathrel{\mathop{\hbox{\rightarrowfill}}\limits
131
 
%^{\mkern12mu#1\mkern12mu}_{\mkern12mu#2\mkern12mu}}}
132
 
\def\t@@^#1{\@ifnextchar_{\t@^{#1}}{\t@^{#1}_{}}}
133
 
\def\to{\@ifnextchar^{\t@@}{\t@@^{}}}
134
 
 
135
 
\def\t@left^#1_#2{\def\n@one{#1}\def\n@two{#2}\mathrel{\setw@dth{#1}{#2}
136
 
\mathop{\hbox to \w@dth{\leftarrowfill}}\limits
137
 
\ifx\n@one\empty\else ^{\box\z@}\fi
138
 
\ifx\n@two\empty\else _{\box\@ne}\fi}}
139
 
%\def\t@left^#1_#2{\mathrel{\mathop{\hbox{\leftarrowfill}}\limits
140
 
%^{\mkern12mu#1\mkern12mu}_{\mkern12mu#2\mkern12mu}}}
141
 
\def\t@@left^#1{\@ifnextchar_{\t@left^{#1}}{\t@left^{#1}_{}}}
142
 
\def\toleft{\@ifnextchar^{\t@@left}{\t@@left^{}}}
143
 
 
144
 
\def\two@^#1_#2{\allowbreak
145
 
\def\n@one{#1}\def\n@two{#2}\mathrel{\setw@dth{#1}{#2}
146
 
\mathop{\vcenter{\lineskip\z@\baselineskip\z@
147
 
                 \hbox to \w@dth{\rightarrowfill}%
148
 
                 \hbox to \w@dth{\rightarrowfill}}%
149
 
       }\limits
150
 
\ifx\n@one\empty\else ^{\box\z@}\fi
151
 
\ifx\n@two\empty\else _{\box\@ne}\fi}}
152
 
\def\tw@@^#1{\@ifnextchar _{\two@^{#1}}{\two@^{#1}_{}}}
153
 
\def\two{\@ifnextchar ^{\tw@@}{\tw@@^{}}}
154
 
 
155
 
\def\tofr@^#1_#2{\def\n@one{#1}\def\n@two{#2}\mathrel{\setw@dth{#1}{#2}
156
 
\mathop{\vcenter{\hbox to \w@dth{\rightarrowfill}\kern-1.7ex
157
 
                 \hbox to \w@dth{\leftarrowfill}}%
158
 
       }\limits
159
 
\ifx\n@one\empty\else ^{\box\z@}\fi
160
 
\ifx\n@two\empty\else _{\box\@ne}\fi}}
161
 
\def\t@fr@^#1{\@ifnextchar_ {\tofr@^{#1}}{\tofr@^{#1}_{}}}
162
 
\def\tofro{\@ifnextchar^ {\t@fr@}{\t@fr@^{}}}
163
 
 
164
 
\def\epi{\mathop{\mathchar"221\mkern -12mu\mathchar"221}\limits}
165
 
\def\leftepi{\mathop{\mathchar"220\mkern -12mu\mathchar"220}\limits}
166
 
\def\mon{\mathop{\m@th\hbox to
167
 
      14.6\P@{\lasyb\char'51\hskip-2.1\P@$\arrext$\hss
168
 
$\mathord\rightarrow$}}\limits} % width of \epi
169
 
\def\leftmono{\mathrel{\m@th\hbox to
170
 
14.6\P@{$\mathord\leftarrow$\hss$\arrext$\hskip-2.1\P@\lasyb\char'50%
171
 
}}\limits} % width of \epi
172
 
\mathchardef\arrext="0200       % amr minus for arrow extension (see \into)
173
 
 
174
 
 
175
 
\setlength{\unitlength}{.01em}%
176
 
\def\settypes(#1,#2,#3){\arrowtypea#1 \arrowtypeb#2 \arrowtypec#3}
177
 
\def\settoheight#1#2{\setbox\@tempboxa\hbox{#2}#1\ht\@tempboxa\relax}%
178
 
\def\settodepth#1#2{\setbox\@tempboxa\hbox{#2}#1\dp\@tempboxa\relax}%
179
 
\def\settokens`#1`#2`#3`#4`{%
180
 
     \def\tokena{#1}\def\tokenb{#2}\def\tokenc{#3}\def\tokend{#4}}
181
 
\def\setsqparms[#1`#2`#3`#4;#5`#6]{%
182
 
\arrowtypea #1
183
 
\arrowtypeb #2
184
 
\arrowtypec #3
185
 
\arrowtyped #4
186
 
\width #5
187
 
\height #6
188
 
}
189
 
\def\setpos(#1,#2){\xpos=#1 \ypos#2}
190
 
 
191
 
 
192
 
 
193
 
\def\settriparms[#1`#2`#3;#4]{\settripairparms[#1`#2`#3`1`1;#4]}%
194
 
 
195
 
\def\settripairparms[#1`#2`#3`#4`#5;#6]{%
196
 
\arrowtypea #1
197
 
\arrowtypeb #2
198
 
\arrowtypec #3
199
 
\arrowtyped #4
200
 
\arrowtypee #5
201
 
\width #6
202
 
\height #6
203
 
}
204
 
 
205
 
\def\resetparms{\settripairparms[1`1`1`1`1;500]\width 500}%default values%
206
 
 
207
 
\resetparms
208
 
 
209
 
\def\mvector(#1,#2)#3{%%
210
 
\put(0,0){\vector(#1,#2){#3}}%
211
 
\put(0,0){\vector(#1,#2){26}}%
212
 
}
213
 
\def\evector(#1,#2)#3{{%%
214
 
\arrowlength #3
215
 
\put(0,0){\vector(#1,#2){\arrowlength}}%
216
 
\advance \arrowlength by-30
217
 
\put(0,0){\vector(#1,#2){\arrowlength}}%
218
 
}}
219
 
 
220
 
\def\horsize#1#2{%
221
 
\settowidth{\tempdimen}{$#2$}%
222
 
#1=\tempdimen
223
 
\divide #1 by\unitlength
224
 
}
225
 
 
226
 
\def\vertsize#1#2{%
227
 
\settoheight{\tempdimen}{$#2$}%
228
 
#1=\tempdimen
229
 
\settodepth{\tempdimen}{$#2$}%
230
 
\advance #1 by\tempdimen
231
 
\divide #1 by\unitlength
232
 
}
233
 
 
234
 
\def\putvector(#1,#2)(#3,#4)#5#6{{%
235
 
\ifnum3<\arrowtype
236
 
\putdashvector(#1,#2)(#3,#4)#5\arrowtype
237
 
\else
238
 
\ifnum\arrowtype<-3
239
 
\putdashvector(#1,#2)(#3,#4)#5\arrowtype
240
 
\else
241
 
\xpos=#1
242
 
\ypos=#2
243
 
\run=#3
244
 
\rise=#4
245
 
\arrowlength=#5
246
 
\ifnum \arrowtype<0
247
 
    \ifnum \run=0
248
 
        \advance \ypos by-\arrowlength
249
 
    \else
250
 
        \tempcounta \arrowlength
251
 
        \multiply \tempcounta by\rise
252
 
        \divide \tempcounta by\run
253
 
        \ifnum\run>0
254
 
            \advance \xpos by\arrowlength
255
 
            \advance \ypos by\tempcounta
256
 
        \else
257
 
            \advance \xpos by-\arrowlength
258
 
            \advance \ypos by-\tempcounta
259
 
        \fi
260
 
    \fi
261
 
    \multiply \arrowtype by-1
262
 
    \multiply \rise by-1
263
 
    \multiply \run by-1
264
 
\fi
265
 
\ifcase \arrowtype
266
 
\or \put(\xpos,\ypos){\vector(\run,\rise){\arrowlength}}%
267
 
\or \put(\xpos,\ypos){\mvector(\run,\rise)\arrowlength}%
268
 
\or \put(\xpos,\ypos){\evector(\run,\rise){\arrowlength}}%
269
 
\fi\fi\fi
270
 
}}
271
 
 
272
 
\def\putsplitvector(#1,#2)#3#4{%%
273
 
\xpos #1
274
 
\ypos #2
275
 
\arrowtype #4
276
 
\halflength #3
277
 
\arrowlength #3
278
 
\gap 140
279
 
\advance \halflength by-\gap
280
 
\divide \halflength by2
281
 
\ifnum\arrowtype>0
282
 
   \ifcase \arrowtype
283
 
   \or \put(\xpos,\ypos){\line(0,-1){\halflength}}%
284
 
       \advance\ypos by-\halflength
285
 
       \advance\ypos by-\gap
286
 
       \put(\xpos,\ypos){\vector(0,-1){\halflength}}%
287
 
   \or \put(\xpos,\ypos){\line(0,-1)\halflength}%
288
 
       \put(\xpos,\ypos){\vector(0,-1)3}%
289
 
       \advance\ypos by-\halflength
290
 
       \advance\ypos by-\gap
291
 
       \put(\xpos,\ypos){\vector(0,-1){\halflength}}%
292
 
   \or \put(\xpos,\ypos){\line(0,-1)\halflength}%
293
 
       \advance\ypos by-\halflength
294
 
       \advance\ypos by-\gap
295
 
       \put(\xpos,\ypos){\evector(0,-1){\halflength}}%
296
 
   \fi
297
 
\else \arrowtype=-\arrowtype
298
 
   \ifcase\arrowtype
299
 
   \or \advance \ypos by-\arrowlength
300
 
       \put(\xpos,\ypos){\line(0,1){\halflength}}%
301
 
       \advance\ypos by\halflength
302
 
       \advance\ypos by\gap
303
 
       \put(\xpos,\ypos){\vector(0,1){\halflength}}%
304
 
   \or \advance \ypos by-\arrowlength
305
 
       \put(\xpos,\ypos){\line(0,1)\halflength}%
306
 
       \put(\xpos,\ypos){\vector(0,1)3}%
307
 
       \advance\ypos by\halflength
308
 
       \advance\ypos by\gap
309
 
       \put(\xpos,\ypos){\vector(0,1){\halflength}}%
310
 
   \or \advance \ypos by-\arrowlength
311
 
       \put(\xpos,\ypos){\line(0,1)\halflength}%
312
 
       \advance\ypos by\halflength
313
 
       \advance\ypos by\gap
314
 
       \put(\xpos,\ypos){\evector(0,1){\halflength}}%
315
 
   \fi
316
 
\fi
317
 
}
318
 
 
319
 
\def\putmorphism(#1)(#2,#3)[#4`#5`#6]#7#8#9{{%
320
 
\run #2
321
 
\rise #3
322
 
\ifnum\rise=0
323
 
  \puthmorphism(#1)[#4`#5`#6]{#7}{#8}#9%
324
 
\else\ifnum\run=0
325
 
  \putvmorphism(#1)[#4`#5`#6]{#7}{#8}#9%
326
 
\else
327
 
\setpos(#1)%
328
 
\arrowlength #7
329
 
\arrowtype #8
330
 
\ifnum\run=0
331
 
\else\ifnum\rise=0
332
 
\else
333
 
\ifnum\run>0
334
 
    \coefa=1
335
 
\else
336
 
   \coefa=-1
337
 
\fi
338
 
\ifnum\arrowtype>0
339
 
   \coefb=0
340
 
   \coefc=-1
341
 
\else
342
 
   \coefb=\coefa
343
 
   \coefc=1
344
 
   \arrowtype=-\arrowtype
345
 
\fi
346
 
\width=2
347
 
\multiply \width by\run
348
 
\divide \width by\rise
349
 
\ifnum \width<0  \width=-\width\fi
350
 
\advance\width by60
351
 
\if l#9 \width=-\width\fi
352
 
\putbox(\xpos,\ypos){#4}%            %node 1
353
 
{\multiply \coefa by\arrowlength%      %node 2
354
 
\advance\xpos by\coefa
355
 
\multiply \coefa by\rise
356
 
\divide \coefa by\run
357
 
\advance \ypos by\coefa
358
 
\putbox(\xpos,\ypos){#5} }%
359
 
{\multiply \coefa by\arrowlength%      %label
360
 
\divide \coefa by2
361
 
\advance \xpos by\coefa
362
 
\advance \xpos by\width
363
 
\multiply \coefa by\rise
364
 
\divide \coefa by\run
365
 
\advance \ypos by\coefa
366
 
\if l#9%
367
 
   \putrbox(\xpos,\ypos){#6}%
368
 
\else\if r#9%
369
 
   \putlbox(\xpos,\ypos){#6}%
370
 
\fi\fi }%
371
 
{\multiply \rise by-\coefc%             %arrow
372
 
\multiply \run by-\coefc
373
 
\multiply \coefb by\arrowlength
374
 
\advance \xpos by\coefb
375
 
\multiply \coefb by\rise
376
 
\divide \coefb by\run
377
 
\advance \ypos by\coefb
378
 
\multiply \coefc by70
379
 
\advance \ypos by\coefc
380
 
\multiply \coefc by\run
381
 
\divide \coefc by\rise
382
 
\advance \xpos by\coefc
383
 
\multiply \coefa by140
384
 
\multiply \coefa by\run
385
 
\divide \coefa by\rise
386
 
\advance \arrowlength by\coefa
387
 
\ifcase\arrowtype
388
 
\or \put(\xpos,\ypos){\vector(\run,\rise){\arrowlength}}%
389
 
\or \put(\xpos,\ypos){\mvector(\run,\rise){\arrowlength}}%
390
 
\or \put(\xpos,\ypos){\evector(\run,\rise){\arrowlength}}%
391
 
\fi}\fi\fi\fi\fi}}
392
 
 
393
 
 
394
 
\newcount\numbdashes \newcount\lengthdash \newcount\increment
395
 
 
396
 
\def\howmanydashes{% Actually returns both number and length
397
 
\numbdashes=\arrowlength \lengthdash=40
398
 
\divide\numbdashes by \lengthdash
399
 
\lengthdash=\arrowlength
400
 
\divide\lengthdash by \numbdashes
401
 
%This futzing around is to minimize round-off error.
402
 
\increment=\lengthdash
403
 
\multiply\lengthdash by 3
404
 
\divide\lengthdash by 5
405
 
}
406
 
 
407
 
\def\putdashvector(#1)(#2,#3)#4#5{%
408
 
\ifnum#3=0 \putdashhvector(#1){#4}#5
409
 
\else
410
 
\ifnum#2=0
411
 
\putdashvvector(#1){#4}#5\fi\fi}
412
 
 
413
 
\def\putdashhvector(#1,#2)#3#4{{%
414
 
\arrowlength=#3 \howmanydashes
415
 
\multiput(#1,#2)(\increment,0){\numbdashes}%
416
 
{\vrule height .4pt width \lengthdash\unitlength}
417
 
\arrowtype=#4 \xpos=#1
418
 
\ifnum\arrowtype<0 \advance\arrowtype by 7 \fi
419
 
\ifcase\arrowtype
420
 
\or \advance\xpos by 10
421
 
    \put(\xpos,#2){\vector(-1,0){\lengthdash}}
422
 
    \advance\xpos by 40
423
 
    \put(\xpos,#2){\vector(-1,0){\lengthdash}}
424
 
\or \advance \xpos by 10
425
 
    \put(\xpos,#2){\vector(-1,0){\lengthdash}}
426
 
    \advance\xpos by  \arrowlength
427
 
    \advance\xpos by  -50
428
 
    \put(\xpos,#2){\vector(-1,0){\lengthdash}}
429
 
\or \advance\xpos by 10
430
 
    \put(\xpos,#2){\vector(-1,0){\lengthdash}}
431
 
\or \advance\xpos by \arrowlength
432
 
    \advance\xpos by -\lengthdash
433
 
    \put(\xpos,#2){\vector(1,0){\lengthdash}}
434
 
\or {\advance\xpos by 10
435
 
    \put(\xpos,#2){\vector(1,0){\lengthdash}}}
436
 
    \advance\xpos by \arrowlength
437
 
    \advance\xpos by -\lengthdash
438
 
    \put(\xpos,#2){\vector(1,0){\lengthdash}}
439
 
\or \advance\xpos by \arrowlength
440
 
    \advance\xpos by -\lengthdash
441
 
    \put(\xpos,#2){\vector(1,0){\lengthdash}}
442
 
    \advance\xpos by -40
443
 
    \put(\xpos,#2){\vector(1,0){\lengthdash}}
444
 
   \fi
445
 
}}
446
 
 
447
 
\def\putdashvvector(#1,#2)#3#4{{%
448
 
\arrowlength=#3 \howmanydashes
449
 
\ypos=#2 \advance\ypos by -\arrowlength
450
 
\multiput(#1,#2)(0,\increment){\numbdashes}%
451
 
    {\vrule width .4pt height \lengthdash\unitlength}
452
 
\arrowtype=#4 \ypos=#2
453
 
\ifnum\arrowtype<0 \advance\arrowtype by 7 \fi
454
 
\ifcase\arrowtype
455
 
\or \advance\ypos by \arrowlength \advance\ypos by -40
456
 
    \put(#1,\ypos){\vector(0,1){\lengthdash}}
457
 
    \advance\ypos by -40
458
 
    \put(#1,\ypos){\vector(0,1){\lengthdash}}
459
 
\or \advance\ypos by 10
460
 
    \put(#1,\ypos){\vector(0,1){\lengthdash}}
461
 
    \advance\ypos by \arrowlength \advance\ypos by -40
462
 
    \put(#1,\ypos){\vector(0,1){\lengthdash}}
463
 
\or \advance\ypos by \arrowlength \advance\ypos by -40
464
 
    \put(#1,\ypos){\vector(0,1){\lengthdash}}
465
 
\or \advance\ypos by 10
466
 
    \put(#1,\ypos){\vector(0,-1){\lengthdash}}
467
 
\or \advance\ypos by 10
468
 
    \put(#1,\ypos){\vector(0,-1){\lengthdash}}
469
 
    \advance\ypos by \arrowlength \advance\ypos by -40
470
 
    \put(#1,\ypos){\vector(0,-1){\lengthdash}}
471
 
\or \advance\ypos by 10
472
 
    \put(#1,\ypos){\vector(0,-1){\lengthdash}}
473
 
    \advance\ypos by 40
474
 
    \put(#1,\ypos){\vector(0,-1){\lengthdash}}
475
 
\fi
476
 
}}
477
 
 
478
 
\def\puthmorphism(#1,#2)[#3`#4`#5]#6#7#8{{%
479
 
\xpos #1
480
 
\ypos #2
481
 
\width #6
482
 
\arrowlength #6
483
 
\arrowtype=#7
484
 
\putbox(\xpos,\ypos){#3\vphantom{#4}}%
485
 
{\advance \xpos by\arrowlength
486
 
\putbox(\xpos,\ypos){\vphantom{#3}#4}}%
487
 
\horsize{\tempcounta}{#3}%
488
 
\horsize{\tempcountb}{#4}%
489
 
\divide \tempcounta by2
490
 
\divide \tempcountb by2
491
 
\advance \tempcounta by30
492
 
\advance \tempcountb by30
493
 
\advance \xpos by\tempcounta
494
 
\advance \arrowlength by-\tempcounta
495
 
\advance \arrowlength by-\tempcountb
496
 
\putvector(\xpos,\ypos)(1,0)\arrowlength\arrowtype
497
 
\divide \arrowlength by2
498
 
\advance \xpos by\arrowlength
499
 
\vertsize{\tempcounta}{#5}%
500
 
\divide\tempcounta by2
501
 
\advance \tempcounta by20
502
 
\if a#8 %
503
 
   \advance \ypos by\tempcounta
504
 
   \putbox(\xpos,\ypos){#5}%
505
 
\else
506
 
   \advance \ypos by-\tempcounta
507
 
   \putbox(\xpos,\ypos){#5}%
508
 
\fi}}
509
 
 
510
 
\def\putvmorphism(#1,#2)[#3`#4`#5]#6#7#8{{%
511
 
\xpos #1
512
 
\ypos #2
513
 
\arrowlength #6
514
 
\arrowtype #7
515
 
\settowidth{\xlen}{$#5$}%
516
 
\putbox(\xpos,\ypos){#3}%
517
 
{\advance \ypos by-\arrowlength
518
 
\putbox(\xpos,\ypos){#4}}%
519
 
{\advance\arrowlength by-140
520
 
\advance \ypos by-70
521
 
\ifdim\xlen>0pt
522
 
   \if m#8%
523
 
      \putsplitvector(\xpos,\ypos)\arrowlength\arrowtype
524
 
   \else
525
 
   \putvector(\xpos,\ypos)(0,-1)\arrowlength\arrowtype
526
 
   \fi
527
 
\else
528
 
   \putvector(\xpos,\ypos)(0,-1)\arrowlength\arrowtype
529
 
\fi}%
530
 
\ifdim\xlen>0pt
531
 
   \divide \arrowlength by2
532
 
   \advance\ypos by-\arrowlength
533
 
   \if l#8%
534
 
      \advance \xpos by-40
535
 
      \putrbox(\xpos,\ypos){#5}%
536
 
   \else\if r#8%
537
 
      \advance \xpos by40
538
 
      \putlbox(\xpos,\ypos){#5}%
539
 
   \else
540
 
      \putbox(\xpos,\ypos){#5}%
541
 
   \fi\fi
542
 
\fi
543
 
}}
544
 
 
545
 
\def\putsquarep<#1>(#2)[#3;#4`#5`#6`#7]{{%
546
 
\setsqparms[#1]%
547
 
\setpos(#2)%
548
 
\settokens`#3`%
549
 
\puthmorphism(\xpos,\ypos)[\tokenc`\tokend`{#7}]{\width}{\arrowtyped}b%
550
 
\advance\ypos by \height
551
 
\puthmorphism(\xpos,\ypos)[\tokena`\tokenb`{#4}]{\width}{\arrowtypea}a%
552
 
\putvmorphism(\xpos,\ypos)[``{#5}]{\height}{\arrowtypeb}l%
553
 
\advance\xpos by \width
554
 
\putvmorphism(\xpos,\ypos)[``{#6}]{\height}{\arrowtypec}r%
555
 
}}
556
 
 
557
 
\def\putsquare{\@ifnextchar <{\putsquarep}{\putsquarep%
558
 
   <\arrowtypea`\arrowtypeb`\arrowtypec`\arrowtyped;\width`\height>}}
559
 
\def\square{\@ifnextchar< {\squarep}{\squarep
560
 
   <\arrowtypea`\arrowtypeb`\arrowtypec`\arrowtyped;\width`\height>}}
561
 
                                                   %         #6
562
 
\def\squarep<#1>[#2`#3`#4`#5;#6`#7`#8`#9]{{%       %     #2------>#3
563
 
\setsqparms[#1]%                                   %      |       |
564
 
\diagram%                                          %      |       |
565
 
\putsquarep<\arrowtypea`\arrowtypeb`\arrowtypec`%  %    #7|       |#8
566
 
\arrowtyped;\width`\height>%                       %      |       |
567
 
(0,0)[#2`#3`#4`{#5};#6`#7`#8`{#9}]%                %      |       |
568
 
\enddiagram%                                       %      v       v
569
 
}}                                                 %     #4------>#5
570
 
                                                   %         #9
571
 
\def\putptrianglep<#1>(#2,#3)[#4`#5`#6;#7`#8`#9]{{%
572
 
\settriparms[#1]%
573
 
\xpos=#2 \ypos=#3
574
 
\advance\ypos by \height
575
 
\puthmorphism(\xpos,\ypos)[#4`#5`{#7}]{\height}{\arrowtypea}a%
576
 
\putvmorphism(\xpos,\ypos)[`#6`{#8}]{\height}{\arrowtypeb}l%
577
 
\advance\xpos by\height
578
 
\putmorphism(\xpos,\ypos)(-1,-1)[``{#9}]{\height}{\arrowtypec}r%
579
 
}}
580
 
 
581
 
\def\putptriangle{\@ifnextchar <{\putptrianglep}{\putptrianglep
582
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
583
 
\def\ptriangle{\@ifnextchar <{\ptrianglep}{\ptrianglep
584
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
585
 
                                              %          #5
586
 
\def\ptrianglep<#1>[#2`#3`#4;#5`#6`#7]{{%%    %      #2----->#3
587
 
\settriparms[#1]%                             %      |      /
588
 
\diagram%                                     %      |     /
589
 
\putptrianglep<\arrowtypea`\arrowtypeb`%      %    #6|    /#7
590
 
\arrowtypec;\height>%                         %      |   /
591
 
(0,0)[#2`#3`#4;#5`#6`{#7}]%                   %      |  /
592
 
\enddiagram%%                                 %      v v
593
 
}}                                            %      #4
594
 
 
595
 
\def\putqtrianglep<#1>(#2,#3)[#4`#5`#6;#7`#8`#9]{{%
596
 
\settriparms[#1]%
597
 
\xpos=#2 \ypos=#3
598
 
\advance\ypos by\height
599
 
\puthmorphism(\xpos,\ypos)[#4`#5`{#7}]{\height}{\arrowtypea}a%
600
 
\putmorphism(\xpos,\ypos)(1,-1)[``{#8}]{\height}{\arrowtypeb}l%
601
 
\advance\xpos by\height
602
 
\putvmorphism(\xpos,\ypos)[`#6`{#9}]{\height}{\arrowtypec}r%
603
 
}}
604
 
 
605
 
\def\putqtriangle{\@ifnextchar <{\putqtrianglep}{\putqtrianglep
606
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
607
 
\def\qtriangle{\@ifnextchar <{\qtrianglep}{\qtrianglep
608
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
609
 
                                              %           #5
610
 
\def\qtrianglep<#1>[#2`#3`#4;#5`#6`#7]{{%%    %        #2----->#3
611
 
\settriparms[#1]%                             %         \      |
612
 
\width=\height                                %          \     |
613
 
\diagram%                                     %         #6\    |#7
614
 
\putqtrianglep<\arrowtypea`\arrowtypeb`%      %            \   |
615
 
\arrowtypec;\height>%                         %             \  |
616
 
(0,0)[#2`#3`#4;#5`#6`{#7}]%                   %              v v
617
 
\enddiagram%%                                 %               #4
618
 
}}
619
 
 
620
 
\def\putdtrianglep<#1>(#2,#3)[#4`#5`#6;#7`#8`#9]{{%
621
 
\settriparms[#1]%
622
 
\xpos=#2 \ypos=#3
623
 
\puthmorphism(\xpos,\ypos)[#5`#6`{#9}]{\height}{\arrowtypec}b%
624
 
\advance\xpos by \height \advance\ypos by\height
625
 
\putmorphism(\xpos,\ypos)(-1,-1)[``{#7}]{\height}{\arrowtypea}l%
626
 
\putvmorphism(\xpos,\ypos)[#4``{#8}]{\height}{\arrowtypeb}r%
627
 
}}
628
 
 
629
 
\def\putdtriangle{\@ifnextchar <{\putdtrianglep}{\putdtrianglep
630
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
631
 
\def\dtriangle{\@ifnextchar <{\dtrianglep}{\dtrianglep
632
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
633
 
                                              %                   #2
634
 
\def\dtrianglep<#1>[#2`#3`#4;#5`#6`#7]{{%%    %                  / |
635
 
\settriparms[#1]%                             %                 /  |
636
 
\width=\height                                %              #5/   |#6
637
 
\diagram%                                     %               /    |
638
 
\putdtrianglep<\arrowtypea`\arrowtypeb`%      %              /     |
639
 
\arrowtypec;\height>%                         %             v      v
640
 
(0,0)[#2`#3`#4;#5`#6`{#7}]%                   %            #3----->#4
641
 
\enddiagram%%                                 %                #7
642
 
}}
643
 
 
644
 
\def\putbtrianglep<#1>(#2,#3)[#4`#5`#6;#7`#8`#9]{{%
645
 
\settriparms[#1]%
646
 
\xpos=#2 \ypos=#3
647
 
\puthmorphism(\xpos,\ypos)[#5`#6`{#9}]{\height}{\arrowtypec}b%
648
 
\advance\ypos by\height
649
 
\putmorphism(\xpos,\ypos)(1,-1)[``{#8}]{\height}{\arrowtypeb}r%
650
 
\putvmorphism(\xpos,\ypos)[#4``{#7}]{\height}{\arrowtypea}l%
651
 
}}
652
 
 
653
 
\def\putbtriangle{\@ifnextchar <{\putbtrianglep}{\putbtrianglep
654
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
655
 
\def\btriangle{\@ifnextchar <{\btrianglep}{\btrianglep
656
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
657
 
                                             %              #2
658
 
\def\btrianglep<#1>[#2`#3`#4;#5`#6`#7]{{%%   %              | \
659
 
\settriparms[#1]%                            %              |  \
660
 
\width=\height                               %            #5|   \#6
661
 
\diagram%                                    %              |    \
662
 
\putbtrianglep<\arrowtypea`\arrowtypeb`%     %              |     \
663
 
\arrowtypec;\height>%                        %              v      v
664
 
(0,0)[#2`#3`#4;#5`#6`{#7}]%                  %              #3----->#4
665
 
\enddiagram%%                                %                 #7
666
 
}}
667
 
 
668
 
\def\putAtrianglep<#1>(#2,#3)[#4`#5`#6;#7`#8`#9]{{%
669
 
\settriparms[#1]%
670
 
\xpos=#2 \ypos=#3
671
 
{\multiply \height by2
672
 
\puthmorphism(\xpos,\ypos)[#5`#6`{#9}]{\height}{\arrowtypec}b}%
673
 
\advance\xpos by\height \advance\ypos by\height
674
 
\putmorphism(\xpos,\ypos)(-1,-1)[#4``{#7}]{\height}{\arrowtypea}l%
675
 
\putmorphism(\xpos,\ypos)(1,-1)[``{#8}]{\height}{\arrowtypeb}r%
676
 
}}
677
 
 
678
 
\def\putAtriangle{\@ifnextchar <{\putAtrianglep}{\putAtrianglep
679
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
680
 
\def\Atriangle{\@ifnextchar <{\Atrianglep}{\Atrianglep
681
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
682
 
                                                   %           #2
683
 
\def\Atrianglep<#1>[#2`#3`#4;#5`#6`#7]{{%%         %         /   \
684
 
\settriparms[#1]%                                  %        /     \
685
 
\width=\height                                     %     #5/       \#6
686
 
\diagram%                                          %      /         \
687
 
\putAtrianglep<\arrowtypea`\arrowtypeb`%           %     /           \
688
 
\arrowtypec;\height>%                              %    v             v
689
 
(0,0)[#2`#3`#4;#5`#6`{#7}]%                        %   #3------------>#4
690
 
\enddiagram%%                                      %          #7
691
 
}}
692
 
 
693
 
\def\putAtrianglepairp<#1>(#2)[#3;#4`#5`#6`#7`#8]{{%
694
 
\settripairparms[#1]%
695
 
\setpos(#2)%
696
 
\settokens`#3`%
697
 
\puthmorphism(\xpos,\ypos)[\tokenb`\tokenc`{#7}]{\height}{\arrowtyped}b%
698
 
\advance\xpos by\height
699
 
\puthmorphism(\xpos,\ypos)[\phantom{\tokenc}`\tokend`{#8}]%
700
 
{\height}{\arrowtypee}b%
701
 
\advance\ypos by\height
702
 
\putmorphism(\xpos,\ypos)(-1,-1)[\tokena``{#4}]{\height}{\arrowtypea}l%
703
 
\putvmorphism(\xpos,\ypos)[``{#5}]{\height}{\arrowtypeb}m%
704
 
\putmorphism(\xpos,\ypos)(1,-1)[``{#6}]{\height}{\arrowtypec}r%
705
 
}}
706
 
 
707
 
\def\putAtrianglepair{\@ifnextchar <{\putAtrianglepairp}{\putAtrianglepairp%
708
 
   <\arrowtypea`\arrowtypeb`\arrowtypec`\arrowtyped`\arrowtypee;\height>}}
709
 
\def\Atrianglepair{\@ifnextchar <{\Atrianglepairp}{\Atrianglepairp%
710
 
   <\arrowtypea`\arrowtypeb`\arrowtypec`\arrowtyped`\arrowtypee;\height>}}
711
 
 
712
 
\def\Atrianglepairp<#1>[#2;#3`#4`#5`#6`#7]{{%           %  #2a
713
 
\settripairparms[#1]%                         %           / | \
714
 
\settokens`#2`%                               %          /  |  \
715
 
\width=\height                                %       #3/  #4   \#5
716
 
\diagram%                                     %        /    |    \
717
 
\putAtrianglepairp                            %       /     |     \
718
 
<\arrowtypea`\arrowtypeb`\arrowtypec`%        %      v      v      v
719
 
\arrowtyped`\arrowtypee;\height>%             %     #2b---->#2c---->#2d
720
 
(0,0)[{#2};#3`#4`#5`#6`{#7}]%                 %         #6     #7
721
 
\enddiagram%%
722
 
}}
723
 
 
724
 
\def\putVtrianglep<#1>(#2,#3)[#4`#5`#6;#7`#8`#9]{{%
725
 
\settriparms[#1]%
726
 
\xpos=#2 \ypos=#3
727
 
\advance\ypos by\height
728
 
{\multiply\height by2
729
 
\puthmorphism(\xpos,\ypos)[#4`#5`{#7}]{\height}{\arrowtypea}a}%
730
 
\putmorphism(\xpos,\ypos)(1,-1)[`#6`{#8}]{\height}{\arrowtypeb}l%
731
 
\advance\xpos by\height
732
 
\advance\xpos by\height
733
 
\putmorphism(\xpos,\ypos)(-1,-1)[``{#9}]{\height}{\arrowtypec}r%
734
 
}}
735
 
 
736
 
\def\putVtriangle{\@ifnextchar <{\putVtrianglep}{\putVtrianglep
737
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
738
 
\def\Vtriangle{\@ifnextchar <{\Vtrianglep}{\Vtrianglep
739
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
740
 
                                               %               #5
741
 
\def\Vtrianglep<#1>[#2`#3`#4;#5`#6`#7]{{%%     %        #2------------->#3
742
 
\settriparms[#1]%                              %         \             /
743
 
\width=\height                                 %          \           /
744
 
\diagram%                                      %         #6\         /#7
745
 
\putVtrianglep<\arrowtypea`\arrowtypeb`%       %            \       /
746
 
\arrowtypec;\height>%                          %             \     /
747
 
(0,0)[#2`#3`#4;#5`#6`{#7}]%                    %              v   v
748
 
\enddiagram%%                                  %               #4
749
 
}}
750
 
 
751
 
\def\putVtrianglepairp<#1>(#2)[#3;#4`#5`#6`#7`#8]{{
752
 
\settripairparms[#1]%
753
 
\setpos(#2)%
754
 
\settokens`#3`%
755
 
\advance\ypos by\height
756
 
\putmorphism(\xpos,\ypos)(1,-1)[`\tokend`{#6}]{\height}{\arrowtypec}l%
757
 
\puthmorphism(\xpos,\ypos)[\tokena`\tokenb`{#4}]{\height}{\arrowtypea}a%
758
 
\advance\xpos by\height
759
 
\puthmorphism(\xpos,\ypos)[\phantom{\tokenb}`\tokenc`{#5}]%
760
 
{\height}{\arrowtypeb}a%
761
 
\putvmorphism(\xpos,\ypos)[``{#7}]{\height}{\arrowtyped}m%
762
 
\advance\xpos by\height
763
 
\putmorphism(\xpos,\ypos)(-1,-1)[``{#8}]{\height}{\arrowtypee}r%
764
 
}}
765
 
 
766
 
\def\putVtrianglepair{\@ifnextchar <{\putVtrianglepairp}{\putVtrianglepairp%
767
 
    <\arrowtypea`\arrowtypeb`\arrowtypec`\arrowtyped`\arrowtypee;\height>}}
768
 
\def\Vtrianglepair{\@ifnextchar <{\Vtrianglepairp}{\Vtrianglepairp%
769
 
    <\arrowtypea`\arrowtypeb`\arrowtypec`\arrowtyped`\arrowtypee;\height>}}
770
 
                                               %     #3      #4
771
 
\def\Vtrianglepairp<#1>[#2;#3`#4`#5`#6`#7]{{%  %  #2a---->#2b---->#2c
772
 
\settripairparms[#1]%                          %   \      |      /
773
 
\settokens`#2`%                                %    \     |     /
774
 
\diagram%                                      %   #5\   #6    /#7
775
 
\putVtrianglepairp                             %      \   |   /
776
 
<\arrowtypea`\arrowtypeb`\arrowtypec`%         %       \  |  /
777
 
\arrowtyped`\arrowtypee;\height>%              %        v v v
778
 
(0,0)[{#2};#3`#4`#5`#6`{#7}]%                  %         #2d
779
 
\enddiagram%%
780
 
}}
781
 
 
782
 
 
783
 
\def\putCtrianglep<#1>(#2,#3)[#4`#5`#6;#7`#8`#9]{{%
784
 
\settriparms[#1]%
785
 
\xpos=#2 \ypos=#3
786
 
\advance\ypos by\height
787
 
\putmorphism(\xpos,\ypos)(1,-1)[``{#9}]{\height}{\arrowtypec}l%
788
 
\advance\xpos by\height
789
 
\advance\ypos by\height
790
 
\putmorphism(\xpos,\ypos)(-1,-1)[#4`#5`{#7}]{\height}{\arrowtypea}l%
791
 
{\multiply\height by 2
792
 
\putvmorphism(\xpos,\ypos)[`#6`{#8}]{\height}{\arrowtypeb}r}%
793
 
}}
794
 
 
795
 
\def\putCtriangle{\@ifnextchar <{\putCtrianglep}{\putCtrianglep
796
 
    <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
797
 
\def\Ctriangle{\@ifnextchar <{\Ctrianglep}{\Ctrianglep
798
 
    <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
799
 
                                             %                 #2
800
 
\def\Ctrianglep<#1>[#2`#3`#4;#5`#6`#7]{{%%   %                / |
801
 
\settriparms[#1]%                            %             #5/  |
802
 
\width=\height                               %              /   |
803
 
\diagram%                                    %             v    |
804
 
\putCtrianglep<\arrowtypea`\arrowtypeb`%     %           #3     |#6
805
 
\arrowtypec;\height>%                        %             \    |
806
 
(0,0)[#2`#3`#4;#5`#6`{#7}]%                  %            #7\   |
807
 
\enddiagram%%                                %               \  |
808
 
}}                                           %                v v
809
 
                                             %                 #4
810
 
\def\putDtrianglep<#1>(#2,#3)[#4`#5`#6;#7`#8`#9]{{%
811
 
\settriparms[#1]%
812
 
\xpos=#2 \ypos=#3
813
 
\advance\xpos by\height \advance\ypos by\height
814
 
\putmorphism(\xpos,\ypos)(-1,-1)[``{#9}]{\height}{\arrowtypec}r%
815
 
\advance\xpos by-\height \advance\ypos by\height
816
 
\putmorphism(\xpos,\ypos)(1,-1)[`#5`{#8}]{\height}{\arrowtypeb}r%
817
 
{\multiply\height by 2
818
 
\putvmorphism(\xpos,\ypos)[#4`#6`{#7}]{\height}{\arrowtypea}l}%
819
 
}}
820
 
 
821
 
\def\putDtriangle{\@ifnextchar <{\putDtrianglep}{\putDtrianglep
822
 
    <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
823
 
\def\Dtriangle{\@ifnextchar <{\Dtrianglep}{\Dtrianglep
824
 
   <\arrowtypea`\arrowtypeb`\arrowtypec;\height>}}
825
 
                                            %          #2
826
 
\def\Dtrianglep<#1>[#2`#3`#4;#5`#6`#7]{{%%  %          | \
827
 
\settriparms[#1]%                           %          |  \#6
828
 
\width=\height                              %          |   \
829
 
\diagram%                                   %          |    v
830
 
\putDtrianglep<\arrowtypea`\arrowtypeb`%    %        #5|    #3
831
 
\arrowtypec;\height>%                       %          |    /
832
 
(0,0)[#2`#3`#4;#5`#6`{#7}]%                 %          |   /#7
833
 
\enddiagram%%                               %          |  /
834
 
}}                                          %          v v
835
 
                                            %          #4
836
 
\def\setrecparms[#1`#2]{\width=#1 \height=#2}%
837
 
%              #4
838
 
%        #3b<-------#3a x #3b
839
 
%       ^ |             |
840
 
%      /  |             |
841
 
%   #5/   |             |
842
 
%    /    |             |
843
 
%   /     |             |
844
 
%  /      |             |
845
 
% #3c     |#6           |#3a x #5
846
 
%  \      |             |
847
 
%   \     |             |
848
 
%  #8\    |             |
849
 
%     \   |             |
850
 
%      \  |             |
851
 
%       v v             v
852
 
%        #3d<-------#3a x #3d
853
 
%              #8
854
 
 
855
 
\def\recursep<#1`#2>[#3;#4`#5`#6`#7`#8]{{\m@th
856
 
\width=#1 \height=#2
857
 
\settokens`#3`
858
 
\settowidth{\tempdimen}{$\tokena$}
859
 
\ifdim\tempdimen=0pt
860
 
  \savebox{\tempboxa}{\hbox{$\tokenb$}}%
861
 
  \savebox{\tempboxb}{\hbox{$\tokend$}}%
862
 
  \savebox{\tempboxc}{\hbox{$#6$}}%
863
 
\else
864
 
  \savebox{\tempboxa}{\hbox{$\hbox{$\tokena$}\times\hbox{$\tokenb$}$}}%
865
 
  \savebox{\tempboxb}{\hbox{$\hbox{$\tokena$}\times\hbox{$\tokend$}$}}%
866
 
  \savebox{\tempboxc}{\hbox{$\hbox{$\tokena$}\times\hbox{$#6$}$}}%
867
 
\fi
868
 
\ypos=\height
869
 
\divide\ypos by 2
870
 
\xpos=\ypos
871
 
\advance\xpos by \width
872
 
\bfig
873
 
\putCtrianglep<-1`1`1;\ypos>(0,0)[`\tokenc`;#5`#6`{#7}]%
874
 
\puthmorphism(\ypos,0)[\tokend`\usebox{\tempboxb}`{#8}]{\width}{-1}b%
875
 
\puthmorphism(\ypos,\height)[\tokenb`\usebox{\tempboxa}`{#4}]{\width}{-1}a%
876
 
\advance\ypos by \width
877
 
\putvmorphism(\ypos,\height)[``\usebox{\tempboxc}]{\height}1r%
878
 
\efig
879
 
}}
880
 
 
881
 
\def\recurse{\@ifnextchar <{\recursep}{\recursep<\width`\height>}}
882
 
 
883
 
\def\puttwohmorphisms(#1,#2)[#3`#4;#5`#6]#7#8#9{{%
884
 
% 1 and 2 are position, 3 and 4 are the nodes, 5 and 6 the labels,
885
 
% 7 the distance between node centers and 8 & 9 are the arrow types.
886
 
%         #5
887
 
% #3 ===========> #4
888
 
%         #6
889
 
%
890
 
\puthmorphism(#1,#2)[#3`#4`]{#7}0a
891
 
\ypos=#2
892
 
\advance\ypos by 20
893
 
\puthmorphism(#1,\ypos)[\phantom{#3}`\phantom{#4}`#5]{#7}{#8}a
894
 
\advance\ypos by -40
895
 
\puthmorphism(#1,\ypos)[\phantom{#3}`\phantom{#4}`#6]{#7}{#9}b
896
 
}}
897
 
 
898
 
\def\puttwovmorphisms(#1,#2)[#3`#4;#5`#6]#7#8#9{{%
899
 
% 1 and 2 are position, 3 and 4 are the nodes, 5 and 6 the labels,
900
 
% 7 the distance between node centers and 8 & 9 are the arrow types.
901
 
%
902
 
%              #3
903
 
%              ||
904
 
%              ||
905
 
%           #5 || #6
906
 
%              ||
907
 
%              ||
908
 
%              vv
909
 
%              #4
910
 
%
911
 
\putvmorphism(#1,#2)[#3`#4`]{#7}0a
912
 
\xpos=#1
913
 
\advance\xpos by -20
914
 
\putvmorphism(\xpos,#2)[\phantom{#3}`\phantom{#4}`#5]{#7}{#8}l
915
 
\advance\xpos by 40
916
 
\putvmorphism(\xpos,#2)[\phantom{#3}`\phantom{#4}`#6]{#7}{#9}r
917
 
}}
918
 
 
919
 
\def\puthcoequalizer(#1)[#2`#3`#4;#5`#6`#7]#8#9{{%
920
 
% #1 is (\xpos,\ypos), the next 6 are the nodes and arrow labels
921
 
% #8 is the distance between each pair of nodes and #9 is the pos of #7
922
 
% either a (above) or b (below)
923
 
%         #5            #7
924
 
% #2 ===========> #3 --------> #4
925
 
%         #6
926
 
%
927
 
\setpos(#1)%
928
 
\puttwohmorphisms(\xpos,\ypos)[#2`#3;#5`#6]{#8}11%
929
 
\advance\xpos by #8
930
 
\puthmorphism(\xpos,\ypos)[\phantom{#3}`#4`#7]{#8}1{#9}
931
 
}}
932
 
 
933
 
\def\putvcoequalizer(#1)[#2`#3`#4;#5`#6`#7]#8#9{{%
934
 
% #1 is (\xpos,\ypos), the next 6 are the nodes and arrow labels
935
 
% #8 is the distance between each pair of nodes and #9 is the pos of #7
936
 
% either l (left) or r (right)
937
 
%
938
 
%              #2
939
 
%              | |
940
 
%              | |
941
 
%           #5 | | #6
942
 
%              | |
943
 
%              | |
944
 
%              v v
945
 
%              #3
946
 
%               |
947
 
%               |
948
 
%            #7 |
949
 
%               |
950
 
%               v
951
 
%              #4
952
 
%
953
 
\setpos(#1)%
954
 
\puttwovmorphisms(\xpos,\ypos)[#2`#3;#5`#6]{#8}11%
955
 
\advance\ypos by -#8
956
 
\putvmorphism(\xpos,\ypos)[\phantom{#3}`#4`#7]{#8}1{#9}
957
 
}}
958
 
 
959
 
\def\putthreehmorphisms(#1)[#2`#3;#4`#5`#6]#7(#8)#9{{%
960
 
% Use: \putthreehmorphisms(xpos,ypos)[lnode`rnode;toplabel`midlabel%
961
 
% botlabel]{distance}(toparrowtype,midarrowtype,botarrowtype){position}
962
 
\setpos(#1) \settypes(#8)
963
 
\if a#9 %
964
 
     \vertsize{\tempcounta}{#5}%
965
 
     \vertsize{\tempcountb}{#6}%
966
 
     \ifnum \tempcounta<\tempcountb \tempcounta=\tempcountb \fi
967
 
\else
968
 
     \vertsize{\tempcounta}{#4}%
969
 
     \vertsize{\tempcountb}{#5}%
970
 
     \ifnum \tempcounta<\tempcountb \tempcounta=\tempcountb \fi
971
 
\fi
972
 
\advance \tempcounta by 60
973
 
\puthmorphism(\xpos,\ypos)[#2`#3`#5]{#7}{\arrowtypeb}{#9}
974
 
\advance\ypos by \tempcounta
975
 
\puthmorphism(\xpos,\ypos)[\phantom{#2}`\phantom{#3}`#4]{#7}{\arrowtypea}{#9}
976
 
\advance\ypos by -\tempcounta \advance\ypos by -\tempcounta
977
 
\puthmorphism(\xpos,\ypos)[\phantom{#2}`\phantom{#3}`#6]{#7}{\arrowtypec}{#9}
978
 
}}
979
 
 
980
 
\def\setarrowtoks[#1`#2`#3`#4`#5`#6]{%
981
 
\def\toka{#1}
982
 
\def\tokb{#2}
983
 
\def\tokc{#3}
984
 
\def\tokd{#4}
985
 
\def\toke{#5}
986
 
\def\tokf{#6}
987
 
}
988
 
\def\hex{\@ifnextchar <{\hexp}{\hexp<1000`400>}}
989
 
\def\hexp<#1`#2>[#3`#4`#5`#6`#7`#8;#9]{%
990
 
\setarrowtoks[#9]
991
 
\yext=#2 \advance \yext by #2
992
 
\xext=#1 \advance\xext by \yext
993
 
\bfig
994
 
\putCtriangle<-1`0`1;#2>(0,0)[`#5`;\tokb``\tokd]
995
 
\xext=#1 \yext=#2 \advance \yext by #2
996
 
\putsquare<1`0`0`1;\xext`\yext>(#2,0)[#3`#4`#7`#8;\toka```\tokf]
997
 
\advance \xext by #2
998
 
\putDtriangle<0`1`-1;#2>(\xext,0)[`#6`;`\tokc`\toke]
999
 
\efig
1000
 
}
1001
 
%\def\doublecomplex[#1`#2`#3`#4`#5`#6`#7`#8`#9]{%
1002
 
%\bfig
1003
 
%\putsquare<0`0`1`1;500`500>(0,1700)[`\vdots`\cdots`{#1};```]
1004
 
%\puthmorphism(500,1700)[\ph{#1}`\cdots`]{500}1a
1005
 
%\puthmorphism(1000,1700)[\ph{\cdots}`\ph{#2}`]{500}1a
1006
 
%\putsquare<0`1`1`1;700`500>(1500,1700)[\vdots`\vdots`{#2}`{#3};```]
1007
 
%\puthmorphism(2200,1700)[\ph{#3}`0`]{500}1a
1008
 
%\putvmorphism(500,1700)[`\vdots`]{400}1a \putvmorphism(500,1300)[``]{400}1a
1009
 
%\putvmorphism(1500,1700)[`\vdots`]{400}1a \putvmorphism(1500,1300)[``]{400}1a
1010
 
%\putvmorphism(2200,1700)[`\vdots`]{400}1a \putvmorphism(2200,1300)[``]{400}1a
1011
 
%\putsquare<1`0`1`1;500`500>(0,400)[\cdots`{#4}`\cdots`{#7};```]
1012
 
%\puthmorphism(500,900)[\ph{#1}`\cdots`]{500}1a
1013
 
%\puthmorphism(1000,900)[\ph{\cdots}`\ph{#2}`]{500}1a
1014
 
%\puthmorphism(500,400)[\ph{#1}`\cdots`]{500}1a
1015
 
%\puthmorphism(1000,400)[\ph{\cdots}`\ph{#2}`]{500}1a
1016
 
%\putsquare<1`1`1`1;700`500>(1500,400)[{#5}`{#6}`{#8}`{#9};```]
1017
 
%\puthmorphism(2200,900)[\ph{#6}`0`]{500}1a
1018
 
%\puthmorphism(2200,400)[\ph{#9}`0`]{500}1a
1019
 
%\putvmorphism(500,400)[`0`]{400}1a
1020
 
%\putvmorphism(1500,400)[`0`]{400}1a
1021
 
%\putvmorphism(2200,400)[`0`]{400}1a
1022
 
%\efig
1023
 
%}
1024
 
%
1025
 
%\def\doublecocomplex[#1`#2`#3`#4`#5`#6`#7`#8`#9]{%
1026
 
%\bfig
1027
 
%\putsquare<0`0`-1`-1;500`500>(0,1700)[`\vdots`\cdots`{#1};```]
1028
 
%\puthmorphism(500,1700)[\ph{#1}`\cdots`]{500}{-1}a
1029
 
%\puthmorphism(1000,1700)[\ph{\cdots}`\ph{#2}`]{500}{-1}a
1030
 
%\putsquare<0`-1`-1`-1;500`500>(1500,1700)[\vdots`\vdots`{#2}`{#3};```]
1031
 
%\puthmorphism(2000,1700)[\ph{#3}`0`]{500}{-1}a
1032
 
%\putvmorphism(500,1700)[`\vdots`]{400}{-1}a \putvmorphism(500,1300)[``]{400}{-1}a
1033
 
%\putvmorphism(1500,1700)[`\vdots`]{400}{-1}a \putvmorphism(1500,1300)[``]{400}{-1}a
1034
 
%\putvmorphism(2000,1700)[`\vdots`]{400}{-1}a \putvmorphism(2000,1300)[``]{400}{-1}a
1035
 
%\putsquare<-1`0`-1`-1;500`500>(0,400)[\cdots`{#4}`\cdots`{#7};```]
1036
 
%\puthmorphism(500,900)[\ph{#1}`\cdots`]{500}{-1}a
1037
 
%\puthmorphism(1000,900)[\ph{\cdots}`\ph{#2}`]{500}{-1}a
1038
 
%\puthmorphism(500,400)[\ph{#1}`\cdots`]{500}{-1}a
1039
 
%\puthmorphism(1000,400)[\ph{\cdots}`\ph{#2}`]{500}{-1}a
1040
 
%\putsquare<-1`-1`-1`-1;500`500>(1500,400)[{#5}`{#6}`{#8}`{#9};```]
1041
 
%\puthmorphism(2000,900)[\ph{#6}`0`]{500}{-1}a
1042
 
%\puthmorphism(2000,400)[\ph{#9}`0`]{500}{-1}a
1043
 
%\putvmorphism(500,400)[`0`]{400}{-1}a
1044
 
%\putvmorphism(1500,400)[`0`]{400}{-1}a
1045
 
%\putvmorphism(2000,400)[`0`]{400}{-1}a
1046
 
%\efig
1047
 
%}
1048
 
\makeatother