summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-11 23:49:28 +0000
committerKarl Berry <karl@freefriends.org>2006-01-11 23:49:28 +0000
commitd780c57e68c80655669a3b01af46b9978f5698ef (patch)
tree7eb9b6d2291e813296b41ae01eb7872442b78e9d
parent465c3a91c12b03e3e44ed760e4356fa340f830b8 (diff)
trunk/Master/texmf-dist/source/generic
git-svn-id: svn://tug.org/texlive/trunk@115 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/source/generic/babel/athnum.dtx278
-rw-r--r--Master/texmf-dist/source/generic/babel/babel.drv188
-rw-r--r--Master/texmf-dist/source/generic/babel/babel.dtx5793
-rw-r--r--Master/texmf-dist/source/generic/babel/babel.ins250
-rw-r--r--Master/texmf-dist/source/generic/babel/bahasa.dtx243
-rw-r--r--Master/texmf-dist/source/generic/babel/bahasa.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/base.ins299
-rw-r--r--Master/texmf-dist/source/generic/babel/basque.dtx390
-rw-r--r--Master/texmf-dist/source/generic/babel/basque.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/bbcompat.dtx261
-rw-r--r--Master/texmf-dist/source/generic/babel/bbidxglo.dtx124
-rw-r--r--Master/texmf-dist/source/generic/babel/bbplain.dtx717
-rw-r--r--Master/texmf-dist/source/generic/babel/breton.dtx365
-rw-r--r--Master/texmf-dist/source/generic/babel/breton.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/bulgarian.dtx1037
-rw-r--r--Master/texmf-dist/source/generic/babel/bulgarian.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/catalan.dtx712
-rw-r--r--Master/texmf-dist/source/generic/babel/catalan.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/croatian.dtx226
-rw-r--r--Master/texmf-dist/source/generic/babel/croatian.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/czech.dtx276
-rw-r--r--Master/texmf-dist/source/generic/babel/czech.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/danish.dtx304
-rw-r--r--Master/texmf-dist/source/generic/babel/danish.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/dutch.dtx560
-rw-r--r--Master/texmf-dist/source/generic/babel/dutch.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/english.dtx451
-rw-r--r--Master/texmf-dist/source/generic/babel/english.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/esperanto.dtx341
-rw-r--r--Master/texmf-dist/source/generic/babel/esperanto.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/estonian.dtx426
-rw-r--r--Master/texmf-dist/source/generic/babel/estonian.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/finnish.dtx362
-rw-r--r--Master/texmf-dist/source/generic/babel/finnish.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/frenchb.dtx2477
-rw-r--r--Master/texmf-dist/source/generic/babel/frenchb.ins155
-rw-r--r--Master/texmf-dist/source/generic/babel/galician.dtx476
-rw-r--r--Master/texmf-dist/source/generic/babel/galician.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/german.ins149
-rw-r--r--Master/texmf-dist/source/generic/babel/germanb.dtx543
-rw-r--r--Master/texmf-dist/source/generic/babel/greek.dtx864
-rw-r--r--Master/texmf-dist/source/generic/babel/greek.fdd349
-rw-r--r--Master/texmf-dist/source/generic/babel/greek.ins158
-rw-r--r--Master/texmf-dist/source/generic/babel/grmath.dtx168
-rw-r--r--Master/texmf-dist/source/generic/babel/grsymb.dtx131
-rw-r--r--Master/texmf-dist/source/generic/babel/heb209.dtx165
-rw-r--r--Master/texmf-dist/source/generic/babel/hebinp.dtx550
-rw-r--r--Master/texmf-dist/source/generic/babel/hebrew.dtx3329
-rw-r--r--Master/texmf-dist/source/generic/babel/hebrew.fdd1297
-rw-r--r--Master/texmf-dist/source/generic/babel/hebrew.ins215
-rw-r--r--Master/texmf-dist/source/generic/babel/icelandic.dtx749
-rw-r--r--Master/texmf-dist/source/generic/babel/icelandic.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/interlingua.dtx207
-rw-r--r--Master/texmf-dist/source/generic/babel/interlingua.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/irish.dtx218
-rw-r--r--Master/texmf-dist/source/generic/babel/irish.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/italian.dtx857
-rw-r--r--Master/texmf-dist/source/generic/babel/italian.ins155
-rw-r--r--Master/texmf-dist/source/generic/babel/latin.dtx623
-rw-r--r--Master/texmf-dist/source/generic/babel/latin.ins150
-rw-r--r--Master/texmf-dist/source/generic/babel/lsorbian.dtx239
-rw-r--r--Master/texmf-dist/source/generic/babel/magyar.dtx1411
-rw-r--r--Master/texmf-dist/source/generic/babel/magyar.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/ngermanb.dtx357
-rw-r--r--Master/texmf-dist/source/generic/babel/norsk.dtx453
-rw-r--r--Master/texmf-dist/source/generic/babel/norsk.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/polish.dtx563
-rw-r--r--Master/texmf-dist/source/generic/babel/polish.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/portuges.dtx473
-rw-r--r--Master/texmf-dist/source/generic/babel/portuges.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/romanian.dtx232
-rw-r--r--Master/texmf-dist/source/generic/babel/romanian.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/russianb.dtx1238
-rw-r--r--Master/texmf-dist/source/generic/babel/russianb.ins147
-rw-r--r--Master/texmf-dist/source/generic/babel/samin.dtx232
-rw-r--r--Master/texmf-dist/source/generic/babel/samin.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/scottish.dtx209
-rw-r--r--Master/texmf-dist/source/generic/babel/scottish.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/serbian.dtx312
-rw-r--r--Master/texmf-dist/source/generic/babel/serbian.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/slovak.dtx417
-rw-r--r--Master/texmf-dist/source/generic/babel/slovak.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/slovene.dtx302
-rw-r--r--Master/texmf-dist/source/generic/babel/slovene.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/sorbian.ins149
-rw-r--r--Master/texmf-dist/source/generic/babel/spanish.dtx2638
-rw-r--r--Master/texmf-dist/source/generic/babel/spanish.ins151
-rw-r--r--Master/texmf-dist/source/generic/babel/swedish.dtx442
-rw-r--r--Master/texmf-dist/source/generic/babel/swedish.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/turkish.dtx309
-rw-r--r--Master/texmf-dist/source/generic/babel/turkish.ins148
-rw-r--r--Master/texmf-dist/source/generic/babel/ukraineb.dtx1158
-rw-r--r--Master/texmf-dist/source/generic/babel/ukraineb.ins147
-rw-r--r--Master/texmf-dist/source/generic/babel/user.drv170
-rw-r--r--Master/texmf-dist/source/generic/babel/usorbian.dtx360
-rw-r--r--Master/texmf-dist/source/generic/babel/welsh.dtx207
-rw-r--r--Master/texmf-dist/source/generic/babel/welsh.ins148
-rw-r--r--Master/texmf-dist/source/generic/borceux/compatibility/OldDiagram291
-rw-r--r--Master/texmf-dist/source/generic/borceux/compatibility/OldMaxiDiagram209
-rw-r--r--Master/texmf-dist/source/generic/borceux/compatibility/OldMicroDiagram90
-rw-r--r--Master/texmf-dist/source/generic/borceux/compatibility/OldMiniDiagram107
-rw-r--r--Master/texmf-dist/source/generic/borceux/compatibility/OldMultipleArrows49
-rw-r--r--Master/texmf-dist/source/generic/german/betatest/00readme.1st7
-rw-r--r--Master/texmf-dist/source/generic/german/german.MISSING10
-rw-r--r--Master/texmf-dist/source/generic/german/german.dtx2331
-rw-r--r--Master/texmf-dist/source/generic/german/german.ins84
-rw-r--r--Master/texmf-dist/source/generic/kastrup/binhex.drv49
-rw-r--r--Master/texmf-dist/source/generic/kastrup/binhex.dtx518
-rw-r--r--Master/texmf-dist/source/generic/kastrup/binhex.ins32
-rw-r--r--Master/texmf-dist/source/generic/mfpic/grafbase.dtx5900
-rw-r--r--Master/texmf-dist/source/generic/mfpic/mfpic.dtx5045
-rw-r--r--Master/texmf-dist/source/generic/mfpic/mfpic.ins90
-rw-r--r--Master/texmf-dist/source/generic/midnight/00readme.txt18
-rw-r--r--Master/texmf-dist/source/generic/midnight/Index23
-rw-r--r--Master/texmf-dist/source/generic/psfig/pscompress12
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/arbortext.pro100
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/dospecial.frag43
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/dospecial.patch37
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/graphpaper.ps.gzbin0 -> 448 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/README76
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/cleanfig3
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/box.ps.gzbin0 -> 105 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/cm.ps.gzbin0 -> 159 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/piechart.ps.gzbin0 -> 2456 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/pretzel.ps.gzbin0 -> 207 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/rosette.ps.gzbin0 -> 1240 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/starlines.ps.gzbin0 -> 261 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/trevor.ps.gzbin0 -> 16054 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/zip.ps.gzbin0 -> 204 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep68.pro446
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep68.procs439
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep70.pro451
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep70.procs450
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macdemo.tex19
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/bullet.fig68.Zbin0 -> 11016 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/bullet.fig68.bb2
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/dave.fig68.Zbin0 -> 3596 bytes
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/dave.fig68.bb2
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/macdraw.fig68.Z4
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/macdraw.fig68.bb2
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/macdemo/stripfonts.awk5
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/psfig-li.pro100
-rw-r--r--Master/texmf-dist/source/generic/psfig/unsupported/psfig-li.tex391
-rw-r--r--Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.dtx837
-rw-r--r--Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.ins37
-rw-r--r--Master/texmf-dist/source/generic/realcalc/readme39
-rw-r--r--Master/texmf-dist/source/generic/ruhyphen/BUGS75
-rw-r--r--Master/texmf-dist/source/generic/ruhyphen/Makefile10
-rw-r--r--Master/texmf-dist/source/generic/ruhyphen/README368
-rw-r--r--Master/texmf-dist/source/generic/ruhyphen/README.ruhyphal118
-rw-r--r--Master/texmf-dist/source/generic/ruhyphen/hyphen.rules129
-rwxr-xr-xMaster/texmf-dist/source/generic/ruhyphen/mkcyryo22
-rwxr-xr-xMaster/texmf-dist/source/generic/ruhyphen/reduce-patt8
-rwxr-xr-xMaster/texmf-dist/source/generic/ruhyphen/sorthyph9
-rwxr-xr-xMaster/texmf-dist/source/generic/ruhyphen/sortkoi816
-rwxr-xr-xMaster/texmf-dist/source/generic/ruhyphen/trans9
-rw-r--r--Master/texmf-dist/source/generic/shapepar/proshap.py350
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/0sampdos.inf5
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/post1.tex3
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/post2.tex4
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea1.tex5
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea2.tex7
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea3.tex6
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv0.raw5
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv1.raw9
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv2.raw11
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv3.raw15
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv4.raw8
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv5.raw15
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv6.raw36
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tcv.bat16
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/sampdos/tcv_.bat4
-rw-r--r--Master/texmf-dist/source/generic/tap/tabcv/tapcv.awk239
-rw-r--r--Master/texmf-dist/source/generic/textmerg/textmerg.drv18
-rw-r--r--Master/texmf-dist/source/generic/textmerg/textmerg.dtx890
-rw-r--r--Master/texmf-dist/source/generic/textmerg/textmerg.ins69
-rw-r--r--Master/texmf-dist/source/generic/wsuipa/README.wsuipa8
-rw-r--r--Master/texmf-dist/source/generic/wsuipa/changes.dec9311
-rw-r--r--Master/texmf-dist/source/generic/wsuipa/changes.jun9111
-rw-r--r--Master/texmf-dist/source/generic/wsuipa/changes.mar9110
-rw-r--r--Master/texmf-dist/source/generic/wsuipa/changes.may9228
-rw-r--r--Master/texmf-dist/source/generic/wsuipa/changes.nov9017
-rw-r--r--Master/texmf-dist/source/generic/xypic/CATALOG.doc54
-rw-r--r--Master/texmf-dist/source/generic/xypic/COPYING339
-rw-r--r--Master/texmf-dist/source/generic/xypic/ChangeLog788
-rw-r--r--Master/texmf-dist/source/generic/xypic/INSTALL417
-rw-r--r--Master/texmf-dist/source/generic/xypic/INSTALL.OzTeX600
-rw-r--r--Master/texmf-dist/source/generic/xypic/INSTALL.Textures393
-rw-r--r--Master/texmf-dist/source/generic/xypic/MAKE259
-rw-r--r--Master/texmf-dist/source/generic/xypic/MANIFEST111
-rw-r--r--Master/texmf-dist/source/generic/xypic/Makefile1528
-rw-r--r--Master/texmf-dist/source/generic/xypic/README106
-rw-r--r--Master/texmf-dist/source/generic/xypic/TRAILER91
-rw-r--r--Master/texmf-dist/source/generic/xypic/VERSIONS103
-rw-r--r--Master/texmf-dist/source/generic/xypic/doc2tex.com114
-rw-r--r--Master/texmf-dist/source/generic/xypic/dvitogif89a207
-rw-r--r--Master/texmf-dist/source/generic/xypic/import1.eps1550
-rw-r--r--Master/texmf-dist/source/generic/xypic/install-tds147
-rw-r--r--Master/texmf-dist/source/generic/xypic/kris.eps587
-rw-r--r--Master/texmf-dist/source/generic/xypic/latin1.sty242
-rw-r--r--Master/texmf-dist/source/generic/xypic/movie.cls325
-rw-r--r--Master/texmf-dist/source/generic/xypic/pnmrawtopcropwhite.c175
-rw-r--r--Master/texmf-dist/source/generic/xypic/ross.eps397
-rw-r--r--Master/texmf-dist/source/generic/xypic/xy.doc8324
-rw-r--r--Master/texmf-dist/source/generic/xypic/xy.sty103
-rw-r--r--Master/texmf-dist/source/generic/xypic/xy16textures.doc294
-rw-r--r--Master/texmf-dist/source/generic/xypic/xy17oztex.doc301
-rw-r--r--Master/texmf-dist/source/generic/xypic/xy2cell.doc1839
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyall.doc93
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyarc.doc1436
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyarrow.doc1881
-rw-r--r--Master/texmf-dist/source/generic/xypic/xycmactex.doc71
-rw-r--r--Master/texmf-dist/source/generic/xypic/xycmtip.doc93
-rw-r--r--Master/texmf-dist/source/generic/xypic/xycolor.doc349
-rw-r--r--Master/texmf-dist/source/generic/xypic/xycrayon.doc82
-rw-r--r--Master/texmf-dist/source/generic/xypic/xycurve.doc4920
-rw-r--r--Master/texmf-dist/source/generic/xypic/xydoc.back1
-rw-r--r--Master/texmf-dist/source/generic/xypic/xydoc.bib764
-rw-r--r--Master/texmf-dist/source/generic/xypic/xydoc.sty1270
-rw-r--r--Master/texmf-dist/source/generic/xypic/xydocps.doc34
-rw-r--r--Master/texmf-dist/source/generic/xypic/xydummy.doc97
-rw-r--r--Master/texmf-dist/source/generic/xypic/xydvidrv.doc98
-rw-r--r--Master/texmf-dist/source/generic/xypic/xydvips.doc329
-rw-r--r--Master/texmf-dist/source/generic/xypic/xydvitops.doc346
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyemtex.doc243
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyframe.doc1213
-rw-r--r--Master/texmf-dist/source/generic/xypic/xygraph.doc710
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyguide.man2285
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyidioms.doc283
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyimport.doc245
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyknot.doc2014
-rw-r--r--Master/texmf-dist/source/generic/xypic/xylatex.ini77
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyline.doc664
-rw-r--r--Master/texmf-dist/source/generic/xypic/xymacpat.xyp61
-rw-r--r--Master/texmf-dist/source/generic/xypic/xymatrix.doc1345
-rw-r--r--Master/texmf-dist/source/generic/xypic/xymovie.doc161
-rw-r--r--Master/texmf-dist/source/generic/xypic/xynecula.doc594
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyoztex.doc316
-rw-r--r--Master/texmf-dist/source/generic/xypic/xypic.doc75
-rw-r--r--Master/texmf-dist/source/generic/xypic/xypic.map66
-rw-r--r--Master/texmf-dist/source/generic/xypic/xypic.sty29
-rw-r--r--Master/texmf-dist/source/generic/xypic/xypoly.doc1262
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-c.doc187
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-col.doc165
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-f.doc270
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-l.doc195
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-pro.doc253
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-ps.doc750
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-r.doc226
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-s.doc144
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps-t.doc168
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyps.doc1209
-rw-r--r--Master/texmf-dist/source/generic/xypic/xypsdict.doc375
-rw-r--r--Master/texmf-dist/source/generic/xypic/xypspatt.doc182
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyrecat.doc95
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyrefer.man509
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyrotate.doc538
-rw-r--r--Master/texmf-dist/source/generic/xypic/xysmart.doc569
-rw-r--r--Master/texmf-dist/source/generic/xypic/xytex.ini60
-rw-r--r--Master/texmf-dist/source/generic/xypic/xytextures.doc291
-rw-r--r--Master/texmf-dist/source/generic/xypic/xytile.doc472
-rw-r--r--Master/texmf-dist/source/generic/xypic/xytips.doc239
-rw-r--r--Master/texmf-dist/source/generic/xypic/xytp-f.doc306
-rw-r--r--Master/texmf-dist/source/generic/xypic/xytpic.doc472
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyv2.doc868
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyweb.doc326
-rw-r--r--Master/texmf-dist/source/generic/xypic/xyxdvi.doc335
267 files changed, 117361 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/generic/babel/athnum.dtx b/Master/texmf-dist/source/generic/babel/athnum.dtx
new file mode 100644
index 00000000000..7a088cb5d65
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/athnum.dtx
@@ -0,0 +1,278 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%% \CheckSum{125}
+%% \CharacterTable
+%\iffalse
+%
+%% This is file `athnum.dtx'
+%% (c) 1997-2005 Apostolos Syropoulos.
+%% All rights reserved.
+%
+% Please report errors or suggestions for improvement to
+%
+% Apostolos Syropoulos
+% 366, 28th October Str.
+% GR-671 00 Xanthi, GREECE
+% apostolo at platon.ee.duth.gr or apostolo at obelix.ee.duth.gr
+%
+%\fi
+%
+% \iffalse
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\def\PiIt#1{{%
+ \newdimen\boxW \newdimen\boxH
+ \settowidth{\boxW}{#1}%
+ \settoheight{\boxH}{#1}%
+ \addtolength{\boxW}{0.8pt}
+ \vbox{%
+ \hrule width\boxW\hbox{%
+ \vrule height\boxH\mbox{#1}%
+ \vrule height\boxH}}\kern.5pt}}
+\GetFileInfo{athnum.drv}
+\begin{document}
+ \DocInput{athnum.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+%\title{Athenian Numerals II\footnote{The documentation of this
+% package is essentially the same as that of the package `grnumalt'.
+% The `II' serves as a means to distinguish the two documents.}}
+% \author{Apostolos Syropoulos\\366, 28th October Str.\\
+% GR-671 00 Xanthi, HELLAS\\ Email:\texttt{apostolo@platon.ee.duth.gr}}
+% \date{2003/08/24}
+%\maketitle
+%
+%\MakeShortVerb{\|}
+%
+%\section{Introduction}
+%
+% This \LaTeX\ package implements the macro
+% \DescribeMacro{\athnum}
+% |\athnum|. The macro transforms an Arabic numeral, i.e., the kind
+% of numerals we all use (e.g., 1, 5, 789 etc), to the corresponding
+% {\itshape Athenian} numeral. Athenian numerals were in use only in
+% ancient Athens. The package can be used only in conjunction with the
+% |greek| option of the |babel| package.
+%
+%\section{The Numbering System}
+%
+% The athenian numbering system, like the roman one, employs
+% letters to denote important numbers. Multiple occurrence of a letter denote
+% a multiple of the ``important'' number, e.g., the letter I denotes 1, so
+% III denotes 3. Here are the basic digits used in the Athenian numbering
+% system:
+% \begin{itemize}
+% \item I denotes the number one (1)
+% \item $\Pi$ denotes the number five (5)
+% \item $\Delta$ denotes the number ten (10)
+% \item H denotes the number one hundred (100)
+% \item X denotes the number one thousand (1000)
+% \item M denotes the number ten thousands (10000)
+%\end{itemize}
+% Moreover, the letters $\Delta$, H, X, and M under the letter $\Pi$,
+% denote five times their original value, e.g., the symbol
+% \PiIt{X}, denotes the number 5000, and the symbol
+% \PiIt{$\Delta$}, denotes the number 50. It must be noted that
+% the numbering system does not provide negative numerals or a symbol for
+% zero.
+%
+% The Athenian numbering system is described, among others, in an article in
+% Encyclopedia $\Delta o\mu\acute{\eta}$, Vol. 2, page 280, 7th edition,
+% Athens, October 2, 1975.
+%
+% \section{The Code}
+% Before we do anything further, we have to identify the package.
+% \StopEventually
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}[1996/01/01]
+\ProvidesPackage{athnum}[2003/08/24\space v1.1]
+\typeout{Package: `athnum' v1.1\space <2003/08/24> (A. Syropoulos)}
+% \end{macrocode}
+% Next we check to see if the |babel| package is loaded with at least
+% the |greek| option. In case it isn't, we opt to produce an error message.
+% \begin{macrocode}
+\@ifpackagewith{babel}{greek}{}{%
+ \@ifpackagewith{babel}{polutonikogreek}{}{%
+ \PackageError{athnum}{%
+ `greek' option of the `babel'\MessageBreak
+ package hasn't been loaded}{%
+ The commands provided by this package\MessageBreak
+ are specially designed for greek language\MessageBreak
+ typesetting with the `babel' package. Load\MessageBreak
+ it with at least the `greek' option.}\relax
+ }}
+% \end{macrocode}
+%
+% As it is mentioned in the introduction, the Athenian numerals employ
+% some special digits. These digits are included in the |cb| fonts of
+% Claudio Beccari, and so we must provide access commands.
+% \begin{macrocode}
+\DeclareTextCommand{\PiDelta}{LGR}{\char"02\relax}
+\DeclareTextCommand{\PiEta}{LGR}{\char"03\relax}
+\DeclareTextCommand{\PiChi}{LGR}{\char"04\relax}
+\DeclareTextCommand{\PiMu}{LGR}{\char"05\relax}
+% \end{macrocode}
+%\begin{macro}{\@@athnum}
+% Now, we turn our attention to the definition of the macro
+% |\@@athnum|. This macro uses one integer variable (or counter in
+% \TeX's jargon.)
+% \begin{macrocode}
+\newcount\@ath@num
+% \end{macrocode}
+% The macro |\@@athnum| is also defined as a robust command.
+% \begin{macrocode}
+\DeclareRobustCommand*{\@@athnum}[1]{%
+% \end{macrocode}
+% After assigning to variable |\@ath@num| the value of the macro's argument,
+%we make sure that the argument is in the expected range, i.e., it is greater
+% than zero, and less or equal to $249999$. In case it isn't, we simply
+% produce a |\space|, warn the user about it and quit. Although, the
+% |\athnum| macro is capable to produce an Athenian numeral for even greater
+% intergers, the following argument by Claudio Beccari convised me to place
+% this above upper limit:
+% \begin{quote}
+% According to psychological perception studies (that ancient Athenians
+% and Romans perfectly knew without needing to study Freud and Jung)
+% living beings (which includes at least all vertebrates, not only
+% humans) can perceive up to four randomly set objects of the same kind
+% without the need of counting, the latter activity being a specific
+% acquired ability of human kind; the biquinary numbering notation
+% used by the Athenians and the Romans exploits this natural
+% characteristic of human beings.
+% \end{quote}
+% \begin{macrocode}
+ \@ath@num#1\relax
+ \ifnum\@ath@num<\@ne%
+ \space%
+ \PackageWarning{athnum}{%
+ Illegal value (\the\@ath@num) for athenian numeral}%
+ \else\ifnum\@ath@num>249999%
+ \space%
+ \PackageWarning{athnum}{%
+ Illegal value (\the\@ath@num) for athenian numeral}%
+ \else
+% \end{macrocode}
+% Having done all the necessary checks, we are now ready to do the actual
+% computation. If the number is greater than $49999$, then it certainly
+% has at least one \PiIt{M} ``digit''. We find all such digits by continuously
+% subtracting $50000$ from |\@ath@num|, until |\@ath@num| becomes less than
+% $50000$.
+% \begin{macrocode}
+ \@whilenum\@ath@num>49999\do{%
+ \PiMu\advance\@ath@num-50000}%
+% \end{macrocode}
+% We now check for tens of thousands.
+% \begin{macrocode}
+ \@whilenum\@ath@num>9999\do{%
+ M\advance\@ath@num-\@M}%
+% \end{macrocode}
+% Since a number can have only one \PiIt{X} ``digit'' (equivalent to 5000), it
+% is easy to check it out and produce the corresponding numeral in case it does
+% have one.
+% \begin{macrocode}
+ \ifnum\@ath@num>4999%
+ \PiChi\advance\@ath@num-5000%
+ \fi\relax
+% \end{macrocode}
+% Next, we check for thousands, the same way we checked for tens of thousands.
+% \begin{macrocode}
+ \@whilenum\@ath@num>999\do{%
+ Q\advance\@ath@num-\@m}%
+% \end{macrocode}
+% Like the five thousands, a numeral can have at most one \PiIt{H} ``digit''
+% (equivalent to 500).
+% \begin{macrocode}
+ \ifnum\@ath@num>499%
+ \PiEta\advance\@ath@num-500%
+ \fi\relax
+% \end{macrocode}
+% It is time to check hundreds, which follow the same pattern as thousands
+% \begin{macrocode}
+ \@whilenum\@ath@num>99\do{%
+ H\advance\@ath@num-100}%
+% \end{macrocode}
+% A numeral can have only one \PiIt{$\Delta$} ``digit'' (equivalent to 50).
+% \begin{macrocode}
+ \ifnum\@ath@num>49%
+ \PiDelta\advance\@ath@num-50%
+ \fi\relax
+% \end{macrocode}
+% Let's check now decades.
+% \begin{macrocode}
+ \@whilenum\@ath@num>9\do{%
+ D\advance\@ath@num by-10}%
+% \end{macrocode}
+% We check for five and, finally, for the digits 1, 2, 3, and 4.
+% \begin{macrocode}
+ \@whilenum\@ath@num>4\do{%
+ P\advance\@ath@num-5}%
+ \ifcase\@ath@num\or I\or II\or III\or IIII\fi%
+ \fi\fi}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@athnum}
+% The command |\@athnum| has one argument, which
+% is a counter. It calls the command |\@@athnum| to process the value of
+% the counter.
+% \begin{macrocode}
+\def\@athnum#1{%
+ \expandafter\@@athnum\expandafter{\the#1}}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\athnum}
+% The command |\athnum| is a wrapper that declares
+% a new counter in a local scope, assigns to it the argument of the command
+% and calls the macro |\@athnum|. This way the command can process correctly
+% either a number or a counter.
+% \begin{macrocode}
+\def\athnum#1{%
+ \@ath@num#1\relax
+ \@athnum{\@ath@num}}
+%</package>
+% \end{macrocode}
+%\end{macro}
+%
+% \section*{Acknowledgment}
+% I would like to thank Claudio Beccari for reading the documentation
+% and for his very helpful suggestions. In addition, Antonis Tsolomitis
+% spotted a bug in the first version, which is corrected in the present
+% version.
+% \section*{Dedication}
+% I would like to dedicate this piece of work to my son
+% \begin{center}Demetrios-Georgios.\end{center}
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/babel.drv b/Master/texmf-dist/source/generic/babel/babel.drv
new file mode 100644
index 00000000000..ce7f645b0a3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/babel.drv
@@ -0,0 +1,188 @@
+%%
+%% This is file `babel.drv',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% babel.dtx (with options: `driver')
+%%
+%% This file was generated from file(s) of the Babel system.
+%% ---------------------------------------------------------
+%%
+%% Copyright (C) 2004 Johannes Braams. All rights reserved.
+%%
+%% To produce the documentation in the way you like you are allowed
+%% to change this driver file.
+%%
+%%
+%% File 'babel.dtx'
+%%\ProvidesFile{babel.dtx}[2005/05/21 v3.8g The Babel package]
+%% Babel package for LaTeX2e.
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% all rights reserved.
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+\ifx\ProvidesFile\@undefined
+ \def\ProvidesFile#1[#2 #3 #4]{%
+ \wlog{File: #1 #4 #3 <#2>}%
+ \let\ProvidesFile\@undefined
+ }
+\fi
+\ProvidesFile{babel.drv}
+ [2005/05/21 v3.8g %
+]
+\documentclass{ltxdoc}
+\usepackage{url,t1enc,supertabular}
+\usepackage[icelandic,english]{babel}
+\DoNotIndex{\!,\',\,,\.,\-,\:,\;,\?,\/,\^,\`,\@M}
+\DoNotIndex{\@,\@ne,\@m,\@afterheading,\@date,\@endpart}
+\DoNotIndex{\@hangfrom,\@idxitem,\@makeschapterhead,\@mkboth}
+\DoNotIndex{\@oddfoot,\@oddhead,\@restonecolfalse,\@restonecoltrue}
+\DoNotIndex{\@starttoc,\@unused}
+\DoNotIndex{\accent,\active}
+\DoNotIndex{\addcontentsline,\advance,\Alph,\arabic}
+\DoNotIndex{\baselineskip,\begin,\begingroup,\bf,\box,\c@secnumdepth}
+\DoNotIndex{\catcode,\centering,\char,\chardef,\clubpenalty}
+\DoNotIndex{\columnsep,\columnseprule,\crcr,\csname}
+\DoNotIndex{\day,\def,\dimen,\discretionary,\divide,\dp,\do}
+\DoNotIndex{\edef,\else,\@empty,\end,\endgroup,\endcsname,\endinput}
+\DoNotIndex{\errhelp,\errmessage,\expandafter,\fi,\filedate}
+\DoNotIndex{\fileversion,\fmtname,\fnum@figure,\fnum@table,\fontdimen}
+\DoNotIndex{\gdef,\global}
+\DoNotIndex{\hbox,\hidewidth,\hfil,\hskip,\hspace,\ht,\Huge,\huge}
+\DoNotIndex{\ialign,\if@twocolumn,\ifcase,\ifcat,\ifhmode,\ifmmode}
+\DoNotIndex{\ifnum,\ifx,\immediate,\ignorespaces,\input,\item}
+\DoNotIndex{\kern}
+\DoNotIndex{\labelsep,\Large,\large,\labelwidth,\lccode,\leftmargin}
+\DoNotIndex{\lineskip,\leavevmode,\let,\list,\ll,\long,\lower}
+\DoNotIndex{\m@ne,\mathchar,\mathaccent,\markboth,\month,\multiply}
+\DoNotIndex{\newblock,\newbox,\newcount,\newdimen,\newif,\newwrite}
+\DoNotIndex{\nobreak,\noexpand,\noindent,\null,\number}
+\DoNotIndex{\onecolumn,\or}
+\DoNotIndex{\p@,par, \parbox,\parindent,\parskip,\penalty}
+\DoNotIndex{\protect,\ps@headings}
+\DoNotIndex{\quotation}
+\DoNotIndex{\raggedright,\raise,\refstepcounter,\relax,\rm,\setbox}
+\DoNotIndex{\section,\setcounter,\settowidth,\scriptscriptstyle}
+\DoNotIndex{\sfcode,\sl,\sloppy,\small,\space,\spacefactor,\strut}
+\DoNotIndex{\string}
+\DoNotIndex{\textwidth,\the,\thechapter,\thefigure,\thepage,\thepart}
+\DoNotIndex{\thetable,\thispagestyle,\titlepage,\tracingmacros}
+\DoNotIndex{\tw@,\twocolumn,\typeout,\uppercase,\usecounter}
+\DoNotIndex{\vbox,\vfil,\vskip,\vspace,\vss}
+\DoNotIndex{\widowpenalty,\write,\xdef,\year,\z@,\z@skip}
+\makeatletter
+\gdef\dlqq{{\setbox\tw@=\hbox{,}\setbox\z@=\hbox{''}%
+ \dimen\z@=\ht\z@ \advance\dimen\z@-\ht\tw@
+ \setbox\z@=\hbox{\lower\dimen\z@\box\z@}\ht\z@=\ht\tw@
+ \dp\z@=\dp\tw@ \box\z@\kern-.04em}}
+\@addtoreset{CodelineNo}{section}
+\renewcommand\theCodelineNo{%
+ \reset@font\scriptsize\thesection.\arabic{CodelineNo}}
+\renewcommand\codeline@wrindex[1]{\if@filesw
+ \immediate\write\@indexfile
+ {\string\indexentry{#1}%
+ {\number\c@section.\number\c@CodelineNo}}\fi}
+\renewenvironment{theglossary}{%
+ \glossary@prologue%
+ \GlossaryParms \let\item\@idxitem \ignorespaces}%
+ {}
+\makeatother
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\m[1]{\mbox{$\langle$\it#1\/$\rangle$}}
+\newcommand*\langvar{\m{lang}}
+\newcommand*\note[1]{}
+\newcommand*\bsl{\protect\bslash}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+\newcommand*\langdeffile[1]{%
+ \clearpage
+ \DocInput{#1}}
+\DisableCrossrefs
+\RecordChanges
+\CodelineIndex
+\setcounter{StandardModuleDepth}{1}
+\begin{document}
+\DocInput{babel.dtx}
+^^A% \changes{babel~3.6i}{1997/02/22}{Added kannada}
+\langdeffile{esperanto.dtx}
+\langdeffile{interlingua.dtx}
+\langdeffile{dutch.dtx}
+\langdeffile{english.dtx}
+\langdeffile{germanb.dtx}
+\langdeffile{ngermanb.dtx}
+\langdeffile{breton.dtx}
+\langdeffile{welsh.dtx}
+\langdeffile{irish.dtx}
+\langdeffile{scottish.dtx}
+\langdeffile{greek.dtx}
+\langdeffile{frenchb.dtx}
+\langdeffile{italian.dtx}
+\langdeffile{latin.dtx}
+\langdeffile{portuges.dtx}
+\langdeffile{spanish.dtx}
+\langdeffile{catalan.dtx}
+\langdeffile{galician.dtx}
+\langdeffile{basque.dtx}
+\langdeffile{romanian.dtx}
+\langdeffile{danish.dtx}
+\langdeffile{icelandic.dtx}
+\langdeffile{norsk.dtx}
+\langdeffile{swedish.dtx}
+\langdeffile{samin.dtx}
+\langdeffile{finnish.dtx}
+\langdeffile{magyar.dtx}
+\langdeffile{estonian.dtx}
+\langdeffile{croatian.dtx}
+\langdeffile{czech.dtx}
+\langdeffile{polish.dtx}
+\langdeffile{serbian.dtx}
+\langdeffile{slovak.dtx}
+\langdeffile{slovene.dtx}
+\langdeffile{russianb.dtx}
+\langdeffile{bulgarian.dtx}
+\langdeffile{ukraineb.dtx}
+\langdeffile{lsorbian.dtx}
+\langdeffile{usorbian.dtx}
+\langdeffile{turkish.dtx}
+\langdeffile{hebrew.dtx}
+\DocInput{hebinp.dtx}
+\DocInput{hebrew.fdd}
+\DocInput{heb209.dtx}
+\langdeffile{bahasa.dtx}
+\clearpage
+\DocInput{bbplain.dtx}
+\clearpage
+\def\filename{index}
+\PrintIndex
+\clearpage
+\def\filename{changes}
+\PrintChanges
+\end{document}
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
+%%
+%% End of file `babel.drv'.
diff --git a/Master/texmf-dist/source/generic/babel/babel.dtx b/Master/texmf-dist/source/generic/babel/babel.dtx
new file mode 100644
index 00000000000..aa0a577b1a8
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/babel.dtx
@@ -0,0 +1,5793 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{3805}
+%%
+% \def\filename{babel.dtx}
+% \let\thisfilename\filename
+%
+%\iffalse
+% \changes{babel~3.5g}{1996/10/10}{We need at least \LaTeX\ from
+% December 1994}
+% \changes{babel~3.6k}{1999/03/18}{We need at least \LaTeX\ from
+% June 1998}
+% \begin{macrocode}
+%<+package>\NeedsTeXFormat{LaTeX2e}[1998/06/01]
+% \end{macrocode}
+%
+%% File 'babel.dtx'
+%\fi
+%%\ProvidesFile{babel.dtx}[2005/05/21 v3.8g The Babel package]
+%\iffalse
+%
+% Babel DOCUMENT-STYLE option for LaTeX version 2.09 or plain TeX;
+%% Babel package for LaTeX2e.
+%
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% all rights reserved.
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage{supertabular}
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\m[1]{\mbox{$\langle$\it#1\/$\rangle$}}
+\newcommand*\langvar{\m{lang}}
+\newcommand*\note[1]{}
+\newcommand*\bsl{\protect\bslash}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{babel.dtx}
+\end{document}
+%</filedriver>
+% \changes{babel~3.7a}{1997/04/16}{Make multiple loading of
+% \file{babel.def} impossible}
+% \begin{macrocode}
+%<*core>
+\ifx\bbl@afterfi\@undefined
+\else
+ \bbl@afterfi\endinput
+\fi
+%</core>
+% \end{macrocode}
+%<*dtx>
+\ProvidesFile{babel.dtx}
+%</dtx>
+%\fi
+%
+% \GetFileInfo{babel.dtx}
+%
+% \changes{babel~2.0a}{1990/04/02}{Added text about \file{german.sty}}
+% \changes{babel~2.0b}{1990/04/18}{Changed order of code to prevent
+% plain \TeX from seeing all of it}
+% \changes{babel~2.1}{1990/04/24}{Modified user interface,
+% \cs{langTeX} no longer necessary}
+% \changes{babel~2.1a}{1990/05/01}{Incorporated Nico's comments}
+% \changes{babel~2.1b}{1990/05/01}{rename \cs{language} to
+% \cs{current@language}}
+% \changes{babel~2.1c}{1990/05/22}{abstract for report fixed, missing
+% \texttt{\}}, found by Nicolas Brouard}
+% \changes{babel~2.1d}{1990/07/04}{Missing right brace in definition of
+% abstract environment, found by Werenfried Spit}
+% \changes{babel~2.1e}{1990/07/16}{Incorporated more comments from
+% Nico}
+% \changes{babel~2.2}{1990/07/17}{Renamed \cs{newlanguage} to
+% \cs{addlanguage}}
+% \changes{babel~2.2a}{1990/08/27}{Modified the documentation
+% somewhat}
+% \changes{babel~3.0}{1991/04/23}{Moved part of the code to hyphen.doc
+% in preparation for \TeX~3.0}
+% \changes{babel~3.0a}{1991/05/21}{Updated comments in various places}
+% \changes{babel~3.0b}{1991/05/25}{Removed some problems in change log}
+% \changes{babel~3.0c}{1991/07/15}{Renamed \file{babel.sty} and
+% \file{latexhax.sty} to \file{.com}}
+% \changes{babel~3.1}{1991/10/31}{Added the support for active
+% characters and for extending a macro}
+% \changes{babel~3.1}{1991/11/05}{Removed the need for
+% \file{latexhax}}
+% \changes{babel~3.2}{1991/11/10}{Some Changes by br}
+% \changes{babel~3.2a}{1992/02/15}{Fixups of the code and
+% documentation}
+% \changes{babel~3.3}{1993/07/06}{Included driver file, and prepared
+% for distribution}
+% \changes{babel~3.4}{1994/01/30}{Updated for \LaTeXe}
+% \changes{babel~3.4}{1994/02/28}{Added language definition file for
+% bahasa}
+% \changes{babel~3.4b}{1994/05/18}{Added a small driver to be able to
+% process just this file}
+% \changes{babel~3.5a}{1995/02/03}{Provided common code to handle the
+% active double quote}
+% \changes{babel~3.5c}{1995/06/14}{corrected a few typos (PR1652)}
+% \changes{babel~3.5d}{1995/07/02}{Merged glyphs.dtx into this file}
+% \changes{babel~3.5f}{1995/07/13}{repaired a typo}
+% \changes{babel~3.5f}{1996/01/09}{replaced \cs{tmp}, \cs{bbl@tmp} and
+% \cs{bbl@temp} with \cs{bbl@tempa}}
+% \changes{babel~3.5g}{1996/07/09}{replaced \cs{undefined} with
+% \cs{@undefined} to be consistent with \LaTeX}
+% \changes{babel~3.7d}{1999/05/05}{Fixed a few typos in \cs{changes}
+% entries which made typesetting the code impossible}
+% \changes{babel~3.7h}{2001/03/01}{Added a number of missing comment
+% characters which caused spurious white space}
+% \changes{babel~3.8e}{2005/03/24}{Many enhancements to the text by
+% Andrew Young}
+%
+% \title {Babel, a multilingual package for use with \LaTeX's standard
+% document classes\thanks{During the development ideas from Nico
+% Poppelier, Piet van Oostrum and many others have been used.
+% Bernd Raichle has provided many helpful suggestions.}}
+%
+% \author{Johannes Braams\\
+% Kersengaarde 33\\
+% 2723 BP Zoetermeer\\
+% The Netherlands\\
+% \texttt{babel@braams.cistron.nl}}
+%
+% \date{Printed \today}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The standard distribution of \LaTeX\ contains a number of
+% document classes that are meant to be used, but also serve as
+% examples for other users to create their own document classes.
+% These document classes have become very popular among \LaTeX\
+% users. But it should be kept in mind that they were designed for
+% American tastes and typography. At one time they contained a
+% number of hard-wired texts. This report describes \babel{}, a
+% package that makes use of the new capabilities of \TeX\ version 3
+% to provide an environment in which documents can be typeset in
+% a non-American language, or in more than one language.
+% \end{abstract}
+%
+% \begin{multicols}{2}
+% \tableofcontents
+% \end{multicols}
+%
+% \section{The user interface}\label{U-I}
+%
+% The user interface of this package is quite simple. It consists
+% of a set of commands that switch from one language to another, and
+% a set of commands that deal with shorthands. It is also possible
+% to find out what the current language is.
+%
+% \DescribeMacro{\selectlanguage}
+% When a user wants to switch from one language to another he can
+% do so using the macro |\selectlanguage|. This macro takes the
+% language, defined previously by a language definition file, as
+% its argument. It calls several macros that should be defined in
+% the language definition files to activate the special definitions
+% for the language chosen.
+%
+% \DescribeEnv{otherlanguage}
+% The environment \Lenv{otherlanguage} does basically the same as
+% |\selectlanguage|, except the language change is local to the
+% environment. This environment is required for intermixing
+% left-to-right typesetting with right-to-left typesetting.
+% The language to switch to is specified as an
+% argument to |\begin{otherlanguage}|.
+%
+% \DescribeMacro{\foreignlanguage}
+% The command |\foreignlanguage| takes two arguments; the second
+% argument is a phrase to be typeset according to the rules of the
+% language named in its first argument. This command only switches
+% the extra definitions and the hyphenation rules for the language,
+% \emph{not} the names and dates.
+%
+% \DescribeEnv{otherlanguage*}
+% In the environment \Lenv{otherlanguage*} only the typesetting
+% is done according to the rules of the other language, but the
+% text-strings such as `figure', `table', etc. are left as they
+% were set outside this environment.
+%
+% \DescribeEnv{hyphenrules}
+% The environment \Lenv{hyphenrules} can be used to select
+% \emph{only} the hyphenation rules to be used. This can for
+% instance be used to select `nohyphenation', provided that in
+% \file{language.dat} the `language' nohyphenation is defined by
+% loading \file{serohyph.tex}.
+%
+% \DescribeMacro{\languagename}
+% The control sequence |\languagename| contains the name of the
+% current language.
+%
+% \DescribeMacro{\iflanguage}
+% If more than one language is used, it might be necessary to know
+% which language is active at a specific time. This can be checked
+% by a call to |\iflanguage|. This macro takes three arguments.
+% The first argument is the name of a language; the second and
+% third arguments are the actions to take if the result of the test
+% is \texttt{true} or \texttt{false} respectively.
+%
+% \DescribeMacro{\useshorthands}
+% The command |\useshorthands| initiates the definition of
+% user-defined shorthand sequences. It has one argument, the
+% character that starts these personal shorthands.
+%
+% \DescribeMacro{\defineshorthand}
+% The command |\defineshorthand| takes two arguments: the first
+% is a one- or two-character shorthand sequence, and the second is
+% the code the shorthand should expand to.
+%
+% \DescribeMacro{\aliasshorthand}
+% The command |\aliasshorthand| can be used to let another
+% character perform the same functions as the default shorthand
+% character. If one prefers for example to use the character |/|
+% over |"| in typing polish texts, this can be achieved by entering
+% |\aliasshorthand{"}{/}|. \emph{Please note} that the substitute
+% shorthand character must have been declared in the preamble of
+% your document, using a command such as |\useshorthands{/}| in this
+% example.
+%
+% \DescribeMacro{\languageshorthands}
+% The command |\languageshorthands| can be used to switch the
+% shorthands on the language level. It takes one argument, the
+% name of a language. Note that for this to work the language
+% should have been specified as an option when loading the \babel\
+% package.
+%
+% \DescribeMacro{\shorthandon}
+% \DescribeMacro{\shorthandoff}
+% It is sometimes necessary to switch a shorthand
+% character off temporarily, because it must be used in an
+% entirely different way. For this purpose, the user commands
+% |\shorthandoff| and |\shorthandon| are provided. They each take a
+% list of characters as their arguments. The command |\shorthandoff|
+% sets the |\catcode| for each of the characters in its argument to
+% other (12); the command |\shorthandon| sets the |\catcode| to
+% active (13). Both commands only work on `known'
+% shorthand characters. If a character is not known to be a
+% shorthand character its category code will be left unchanged.
+%
+% \DescribeMacro{\languageattribute}
+% This is a user-level command, to be used in the preamble of a
+% document (after |\usepackage[...]{babel}|), that declares which
+% attributes are to be used for a given language. It takes two
+% arguments: the first is the name of the language; the second,
+% a (list of) attribute(s) to used.
+% The command checks whether the language is known in this document
+% and whether the attribute(s) are known for this language.
+%
+% \subsection{Languages supported by \Babel}
+%
+% In the following table all the languages supported by \Babel\ are
+% listed, together with the names of the options with which you can
+% load \babel\ for each language.
+%
+% \begin{center}
+% \tablehead{Language & Option(s)\\\hline}
+% \tabletail{\hline}
+% \begin{supertabular}{l p{8cm}}
+% Afrikaans & afrikaans\\
+% Bahasa & bahasa\\
+% Basque & basque\\
+% Breton & breton\\
+% Bulgarian & bulgarian\\
+% Catalan & catalan\\
+% Croatian & croatian\\
+% Czech & czech\\
+% Danish & danish\\
+% Dutch & dutch\\
+% English & english, USenglish, american, UKenglish,
+% british, canadian, australian, newzealand\\
+% Esperanto & esperanto\\
+% Estonian & estonian\\
+% Finnish & finnish\\
+% French & french, francais, canadien, acadian\\
+% Galician & galician\\
+% German & austrian, german, germanb, ngerman, naustrian\\
+% Greek & greek, polutonikogreek \\
+% Hebrew & hebrew \\
+% Hungarian & magyar, hungarian\\
+% Icelandic & icelandic \\
+% Interlingua & interlingua \\
+% Irish Gaelic & irish\\
+% Italian & italian\\
+%^^A Kannada & kannada \\
+% Latin & latin \\
+% Lower Sorbian & lowersorbian\\
+%^^A Devnagari & nagari \\
+% North Sami & samin \\
+% Norwegian & norsk, nynorsk\\
+% Polish & polish\\
+% Portuguese & portuges, portuguese, brazilian, brazil\\
+% Romanian & romanian\\
+% Russian & russian\\
+%^^A Sanskrit & sanskrit\\
+% Scottish Gaelic & scottish\\
+% Spanish & spanish\\
+% Slovakian & slovak\\
+% Slovenian & slovene\\
+% Swedish & swedish\\
+% Serbian & serbian\\
+%^^A Tamil & tamil \\
+% Turkish & turkish\\
+% Ukrainian & ukrainian\\
+% Upper Sorbian & uppersorbian\\
+% Welsh & welsh\\
+% \end{supertabular}
+% \end{center}
+%
+% For some languages \babel\ supports the options
+% \Lopt{activeacute} and \Lopt{activegrave}; for typestting Russian
+% texts, \babel\ knows about the options \Lopt{LWN} and \Lopt{LCY}
+% to specify the fontencoding of the cyrillic font used. Currently
+% only \Lopt{LWN} is supported.
+%
+% \subsection{Workarounds}
+%
+% If you use the document class \cls{book} \emph{and} you use
+% |\ref| inside the argument of |\chapter|,
+% \LaTeX\ will keep complaining about an undefined
+% label. The reason is that the argument of |\ref| is passed through
+% |\uppercase| at some time during processing. To prevent such
+% problems, you could revert to using uppercase labels, or you can
+% use |\lowercase{\ref{foo}}| inside the argument of |\chapter|.
+%
+% \section{Changes for \LaTeXe}
+%
+% With the advent of \LaTeXe\ the interface to \babel\ in the
+% preamble of the document has changed. With \LaTeX2.09 one used to
+% call up the \babel\ system with a line such as:
+%
+%\begin{verbatim}
+%\documentstyle[dutch,english]{article}
+%\end{verbatim}
+%
+% which would tell \LaTeX\ that the document would be written in
+% two languages, Dutch and English, and that English would be the
+% first language in use.
+%
+% The \LaTeXe\ way of providing the same information is:
+%
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage[dutch,english]{babel}
+%\end{verbatim}
+%
+% or, making \Lopt{dutch} and \Lopt{english} global options in
+% order to let other packages detect and use them:
+%
+%\begin{verbatim}
+%\documentclass[dutch,english]{article}
+%\usepackage{babel}
+%\usepackage{varioref}
+%\end{verbatim}
+%
+% In this last example, the package \texttt{varioref} will also see
+% the options and will be able to use them.
+%
+% \section{Changes in \Babel\ version 3.7}
+%
+% In \Babel\ version 3.7 a number of bugs that were found in
+% version~3.6 are fixed. Also a number of changes and additions
+% have occurred:
+% \begin{itemize}
+% \item Shorthands are expandable again. The disadvantage is that
+% one has to type |'{}a| when the acute accent is used as a
+% shorthand character. The advantage is that a number of other
+% problems (such as the breaking of ligatures, etc.) have
+% vanished.
+% \item Two new commands, |\shorthandon| and |\shorthandoff| have
+% been introduced to enable to temporarily switch off one or more
+% shorthands.
+%^^A \item Support for typesetting Sanskrit in transliteration is now
+%^^A available, thanks to Jun Takashima.
+%^^A \item Support for typesetting Kannada, Devnagari and Tamil is now
+%^^A available thanks to Jun Takashima.
+% \item Support for typesetting Greek has been enhanced. Code from
+% the \pkg{kdgreek} package (suggested by the author) was added
+% and |\greeknumeral| has been added.
+% \item Support for typesetting Basque is now available thanks to
+% Juan Aguirregabiria.
+% \item Support for typesetting Serbian with Latin script is now
+% available thanks to Dejan Muhamedagi\'{c} and Jankovic
+% Slobodan.
+% \item Support for typesetting Hebrew (and potential support for
+% typesetting other right-to-left written languages) is now
+% available thanks to Rama Porrat and Boris Lavva.
+% \item Support for typesetting Bulgarian is now available thanks to
+% Georgi Boshnakov.
+% \item Support for typesetting Latin is now available, thanks to
+% Claudio Beccari and Krzysztof Konrad \.Zelechowski.
+% \item Support for typesetting North Sami is now available, thanks
+% to Regnor Jernsletten.
+% \item The options \Lopt{canadian}, \Lopt{canadien} and
+% \Lopt{acadien} have been added for Canadian English and French
+% use.
+% \item A language attribute has been added to the |\mark...|
+% commands in order to make sure that a Greek header line comes
+% out right on the last page before a language switch.
+% \item Hyphenation pattern files are now read \emph{inside a
+% group}; therefore any changes a pattern file needs to make to
+% lowercase codes, uppercase codes, and category codes are kept
+% local to that group. If they are needed for the language, these
+% changes will need to be repeated and stored in |\extras...|
+% \item The concept of language attributes is introduced. It is
+% intended to give the user some control over the
+% features a language-definition file provides. Its
+% first use is for the Greek language, where the user can choose
+% the $\pi o\lambda\upsilon\tau o\nu\kappa\acute{o}$
+% (``Polutoniko'' or multi-accented) Greek way of typesetting
+% texts. These attributes will possibly find wider use in future
+% releases.
+% \item The environment \Lenv{hyphenrules} is introduced.
+% \item The syntax of the file \file{language.dat} has been
+% extended to allow (optionally) specifying the font
+% encoding to be used while processing the patterns file.
+% \item The command |\providehyphenmins| should now be used in
+% language definition files in order to be able to keep any
+% settings provided by the pattern file.
+% \end{itemize}
+%
+% \section{Changes in \Babel\ version 3.6}
+%
+% In \Babel\ version 3.6 a number of bugs that were found in
+% version~3.5 are fixed. Also a number of changes and additions
+% have occurred:
+% \begin{itemize}
+% \item A new environment \Lenv{otherlanguage*} is introduced. it
+% only switches the `specials', but leaves the `captions'
+% untouched.
+% \item The shorthands are no longer fully expandable. Some
+% problems could only be solved by peeking at the token following
+% an active character. The advantage is that |'{}a| works as
+% expected for languages that have the |'| active.
+% \item Support for typesetting french texts is much enhanced; the
+% file \file{francais.ldf} is now replaced by \file{frenchb.ldf}
+% which is maintained by Daniel Flipo.
+% \item Support for typesetting the russian language is again
+% available. The language definition file was originally
+% developed by Olga Lapko from CyrTUG. The fonts needed to
+% typeset the russian language are now part of the \babel\
+% distribution. The support is not yet up to the level which is
+% needed according to Olga, but this is a start.
+% \item Support for typesetting greek texts is now also
+% available. What is offered in this release is a first attempt;
+% it will be enhanced later on by Yannis Haralambous.
+% \item in \babel\ 3.6j some hooks have been added for the
+% development of support for Hebrew typesetting.
+% \item Support for typesetting texts in Afrikaans (a variant of
+% Dutch, spoken in South Africa) has been added to
+% \file{dutch.ldf}.
+% \item Support for typesetting Welsh texts is now available.
+% \item A new command |\aliasshorthand| is introduced. It seems
+% that in Poland various conventions are used to type the
+% necessary Polish letters. It is now possible to use the
+% character~|/| as a shorthand character instead of the
+% character~|"|, by issuing the command |\aliasshorthand{"}{/}|.
+% \item The shorthand mechanism now deals correctly with characters
+% that are already active.
+% \item Shorthand characters are made active at |\begin{document}|,
+% not earlier. This is to prevent problems with other packages.
+% \item A \emph{preambleonly} command |\substitutefontfamily| has
+% been added to create \file{.fd} files on the fly when the font
+% families of the Latin text differ from the families used for
+% the Cyrillic or Greek parts of the text.
+% \item Three new commands |\LdfInit|, |\ldf@quit| and
+% |\ldf@finish| are introduced that perform a number of standard
+% tasks.
+% \item In babel 3.6k the language Ukrainian has been added and the
+% support for Russian typesetting has been adapted to the package
+% 'cyrillic' to be released with the December 1998 release of
+% \LaTeXe.
+% \end{itemize}
+%
+% \section{Changes in \Babel\ version 3.5}
+%
+% In \Babel\ version 3.5 a lot of changes have been made when
+% compared with the previous release. Here is a list of the most
+% important ones:
+% \begin{itemize}
+% \item the selection of the language is delayed until
+% |\begin{document}|, which means you must
+% add appropriate |\selectlanguage| commands if you include
+% |\hyphenation| lists in the preamble of your document.
+% \item \babel\ now has a \Lenv{language} environment and a new
+% command |\foreignlanguage|;
+% \item the way active characters are dealt with is completely
+% changed. They are called `shorthands'; one can have three
+% levels of shorthands: on the user level, the language level, and
+% on `system level'. A consequence of the new way of handling
+% active characters is that they are now written to auxiliary
+% files `verbatim';
+% \item A language change now also writes information in the
+% \file{.aux} file, as the change might also affect typesetting
+% the table of contents. The consequence is that an .aux file
+% generated by a LaTeX format with babel preloaded gives errors
+% when read with a LaTeX format without babel; but I think this
+% probably doesn't occur;
+% \item \babel\ is now compatible with the \pkg{inputenc} and
+% \pkg{fontenc} packages;
+% \item the language definition files now have a new extension,
+% \file{ldf};
+% \item the syntax of the file \file{language.dat} is extended to
+% be compatible with the \pkg{french} package by Bernard Gaulle;
+% \item each language definition file looks for a configuration
+% file which has the same name, but the extension \file{.cfg}. It
+% can contain any valid \LaTeX\ code.
+% \end{itemize}
+%
+% \section{The interface between the core of \babel{} and the language
+% definition files}
+%
+% In the core of the \babel{} system, several macros are defined
+% for use in language definition files. Their purpose
+% is to make a new language known.
+%
+% \DescribeMacro{\addlanguage}
+% The macro |\addlanguage| is a non-outer version of the macro
+% |\newlanguage|, defined in \file{plain.tex} version~3.x. For
+% older versions of \file{plain.tex} and \file{lplain.tex} a
+% substitute definition is used.
+%
+% \DescribeMacro{\adddialect}
+% The macro |\adddialect| can be used when two
+% languages can (or must) use the same hyphenation
+% patterns. This can also be useful for
+% languages for which no patterns are preloaded in the format. In
+% such cases the default behaviour of the \babel{} system is to
+% define this language as a `dialect' of the language for which the
+% patterns were loaded as |\language0|.
+%
+% The language definition files must conform to a number of
+% conventions, because these files have to fill
+% in the gaps left by the common code in \file{babel.def}, i.\,e.,
+% the definitions of the macros that produce texts. Also the
+% language-switching possibility which has been built into the
+% \babel{} system has its implications.
+%
+% The following assumptions are made:
+% \begin{itemize}
+% \item Some of the language-specific definitions might be used by
+% plain \TeX\ users, so the files have to be coded so that they
+% can be read by both \LaTeX\ and plain \TeX. The current
+% format can be checked by looking at the value of the macro
+% |\fmtname|.
+%
+% \item The common part of the \babel{} system redefines a number
+% of macros and environments (defined previously in the document
+% style) to put in the names of macros that replace the previously
+% hard-wired texts. These macros have to be defined in the
+% language definition files.
+%
+% \item The language definition files define five macros, used to
+% activate and deactivate the language-specific definitions. These
+% macros are |\|\langvar|hyphenmins|, |\captions|\langvar,
+% |\date|\langvar, |\extras|\langvar\ and |\noextras|\langvar; where
+% \langvar\ is either the name of the language definition file or
+% the name of the \LaTeX\ option that is to be used. These
+% macros and their functions are discussed below.
+%
+% \item When a language definition file is loaded, it can define
+% |\l@|\langvar\ to be a dialect of |\language0| when
+% |\l@|\langvar\ is undefined.
+%
+% \item The language definition files can be read in the preamble of
+% the document, but also in the middle of document processing. This
+% means that they have to function independently of the current
+% |\catcode| of the \texttt{@}~sign.
+% \end{itemize}
+%
+% \DescribeMacro{\providehyphenmins}
+% The macro |\providehyphenmins| should be used in the language
+% definition files to set the |\lefthyphenmin| and
+% |\righthyphenmin|. This macro will check whether these parameters
+% were provided by the hyphenation file before it takes any action.
+%
+% \DescribeMacro{\langhyphenmins}
+% The macro |\|\langvar|hyphenmins| is used to store the values of
+% the |\lefthyphenmin| and |\righthyphenmin|.
+%
+% \DescribeMacro{\captionslang}
+% The macro |\captions|\langvar\ defines the macros that
+% hold the texts to replace the original hard-wired texts.
+%
+% \DescribeMacro{\datelang}
+% The macro |\date|\langvar\ defines |\today| and
+%
+% \DescribeMacro{\extraslang}
+% The macro |\extras|\langvar\ contains all the extra definitions
+% needed for a specific language.
+%
+% \DescribeMacro{\noextraslang}
+% Because we want to let the user switch
+% between languages, but we do not know what state \TeX\ might be in
+% after the execution of |\extras|\langvar, a macro that brings
+% \TeX\ into a predefined state is needed. It will be no surprise
+% that the name of this macro is |\noextras|\langvar.
+%
+% \DescribeMacro{\bbl@declare@ttribute}
+% This is a command to be used in the language definition files for
+% declaring a language attribute. It takes three arguments: the
+% name of the language, the attribute to be defined, and the code
+% to be executed when the attribute is to be used.
+%
+% \DescribeMacro{\main@language}
+% To postpone the activation of the definitions needed for a
+% language until the beginning of a document, all language
+% definition files should use |\main@language| instead of
+% |\selectlanguage|. This will just store the name of the language,
+% and the proper language will be activated at the start of the
+% document.
+%
+% \DescribeMacro{\ProvidesLanguage}
+% The macro |\ProvidesLanguage| should be used to identify the
+% language definition files. Its syntax is similar to the syntax
+% of the \LaTeX\ command |\ProvidesPackage|.
+%
+% \DescribeMacro{\LdfInit}
+% The macro |\LdfInit| performs a couple of standard checks that
+% must be made at the beginning of a language definition file,
+% such as checking the category code of the @-sign, preventing
+% the \file{.ldf} file from being processed twice, etc.
+%
+% \DescribeMacro{\ldf@quit}
+% The macro |\ldf@quit| does work needed
+% if a \file{.ldf} file was processed
+% earlier. This includes resetting the category code
+% of the @-sign, preparing the language to be activated at
+% |\begin{document}| time, and ending the input stream.
+%
+% \DescribeMacro{\ldf@finish}
+% The macro |\ldf@finish| does work needed
+% at the end of each \file{.ldf} file. This
+% includes resetting the category code of the @-sign,
+% loading a local configuration file, and preparing the language
+% to be activated at |\begin{document}| time.
+%
+% \DescribeMacro{\loadlocalcfg}
+% After processing a language definition file,
+% \LaTeX\ can be instructed to load a local configuration
+% file. This file can, for instance, be used to add strings to
+% |\captions|\langvar\ to support local document
+% classes. The user will be informed that this
+% configuration file has been loaded. This macro is called by
+% |\ldf@finish|.
+%
+% \DescribeMacro{\substitutefontfamily}
+% This command takes three arguments, a font encoding and two font
+% family names. It creates a font description file for the first
+% font in the given encoding. This \file{.fd} file will instruct
+% \LaTeX\ to use a font from the second family when a font from the
+% first family in the given encoding seems to be needed.
+%
+% \subsection{Support for active characters}
+%
+% In quite a number of language definition files, active characters
+% are introduced. To facilitate this, some support macros are
+% provided.
+%
+% \DescribeMacro{\initiate@active@char}
+% The internal macro |\initiate@active@char| is used in language
+% definition files to instruct \LaTeX\ to give a character the
+% category code `active'. When a character has been made active it
+% will remain that way until the end of the document. Its
+% definition may vary.
+%
+% \DescribeMacro{\bbl@activate}
+% \DescribeMacro{\bbl@deactivate}
+% The command |\bbl@activate| is used to change the way an active
+% character expands. |\bbl@activate| `switches on' the active
+% behaviour of the character. |\bbl@deactivate| lets the active
+% character expand to its former (mostly) non-active self.
+%
+% \DescribeMacro{\declare@shorthand}
+% The macro |\declare@shorthand| is used to define the various
+% shorthands. It takes three arguments: the name for the collection
+% of shorthands this definition belongs to; the character
+% (sequence) that makes up the shorthand, i.e.\ |~| or |"a|; and the
+% code to be executed when the shorthand is encountered.
+%
+% \DescribeMacro{\bbl@add@special}
+% \DescribeMacro{\bbl@remove@special}
+% The \TeX book states: ``Plain \TeX\ includes a macro called
+% |\dospecials| that is
+% essentially a set macro, representing the set of all characters
+% that have a special category code.'' \cite[p.~380]{DEK} It is
+% used to set text `verbatim'. To make this work if more
+% characters get a special category code, you have to add this
+% character to the macro |\dospecial|. \LaTeX\ adds another macro
+% called |\@sanitize| representing the same character set, but
+% without the curly braces. The macros
+% |\bbl@add@special|\meta{char} and
+% |\bbl@remove@special|\meta{char} add and remove the character
+% \meta{char} to these two sets.
+%
+% \subsection{Support for saving macro definitions}
+%
+% Language definition files may want to \emph{re}define macros that
+% already exist. Therefor a mechanism for saving (and restoring)
+% the original definition of those macros is provided. We provide
+% two macros for this\footnote{This mechanism was introduced by
+% Bernd Raichle.}.
+%
+% \DescribeMacro{\babel@save} To save the current meaning of any
+% control sequence, the macro |\babel@save| is provided. It takes
+% one argument, \meta{csname}, the control sequence for which the
+% meaning has to be saved.
+%
+% \DescribeMacro{\babel@savevariable} A second macro is provided to
+% save the current value of a variable. In this context, anything
+% that is allowed after the |\the| primitive is considered to be a
+% variable. The macro takes one argument, the \meta{variable}.
+%
+% The effect of the preceding macros is to append a piece of code
+% to the current definition of |\originalTeX|. When
+% |\originalTeX| is expanded, this code restores the previous
+% definition of the control sequence or the previous value of the
+% variable.
+%
+% \subsection{Support for extending macros}
+%
+% \DescribeMacro{\addto}
+% The macro |\addto{|\meta{control sequence}|}{|\meta{\TeX\
+% code}|}| can be used to extend the definition of a macro. The
+% macro need not be defined. This macro can, for instance, be used
+% in adding instructions to a macro like |\extrasenglish|.
+%
+% \subsection{Macros common to a number of languages}
+%
+% \DescribeMacro{\allowhyphens}
+% In a couple of European languages compound words are used. This
+% means that when \TeX\ has to hyphenate such a compound word, it
+% only does so at the `\texttt{-}' that is used in such words. To
+% allow hyphenation in the rest of such a compound word, the macro
+% |\allowhyphens| can be used.
+%
+% \DescribeMacro{\set@low@box}
+% For some languages, quotes need to be lowered to the baseline. For
+% this purpose the macro |\set@low@box| is available. It takes one
+% argument and puts that argument in an |\hbox|, at the
+% baseline. The result is available in |\box0| for further
+% processing.
+%
+% \DescribeMacro{\save@sf@q}
+% Sometimes it is necessary to preserve the |\spacefactor|. For
+% this purpose the macro |\save@sf@q| is available. It takes one
+% argument, saves the current spacefactor, executes the argument,
+% and restores the spacefactor.
+%
+% \DescribeMacro{\bbl@frenchspacing}
+% \DescribeMacro{\bbl@nonfrenchspacing}
+% The commands |\bbl@frenchspacing| and |\bbl@nonfrenchspacing| can
+% be used to properly switch French spacing on and off.
+%
+% \section{Compatibility with \file{german.sty}}\label{l-h}
+%
+% The file \file{german.sty} has been
+% one of the sources of inspiration for the \babel{}
+% system. Because of this I wanted to include \file{german.sty} in
+% the \babel{} system. To be able to do that I had to allow for
+% one incompatibility: in the definition of the macro
+% |\selectlanguage| in \file{german.sty} the argument is used as the
+% {$\langle \it number \rangle$} for an |\ifcase|. So in this case
+% a call to |\selectlanguage| might look like
+% |\selectlanguage{\german}|.
+%
+% In the definition of the macro |\selectlanguage| in
+% \file{babel.def} the argument is used as a part of other
+% macronames, so a call to |\selectlanguage| now looks like
+% |\selectlanguage{german}|. Notice the absence of the escape
+% character. As of version~3.1a of \babel{} both syntaxes are
+% allowed.
+%
+% All other features of the original \file{german.sty} have been
+% copied into a new file, called \file{germanb.sty}\footnote{The
+% `b' is added to the name to distinguish the file from Partls'
+% file.}.
+%
+% Although the \babel{} system was developed to be used with
+% \LaTeX, some of the features implemented in the language
+% definition files might be needed by plain \TeX\ users. Care has
+% been taken that all files in the system can be processed by plain
+% \TeX.
+%
+% \section{Compatibility with \file{ngerman.sty}}
+%
+% When used with the options \Lopt{ngerman} or \Lopt{naustrian},
+% \babel{} will provide all features of the package \pkg{ngerman}.
+% There is however one exception: The commands for special
+% hyphenation of double consonants (|"ff| etc.) and ck (|"ck|),
+% which are no longer required with the new German orthography, are
+% undefined. With the \pkg{ngerman} package, however, these
+% commands will generate appropriate warning messages only.
+%
+% \section{Compatibility with the \pkg{french} package}
+%
+% It has been reported to me that the package \pkg{french} by
+% Bernard Gaulle (\texttt{gaulle@idris.fr}) works
+% together with \babel. On the other hand, it seems \emph{not} to
+% work well together with a lot of other packages. Therefore I have
+% decided to no longer load \file{french.ldf} by default. Instead,
+% when you want to use the package by Bernard Gaulle, you will have
+% to request it specifically, by passing either \Lopt{frenchle} or
+% \Lopt{frenchpro} as an option to \babel.
+%
+%\StopEventually{%
+% \clearpage
+% \let\filename\thisfilename
+% \section{Conclusion}
+%
+% A system of document options has been presented that enable the
+% user of \LaTeX\ to adapt the standard document classes of \LaTeX\
+% to the language he or she prefers to use. These options offer the
+% possibility of switching between languages in one document. The
+% basic interface consists of using one option, which is the same
+% for \emph{all} standard document classes.
+%
+% In some cases the language definition files provide macros that
+% can be useful to plain \TeX\ users as well as to \LaTeX\ users.
+% The \babel{} system has been implemented so that it
+% can be used by both groups of users.
+%
+% \section{Acknowledgements}
+%
+% I would like to thank all who volunteered as $\beta$-testers for
+% their time. I would like to mention Julio Sanchez who supplied
+% the option file for the Spanish language and Maurizio Codogno who
+% supplied the option file for the Italian language. Michel Goossens
+% supplied contributions for most of the other languages. Nico
+% Poppelier helped polish the text of the documentation and
+% supplied parts of the macros for the Dutch language. Paul
+% Wackers and Werenfried Spit helped find and repair bugs.
+%
+% During the further development of the babel system I received
+% much help from Bernd Raichle, for which I am grateful.
+%
+% \begin{thebibliography}{9}
+% \bibitem{DEK} Donald E. Knuth,
+% \emph{The \TeX book}, Addison-Wesley, 1986.
+% \bibitem{LLbook} Leslie Lamport,
+% \emph{\LaTeX, A document preparation System}, Addison-Wesley,
+% 1986.
+% \bibitem{treebus} K.F. Treebus.
+% \emph{Tekstwijzer, een gids voor het grafisch verwerken van
+% tekst.}
+% SDU Uitgeverij ('s-Gravenhage, 1988). A Dutch book on layout
+% design and typography.
+% \bibitem{HP} Hubert Partl,
+% \emph{German \TeX}, \emph{TUGboat} 9 (1988) \#1, p.~70--72.
+% \bibitem{LLth} Leslie Lamport,
+% in: \TeXhax\ Digest, Volume 89, \#13, 17 February 1989.
+% \bibitem{BEP} Johannes Braams, Victor Eijkhout and Nico Poppelier,
+% \emph{The development of national \LaTeX\ styles},
+% \emph{TUGboat} 10 (1989) \#3, p.~401--406.
+% \bibitem{ilatex} Joachim Schrod,
+% \emph{International \LaTeX\ is ready to use},
+% \emph{TUGboat} 11 (1990) \#1, p.~87--90.
+% \end{thebibliography}
+% }
+%
+% \section{Identification}
+%
+% The file \file{babel.sty}\footnote{The file described in this
+% section is called \texttt{\filename}, has version
+% number~\fileversion\ and was last revised on~\filedate.} is meant
+% for \LaTeXe, therefor we make sure that the format file used is
+% the right one.
+%
+% \begin{macro}{\ProvidesLanguage}
+% \changes{babel~3.7a}{1997/03/18}{Added macro to prevent problems
+% with unexpected \cs{ProvidesFile} in plain formats because of
+% \babel.}
+% The identification code for each file is something that was
+% introduced in \LaTeXe. When the command |\ProvidesFile| does not
+% exist, a dummy definition is provided temporarily. For use in the
+% language definition file the command |\ProvidesLanguage| is
+% defined by \babel.
+% \changes{babel~3.4e}{1994/06/24}{Redid the identification code,
+% provided dummy definition of \cs{ProvidesFile} for plain \TeX}
+% \changes{babel~3.5f}{1995/07/26}{Store version in \cs{fileversion}}
+% \changes{babel~3.5f}{1995/12/18}{Need to temporarily change the
+% definition of \cs{ProvidesFile} for December 1995 release}
+% \changes{babel~3.5g}{1996/07/09}{Save a few csnames; use
+% \cs{bbl@tempa} instead of \cs{\@ProvidesFile} and store message
+% in \cs{toks8}}
+% \begin{macrocode}
+%<*!package>
+\ifx\ProvidesFile\@undefined
+ \def\ProvidesFile#1[#2 #3 #4]{%
+ \wlog{File: #1 #4 #3 <#2>}%
+%<*kernel&patterns>
+ \toks8{Babel <#3> and hyphenation patterns for }%
+%</kernel&patterns>
+ \let\ProvidesFile\@undefined
+ }
+% \end{macrocode}
+% As an alternative for |\ProvidesFile| we define
+% |\ProvidesLanguage| here to be used in the language definition
+% files.
+% \begin{macrocode}
+%<*kernel>
+ \def\ProvidesLanguage#1[#2 #3 #4]{%
+ \wlog{Language: #1 #4 #3 <#2>}%
+ }
+\else
+% \end{macrocode}
+% In this case we save the original definition of |\ProvidesFile| in
+% |\bbl@tempa| and restore it after we have stored the version of
+% the file in |\toks8|.
+% \changes{babel~3.7a}{1997/11/04}{Removed superfluous braces}
+% \begin{macrocode}
+%<*kernel&patterns>
+ \let\bbl@tempa\ProvidesFile
+ \def\ProvidesFile#1[#2 #3 #4]{%
+ \toks8{Babel <#3> and hyphenation patterns for }%
+ \bbl@tempa#1[#2 #3 #4]%
+ \let\ProvidesFile\bbl@tempa}
+%</kernel&patterns>
+% \end{macrocode}
+% When |\ProvidesFile| is defined we give |\ProvidesLanguage| a
+% similar definition.
+% \begin{macrocode}
+ \def\ProvidesLanguage#1{%
+ \begingroup
+ \catcode`\ 10 %
+ \@makeother\/%
+ \@ifnextchar[%]
+ {\@provideslanguage{#1}}{\@provideslanguage{#1}[]}}
+ \def\@provideslanguage#1[#2]{%
+ \wlog{Language: #1 #2}%
+ \expandafter\xdef\csname ver@#1.ldf\endcsname{#2}%
+ \endgroup}
+%</kernel>
+\fi
+%</!package>
+% \end{macrocode}
+% \end{macro}
+%
+% Identify each file that is produced from this source file.
+% \changes{babel~3.4c}{1995/04/28}{lhyphen.cfg has become
+% lthyphen.cfg}
+% \changes{babel~3.5b}{1995/01/25}{lthyphen.cfg has become hyphen.cfg}
+% \begin{macrocode}
+%<+package>\ProvidesPackage{babel}
+%<+core>\ProvidesFile{babel.def}
+%<+kernel&patterns>\ProvidesFile{hyphen.cfg}
+%<+kernel&!patterns>\ProvidesFile{switch.def}
+%<+driver&!user>\ProvidesFile{babel.drv}
+%<+driver&user>\ProvidesFile{user.drv}
+ [2005/05/21 v3.8g %
+%<+package> The Babel package]
+%<+core> Babel common definitions]
+%<+kernel> Babel language switching mechanism]
+%<+driver>]
+% \end{macrocode}
+%
+% \section{The Package File}
+%
+% In order to make use of the features of \LaTeXe, the \babel\
+% system contains a package file, \file{babel.sty}. This file
+% is loaded by the |\usepackage| command and defines all the
+% language options known in the \babel\ system. It also takes care
+% of a number of compatibility issues with other packages.
+%
+% \subsection{Language options}
+%
+% \changes{babel~3.6c}{1997/01/05}{When \cs{LdfInit} is undefined we
+% need to load \file{babel.def} from \file{babel.sty}}
+% \changes{babel~3.6l}{1999/04/03}{Don't load \file{babel.def} now,
+% but rather define \cs{LdfInit} temporarily in order to load
+% \file{babel.def} at the right time, preventing problems with the
+% temporary definition of \cs{bbl@redefine}}
+% \changes{babel~3.6r}{1999/04/12}{We \textbf{do} need to load
+% \file{babel.def} right now as \cs{ProvidesLanguage} needs to be
+% defined before the \file{.ldf} files are read and the reason for
+% for 3.6l has been removed}
+% \begin{macrocode}
+%<*package>
+\ifx\LdfInit\@undefined\input babel.def\relax\fi
+% \end{macrocode}
+%
+% For all the languages supported we need to declare an option.
+% \changes{babel~3.5a}{1995/03/14}{Changed extension of language
+% definition files to \texttt{ldf}}
+% \changes{babel~3.5d}{1995/07/02}{Load language definition files
+% \emph{after} the check for the hyphenation patterns}
+% \changes{babel~3.5g}{1996/10/04}{Added option \Lopt{afrikaans}}
+% \changes{babel~3.7g}{2001/02/09}{Added option \Lopt{acadian}}
+% \changes{babel~3.8c}{2004/06/12}{Added option \Lopt{australian}}
+% \begin{macrocode}
+\DeclareOption{acadian}{\input{frenchb.ldf}}
+\DeclareOption{afrikaans}{\input{dutch.ldf}}
+\DeclareOption{american}{\input{english.ldf}}
+\DeclareOption{australian}{\input{english.ldf}}
+% \end{macrocode}
+% Austrian is really a dialect of German.
+% \changes{babel~3.6i}{1997/02/20}{Added the \Lopt{Basque} option}
+% \begin{macrocode}
+\DeclareOption{austrian}{\input{germanb.ldf}}
+\DeclareOption{bahasa}{\input{bahasa.ldf}}
+\DeclareOption{basque}{\input{basque.ldf}}
+\DeclareOption{brazil}{\input{portuges.ldf}}
+% \end{macrocode}
+% \changes{babel~3.5b}{1995/05/25}{Added \Lopt{brazilian} as
+% alternative for \Lopt{brazil}}
+% \begin{macrocode}
+\DeclareOption{brazilian}{\input{portuges.ldf}}
+\DeclareOption{breton}{\input{breton.ldf}}
+% \end{macrocode}
+% \changes{babel~3.5d}{1995/07/02}{Added \Lopt{british} as an
+% alternative for \Lopt{english} with a preference for british
+% hyphenation}
+% \changes{babel~3.7f}{2000/09/21}{Added the \Lopt{bulgarian} option}
+% \changes{babel~3.7g}{2001/02/07}{Added option \Lopt{canadian}}
+% \changes{babel~3.7g}{2001/02/09}{Added option \Lopt{canadien}}
+% \begin{macrocode}
+\DeclareOption{british}{\input{english.ldf}}
+\DeclareOption{bulgarian}{\input{bulgarian.ldf}}
+\DeclareOption{canadian}{\input{english.ldf}}
+\DeclareOption{canadien}{\input{frenchb.ldf}}
+\DeclareOption{catalan}{\input{catalan.ldf}}
+\DeclareOption{croatian}{\input{croatian.ldf}}
+\DeclareOption{czech}{\input{czech.ldf}}
+\DeclareOption{danish}{\input{danish.ldf}}
+\DeclareOption{dutch}{\input{dutch.ldf}}
+% \end{macrocode}
+% \changes{babel~3.5b}{1995/06/06}{Added the \Lopt{estonian} option}
+% \begin{macrocode}
+\DeclareOption{english}{\input{english.ldf}}
+\DeclareOption{esperanto}{\input{esperanto.ldf}}
+\DeclareOption{estonian}{\input{estonian.ldf}}
+\DeclareOption{finnish}{\input{finnish.ldf}}
+% \end{macrocode}
+% The \babel\ support or French used to be stored in
+% \file{francais.ldf}; therefor the \LaTeX2.09 option used to be
+% \Lopt{francais}. The hyphenation patterns may be loaded as either
+% `french' or as `francais'.
+% \changes{babel~3.5f}{1996/01/10}{Now use the file \file{frenchb.ldf}
+% from Daniel Flipo for french support}
+% \changes{babel~3.6e}{1997/01/08}{Added option \Lopt{frenchb} an
+% alias for \Lopt{francais}}
+% \begin{macrocode}
+\DeclareOption{francais}{\input{frenchb.ldf}}
+\DeclareOption{frenchb}{\input{frenchb.ldf}}
+% \end{macrocode}
+% With \LaTeXe\ we can now also use the option \Lopt{french} and
+% still call the file \file{frenchb.ldf}.
+% \changes{babel~3.5d}{1995/07/02}{Load \file{french.ldf} when it is
+% found instead of \file{frenchb.ldf}}
+% \changes{babel~3.7j}{2003/06/07}{\emph{only} load
+% \file{frenchb.ldf}}
+% \begin{macrocode}
+\DeclareOption{french}{\input{frenchb.ldf}}%
+\DeclareOption{galician}{\input{galician.ldf}}
+\DeclareOption{german}{\input{germanb.ldf}}
+\DeclareOption{germanb}{\input{germanb.ldf}}
+% \end{macrocode}
+% \changes{babel~3.5f}{1996/05/31}{Added the \Lopt{greek} option}
+% \changes{babel~3.7a}{1997/11/13}{Added the \Lopt{polutonikogreek}
+% option}
+% \changes{babel~3.7c}{1999/04/22}{set the correct language attribute
+% for polutoniko greek}
+% \begin{macrocode}
+\DeclareOption{greek}{\input{greek.ldf}}
+\DeclareOption{polutonikogreek}{%
+ \input{greek.ldf}%
+ \languageattribute{greek}{polutoniko}}
+% \end{macrocode}
+% \changes{babel~3.7a}{1998/03/27}{Added the \Lopt{hebrew} option}
+% \begin{macrocode}
+\DeclareOption{hebrew}{%
+ \input{rlbabel.def}%
+ \input{hebrew.ldf}}
+% \end{macrocode}
+% \Lopt{hungarian} is just a synonym for \Lopt{magyar}
+%^^A \changes{babel~3.6i}{1997/02/21}{Added the \Lopt{kannada} option}
+% \changes{babel~3.7a}{1997/05/21}{Added the \Lopt{icelandic} option}
+%^^A \changes{babel~3.7a}{1998/03/30}{{Added the \Lopt{nagari} option}
+% \changes{babel~3.7b}{1998/06/25}{Added the \Lopt{latin} option}
+% \changes{babel~3.7m}{2003/11/13}{Added the \Lopt{interlingua}
+% option}
+% \begin{macrocode}
+\DeclareOption{hungarian}{\input{magyar.ldf}}
+\DeclareOption{icelandic}{\input{icelandic.ldf}}
+\DeclareOption{interlingua}{\input{interlingua.ldf}}
+\DeclareOption{irish}{\input{irish.ldf}}
+\DeclareOption{italian}{\input{italian.ldf}}
+\DeclareOption{latin}{\input{latin.ldf}}
+\DeclareOption{lowersorbian}{\input{lsorbian.ldf}}
+%^^A\DeclareOption{kannada}{\input{kannada.ldf}}
+\DeclareOption{magyar}{\input{magyar.ldf}}
+%^^A\DeclareOption{nagari}{\input{nagari.ldf}}
+% \end{macrocode}
+% `New' German orthography, including Austrian variant:
+% \changes{babel~3.6p}{1999/04/10}{Added the \Lopt{ngerman} and
+% \Lopt{naustrian} options}
+% \changes{babel~3.7f}{2000/09/26}{Added the \Lopt{samin} option}
+% \changes{babel~3.8c}{2004/06/12}{Added the \Lopt{newzealand} option}
+% \begin{macrocode}
+\DeclareOption{naustrian}{\input{ngermanb.ldf}}
+\DeclareOption{newzealand}{\input{english.ldf}}
+\DeclareOption{ngerman}{\input{ngermanb.ldf}}
+\DeclareOption{norsk}{\input{norsk.ldf}}
+\DeclareOption{samin}{\input{samin.ldf}}
+% \end{macrocode}
+% For Norwegian two spelling variants are provided.
+% \begin{macrocode}
+\DeclareOption{nynorsk}{\input{norsk.ldf}}
+\DeclareOption{polish}{\input{polish.ldf}}
+\DeclareOption{portuges}{\input{portuges.ldf}}
+\DeclareOption{portuguese}{\input{portuges.ldf}}
+\DeclareOption{romanian}{\input{romanian.ldf}}
+\DeclareOption{russian}{\input{russianb.ldf}}
+% \end{macrocode}
+%^^A \changes{babel~3.7a}{1997/02/07}{Added the \Lopt{sanskrit} option}
+% \changes{babel~3.6i}{1997/02/21}{Added the \Lopt{ukrainian} option}
+%^^A \changes{babel~3.7a}{1998/03/30}{Added the \Lopt{tamil} option}
+% \begin{macrocode}
+%^^A\DeclareOption{sanskrit}{\input{sanskrit.ldf}}
+\DeclareOption{scottish}{\input{scottish.ldf}}
+\DeclareOption{serbian}{\input{serbian.ldf}}
+\DeclareOption{slovak}{\input{slovak.ldf}}
+\DeclareOption{slovene}{\input{slovene.ldf}}
+\DeclareOption{spanish}{\input{spanish.ldf}}
+\DeclareOption{swedish}{\input{swedish.ldf}}
+%^^A\DeclareOption{tamil}{\input{tamil.ldf}}
+\DeclareOption{turkish}{\input{turkish.ldf}}
+\DeclareOption{ukrainian}{\input{ukraineb.ldf}}
+\DeclareOption{uppersorbian}{\input{usorbian.ldf}}
+\DeclareOption{welsh}{\input{welsh.ldf}}
+% \end{macrocode}
+% \changes{babel~3.6e}{1997/01/08}{Added options \Lopt{UKenglish} and
+% \Lopt{USenglish}}
+% \begin{macrocode}
+\DeclareOption{UKenglish}{\input{english.ldf}}
+\DeclareOption{USenglish}{\input{english.ldf}}
+% \end{macrocode}
+%
+% For all those languages for which the option name is the same as
+% the name of the language specific file we specify a default
+% option, which tries to load the file specified. If this doesn't
+% succeed an error is signalled.
+% \changes{babel~3.6i}{1997/03/12}{Added default option}
+% \begin{macrocode}
+\DeclareOption*{%
+ \InputIfFileExists{\CurrentOption.ldf}{}{%
+ \PackageError{babel}{%
+ Language definition file \CurrentOption.ldf not found}{%
+ Maybe you misspelled the language option?}}%
+ }
+% \end{macrocode}
+% Another way to extend the list of `known' options for \babel\ is
+% to create the file \file{bblopts.cfg} in which one can add
+% option declarations.
+% \changes{babel~3.6i}{1997/03/15}{Added the possibility to have a
+% \file{bblopts.cfg} file with option declarations.}
+% \begin{macrocode}
+\InputIfFileExists{bblopts.cfg}{%
+ \typeout{*************************************^^J%
+ * Local config file bblopts.cfg used^^J%
+ *}%
+ }{}
+% \end{macrocode}
+%
+% Apart from all the language options we also have a few options
+% that influence the behaviour of language definition files.
+%
+% The following options don't do anything themselves, they are just
+% defined in order to make it possible for language definition
+% files to check if one of them was specified by the user.
+% \changes{babel~3.5d}{1995/07/04}{Added options to influence
+% behaviour of active acute and grave accents}
+% \begin{macrocode}
+\DeclareOption{activeacute}{}
+\DeclareOption{activegrave}{}
+% \end{macrocode}
+% The next option tells \babel\ to leave shorthand characters
+% active at the end of processing the package. This is \emph{not}
+% the default as it can cause problems with other packages, but for
+% those who want to use the shorthand characters in the preamble of
+% their documents this can help.
+% \changes{babel~3.6f}{1997/01/14}{Added option
+% \Lopt{KeepShorthandsActive}}
+% \changes{babel~3.7a}{1997/03/21}{No longer define the control
+% sequence \cs{KeepShorthandsActive}}
+% \begin{macrocode}
+\DeclareOption{KeepShorthandsActive}{}
+% \end{macrocode}
+%
+% The options have to be processed in the order in which the user
+% specified them:
+% \begin{macrocode}
+\ProcessOptions*
+% \end{macrocode}
+% \changes{babel~3.7c}{1999/03/13}{Added an error message for when no
+% language option was specified}
+% In order to catch the case where the user forgot to specify a
+% language we check whether |\bbl@main@language|, has become
+% defined. If not, no language has been loaded and an error
+% message is displayed.
+% \changes{babel~3.7c}{1999/04/09}{No longer us a redefinition of an
+% internal macro, just check \cs{bbl@main@language} and load
+% \file{babel.def}}
+% \begin{macrocode}
+\ifx\bbl@main@language\@undefined
+ \PackageError{babel}{%
+ You haven't specified a language option}{%
+ You need to specify a language, either as a global
+ option\MessageBreak
+ or as an optional argument to the \string\usepackage\space
+ command; \MessageBreak
+ You shouldn't try to proceed from here, type x to quit.}
+% \end{macrocode}
+% To prevent undefined command errors when the user insists on
+% continuing we load \file{babel.def} here. He should expect more
+% errors though.
+% \begin{macrocode}
+ \input{babel.def}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\substitutefontfamily}
+% The command |\substitutefontfamily| creates an \file{.fd} file on
+% the fly. The first argument is an encoding mnemonic, the second
+% and third arguments are font family names.
+% \changes{babel~3.7j}{2003/06/15}{create file with lowercase name}
+% \begin{macrocode}
+\def\substitutefontfamily#1#2#3{%
+ \lowercase{\immediate\openout15=#1#2.fd\relax}%
+ \immediate\write15{%
+ \string\ProvidesFile{#1#2.fd}%
+ [\the\year/\two@digits{\the\month}/\two@digits{\the\day}
+ \space generated font description file]^^J
+ \string\DeclareFontFamily{#1}{#2}{}^^J
+ \string\DeclareFontShape{#1}{#2}{m}{n}{<->ssub * #3/m/n}{}^^J
+ \string\DeclareFontShape{#1}{#2}{m}{it}{<->ssub * #3/m/it}{}^^J
+ \string\DeclareFontShape{#1}{#2}{m}{sl}{<->ssub * #3/m/sl}{}^^J
+ \string\DeclareFontShape{#1}{#2}{m}{sc}{<->ssub * #3/m/sc}{}^^J
+ \string\DeclareFontShape{#1}{#2}{b}{n}{<->ssub * #3/bx/n}{}^^J
+ \string\DeclareFontShape{#1}{#2}{b}{it}{<->ssub * #3/bx/it}{}^^J
+ \string\DeclareFontShape{#1}{#2}{b}{sl}{<->ssub * #3/bx/sl}{}^^J
+ \string\DeclareFontShape{#1}{#2}{b}{sc}{<->ssub * #3/bx/sc}{}^^J
+ }%
+ \closeout15
+ }
+% \end{macrocode}
+% This command should only be used in the preamble of a document.
+% \begin{macrocode}
+\@onlypreamble\substitutefontfamily
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{The Kernel of Babel}
+%
+% The kernel of the \babel\ system is stored in either
+% \file{hyphen.cfg} or \file{switch.def} and \file{babel.def}. The
+% file \file{hyphen.cfg} is a file that can be loaded into the
+% format, which is necessary when you want to be able to switch
+% hyphenation patterns. The file \file{babel.def} contains some
+% \TeX\ code that can be read in at run time. When \file{babel.def}
+% is loaded it checks if \file{hyphen.cfg} is in the format; if
+% not the file \file{switch.def} is loaded.
+%
+% Because plain \TeX\ users might want to use some of the features
+% of the \babel{} system too, care has to be taken that plain \TeX\
+% can process the files. For this reason the current format will
+% have to be checked in a number of places. Some of the code below
+% is common to plain \TeX\ and \LaTeX, some of it is for the
+% \LaTeX\ case only.
+%
+% When the command |\AtBeginDocument| doesn't exist we assume that
+% we are dealing with a plain-based format. In that case the file
+% \file{plain.def} is needed.
+%
+% \begin{macrocode}
+%<*kernel|core>
+\ifx\AtBeginDocument\@undefined
+% \end{macrocode}
+% But we need to use the second part of \file{plain.def} (when we
+% load it from \file{switch.def}) which we can do by defining
+% |\adddialect|.
+% \changes{babel~3.7c}{1999/04/20}{define \cs{adddialect} before
+% loading \file{plain.def} here}
+% \begin{macrocode}
+%<kernel&!patterns> \def\adddialect{}
+ \input plain.def\relax
+\fi
+%</kernel|core>
+% \end{macrocode}
+%
+% Check the presence of the command |\iflanguage|, if it is
+% undefined read the file \file{switch.def}.
+% \changes{babel~3.0d}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \begin{macrocode}
+%<*core>
+\ifx\iflanguage\@undefined
+ \input switch.def\relax
+\fi
+%</core>
+% \end{macrocode}
+% \changes{babel~3.6a}{1996/11/02}{Removed \cs{babel@core@loaded}, no
+% longer needed with the advent of \cs{LdfInit}}
+%
+% \subsection{Encoding issues (part 1)}
+%
+% The first thing we need to do is to determine, at
+% |\begin{document}|, which latin fontencoding to use.
+%
+% \begin{macro}{\latinencoding}
+% \changes{babel~3.6i}{1997/03/15}{Macro added, moved from
+% \file{.ldf} files}
+% When text is being typeset in an encoding other than `latin'
+% (\texttt{OT1} or \texttt{T1}), it would be nice to still have
+% Roman numerals come out in the Latin encoding.
+% So we first assume that the current encoding at the end
+% of processing the package is the Latin encoding.
+% \begin{macrocode}
+%<*core>
+\AtEndOfPackage{\edef\latinencoding{\cf@encoding}}
+% \end{macrocode}
+% But this might be overruled with a later loading of the package
+% \pkg{fontenc}. Therefor we check at the execution of
+% |\begin{document}| whether it was loaded with the \Lopt{T1}
+% option. The normal way to do this (using |\@ifpackageloaded|) is
+% disabled for this package. Now we have to revert to parsing the
+% internal macro |\@filelist| which contains all the filenames
+% loaded.
+% \changes{babel~3.6k}{1999/03/15}{Use T1 encoding when it is a known
+% encoding}
+% \changes{babel~3.6m}{1999/04/06}{Can't use \cs{@ifpackageloaded}
+% need to parse \cs{@filelist}}
+% \changes{babel~3.6n}{1999/04/07}{moved checking for fontenc right to
+% the top of \file{babel.sty}}
+% \changes{babel~3.6n}{1999/04/07}{Added a check for `manual' selection
+% of \texttt{T1} encoding, without loading \pkg{fontenc}}
+% \changes{babel~3.6q}{1999/04/12}{Better solution then parsing
+% \cs{@filelist}, use \cs{@ifl@aded}}
+% \changes{babel~3.6u}{1999/04/20}{Moved this code to
+% \file{babel.def}}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \gdef\latinencoding{OT1}%
+ \ifx\cf@encoding\bbl@t@one
+ \xdef\latinencoding{\bbl@t@one}%
+ \else
+ \@ifl@aded{def}{t1enc}{\xdef\latinencoding{\bbl@t@one}}{}%
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\latintext}
+% \changes{babel~3.6i}{1997/03/15}{Macro added, moved from
+% \file{.ldf} files}
+% Then we can define the command |\latintext| which is a
+% declarative switch to a latin font-encoding.
+% \begin{macrocode}
+\DeclareRobustCommand{\latintext}{%
+ \fontencoding{\latinencoding}\selectfont
+ \def\encodingdefault{\latinencoding}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textlatin}
+% \changes{babel~3.6i}{1997/03/15}{Macro added, moved from
+% \file{.ldf} files}
+% \changes{babel~3.7j}{2003/03/19}{added \cs{leavevmode} to prevent a
+% paragraph starting \emph{inside} the group}
+% \changes{babel~3.7k}{2003/10/12}{Use \cs{DeclareTextFontComand}}
+% This command takes an argument which is then typeset using the
+% requested font encoding. In order to avoid many encoding switches
+% it operates in a local scope.
+% \begin{macrocode}
+\ifx\@undefined\DeclareTextFontCommand
+ \DeclareRobustCommand{\textlatin}[1]{\leavevmode{\latintext #1}}
+\else
+ \DeclareTextFontCommand{\textlatin}{\latintext}
+\fi
+%</core>
+% \end{macrocode}
+% \end{macro}
+%
+% We also need to redefine a number of commands to ensure that the
+% right font encoding is used, but this can't be done before
+% \file{babel.def} is loaded.
+% \changes{babel~3.6o}{1999/04/07}{Moved the rest of the font encoding
+% related definitions to their original place}
+%
+% \subsection{Multiple languages}
+%
+% With \TeX\ version~3.0 it has become possible to load hyphenation
+% patterns for more than one language. This means that some extra
+% administration has to be taken care of. The user has to know for
+% which languages patterns have been loaded, and what values of
+% |\language| have been used.
+%
+% Some discussion has been going on in the \TeX\ world about how to
+% use |\language|. Some have suggested to set a fixed standard,
+% i.\,e., patterns for each language should \emph{always} be loaded
+% in the same location. It has also been suggested to use the
+% \textsc{iso} list for this purpose. Others have pointed out that
+% the \textsc{iso} list contains more than 256~languages, which
+% have \emph{not} been numbered consecutively.
+%
+% I think the best way to use |\language|, is to use it
+% dynamically. This code implements an algorithm to do so. It uses
+% an external file in which the person who maintains a \TeX\
+% environment has to record for which languages he has hyphenation
+% patterns \emph{and} in which files these are stored\footnote{This
+% is because different operating systems sometimes use \emph{very}
+% different file-naming conventions.}. When hyphenation exceptions
+% are stored in a separate file this can be indicated by naming
+% that file \emph{after} the file with the hyphenation patterns.
+%
+% This ``configuration file'' can contain empty lines and comments,
+% as well as lines which start with an equals (\texttt{=})
+% sign. Such a line will instruct \LaTeX\ that the hyphenation
+% patterns just processed have to be known under an alternative
+% name. Here is an example:
+% \begin{verbatim}
+% % File : language.dat
+% % Purpose : tell iniTeX what files with patterns to load.
+% english english.hyphenations
+% =british
+%
+% dutch hyphen.dutch exceptions.dutch % Nederlands
+% german hyphen.ger
+% \end{verbatim}
+%
+% As the file \file{switch.def} needs to be read only once, we
+% check whether it was read before. If it was, the command
+% |\iflanguage| is already defined, so we can stop processing.
+% \begin{macrocode}
+%<*kernel>
+%<*!patterns>
+\expandafter\ifx\csname iflanguage\endcsname\relax \else
+\expandafter\endinput
+\fi
+%</!patterns>
+% \end{macrocode}
+%
+% \begin{macro}{\language}
+% Plain \TeX\ version~3.0 provides the primitive |\language| that
+% is used to store the current language. When used with a pre-3.0
+% version this function has to be implemented by allocating a
+% counter.
+% \begin{macrocode}
+\ifx\language\@undefined
+ \csname newcount\endcsname\language
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\last@language}
+% Another counter is used to store the last language defined. For
+% pre-3.0 formats an extra counter has to be allocated,
+% \begin{macrocode}
+\ifx\newlanguage\@undefined
+ \csname newcount\endcsname\last@language
+% \end{macrocode}
+% plain \TeX\ version 3.0 uses |\count 19| for this purpose.
+% \begin{macrocode}
+\else
+ \countdef\last@language=19
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\addlanguage}
+%
+% To add languages to \TeX's memory plain \TeX\ version~3.0
+% supplies |\newlanguage|, in a pre-3.0 environment a similar macro
+% has to be provided. For both cases a new macro is defined here,
+% because the original |\newlanguage| was defined to be |\outer|.
+%
+% For a format based on plain version~2.x, the definition of
+% |\newlanguage| can not be copied because |\count 19| is used for
+% other purposes in these formats. Therefor |\addlanguage| is
+% defined using a definition based on the macros used to define
+% |\newlanguage| in plain \TeX\ version~3.0.
+% \changes{babel~3.2}{1991/11/11}{Added a \texttt{\%}, removed
+% \texttt{by}}
+% \begin{macrocode}
+\ifx\newlanguage\@undefined
+ \def\addlanguage#1{%
+ \global\advance\last@language \@ne
+ \ifnum\last@language<\@cclvi
+ \else
+ \errmessage{No room for a new \string\language!}%
+ \fi
+ \global\chardef#1\last@language
+ \wlog{\string#1 = \string\language\the\last@language}}
+% \end{macrocode}
+%
+% For formats based on plain version~3.0 the definition of
+% |\newlanguage| can be simply copied, removing |\outer|.
+%
+% \begin{macrocode}
+\else
+ \def\addlanguage{\alloc@9\language\chardef\@cclvi}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\adddialect}
+% The macro |\adddialect| can be used to add the name of a dialect
+% or variant language, for which an already defined hyphenation
+% table can be used.
+% \changes{babel~3.2}{1991/11/11}{Added \cs{relax}}
+% \begin{macrocode}
+\def\adddialect#1#2{%
+ \global\chardef#1#2\relax
+ \wlog{\string#1 = a dialect from \string\language#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\iflanguage}
+% Users might want to test (in a private package for instance)
+% which language is currently active. For this we provide a test
+% macro, |\iflanguage|, that has three arguments. It checks
+% whether the first argument is a known language. If so, it
+% compares the first argument with the value of |\language|. Then,
+% depending on the result of the comparison, it executes either the
+% second or the third argument.
+% \changes{babel~3.0a}{1991/05/29}{Added \cs{@bsphack} and
+% \cs{@esphack}}
+% \changes{babel~3.0c}{1991/07/21}{Added comment character after
+% \texttt{\#2}}
+% \changes{babel~3.0d}{1991/08/08}{Removed superfluous
+% \cs{expandafter}}
+% \changes{babel~3.0d}{1991/10/07}{Removed space hacks and use of
+% \cs{@ifundefined}}
+% \changes{babel~3.2}{1991/11/11}{Rephrased \cs{ifnum} test}
+% \changes{babel~3.7a}{1998/06/10}{Now evaluate the \cs{ifnum} test
+% \emph{after} the \cs{fi} from the \cs{ifx} test and use
+% \cs{@firstoftwo} and \cs{@secondoftwo}}
+% \changes{babel~3.7b}{1998/06/29}{Slight enhancement: added braces
+% around first argument of \cs{bbl@afterfi}}
+% \begin{macrocode}
+\def\iflanguage#1{%
+ \expandafter\ifx\csname l@#1\endcsname\relax
+ \@nolanerr{#1}%
+ \else
+ \bbl@afterfi{\ifnum\csname l@#1\endcsname=\language
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\selectlanguage}
+% The macro |\selectlanguage| checks whether the language is
+% already defined before it performs its actual task, which is to
+% update |\language| and activate language-specific definitions.
+%
+% To allow the call of |\selectlanguage| either with a control
+% sequence name or with a simple string as argument, we have to use
+% a trick to delete the optional escape character.
+%
+% To convert a control sequence to a string, we use the |\string|
+% primitive. Next we have to look at the first character of this
+% string and compare it with the escape character. Because this
+% escape character can be changed by setting the internal integer
+% |\escapechar| to a character number, we have to compare this
+% number with the character of the string. To do this we have to
+% use \TeX's backquote notation to specify the character as a
+% number.
+%
+% If the first character of the |\string|'ed argument is the
+% current escape character, the comparison has stripped this
+% character and the rest in the `then' part consists of the rest of
+% the control sequence name. Otherwise we know that either the
+% argument is not a control sequence or |\escapechar| is set to a
+% value outside of the character range~$0$--$255$.
+%
+% If the user gives an empty argument, we provide a default
+% argument for |\string|. This argument should expand to nothing.
+%
+% \changes{babel~3.0c}{1991/06/06}{Made \cs{selectlanguage}
+% robust}
+% \changes{babel~3.2}{1991/11/11}{Modified to allow arguments that
+% start with an escape character}
+% \changes{babel~3.2a}{1991/11/17}{Simplified the modification to
+% allow the use in a \cs{write} command}
+% \changes{babel~3.5b}{1995/05/13}{Store the name of the current
+% language in a control sequence instead of passing the whole macro
+% construct to strip the escape character in the argument of
+% \cs{selectlanguage }.}
+% \changes{babel~3.5f}{1995/08/30}{Added a missing percent character}
+% \changes{babel~3.5f}{1995/11/16}{Moved check for escape character
+% one level down in the expansion}
+% \begin{macrocode}
+\edef\selectlanguage{%
+ \noexpand\protect
+ \expandafter\noexpand\csname selectlanguage \endcsname
+ }
+% \end{macrocode}
+% Because the command |\selectlanguage| could be used in a moving
+% argument it expands to \verb*=\protect\selectlanguage =.
+% Therefor, we have to make sure that a macro |\protect| exists.
+% If it doesn't it is |\let| to |\relax|.
+% \begin{macrocode}
+\ifx\@undefined\protect\let\protect\relax\fi
+% \end{macrocode}
+% As \LaTeX$\:$2.09 writes to files \textit{expanded} whereas
+% \LaTeXe\ takes care \textit{not} to expand the arguments of
+% |\write| statements we need to be a bit clever about the way we
+% add information to \file{.aux} files. Therefor we introduce the
+% macro |\xstring| which should expand to the right amount of
+% |\string|'s.
+% \begin{macrocode}
+\ifx\documentclass\@undefined
+ \def\xstring{\string\string\string}
+\else
+ \let\xstring\string
+\fi
+% \end{macrocode}
+%
+% \changes{babel~3.5b}{1995/03/04}{Changed the name of the internal
+% macro to \cs{selectlanguage }.}
+% \changes{babel~3.5b}{1995/03/05}{Added an extra level of expansion to
+% separate the switching mechanism from writing to aux files}
+% \changes{babel~3.7f}{2000/09/25}{Use \cs{aftergroup} to keep the
+% language grouping correct in auxiliary files {PR3091}}
+% Since version 3.5 \babel\ writes entries to the auxiliary files in
+% order to typeset table of contents etc. in the correct language
+% environment.
+% \begin{macro}{\bbl@pop@language}
+% \emph{But} when the language change happens \emph{inside} a group
+% the end of the group doesn't write anything to the auxiliary
+% files. Therefor we need \TeX's |aftergroup| mechanism to help
+% us. The command |\aftergroup| stores the token immediately
+% following it to be executed when the current group is closed. So
+% we define a temporary control sequence |\bbl@pop@language| to be
+% executed at the end of the group. It calls |\bbl@set@language|
+% with the name of the current language as its argument.
+%
+% \changes{babel~3.7j}{2003/03/18}{Introduce the language stack
+% mechanism}
+% \begin{macro}{\bbl@language@stack}
+% The previous solution works for one level of nesting groups, but
+% as soon as more levels are used it is no longer adequate. For
+% that case we need to keep track of the nested languages using a
+% stack mechanism. This stack is called |\bbl@language@stack| and
+% initially empty.
+% \begin{macrocode}
+\xdef\bbl@language@stack{}
+% \end{macrocode}
+% When using a stack we need a mechanism to push an element on the
+% stack and to retrieve the information afterwards.
+% \begin{macro}{\bbl@push@language}
+% \begin{macro}{\bbl@pop@language}
+% The stack is simply a list of languagenames, separated with a `+'
+% sign; the push function can be simple:
+% \begin{macrocode}
+\def\bbl@push@language{%
+ \xdef\bbl@language@stack{\languagename+\bbl@language@stack}%
+ }
+% \end{macrocode}
+% Retrieving information from the stack is a little bit less simple,
+% as we need to remove the element from the stack while storing it
+% in the macro |\languagename|. For this we first define a helper function.
+% \begin{macro}{\bbl@pop@lang}
+% This macro stores its first element (which is delimited by the
+% `+'-sign) in |\languagename| and stores the rest of the string
+% (delimited by `-') in its third argument.
+% \begin{macrocode}
+\def\bbl@pop@lang#1+#2-#3{%
+ \def\languagename{#1}\xdef#3{#2}%
+ }
+% \end{macrocode}
+% \end{macro}
+% The reason for the somewhat weird arrangement of arguments to the
+% helper function is the fact it is called in the following way:
+% \begin{macrocode}
+\def\bbl@pop@language{%
+ \expandafter\bbl@pop@lang\bbl@language@stack-\bbl@language@stack
+% \end{macrocode}
+% This means that before |\bbl@pop@lang| is executed \TeX\ first
+% \emph{expands} the stack, stored in |\bbl@language@stack|. The
+% result of that is that the argument string of |\bbl@pop@lang|
+% contains one or more language names, each followed by a `+'-sign
+% (zero language names won't occur as this macro will only be
+% called after something has been pushed on the stack) followed by
+% the `-'-sign and finally the reference to the stack.
+% \begin{macrocode}$$
+ \expandafter\bbl@set@language\expandafter{\languagename}%
+ }
+% \end{macrocode}
+% Once the name of the previous language is retrieved from the stack,
+% it is fed to |\bbl@set@language| to do the actual work of
+% switching everything that needs switching.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{babel~3.7j}{2003/03/18}{Now use the language stack mechanism}
+% \begin{macrocode}
+\expandafter\def\csname selectlanguage \endcsname#1{%
+ \bbl@push@language
+ \aftergroup\bbl@pop@language
+ \bbl@set@language{#1}}
+% \end{macrocode}
+% \changes{babel~3.7m}{2003/11/12}{Removed the superfluous empty
+% definition of \cs{bbl@pop@language}}
+% \end{macro}
+%
+% \begin{macro}{\bbl@set@language}
+% \changes{babel~3.5f}{1995/11/16}{Now also define \cs{languagename}
+% at this level}
+% \changes{babel~3.7f}{2000/09/25}{Macro \cs{bbl@set@language}
+% introduced}
+% The macro |\bbl@set@language| takes care of switching the language
+% environment \emph{and} of writing entries on the auxiliary files.
+% \begin{macrocode}
+\def\bbl@set@language#1{%
+ \edef\languagename{%
+ \ifnum\escapechar=\expandafter`\string#1\@empty
+ \else \string#1\@empty\fi}%
+ \select@language{\languagename}%
+% \end{macrocode}
+% We also write a command to change the current language in the
+% auxiliary files.
+% \changes{babel~3.5a}{1995/02/17}{write the language change to the
+% auxiliary files}
+% \begin{macrocode}
+ \if@filesw
+ \protected@write\@auxout{}{\string\select@language{\languagename}}%
+ \addtocontents{toc}{\xstring\select@language{\languagename}}%
+ \addtocontents{lof}{\xstring\select@language{\languagename}}%
+ \addtocontents{lot}{\xstring\select@language{\languagename}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% First, check if the user asks for a known language. If so,
+% update the value of |\language| and call |\originalTeX|
+% to bring \TeX\ in a certain pre-defined state.
+% \changes{babel~3.0a}{1991/05/29}{Added \cs{@bsphack} and
+% \cs{@esphack}}
+% \changes{babel~3.0d}{1991/08/08}{Removed superfluous
+% \cs{expandafter}}
+% \changes{babel~3.0d}{1991/10/07}{Removed space hacks and use of
+% \cs{@ifundefined}}
+% \changes{babel~3.2a}{1991/11/17}{Added \cs{relax} as first command
+% to stop an expansion if \cs{protect} is empty}
+% \changes{babel~3.6a}{1996/11/07}{Check for the existence of
+% \cs{date...} instead of \cs{l@...}}
+% \changes{babel~3.7m}{2003/11/16}{Check for the existence of both
+% \cs{l@...} and \cs{date...}}
+% \begin{macrocode}
+\def\select@language#1{%
+ \expandafter\ifx\csname l@#1\endcsname\relax
+ \@nolanerr{#1}%
+ \else
+ \expandafter\ifx\csname date#1\endcsname\relax
+ \@noopterr{#1}%
+ \else
+ \language=\csname l@#1\endcsname\relax
+ \originalTeX
+% \end{macrocode}
+% The name of the language is stored in the control sequence
+% |\languagename|. The contents of this control sequence could be
+% tested in the following way:
+% \begin{verbatim}
+% \edef\tmp{\string english}
+% \ifx\languagename\tmp
+% ...
+% \else
+% ...
+% \fi
+% \end{verbatim}
+% The construction with |\string| is necessary because
+% |\languagename| returns the name with characters of category code
+% \texttt{12} (other). Then we have to \emph{re}define
+% |\originalTeX| to compensate for the things that have been
+% activated. To save memory space for the macro definition of
+% |\originalTeX|, we construct the control sequence name for the
+% |\noextras|\langvar\ command at definition time by expanding the
+% |\csname| primitive.
+% \changes{babel~3.0a}{1991/06/06}{Replaced \cs{gdef} with \cs{def}}
+% \changes{babel~3.1}{1991/10/31}{\cs{originalTeX} should only be
+% executed once}
+% \changes{babel~3.2a}{1991/11/17}{Added three \cs{expandafter}s
+% to save macro space for \cs{originalTeX}}
+% \changes{babel~3.2a}{1991/11/20}{Moved definition of
+% \cs{originalTeX} before \cs{extras\langvar}}
+% \changes{babel~3.2a}{1991/11/24}{Set \cs{originalTeX} to
+% \cs{empty}, because it should be expandable.}
+% \begin{macrocode}
+ \expandafter\def\expandafter\originalTeX
+ \expandafter{\csname noextras#1\endcsname
+ \let\originalTeX\@empty}%
+% \end{macrocode}
+% \changes{babel~3.6d}{1997/01/07}{set the language shorthands to
+% `none' before switching on the extras}
+% \begin{macrocode}
+ \languageshorthands{none}%
+ \babel@beginsave
+% \end{macrocode}
+% Now activate the language-specific definitions. This is done by
+% constructing the names of three macros by concatenating three
+% words with the argument of |\selectlanguage|, and calling these
+% macros.
+% \changes{babel~3.5b}{1995/05/13}{Separated the setting of the
+% hyphenmin values}
+% \begin{macrocode}
+ \csname captions#1\endcsname
+ \csname date#1\endcsname
+ \csname extras#1\endcsname\relax
+% \end{macrocode}
+% The switching of the values of |\lefthyphenmin| and
+% |\righthyphenmin| is somewhat different. First we save their
+% current values, then we check if |\|\langvar|hyphenmins| is
+% defined. If it is not, we set default values (2 and 3), otherwise
+% the values in |\|\langvar|hyphenmins| will be used.
+% \changes{babel~3.5b}{1995/06/05}{Addedd default setting of hyphenmin
+% parameters}
+% \begin{macrocode}
+ \babel@savevariable\lefthyphenmin
+ \babel@savevariable\righthyphenmin
+ \expandafter\ifx\csname #1hyphenmins\endcsname\relax
+ \set@hyphenmins\tw@\thr@@\relax
+ \else
+ \expandafter\expandafter\expandafter\set@hyphenmins
+ \csname #1hyphenmins\endcsname\relax
+ \fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{otherlanguage}
+% The \Lenv{otherlanguage} environment can be used as an
+% alternative to using the |\selectlanguage| declarative
+% command. When you are typesetting a document which mixes
+% left-to-right and right-to-left typesetting you have to use this
+% environment in order to let things work as you expect them to.
+%
+% The first thing this environment does is store the name of the
+% language in |\languagename|; it then calls
+% \verb*=\selectlanguage = to switch on everything that is needed for
+% this language The |\ignorespaces| command is necessary to hide
+% the environment when it is entered in horizontal mode.
+% \changes{babel~3.5d}{1995/06/22}{environment added}
+% \changes{babel~3.5e}{1995/07/07}{changed name}
+% \changes{babel~3.7j}{2003/03/18}{rely on \cs{selectlanguage } to
+% keep track of the nesting}
+% \begin{macrocode}
+\long\def\otherlanguage#1{%
+ \csname selectlanguage \endcsname{#1}%
+ \ignorespaces
+ }
+% \end{macrocode}
+% The |\endotherlanguage| part of the environment calls
+% |\originalTeX| to restore (most of) the settings and tries to
+% hide itself when it is called in horizontal mode.
+% \begin{macrocode}
+\long\def\endotherlanguage{%
+ \originalTeX
+ \global\@ignoretrue\ignorespaces
+ }
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \begin{environment}{otherlanguage*}
+% The \Lenv{otherlanguage} environment is meant to be used when a
+% large part of text from a different language needs to be typeset,
+% but without changing the translation of words such as `figure'.
+%
+% This environment makes use of |\foreign@language|.
+% \changes{babel~3.5f}{1996/05/29}{environment added}
+% \changes{babel~3.6d}{1997/01/07}{Introduced \cs{foreign@language}}
+% \begin{macrocode}
+\expandafter\def\csname otherlanguage*\endcsname#1{%
+ \foreign@language{#1}%
+ }
+% \end{macrocode}
+% At the end of the environment we need to switch off the extra
+% definitions. The grouping mechanism of the environment will take
+% care of resetting the correct hyphenation rules.
+% \begin{macrocode}
+\expandafter\def\csname endotherlanguage*\endcsname{%
+ \csname noextras\languagename\endcsname
+ }
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\foreignlanguage}
+% The |\foreignlanguage| command is another substitute for the
+% |\selectlanguage| command. This command takes two arguments, the
+% first argument is the name of the language to use for typesetting
+% the text specified in the second argument.
+%
+% Unlike |\selectlanguage| this command doesn't switch
+% \emph{everything}, it only switches the hyphenation rules and the
+% extra definitions for the language specified. It does this within
+% a group and assumes the |\extras|\langvar\ command doesn't make
+% any |\global| changes. The coding is very similar to part of
+% |\selectlanguage|.
+% \changes{babel~3.5d}{1995/06/22}{Macro added}
+% \changes{babel~3.6d}{1997/01/07}{Introduced \cs{foreign@language}}
+% \changes{babel~3.7a}{1998/03/12}{Added executing \cs{originalTeX}}
+% \begin{macrocode}
+\def\foreignlanguage{\protect\csname foreignlanguage \endcsname}
+\expandafter\def\csname foreignlanguage \endcsname#1#2{%
+ \begingroup
+ \originalTeX
+ \foreign@language{#1}%
+ #2%
+ \csname noextras#1\endcsname
+ \endgroup
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\foreign@language}
+% \changes{babel~3.6d}{1997/01/07}{New macro}
+% This macro does the work for |\foreignlanguage| and the
+% \Lenv{otherlanguage*} environment.
+% \begin{macrocode}
+\def\foreign@language#1{%
+% \end{macrocode}
+% First we need to store the name of the language and check that it
+% is a known language.
+% \begin{macrocode}
+ \def\languagename{#1}%
+ \expandafter\ifx\csname l@#1\endcsname\relax
+ \@nolanerr{#1}%
+ \else
+% \end{macrocode}
+% If it is we can select the proper hyphenation table and switch on
+% the extra definitions for this language.
+% \changes{babel~3.6d}{1997/01/07}{set the language shorthands to
+% `none' before switching on the extras}
+% \begin{macrocode}
+ \language=\csname l@#1\endcsname\relax
+ \languageshorthands{none}%
+% \end{macrocode}
+% Then we set the left- and right hyphenmin variables.
+% \changes{babel~3.6d}{1997/01/07}{Added \cs{relax} to prevent
+% disappearance of the first token after this command.}
+% \begin{macrocode}
+ \csname extras#1\endcsname
+ \expandafter\ifx\csname #1hyphenmins\endcsname\relax
+ \set@hyphenmins\tw@\thr@@\relax
+ \else
+ \expandafter\expandafter\expandafter\set@hyphenmins
+ \csname #1hyphenmins\endcsname\relax
+ \fi
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{hyphenrules}
+% \changes{babel~3.7e}{2000/01/28}{Added environment hyphenrules}
+% The environment \Lenv{hyphenrules} can be used to select
+% \emph{just} the hyphenation rules. This environment does
+% \emph{not} change |\languagename| and when the hyphenation rules
+% specified were not loaded it has no effect.
+% \begin{macrocode}
+\def\hyphenrules#1{%
+ \expandafter\ifx\csname l@#1\endcsname\@undefined
+ \@nolanerr{#1}%
+ \else
+ \language=\csname l@#1\endcsname\relax
+ \languageshorthands{none}%
+ \fi
+ }
+\def\endhyphenrules{}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\providehyphenmins}
+% \changes{babel~3.7f}{2000/02/18}{added macro}
+% The macro |\providehyphenmins| should be used in the language
+% definition files to provide a \emph{default} setting for the
+% hyphenation parameters |\lefthyphenmin| and |\righthyphenmin|. If
+% the macro |\|\langvar|hyphenmins| is already defined this command
+% has no effect.
+% \begin{macrocode}
+\def\providehyphenmins#1#2{%
+ \expandafter\ifx\csname #1hyphenmins\endcsname\relax
+ \@namedef{#1hyphenmins}{#2}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\set@hyphenmins}
+% This macro sets the values of |\lefthyphenmin| and
+% |\righthyphenmin|. It expects two values as its argument.
+% \begin{macrocode}
+\def\set@hyphenmins#1#2{\lefthyphenmin#1\righthyphenmin#2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LdfInit}
+% \changes{babel~3.6a}{1996/10/16}{Macro added}
+% This macro is defined in two versions. The first version is to be
+% part of the `kernel' of \babel, ie. the part that is loaded in
+% the format; the second version is defined in \file{babel.def}.
+% The version in the format just checks the category code of the
+% ampersand and then loads \file{babel.def}.
+% \begin{macrocode}
+\def\LdfInit{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+ \input babel.def\relax
+% \end{macrocode}
+% The category code of the ampersand is restored and the macro
+% calls itself again with the new definition from
+% \file{babel.def}
+% \begin{macrocode}
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \LdfInit}
+%</kernel>
+% \end{macrocode}
+% The second version of this macro takes two arguments. The first
+% argument is the name of the language that will be defined in the
+% language definition file; the second argument is either a control
+% sequence or a string from which a control sequence should be
+% constructed. The existence of the control sequence indicates that
+% the file has been processed before.
+%
+% At the start of processing a language definition file we always
+% check the category code of the ampersand. We make sure that it is
+% a `letter' during the processing of the file.
+% \begin{macrocode}
+%<*core>
+\def\LdfInit#1#2{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+% \end{macrocode}
+% Another character that needs to have the correct category code
+% during processing of language definition files is the equals sign,
+% `=', because it is sometimes used in constructions with the
+% |\let| primitive. Therefor we store its current catcode and
+% restore it later on.
+% \changes{babel~3.7o}{2003/11/26}{make sure the equals sign has its
+% default category code}
+% \begin{macrocode}
+ \chardef\eqcatcode=\catcode`\=
+ \catcode`\==12\relax
+% \end{macrocode}
+% Now we check whether we should perhaps stop the processing of
+% this file. To do this we first need to check whether the second
+% argument that is passed to |\LdfInit| is a control sequence. We
+% do that by looking at the first token after passing |#2| through
+% |string|. When it is equal to |\@backslashchar| we are dealing
+% with a control sequence which we can compare with |\@undefined|.
+% \begin{macrocode}
+ \let\bbl@tempa\relax
+ \expandafter\if\expandafter\@backslashchar
+ \expandafter\@car\string#2\@nil
+ \ifx#2\@undefined
+ \else
+% \end{macrocode}
+% If so, we call |\ldf@quit| (but after the end of this |\if|
+% construction) to set the main language, restore the category code
+% of the @-sign and call |\endinput|.
+% \begin{macrocode}
+ \def\bbl@tempa{\ldf@quit{#1}}
+ \fi
+ \else
+% \end{macrocode}
+% When |#2| was \emph{not} a control sequence we construct one and
+% compare it with |\relax|.
+% \begin{macrocode}
+ \expandafter\ifx\csname#2\endcsname\relax
+ \else
+ \def\bbl@tempa{\ldf@quit{#1}}
+ \fi
+ \fi
+ \bbl@tempa
+% \end{macrocode}
+% Finally we check |\originalTeX|.
+% \begin{macrocode}
+ \ifx\originalTeX\@undefined
+ \let\originalTeX\@empty
+ \else
+ \originalTeX
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ldf@quit}
+% \changes{babel~3.6a}{1996/10/29}{Macro added}
+% This macro interrupts the processing of a language definition file.
+% \changes{babel~3.7o}{2003/11/26}{Also restore the category code of
+% the equals sign}
+% \begin{macrocode}
+\def\ldf@quit#1{%
+ \expandafter\main@language\expandafter{#1}%
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \catcode`\==\eqcatcode \let\eqcatcode\relax
+ \endinput
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ldf@finish}
+% \changes{babel~3.6a}{1996/10/16}{Macro added}
+% This macro takes one argument. It is the name of the language
+% that was defined in the language definition file.
+%
+% We load the local configuration file if one is present, we set
+% the main language (taking into account that the argument might be
+% a control sequence that needs to be expanded) and reset the
+% category code of the @-sign.
+% \changes{babel~3.7o}{2003/11/26}{Also restore the category code of
+% the equals sign}
+% \begin{macrocode}
+\def\ldf@finish#1{%
+ \loadlocalcfg{#1}%
+ \expandafter\main@language\expandafter{#1}%
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \catcode`\==\eqcatcode \let\eqcatcode\relax
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% After the preamble of the document the commands |\LdfInit|,
+% |\ldf@quit| and |\ldf@finish| are no longer needed. Therefor
+% they are turned into warning messages in \LaTeX.
+% \begin{macrocode}
+\@onlypreamble\LdfInit
+\@onlypreamble\ldf@quit
+\@onlypreamble\ldf@finish
+% \end{macrocode}
+%
+% \begin{macro}{\main@language}
+% \changes{babel~3.5a}{1995/02/17}{Macro added}
+% \changes{babel~3.6a}{1996/10/16}{\cs{main@language} now also sets
+% \cs{languagename} and \cs{l@languagename} for use by other
+% packages in the preamble of a document}
+% \begin{macro}{\bbl@main@language}
+% \changes{babel~3.5a}{1995/02/17}{Macro added}
+% This command should be used in the various language definition
+% files. It stores its argument in |\bbl@main@language|; to be used
+% to switch to the correct language at the beginning of the
+% document.
+% \begin{macrocode}
+\def\main@language#1{%
+ \def\bbl@main@language{#1}%
+ \let\languagename\bbl@main@language
+ \language=\csname l@\languagename\endcsname\relax
+ }
+% \end{macrocode}
+% The default is to use English as the main language.
+% \changes{babel~3.6c}{1997/01/05}{When \file{hyphen.cfg} is not
+% loaded in the format \cs{l@english} might not be defined; assume
+% english is language 0}
+% \begin{macrocode}
+\ifx\l@english\@undefined
+ \let\l@english\z@
+\fi
+\main@language{english}
+% \end{macrocode}
+% We also have to make sure that some code gets executed at the
+% beginning of the document.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \expandafter\selectlanguage\expandafter{\bbl@main@language}}
+%</core>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\originalTeX}
+% The macro|\originalTeX| should be known to \TeX\ at this moment.
+% As it has to be expandable we |\let| it to |\@empty| instead of
+% |\relax|.
+% \changes{babel~3.2a}{1991/11/24}{Set \cs{originalTeX} to
+% \cs{empty}, because it should be expandable.}
+% \begin{macrocode}
+%<*kernel>
+\ifx\originalTeX\@undefined\let\originalTeX\@empty\fi
+% \end{macrocode}
+% Because this part of the code can be included in a format, we
+% make sure that the macro which initialises the save mechanism,
+% |\babel@beginsave|, is not considered to be undefined.
+% \begin{macrocode}
+\ifx\babel@beginsave\@undefined\let\babel@beginsave\relax\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@nolanerr}
+% \changes{babel~3.4e}{1994/06/25}{Use \cs{PackageError} in \LaTeXe\
+% mode}
+% \begin{macro}{\@nopatterns}
+% \changes{babel~3.4e}{1994/06/25}{Macro added}
+% The \babel\ package will signal an error when a documents tries
+% to select a language that hasn't been defined earlier. When a
+% user selects a language for which no hyphenation patterns were
+% loaded into the format he will be given a warning about that
+% fact. We revert to the patterns for |\language|=0 in that case.
+% In most formats that will be (US)english, but it might also be
+% empty.
+% \begin{macro}{\@noopterr}
+% \changes{babel~3.7m}{2003/11/16}{Macro added}
+% When the package was loaded without options not everything will
+% work as expected. An error message is issued in that case.
+%
+% When the format knows about |\PackageError| it must be \LaTeXe,
+% so we can safely use its error handling interface. Otherwise
+% we'll have to `keep it simple'.
+% \changes{babel~3.0d}{1991/10/07}{Added a percent sign to remove
+% unwanted white space}
+% \changes{babel~3.5a}{1995/02/15}{Added \cs{@activated} to log active
+% characters}
+% \changes{babel~3.5c}{1995/06/19}{Added missing closing brace}
+% \begin{macrocode}
+\ifx\PackageError\@undefined
+ \def\@nolanerr#1{%
+ \errhelp{Your command will be ignored, type <return> to proceed}%
+ \errmessage{You haven't defined the language #1\space yet}}
+ \def\@nopatterns#1{%
+ \message{No hyphenation patterns were loaded for}%
+ \message{the language `#1'}%
+ \message{I will use the patterns loaded for \string\language=0
+ instead}}
+ \def\@noopterr#1{%
+ \errmessage{The option #1 was not specified in \string\usepackage}
+ \errhelp{You may continue, but expect unexpected results}}
+ \def\@activated#1{%
+ \wlog{Package babel Info: Making #1 an active character}}
+\else
+ \newcommand*{\@nolanerr}[1]{%
+ \PackageError{babel}%
+ {You haven't defined the language #1\space yet}%
+ {Your command will be ignored, type <return> to proceed}}
+ \newcommand*{\@nopatterns}[1]{%
+ \PackageWarningNoLine{babel}%
+ {No hyphenation patterns were loaded for\MessageBreak
+ the language `#1'\MessageBreak
+ I will use the patterns loaded for \string\language=0
+ instead}}
+ \newcommand*{\@noopterr}[1]{%
+ \PackageError{babel}%
+ {You haven't loaded the option #1\space yet}%
+ {You may proceed, but expect unexpected results}}
+ \newcommand*{\@activated}[1]{%
+ \PackageInfo{babel}{%
+ Making #1 an active character}}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The following code is meant to be read by ini\TeX\ because it
+% should instruct \TeX\ to read hyphenation patterns. To this end
+% the \texttt{docstrip} option \texttt{patterns} can be used to
+% include this code in the file \file{hyphen.cfg}.
+% \begin{macrocode}
+%<*patterns>
+% \end{macrocode}
+%
+% \changes{babel~3.5g}{1996/07/09}{Removed the use of
+% \cs{patterns@loaded} altogether}
+%
+% \begin{macro}{\process@line}
+% \changes{babel~3.5b}{1995/04/28}{added macro}
+% Each line in the file \file{language.dat} is processed by
+% |\process@line| after it is read. The first thing this macro does
+% is to check whether the line starts with \texttt{=}.
+% When the first token of a line is an \texttt{=}, the macro
+% |\process@synonym| is called; otherwise the macro
+% |\process@language| will continue.
+% \changes{babel~3.5g}{1996/07/09}{Simplified code, removing
+% \cs{bbl@eq@}}
+% \changes{babel~3.7c}{1999/04/09}{added an extra argument in order to
+% prevent a trailing space from becoming part of the control
+% sequence when defining a synonym (PR 2851)}
+% \begin{macrocode}
+\def\process@line#1#2 #3/{%
+ \ifx=#1
+ \process@synonym#2 /
+ \else
+ \process@language#1#2 #3/%
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\process@synonym}
+% \changes{babel~3.5b}{1995/04/28}{added macro}
+% This macro takes care of the lines which start with an
+% \texttt{=}. It needs an empty token register to begin with.
+% \begin{macrocode}
+\toks@{}
+\def\process@synonym#1 /{%
+ \ifnum\last@language=\m@ne
+% \end{macrocode}
+% When no languages have been loaded yet, the name following the
+% \texttt{=} will be a synonym for hyphenation register 0.
+% \begin{macrocode}
+ \expandafter\chardef\csname l@#1\endcsname0\relax
+ \wlog{\string\l@#1=\string\language0}
+% \end{macrocode}
+% As no hyphenation patterns are read in yet, we can not yet set
+% the hyphenmin parameters. Therefor a commands to do so is stored
+% in a token register and executed when the first pattern file has
+% been processed.
+% \changes{babel~3.7c}{1999/04/27}{Use a token register to temporarily
+% store a command to set hyphenmin parameters for the synonym which
+% is defined \emph{before} the first pattern file is processed}
+% \begin{macrocode}
+ \toks@\expandafter{\the\toks@
+ \expandafter\let\csname #1hyphenmins\expandafter\endcsname
+ \csname\languagename hyphenmins\endcsname}%
+ \else
+% \end{macrocode}
+% Otherwise the name will be a synonym for the language loaded last.
+% \begin{macrocode}
+ \expandafter\chardef\csname l@#1\endcsname\last@language
+ \wlog{\string\l@#1=\string\language\the\last@language}
+% \end{macrocode}
+% We also need to copy the hyphenmin parameters for the synonym.
+% \changes{babel~3.7c}{1999/04/22}{Now also store hyphenmin parameters
+% for language synonyms}
+% \begin{macrocode}
+ \expandafter\let\csname #1hyphenmins\expandafter\endcsname
+ \csname\languagename hyphenmins\endcsname
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\process@language}
+% The macro |\process@language| is used to process a non-empty line
+% from the `configuration file'. It has three arguments, each
+% delimited by white space. The third argument is optional,
+% so a |/| character is expected to delimit the last
+% argument. The first argument is the `name' of a language; the
+% second is the name of the file that contains the patterns. The
+% optional third argument is the name of a file containing
+% hyphenation exceptions.
+%
+% The first thing to do is call |\addlanguage| to allocate a
+% pattern register and to make that register `active'.
+% \changes{babel~3.0d}{1991/08/08}{Removed superfluous
+% \cs{expandafter}}
+% \changes{babel~3.0d}{1991/08/21}{Reinserted \cs{expandafter}}
+% \changes{babel~3.0d}{1991/10/27}{Added the collection of pattern
+% names.}
+% \changes{babel~3.7c}{1999/04/22}{Also store \cs{languagename} for
+% possible later use in \cs{process@synonym}}
+% \begin{macrocode}
+\def\process@language#1 #2 #3/{%
+ \expandafter\addlanguage\csname l@#1\endcsname
+ \expandafter\language\csname l@#1\endcsname
+ \def\languagename{#1}%
+% \end{macrocode}
+% Then the `name' of the language that will be loaded now is
+% added to the token register |\toks8|. and finally
+% the pattern file is read.
+% \begin{macrocode}
+ \global\toks8\expandafter{\the\toks8#1, }%
+% \end{macrocode}
+% \changes{babel~3.7f}{2000/02/18}{Allow for the encoding to be used
+% as part of the language name}
+% For some hyphenation patterns it is needed to load them with a
+% specific font encoding selected. This can be specified in the
+% file \file{language.dat} by adding for instance `\texttt{:T1}' to
+% the name of the language. The macro |\bbl@get@enc| extracts the
+% font encoding from the language name and stores it in
+% |\bbl@hyph@enc|.
+% \begin{macrocode}
+ \begingroup
+ \bbl@get@enc#1:\@@@
+ \ifx\bbl@hyph@enc\@empty
+ \else
+ \fontencoding{\bbl@hyph@enc}\selectfont
+ \fi
+% \end{macrocode}
+%
+% \changes{babel~3.4e}{1994/06/24}{Added code to detect assignments to
+% left- and righthyphenmin in the patternfile.}
+% Some pattern files contain assignments to |\lefthyphenmin| and
+% |\righthyphenmin|. \TeX\ does not keep track of these
+% assignments. Therefor we try to detect such assignments and
+% store them in the |\|\langvar|hyphenmins| macro. When no
+% assignments were made we provide a default setting.
+% \begin{macrocode}
+ \lefthyphenmin\m@ne
+% \end{macrocode}
+% Some pattern files contain changes to the |\lccode| en |\uccode|
+% arrays. Such changes should remain local to the language;
+% therefor we process the pattern file in a group; the |\patterns|
+% command acts globally so its effect will be remembered.
+% \changes{babel~3.7a}{1998/03/27}{Read pattern files in a group}
+% \changes{babel~3.7c}{1999/04/05}{need to set hyphenmin values
+% globally}
+% \changes{babel~3.7c}{1999/04/22}{Set \cs{lefthyphenmin} to \cs{m@ne}
+% \emph{inside} the group; explicitly set the hyphenmin parameters
+% for language 0}
+% \begin{macrocode}
+ \input #2\relax
+% \end{macrocode}
+% Now we globally store the settings of |\lefthyphenmin| and
+% |\righthyphenmin| and close the group.
+% \changes{babel~3.7c}{1999/04/25}{Only set hyphenmin values when the
+% pattern file changed them}
+% \begin{macrocode}
+ \ifnum\lefthyphenmin=\m@ne
+ \else
+ \expandafter\xdef\csname #1hyphenmins\endcsname{%
+ \the\lefthyphenmin\the\righthyphenmin}%
+ \fi
+ \endgroup
+% \end{macrocode}
+% If the counter |\language| is still equal to zero we set the
+% hyphenmin parameters to the values for the language loaded on
+% pattern register 0.
+% \begin{macrocode}
+ \ifnum\the\language=\z@
+ \expandafter\ifx\csname #1hyphenmins\endcsname\relax
+ \set@hyphenmins\tw@\thr@@\relax
+ \else
+ \expandafter\expandafter\expandafter\set@hyphenmins
+ \csname #1hyphenmins\endcsname
+ \fi
+% \end{macrocode}
+% Now execute the contents of token register zero as it may
+% contain commands which set the hyphenmin parameters for synonyms
+% that were defined before the first pattern file is read in.
+% \changes{babel~3.7c}{1999/04/27}{Added the execution of the contents
+% of \cs{toks@}}
+% \begin{macrocode}
+ \the\toks@
+ \fi
+% \end{macrocode}
+% Empty the token register after use.
+% \begin{macrocode}
+ \toks@{}%
+% \end{macrocode}
+% When the hyphenation patterns have been processed we need to see
+% if a file with hyphenation exceptions needs to be read. This is
+% the case when the third argument is not empty and when it does
+% not contain a space token.
+% \changes{babel~3.5b}{1995/04/28}{Added optional reading of file with
+% hyphenation exceptions}
+% \changes{babel~3.5f}{1995/07/25}{Use \cs{empty} instead of
+% \cs{@empty} as the latter is unknown in plain}
+% \begin{macrocode}
+ \def\bbl@tempa{#3}%
+ \ifx\bbl@tempa\@empty
+ \else
+ \ifx\bbl@tempa\space
+ \else
+ \input #3\relax
+ \fi
+ \fi
+ }
+% \end{macrocode}
+%
+% \begin{macro}{\bbl@get@enc}
+% \changes{babel~3.7f}{2000/02/18}{Added macro}
+% \begin{macro}{\bbl@hyph@enc}
+% The macro |\bbl@get@enc| extracts the font encoding from the
+% language name and stores it in |\bbl@hyph@enc|. It uses delimited
+% arguments to achieve this.
+% \begin{macrocode}
+\def\bbl@get@enc#1:#2\@@@{%
+% \end{macrocode}
+% First store both arguments in temporary macros,
+% \begin{macrocode}
+ \def\bbl@tempa{#1}%
+ \def\bbl@tempb{#2}%
+% \end{macrocode}
+% then, if the second argument was empty, no font encoding was
+% specified and we're done.
+% \begin{macrocode}
+ \ifx\bbl@tempb\@empty
+ \let\bbl@hyph@enc\@empty
+ \else
+% \end{macrocode}
+% But if the second argument was \emph{not} empty it will now have
+% a superfluous colon attached to it which we need to remove. This
+% done by feeding it to |\bbl@get@enc|. The string that we are
+% after will then be in the first argument and be stored in
+% |\bbl@tempa|.
+% \begin{macrocode}
+ \bbl@get@enc#2\@@@
+ \edef\bbl@hyph@enc{\bbl@tempa}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\readconfigfile}
+% The configuration file can now be opened for reading.
+% \begin{macrocode}
+\openin1 = language.dat
+% \end{macrocode}
+%
+% See if the file exists, if not, use the default hyphenation file
+% \file{hyphen.tex}. The user will be informed about this.
+%
+% \begin{macrocode}
+\ifeof1
+ \message{I couldn't find the file language.dat,\space
+ I will try the file hyphen.tex}
+ \input hyphen.tex\relax
+\else
+% \end{macrocode}
+%
+% Pattern registers are allocated using count register
+% |\last@language|. Its initial value is~0. The definition of the
+% macro |\newlanguage| is such that it first increments the count
+% register and then defines the language. In order to have the
+% first patterns loaded in pattern register number~0 we initialize
+% |\last@language| with the value~$-1$.
+%
+% \changes{babel~3.1}{1991/05/21}{Removed use of \cs{toks0}}
+% \begin{macrocode}
+ \last@language\m@ne
+% \end{macrocode}
+%
+% We now read lines from the file until the end is found
+%
+% \begin{macrocode}
+ \loop
+% \end{macrocode}
+%
+% While reading from the input, it is useful to switch off
+% recognition of the end-of-line character. This saves us stripping
+% off spaces from the contents of the control sequence.
+%
+% \begin{macrocode}
+ \endlinechar\m@ne
+ \read1 to \bbl@line
+ \endlinechar`\^^M
+% \end{macrocode}
+%
+% Empty lines are skipped.
+% \begin{macrocode}
+ \ifx\bbl@line\@empty
+ \else
+% \end{macrocode}
+%
+% Now we add a space and a |/| character to the end of
+% |\bbl@line|. This is needed to be able to recognize the third,
+% optional, argument of |\process@language| later on.
+% \changes{babel~3.5b}{1995/04/28}{Now add a \cs{space} and a /
+% character}
+% \begin{macrocode}
+ \edef\bbl@line{\bbl@line\space/}%
+ \expandafter\process@line\bbl@line
+ \fi
+% \end{macrocode}
+%
+% Check for the end of the file. To avoid a new \texttt{if}
+% control sequence we create the necessary |\iftrue| or |\iffalse|
+% with the help of |\csname|. But there is one complication with
+% this approach: when skipping the \texttt{loop...repeat} \TeX\ has
+% to read |\if|/|\fi| pairs. So we have to insert a `dummy'
+% |\iftrue|.
+% \changes{babel~3.1}{1991/10/31}{Removed the extra \texttt{if}
+% control sequence}
+% \begin{macrocode}
+ \iftrue \csname fi\endcsname
+ \csname if\ifeof1 false\else true\fi\endcsname
+ \repeat
+% \end{macrocode}
+%
+% Reactivate the default patterns,
+% \begin{macrocode}
+ \language=0
+\fi
+% \end{macrocode}
+% and close the configuration file.
+% \changes{babel~3.2a}{1991/11/20}{Free macro space for
+% \cs{process@language}}
+% \begin{macrocode}
+\closein1
+% \end{macrocode}
+% Also remove some macros from memory
+% \begin{macrocode}
+\let\process@language\@undefined
+\let\process@synonym\@undefined
+\let\process@line\@undefined
+\let\bbl@tempa\@undefined
+\let\bbl@tempb\@undefined
+\let\bbl@eq@\@undefined
+\let\bbl@line\@undefined
+\let\bbl@get@enc\@undefined
+% \end{macrocode}
+%
+% \changes{babel~3.5f}{1995/11/08}{Moved the fiddling with \cs{dump}
+% to \file{bbplain.dtx} as it is no longer needed for \LaTeX}
+% We add a message about the fact that babel is loaded in the
+% format and with which language patterns to the \cs{everyjob}
+% register.
+% \changes{babel~3.6h}{1997/01/23}{Added a couple of \cs{expandafter}s
+% to copy the contents of \cs{toks8} into \cs{everyjob} instead of
+% the reference}
+% \begin{macrocode}
+\ifx\addto@hook\@undefined
+\else
+ \expandafter\addto@hook\expandafter\everyjob\expandafter{%
+ \expandafter\typeout\expandafter{\the\toks8 loaded.}}
+\fi
+% \end{macrocode}
+% Here the code for ini\TeX\ ends.
+% \begin{macrocode}
+%</patterns>
+%</kernel>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Support for active characters}
+%
+% \begin{macro}{\bbl@add@special}
+% \changes{babel~3.2}{1991/11/10}{Added macro}
+% The macro |\bbl@add@special| is used to add a new character (or
+% single character control sequence) to the macro |\dospecials|
+% (and |\@sanitize| if \LaTeX\ is used).
+%
+% To keep all changes local, we begin a new group. Then we
+% redefine the macros |\do| and |\@makeother| to add themselves and
+% the given character without expansion.
+% \begin{macrocode}
+%<*core|shorthands>
+\def\bbl@add@special#1{\begingroup
+ \def\do{\noexpand\do\noexpand}%
+ \def\@makeother{\noexpand\@makeother\noexpand}%
+% \end{macrocode}
+% To add the character to the macros, we expand the original macros
+% with the additional character inside the redefinition of the
+% macros. Because |\@sanitize| can be undefined, we put the
+% definition inside a conditional.
+% \begin{macrocode}
+ \edef\x{\endgroup
+ \def\noexpand\dospecials{\dospecials\do#1}%
+ \expandafter\ifx\csname @sanitize\endcsname\relax \else
+ \def\noexpand\@sanitize{\@sanitize\@makeother#1}%
+ \fi}%
+% \end{macrocode}
+% The macro |\x| contains at this moment the following:\\
+% |\endgroup\def\dospecials{|\textit{old contents}%
+% |\do|\meta{char}|}|.\\
+% If |\@sanitize| is defined, it contains an additional definition
+% of this macro. The last thing we have to do, is the expansion of
+% |\x|. Then |\endgroup| is executed, which restores the old
+% meaning of |\x|, |\do| and |\@makeother|. After the group is
+% closed, the new definition of |\dospecials| (and |\@sanitize|) is
+% assigned.
+% \begin{macrocode}
+ \x}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@remove@special}
+% \changes{babel~3.2}{1991/11/10}{Added macro}
+% The companion of the former macro is |\bbl@remove@special|. It
+% is used to remove a character from the set macros |\dospecials|
+% and |\@sanitize|.
+%
+% To keep all changes local, we begin a new group. Then we define
+% a help macro |\x|, which expands to empty if the characters
+% match, otherwise it expands to its nonexpandable input. Because
+% \TeX\ inserts a |\relax|, if the corresponding |\else| or |\fi|
+% is scanned before the comparison is evaluated, we provide a `stop
+% sign' which should expand to nothing.
+% \begin{macrocode}
+\def\bbl@remove@special#1{\begingroup
+ \def\x##1##2{\ifnum`#1=`##2\noexpand\@empty
+ \else\noexpand##1\noexpand##2\fi}%
+% \end{macrocode}
+% With the help of this macro we define |\do| and |\make@other|.
+% \begin{macrocode}
+ \def\do{\x\do}%
+ \def\@makeother{\x\@makeother}%
+% \end{macrocode}
+% The rest of the work is similar to |\bbl@add@special|.
+% \begin{macrocode}
+ \edef\x{\endgroup
+ \def\noexpand\dospecials{\dospecials}%
+ \expandafter\ifx\csname @sanitize\endcsname\relax \else
+ \def\noexpand\@sanitize{\@sanitize}%
+ \fi}%
+ \x}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Shorthands}
+%
+% \begin{macro}{\initiate@active@char}
+% \changes{babel~3.5a}{1995/02/11}{Added macro}
+% \changes{babel~3.5b}{1995/03/03}{Renamed macro}
+% A language definition file can call this macro to make a
+% character active. This macro takes one argument, the character
+% that is to be made active. When the character was already active
+% this macro does nothing. Otherwise, this macro defines the
+% control sequence |\normal@char|\m{char} to expand to the
+% character in its `normal state' and it defines the active
+% character to expand to |\normal@char|\m{char} by default
+% (\m{char} being the character to be made active). Later its
+% definition can be changed to expand to |\active@char|\m{char}
+% by calling |\bbl@activate{|\m{char}|}|.
+%
+% For example, to make the double quote character active one could
+% have the following line in a language definition file:
+% \begin{verbatim}
+% \initiate@active@char{"}
+% \end{verbatim}
+%
+% \begin{macro}{\bbl@afterelse}
+% \begin{macro}{\bbl@afterfi}
+% Because the code that is used in the handling of active
+% characters may need to look ahead, we take extra care to `throw'
+% it over the |\else| and |\fi| parts of an
+% |\if|-statement\footnote{This code is based on code presented in
+% TUGboat vol. 12, no2, June 1991 in ``An expansion Power Lemma''
+% by Sonja Maus.}. These macros will break if another |\if...\fi|
+% statement appears in one of the arguments.
+% \changes{babel~3.6i}{1997/02/20}{Made \cs{bbl@afterelse} and
+% \cs{bbl@afterfi} \cs{long}}
+% \begin{macrocode}
+\long\def\bbl@afterelse#1\else#2\fi{\fi#1}
+\long\def\bbl@afterfi#1\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{babel~3.7a}{1997/02/23}{Commented out \c{peek@token} and
+% \cs{test@token} as shorthands are made expandable again}
+%
+% \begin{macro}{\peek@token}
+% \changes{babel~3.5f}{1995/12/06}{macro added}
+% \changes{babel~3.6i}{1998/03/10}{Renamed \cs{test@token} to
+% \cs{bbl@test@token} to prevent a clash with Arab\TeX}
+% To prevent error messages when a shorthand, which
+% normally takes an argument, sees a |\par|, or |}|, or similar
+% tokens, we need to be able to `peek' at what is coming up next in
+% the input stream. Depending on the category code of the token
+% that is seen, we need to either continue the code for the active
+% character, or insert the non-active version of that character in
+% the output. The macro |\peek@token| therefore takes two
+% arguments, with which it constructs the control sequence to
+% expand next. It |\let|'s |\bbl@nexta| and |\bbl@nextb| to the two
+% possible macros. This is necessary for |\bbl@test@token| to take
+% the right decision.
+% \begin{macrocode}
+%\def\peek@token#1#2{%
+% \expandafter\let\expandafter\bbl@nexta\csname #1\string#2\endcsname
+% \expandafter\let\expandafter\bbl@nextb
+% \csname system@active\string#2\endcsname
+% \futurelet\bbl@token\bbl@test@token}
+% \end{macrocode}
+%
+% \begin{macro}{\bbl@test@token}
+% \changes{babel~3.5f}{1995/12/06}{macro added}
+% \changes{babel~3.6i}{1998/03/10}{renamed \cs{bbl@token} to
+% \cs{bbl@test@token} to prevent a clash with Arab\TeX}
+% When the result of peeking at the next token has yielded a token
+% with category `letter', `other' or `active' it is safe to proceed
+% with evaluating the code for the shorthand. When a token is found
+% with any other category code proceeding is unsafe and therefor
+% the original shorthand character is inserted in the output. The
+% macro that calls |\bbl@test@token| needs to setup |\bbl@nexta|
+% and |\bbl@nextb| in order to achieve this.
+% \begin{macrocode}
+%\def\bbl@test@token{%
+% \let\bbl@next\bbl@nexta
+% \ifcat\noexpand\bbl@token a%
+% \else
+% \ifcat\noexpand\bbl@token=%
+% \else
+% \ifcat\noexpand\bbl@token\noexpand\bbl@next
+% \else
+% \let\bbl@next\bbl@nextb
+% \fi
+% \fi
+% \fi
+% \bbl@next}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%^^A
+%^^A Tekens met mathcode >"8000 zorgen voor problemen.
+%^^A hier kan op getest worden door ze catcode13 te geven
+%^^A en te vragen of er een undefined macro ontstaat:
+%^^A \ifx#1\undefined{matchcode<"8000}\else get active definition
+%^^A using \let \fi
+%^^A
+% The macro |\initiate@active@char| takes all the necessary actions
+% to make its argument a shorthand character. The real work is
+% performed once for each character.
+% \changes{babel~3.7c}{1999/04/30}{Only execute
+% \cs{initiate@active@char} for each character}
+% \begin{macrocode}
+\def\initiate@active@char#1{%
+ \expandafter\ifx\csname active@char\string##1\endcsname\relax
+ \bbl@afterfi{\@initiate@active@char{#1}}%
+ \fi}
+% \end{macrocode}
+% Note that the definition of |\@initiate@active@char| needs an
+% active character, for this the |~| is used. Some of the changes
+% we need, do not have to become available later on, so we do it
+% inside a group.
+% \begin{macrocode}
+\begingroup
+ \catcode`\~\active
+ \def\x{\endgroup
+ \def\@initiate@active@char##1{%
+% \end{macrocode}
+% If the character is already active we provide the default
+% expansion under this shorthand mechanism.
+% \changes{babel~3.5f}{1996/01/09}{Deal correctly with already active
+% characters, provide top level expansion and define all lower
+% level expansion macros outside of the \cs{else} branch.}
+% \changes{babel~3.5g}{1996/08/13}{Top level expansion of
+% \cs{normal@char char} where char is already active, should be the
+% expansion of the active character, not the active character
+% itself as this causes an endless loop}
+% \changes{babel~3.7d}{1999/08/19}{Make sure the active character
+% doesn't get expanded more then once by the \cs{edef} by adding
+% \cs{expandafter}\cs{strip@prefix}\cs{meaning}}
+% \changes{babel~3.7e}{1999/09/06}{previous change was rubbish; use
+% \cs{let} instead of \cs{edef}}
+% \begin{macrocode}
+ \ifcat\noexpand##1\noexpand~\relax
+ \@ifundefined{normal@char\string##1}{%
+ \expandafter\let\csname normal@char\string##1\endcsname##1%
+ \expandafter\gdef
+ \expandafter##1%
+ \expandafter{%
+ \expandafter\active@prefix\expandafter##1%
+ \csname normal@char\string##1\endcsname}}{}%
+ \else
+% \end{macrocode}
+% Otherwise we write a message in the transcript file,
+% \begin{macrocode}
+ \@activated{##1}%
+% \end{macrocode}
+% and define |\normal@char|\m{char} to expand to the character in
+% its default state.
+% \begin{macrocode}
+ \@namedef{normal@char\string##1}{##1}%
+% \end{macrocode}
+% If we are making the right quote active we need to change
+% |\pr@m@s| as well.
+% \changes{babel~3.5a}{1995/03/10}{Added a check for right quote and
+% adapt \cs{pr@m@s} if necessary}
+% \changes{babel~3.7f}{1999/12/18}{The redefinition needs to take
+% place on level higher, \cs{prim@s} needs to be redefined.}
+% \begin{macrocode}
+ \ifx##1'%
+ \let\prim@s\bbl@prim@s
+% \end{macrocode}
+% Also, make sure that a single |'| in math mode `does the right
+% thing'.
+% \changes{babel~3.7f}{1999/12/18}{Insert a check for math mode in the
+% definition of \cs{normal@char'}}
+% \changes{babel~3.7g}{2000/10/02}{use \cs{textormath} to get rid of
+% the \cs{fi} (PR 3266)}
+% \begin{macrocode}
+ \@namedef{normal@char\string##1}{%
+ \textormath{##1}{^\bgroup\prim@s}}%
+ \fi
+% \end{macrocode}
+% If we are using the caret as a shorthand character special care
+% should be taken to make sure math still works. Therefor an extra
+% level of expansion is introduced with a check for math mode on
+% the upper level.
+% \changes{babel~3.7f}{1999/12/18}{Introduced an extra level of
+% expansion in the definition of an active caret}
+% \begin{macrocode}
+ \ifx##1^%
+ \gdef\bbl@act@caret{%
+ \ifmmode
+ \csname normal@char\string^\endcsname
+ \else
+ \bbl@afterfi
+ {\if@safe@actives
+ \bbl@afterelse\csname normal@char\string##1\endcsname
+ \else
+ \bbl@afterfi\csname user@active\string##1\endcsname
+ \fi}%
+ \fi}
+ \fi
+% \end{macrocode}
+% To prevent problems with the loading of other packages after
+% \babel\ we reset the catcode of the character at the end of the
+% package.
+% \changes{babel~3.5f}{1995/12/01}{Restore the category code of a
+% shorthand char at end of package}
+% \changes{babel~3.6f}{1997/01/14}{Made restoring of the category code
+% of shorthand characters optional}
+% \changes{babel~3.7a}{1997/03/21}{Use \cs{@ifpackagewith} to
+% determine whether shorthand characters need to remain active}
+% \begin{macrocode}
+ \@ifpackagewith{babel}{KeepShorthandsActive}{}{%
+ \edef\bbl@tempa{\catcode`\noexpand##1\the\catcode`##1}%
+ \expandafter\AtEndOfPackage\expandafter{\bbl@tempa}}%
+% \end{macrocode}
+% Now we set the lowercase code of the |~| equal to that of the
+% character to be made active and execute the rest of the code
+% inside a |\lowercase| `environment'.
+% \changes{babel~3.5f}{1996/01/25}{store the \cs{lccode} of the tie
+% before changing it}
+% \begin{macrocode}
+ \@tempcnta=\lccode`\~
+ \lccode`~=`##1%
+ \lowercase{%
+% \end{macrocode}
+% Make the character active and add it to |\dospecials| and
+% |\@sanitize|.
+% \begin{macrocode}
+ \catcode`~\active
+ \expandafter\bbl@add@special
+ \csname \string##1\endcsname
+% \end{macrocode}
+% Also re-activate it again at |\begin{document}|.
+% \begin{macrocode}
+ \AtBeginDocument{%
+ \catcode`##1\active
+% \end{macrocode}
+% We also need to make sure that the shorthands are active during
+% the processing of the \file{.aux} file. Otherwise some citations
+% may give unexpected results in the printout when a shorthand was
+% used in the optional argument of |\bibitem| for example.
+% \changes{babel~3.6i}{1997/03/01}{Make shorthands active during
+% \file{.aux} file processing}
+% \begin{macrocode}
+ \if@filesw
+ \immediate\write\@mainaux{%
+ \string\catcode`##1\string\active}%
+ \fi}%
+% \end{macrocode}
+% Define the character to expand to
+% \begin{center}
+% |\active@prefix| \m{char} |\normal@char|\m{char}
+% \end{center}
+% (where |\active@char|\m{char} is \emph{one} control sequence!).
+% \changes{babel~3.5f}{1996/01/25}{restore the \cs{lccode} of the tie}
+% \begin{macrocode}
+ \expandafter\gdef
+ \expandafter~%
+ \expandafter{%
+ \expandafter\active@prefix\expandafter##1%
+ \csname normal@char\string##1\endcsname}}%
+ \lccode`\~\@tempcnta
+ \fi
+% \end{macrocode}
+% For the active caret we first expand to |\bbl@act@caret| in order
+% to be able to handle math mode correctly.
+% \changes{babel~3.7f}{2000/09/25}{Make an exception for the active
+% caret which needs an extra level of expansion}
+% \begin{macrocode}
+ \ifx##1^%
+ \@namedef{active@char\string##1}{\bbl@act@caret}%
+ \else
+% \end{macrocode}
+% We define the first level expansion of |\active@char|\m{char} to
+% check the status of the |@safe@actives| flag. If it is set to
+% true we expand to the `normal' version of this character,
+% otherwise we call |\@active@char|\m{char}.
+% \begin{macrocode}
+ \@namedef{active@char\string##1}{%
+ \if@safe@actives
+ \bbl@afterelse\csname normal@char\string##1\endcsname
+ \else
+ \bbl@afterfi\csname user@active\string##1\endcsname
+ \fi}%
+ \fi
+% \end{macrocode}
+% The next level of the code checks whether a user has defined a
+% shorthand for himself with this character. First we check for a
+% single character shorthand. If that doesn't exist we check for a
+% shorthand with an argument.
+% \changes{babel~3.5d}{1995/07/02}{Skip the user-level active char
+% with argument if no shorthands with arguments were defined}
+% \changes{babel~3.8b}{2004/04/19}{Now use \cs{bbl@sh@select}}
+% \begin{macrocode}
+ \@namedef{user@active\string##1}{%
+ \expandafter\ifx
+ \csname \user@group @sh@\string##1@\endcsname
+ \relax
+ \bbl@afterelse\bbl@sh@select\user@group##1%
+ {user@active@arg\string##1}{language@active\string##1}%
+ \else
+ \bbl@afterfi\csname \user@group @sh@\string##1@\endcsname
+ \fi}%
+% \end{macrocode}
+% When there is also no user-level shorthand with an argument we
+% will check whether there is a language defined shorthand for
+% this active character. Before the next token is absorbed as
+% argument we need to make sure that this is safe. Therefor
+% |\peek@token| is called to decide that.
+% \changes{babel~3.5f}{1995/12/07}{use \cs{peek@token} to check whether
+% it is safe to proceed}
+% \changes{babel~3.6i}{1997/02/20}{Remove the use of \cs{peek@token}
+% again and make the \cs{...active@arg...} commands \cs{long}}
+% \changes{babel~3.7e}{1999/09/24}{pass the argument on with braces in
+% order to prevent it from breaking up}
+% \changes{babel~3.7f}{2000/02/18}{remove the braces again}
+% \begin{macrocode}
+ \long\@namedef{user@active@arg\string##1}####1{%
+ \expandafter\ifx
+ \csname \user@group @sh@\string##1@\string####1@\endcsname
+ \relax
+ \bbl@afterelse
+ \csname language@active\string##1\endcsname####1%
+ \else
+ \bbl@afterfi
+ \csname \user@group @sh@\string##1@\string####1@%
+ \endcsname
+ \fi}%
+% \end{macrocode}
+% In order to do the right thing when a shorthand with an argument
+% is used by itself at the end of the line we provide a definition
+% for the case of an empty argument. For that case we let the
+% shorthand character expand to its non-active self.
+% \begin{macrocode}
+ \@namedef{\user@group @sh@\string##1@@}{%
+ \csname normal@char\string##1\endcsname}
+% \end{macrocode}
+%
+% Like the shorthands that can be defined by the user, a language
+% definition file can also define shorthands with and without an
+% argument, so we need two more macros to check if they exist.
+% \changes{babel~3.5d}{1995/07/02}{Skip the language-level active char
+% with argument if no shorthands with arguments were defined}
+% \changes{babel~3.8b}{2004/04/19}{Now use \cs{bbl@sh@select}}
+% \begin{macrocode}
+ \@namedef{language@active\string##1}{%
+ \expandafter\ifx
+ \csname \language@group @sh@\string##1@\endcsname
+ \relax
+ \bbl@afterelse\bbl@sh@select\language@group##1%
+ {language@active@arg\string##1}{system@active\string##1}%
+ \else
+ \bbl@afterfi
+ \csname \language@group @sh@\string##1@\endcsname
+ \fi}%
+% \end{macrocode}
+% \changes{babel~3.5f}{1995/12/07}{use \cs{peek@token} to check whether
+% it is safe to proceed}
+% \changes{babel~3.6i}{1997/02/20}{Remove the use of \cs{peek@token}
+% again}
+% \changes{babel~3.7e}{1999/09/24}{pass the argument on with braces in
+% order to prevent it from breaking up}
+% \changes{babel~3.7f}{2000/02/18}{remove the braces again}
+% \begin{macrocode}
+ \long\@namedef{language@active@arg\string##1}####1{%
+ \expandafter\ifx
+ \csname \language@group @sh@\string##1@\string####1@\endcsname
+ \relax
+ \bbl@afterelse
+ \csname system@active\string##1\endcsname####1%
+ \else
+ \bbl@afterfi
+ \csname \language@group @sh@\string##1@\string####1@%
+ \endcsname
+ \fi}%
+% \end{macrocode}
+% And the same goes for the system level.
+% \changes{babel~3.8b}{2004/04/19}{Now use \cs{bbl@sh@select}}
+% \begin{macrocode}
+ \@namedef{system@active\string##1}{%
+ \expandafter\ifx
+ \csname \system@group @sh@\string##1@\endcsname
+ \relax
+ \bbl@afterelse\bbl@sh@select\system@group##1%
+ {system@active@arg\string##1}{normal@char\string##1}%
+ \else
+ \bbl@afterfi\csname \system@group @sh@\string##1@\endcsname
+ \fi}%
+% \end{macrocode}
+% When no shorthands were found the `normal' version of the active
+% character is inserted.
+% \changes{babel~3.5f}{1995/12/07}{use \cs{peek@token} to check whether
+% it is safe to proceed}
+% \changes{babel~3.6i}{1997/02/20}{Remove the use of \cs{peek@token}
+% again}
+% \begin{macrocode}
+ \long\@namedef{system@active@arg\string##1}####1{%
+ \expandafter\ifx
+ \csname \system@group @sh@\string##1@\string####1@\endcsname
+ \relax
+ \bbl@afterelse\csname normal@char\string##1\endcsname####1%
+ \else
+ \bbl@afterfi
+ \csname \system@group @sh@\string##1@\string####1@\endcsname
+ \fi}%
+% \end{macrocode}
+% When a shorthand combination such as |''| ends up in a heading
+% \TeX\ would see |\protect'\protect'|. To prevent this from
+% happening a shorthand needs to be defined at user level.
+% \changes{babel~3.7f}{1999/12/09}{Added an extra shorthand
+% combination on user level to catch an interfering \cs{protect}}
+% \begin{macrocode}
+ \@namedef{user@sh@\string##1@\string\protect@}{%
+ \csname user@active\string##1\endcsname}%
+ }%
+ }\x
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@sh@select}
+% This command helps the shorthand supporting macros to select how
+% to proceed. Note that this macro needs to be expandable as do all
+% the shorthand macros in order for them to work in expansion-only
+% environments such as the argument of |\hyphenation|.
+%
+% This macro expects the name of a group of shorthands in its first
+% argument and a shorthand character in its second argument. It
+% will expand to either |\bbl@firstcs| or |\bbl@scndcs|. Hence two
+% more arguments need to follow it.
+% \changes{babel~3.8b}{2004/04/19}{Added command}
+% \begin{macrocode}
+\def\bbl@sh@select#1#2{%
+ \expandafter\ifx\csname#1@sh@\string#2@sel\endcsname\relax
+ \bbl@afterelse\bbl@scndcs
+ \else
+ \bbl@afterfi\csname#1@sh@\string#2@sel\endcsname
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\active@prefix}
+% The command |\active@prefix| which is used in the expansion of
+% active characters has a function similar to |\OT1-cmd| in that it
+% |\protect|s the active character whenever |\protect| is
+% \emph{not} |\@typeset@protect|.
+% \changes{babel~3.5d}{1995/07/02}{\cs{@protected@cmd} has vanished
+% from \file{ltoutenc.dtx}}
+% \changes{babel~3.7o}{2003/11/17}{Added handling of the situation
+% where \cs{protect} is set to \cs{@unexpandable@protect}}
+% \begin{macrocode}
+\def\active@prefix#1{%
+ \ifx\protect\@typeset@protect
+ \else
+% \end{macrocode}
+% When |\protect| is set to |\@unexpandable@protect| we make sure
+% that the active character is als \emph{not} expanded by inserting
+% |\noexpand| in front of it. The |\@gobble| is needed to remove
+% a token such as |\activechar:| (when the double colon was the
+% active character to be dealt with).
+% \begin{macrocode}
+ \ifx\protect\@unexpandable@protect
+ \bbl@afterelse\bbl@afterfi\noexpand#1\@gobble
+ \else
+ \bbl@afterfi\bbl@afterfi\protect#1\@gobble
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@safe@actives}
+% In some circumstances it is necessary to be able to change the
+% expansion of an active character on the fly. For this purpose the
+% switch |@safe@actives| is available. The setting of this switch
+% should be checked in the first level expansion of
+% |\active@char|\m{char}.
+% \begin{macrocode}
+\newif\if@safe@actives
+\@safe@activesfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@restore@actives}
+% \changes{babel~3.7m}{2003/11/15}{New macro added}
+% When the output routine kicks in while the
+% active characters were made ``safe'' this must be undone in
+% the headers to prevent unexpected typeset results. For this
+% situation we define a command to make them ``unsafe'' again.
+% \begin{macrocode}
+\def\bbl@restore@actives{\if@safe@actives\@safe@activesfalse\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@activate}
+% \changes{babel~3.5a}{1995/02/11}{Added macro}
+%
+% This macro takes one argument, like |\initiate@active@char|. The
+% macro is used to change the definition of an active character to
+% expand to |\active@char|\m{char} instead of
+% |\normal@char|\m{char}.
+% \begin{macrocode}
+\def\bbl@activate#1{%
+ \expandafter\def
+ \expandafter#1\expandafter{%
+ \expandafter\active@prefix
+ \expandafter#1\csname active@char\string#1\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@deactivate}
+% \changes{babel~3.5a}{1995/02/11}{Added macro}
+% This macro takes one argument, like |\bbl@activate|. The macro
+% doesn't really make a character non-active; it changes its
+% definition to expand to |\normal@char|\m{char}.
+% \begin{macrocode}
+\def\bbl@deactivate#1{%
+ \expandafter\def
+ \expandafter#1\expandafter{%
+ \expandafter\active@prefix
+ \expandafter#1\csname normal@char\string#1\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@firstcs}
+% \begin{macro}{\bbl@scndcs}
+% These macros have two arguments. They use one of their arguments
+% to build a control sequence from.
+% \begin{macrocode}
+\def\bbl@firstcs#1#2{\csname#1\endcsname}
+\def\bbl@scndcs#1#2{\csname#2\endcsname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\declare@shorthand}
+% The command |\declare@shorthand| is used to declare a shorthand
+% on a certain level. It takes three arguments:
+% \begin{enumerate}
+% \item a name for the collection of shorthands, i.e. `system', or
+% `dutch';
+% \item the character (sequence) that makes up the shorthand,
+% i.e. |~| or |"a|;
+% \item the code to be executed when the shorthand is encountered.
+% \end{enumerate}
+% \changes{babel~3.5d}{1995/07/02}{Make a `note' when a shorthand with
+% an argument is defined.}
+% \changes{babel~3.6i}{1997/02/23}{Make it possible to distinguish the
+% constructed control sequences for the case with argument}
+% \changes{babel~3.8b}{2004/04/19}{We need to support shorthands with
+% and without argument in different groups; added the name of the
+% group to the storage macro}
+% \begin{macrocode}
+\def\declare@shorthand#1#2{\@decl@short{#1}#2\@nil}
+\def\@decl@short#1#2#3\@nil#4{%
+ \def\bbl@tempa{#3}%
+ \ifx\bbl@tempa\@empty
+ \expandafter\let\csname #1@sh@\string#2@sel\endcsname\bbl@scndcs
+ \@namedef{#1@sh@\string#2@}{#4}%
+ \else
+ \expandafter\let\csname #1@sh@\string#2@sel\endcsname\bbl@firstcs
+ \@namedef{#1@sh@\string#2@\string#3@}{#4}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textormath}
+% Some of the shorthands that will be declared by the language
+% definition files have to be usable in both text and mathmode. To
+% achieve this the helper macro |\textormath| is provided.
+% \begin{macrocode}
+\def\textormath#1#2{%
+ \ifmmode
+ \bbl@afterelse#2%
+ \else
+ \bbl@afterfi#1%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\user@group}
+% \begin{macro}{\language@group}
+% \begin{macro}{\system@group}
+% The current concept of `shorthands' supports three levels or
+% groups of shorthands. For each level the name of the level or
+% group is stored in a macro. The default is to have a user group;
+% use language group `english' and have a system group called
+% `system'.
+% \changes{babel~3.6i}{1997/02/24}{Have a user group called `user' by
+% default}
+% \begin{macrocode}
+\def\user@group{user}
+\def\language@group{english}
+\def\system@group{system}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\useshorthands}
+% This is the user level command to tell \LaTeX\ that user level
+% shorthands will be used in the document. It takes one argument,
+% the character that starts a shorthand.
+% \changes{babel~3.7j}{2001/11/11}{When \TeX\ has seen a character
+% its category code is fixed; need to use a `stand-in' for the
+% call of \cs{bbl@activate}}
+% \begin{macrocode}
+\def\useshorthands#1{%
+% \end{macrocode}
+% First note that this is user level.
+% \begin{macrocode}
+ \def\user@group{user}%
+% \end{macrocode}
+% Then initialize the character for use as a shorthand character.
+% \begin{macrocode}
+ \initiate@active@char{#1}%
+% \end{macrocode}
+% Now that \TeX\ has seen the character its category code is
+% fixed, but for the actions of |\bbl@activate| to succeed we need
+% it to be active. Hence the trick with the |\lccode| to circumvent
+% this.
+% \changes{babel~3.7j}{2003/09/11}{The change from 11/112001 was
+% incomplete}
+% \begin{macrocode}
+ \@tempcnta\lccode`\~
+ \lccode`~=`#1%
+ \lowercase{\catcode`~\active\bbl@activate{~}}%
+ \lccode`\~\@tempcnta}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\defineshorthand}
+% Currently we only support one group of user level shorthands,
+% called `user'.
+% \begin{macrocode}
+\def\defineshorthand{\declare@shorthand{user}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\languageshorthands}
+% A user level command to change the language from which shorthands
+% are used.
+% \begin{macrocode}
+\def\languageshorthands#1{\def\language@group{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\aliasshorthand}
+% \changes{babel~3.5f}{1996/01/25}{New command}
+% \begin{macrocode}
+\def\aliasshorthand#1#2{%
+% \end{macrocode}
+% First the new shorthand needs to be initialized,
+% \begin{macrocode}
+ \expandafter\ifx\csname active@char\string#2\endcsname\relax
+ \ifx\document\@notprerr
+ \@notshorthand{#2}
+ \else
+ \initiate@active@char{#2}%
+% \end{macrocode}
+% Then we need to use the |\lccode| trick to make the new shorthand
+% behave like the old one. Therefore we save the current |\lccode|
+% of the |~|-character and restore it later. Then we |\let| the new
+% shorthand character be equal to the original.
+% \begin{macrocode}
+ \@tempcnta\lccode`\~
+ \lccode`~=`#2%
+ \lowercase{\let~#1}%
+ \lccode`\~\@tempcnta
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@notshorthand}
+% \changes{v3.8d}{2004/11/20}{Error message added}
+%
+% \begin{macrocode}
+\def\@notshorthand#1{%
+ \PackageError{babel}{%
+ The character `\string #1´ should be made
+ a shorthand character;\MessageBreak
+ add the command \string\useshorthands\string{#1\string} to
+ the preamble.\MessageBreak
+ I will ignore your instruction}{}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\shorthandon}
+% \changes{babel~3.7a}{1998/06/07}{Added command}
+% \begin{macro}{\shorthandoff}
+% \changes{babel~3.7a}{1998/06/07}{Added command}
+% The first level definition of these macros just passes the
+% argument on to |\bbl@switch@sh|, adding |\@nil| at the end to
+% denote the end of the list of characters.
+% \begin{macrocode}
+\newcommand*\shorthandon[1]{\bbl@switch@sh{on}#1\@nil}
+\newcommand*\shorthandoff[1]{\bbl@switch@sh{off}#1\@nil}
+% \end{macrocode}
+%
+% \begin{macro}{\bbl@switch@sh}
+% \changes{babel~3.7a}{1998/06/07}{Added command}
+% The macro |\bbl@switch@sh| takes the list of characters apart one
+% by one and subsequently switches the category code of the
+% shorthand character according to the first argument of
+% |\bbl@switch@sh|.
+% \begin{macrocode}
+\def\bbl@switch@sh#1#2#3\@nil{%
+% \end{macrocode}
+% But before any of this switching takes place we make sure that
+% the character we are dealing with is known as a shorthand
+% character. If it is, a macro such as |\active@char"| should
+% exist.
+% \begin{macrocode}
+ \@ifundefined{active@char\string#2}{%
+ \PackageError{babel}{%
+ The character '\string #2' is not a shorthand character
+ in \languagename}{%
+ Maybe you made a typing mistake?\MessageBreak
+ I will ignore your instruction}}{%
+ \csname bbl@switch@sh@#1\endcsname#2}%
+% \end{macrocode}
+% Now that, as the first character in the list has been taken care
+% of, we pass the rest of the list back to |\bbl@switch@sh|.
+% \begin{macrocode}
+ \ifx#3\@empty\else
+ \bbl@afterfi\bbl@switch@sh{#1}#3\@nil
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@switch@sh@off}
+% All that is left to do is define the actual switching
+% macros. Switching off is easy, we just set the category code to
+% `other' (12).
+% \begin{macrocode}
+\def\bbl@switch@sh@off#1{\catcode`#112\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@switch@sh@on}
+% But switching the shorthand character back on is a bit more
+% tricky. It involves making sure that we have an active character
+% to begin with when the macro is being defined. It also needs the
+% use of |\lowercase| and |\lccode| trickery to get everything to
+% work out as expected. And to keep things local that need to
+% remain local a group is opened, which is closed as soon as |\x|
+% gets executed.
+% \begin{macrocode}
+\begingroup
+ \catcode`\~\active
+ \def\x{\endgroup
+ \def\bbl@switch@sh@on##1{%
+ \lccode`~=`##1%
+ \lowercase{%
+ \catcode`~\active
+ }%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+% The next operation makes the above definition effective.
+% \begin{macrocode}
+\x
+%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% To prevent problems with constructs such as |\char"01A| when the
+% double quote is made active, we define a shorthand on
+% system level.
+% \changes{babel~3.5a}{1995/03/10}{Replaced 16 system shorthands to
+% deal with hex numbers by one}
+% \begin{macrocode}
+\declare@shorthand{system}{"}{\csname normal@char\string"\endcsname}
+% \end{macrocode}
+%
+% When the right quote is made active we need to take care of
+% handling it correctly in mathmode. Therefore we define a
+% shorthand at system level to make it expand to a non-active right
+% quote in textmode, but expand to its original definition in
+% mathmode. (Note that the right quote is `active' in mathmode
+% because of its mathcode.)
+% \changes{babel~3.5a}{1995/03/10}{Added a system shorthand for the
+% right quote}
+% \begin{macrocode}
+\declare@shorthand{system}{'}{%
+ \textormath{\csname normal@char\string'\endcsname}%
+ {\sp\bgroup\prim@s}}
+% \end{macrocode}
+%
+% When the left quote is made active we need to take care of
+% handling it correctly when it is followed by for instance an open
+% brace token. Therefore we define a shorthand at system level to
+% make it expand to a non-active left quote.
+% \changes{babel~3.5f}{1996/03/06}{Added a system shorthand for the
+% left quote}
+% \begin{macrocode}
+\declare@shorthand{system}{`}{\csname normal@char\string`\endcsname}
+% \end{macrocode}
+%
+% \begin{macro}{\bbl@prim@s}
+% \changes{babel~3.7f}{1999/12/01}{Need to redefine \cs{prim@s} as
+% well as plain \TeX's definition uses \cs{next}}
+% \begin{macro}{\bbl@pr@m@s}
+% \changes{babel~3.5a}{1995/03/10}{Added macro}
+% One of the internal macros that are involved in substituting
+% |\prime| for each right quote in mathmode is |\prim@s|. This
+% checks if the next character is a right quote. When the right
+% quote is active, the definition of this macro needs to be adapted
+% to look for an active right quote.
+% \begin{macrocode}
+\def\bbl@prim@s{%
+ \prime\futurelet\@let@token\bbl@pr@m@s}
+\begingroup
+ \catcode`\'\active\let'\relax
+ \def\x{\endgroup
+ \def\bbl@pr@m@s{%
+ \ifx'\@let@token
+ \expandafter\pr@@@s
+ \else
+ \ifx^\@let@token
+ \expandafter\expandafter\expandafter\pr@@@t
+ \else
+ \egroup
+ \fi
+ \fi}%
+ }
+\x
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+%</core|shorthands>
+% \end{macrocode}
+%
+% Normally the |~| is active and expands to \verb*=\penalty\@M\ =.
+% When it is written to the \file{.aux} file it is written
+% expanded. To prevent that and to be able to use the character |~|
+% as a start character for a shorthand, it is redefined here as a
+% one character shorthand on system level.
+% \changes{babel~3.5f}{1996/04/02}{No need to reset the category code
+% of the tilde as \cs{initiate@active@char} now correctly deals
+% with active characters}
+% \begin{macrocode}
+%<*core>
+\initiate@active@char{~}
+\declare@shorthand{system}{~}{\leavevmode\nobreak\ }
+\bbl@activate{~}
+% \end{macrocode}
+%
+% \begin{macro}{\OT1dqpos}
+% \begin{macro}{\T1dqpos}
+% The position of the double quote character is different for the
+% OT1 and T1 encodings. It will later be selected using the
+% |\f@encoding| macro. Therefor we define two macros here to store
+% the position of the character in these encodings.
+% \begin{macrocode}
+\expandafter\def\csname OT1dqpos\endcsname{127}
+\expandafter\def\csname T1dqpos\endcsname{4}
+% \end{macrocode}
+% When the macro |\f@encoding| is undefined (as it is in plain
+% \TeX) we define it here to expand to \texttt{OT1}
+% \begin{macrocode}
+\ifx\f@encoding\@undefined
+ \def\f@encoding{OT1}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Language attributes}
+%
+% Language attributes provide a means to give the user control over
+% which features of the language definition files he wants to
+% enable.
+% \changes{babel~3.7c}{1998/07/02}{Added support for language
+% attributes}
+% \begin{macro}{\languageattribute}
+% The macro |\languageattribute| checks whether its arguments are
+% valid and then activates the selected language attribute.
+% \begin{macrocode}
+\newcommand\languageattribute[2]{%
+% \end{macrocode}
+% First check whether the language is known.
+% \begin{macrocode}
+ \expandafter\ifx\csname l@#1\endcsname\relax
+ \@nolanerr{#1}%
+ \else
+% \end{macrocode}
+% Than process each attribute in the list.
+% \begin{macrocode}
+ \@for\bbl@attr:=#2\do{%
+% \end{macrocode}
+% We want to make sure that each attribute is selected only once;
+% therefor we store the already selected attributes in
+% |\bbl@known@attribs|. When that control sequence is not yet
+% defined this attribute is certainly not selected before.
+% \begin{macrocode}
+ \ifx\bbl@known@attribs\@undefined
+ \in@false
+ \else
+% \end{macrocode}
+% Now we need to see if the attribute occurs in the list of
+% already selected attributes.
+% \begin{macrocode}
+ \edef\bbl@tempa{\noexpand\in@{,#1-\bbl@attr,}%
+ {,\bbl@known@attribs,}}%
+ \bbl@tempa
+ \fi
+% \end{macrocode}
+% When the attribute was in the list we issue a warning; this might
+% not be the users intention.
+% \begin{macrocode}
+ \ifin@
+ \PackageWarning{Babel}{%
+ You have more than once selected the attribute
+ '\bbl@attr'\MessageBreak for language #1}%
+ \else
+% \end{macrocode}
+% When we end up here the attribute is not selected before. So, we
+% add it to the list of selected attributes and execute the
+% associated \TeX-code.
+% \begin{macrocode}
+ \edef\bbl@tempa{%
+ \noexpand\bbl@add@list\noexpand\bbl@known@attribs{#1-\bbl@attr}}%
+ \bbl@tempa
+ \edef\bbl@tempa{#1-\bbl@attr}%
+ \expandafter\bbl@ifknown@ttrib\expandafter{\bbl@tempa}\bbl@attributes%
+ {\csname#1@attr@\bbl@attr\endcsname}%
+ {\@attrerr{#1}{\bbl@attr}}%
+ \fi
+ }
+ \fi}
+% \end{macrocode}
+% This command should only be used in the preamble of a document.
+% \begin{macrocode}
+\@onlypreamble\languageattribute
+% \end{macrocode}
+% The error text to be issued when an unknown attribute is
+% selected.
+% \begin{macrocode}
+ \newcommand*{\@attrerr}[2]{%
+ \PackageError{babel}%
+ {The attribute #2 is unknown for language #1.}%
+ {Your command will be ignored, type <return> to proceed}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@declare@ttribute}
+% This command adds the new language/attribute combination to the
+% list of known attributes.
+% \begin{macrocode}
+\def\bbl@declare@ttribute#1#2#3{%
+ \bbl@add@list\bbl@attributes{#1-#2}%
+% \end{macrocode}
+% Then it defines a control sequence to be executed when the
+% attribute is used in a document. The result of this should be
+% that the macro |\extras...| for the current language is extended,
+% otherwise the attribute will not work as its code is removed from
+% memory at |\begin{document}|.
+% \begin{macrocode}
+ \expandafter\def\csname#1@attr@#2\endcsname{#3}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@ifattributeset}
+% \changes{babel~3.7f}{2000/02/12}{macro added}
+% This internal macro has 4 arguments. It can be used to interpret
+% \TeX\ code based on whether a certain attribute was set. This
+% command should appear inside the argument to |\AtBeginDocument|
+% because the attributes are set in the document preamble,
+% \emph{after} \babel\ is loaded.
+%
+% The first argument is the language, the second argument the
+% attribute being checked, and the third and fourth arguments are
+% the true and false clauses.
+% \begin{macrocode}
+\def\bbl@ifattributeset#1#2#3#4{%
+% \end{macrocode}
+% First we need to find out if any attributes were set; if not
+% we're done.
+% \begin{macrocode}
+ \ifx\bbl@known@attribs\@undefined
+ \in@false
+ \else
+% \end{macrocode}
+% The we need to check the list of known attributes.
+% \begin{macrocode}
+ \edef\bbl@tempa{\noexpand\in@{,#1-#2,}%
+ {,\bbl@known@attribs,}}%
+ \bbl@tempa
+ \fi
+% \end{macrocode}
+% When we're this far |\ifin@| has a value indicating if the
+% attribute in question was set or not. Just to be safe the code to
+% be executed is `thrown over the |\fi|'.
+% \begin{macrocode}
+ \ifin@
+ \bbl@afterelse#3%
+ \else
+ \bbl@afterfi#4%
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@add@list}
+% This internal macro adds its second argument to a comma
+% separated list in its first argument. When the list is not
+% defined yet (or empty), it will be initiated
+% \begin{macrocode}
+\def\bbl@add@list#1#2{%
+ \ifx#1\@undefined
+ \def#1{#2}%
+ \else
+ \ifx#1\@empty
+ \def#1{#2}%
+ \else
+ \edef#1{#1,#2}%
+ \fi
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@ifknown@ttrib}
+% An internal macro to check whether a given language/attribute is
+% known. The macro takes 4 arguments, the language/attribute, the
+% attribute list, the \TeX-code to be executed when the attribute
+% is known and the \TeX-code to be executed otherwise.
+% \begin{macrocode}
+\def\bbl@ifknown@ttrib#1#2{%
+% \end{macrocode}
+% We first assume the attribute is unknown.
+% \begin{macrocode}
+ \let\bbl@tempa\@secondoftwo
+% \end{macrocode}
+% Then we loop over the list of known attributes, trying to find a
+% match.
+% \begin{macrocode}
+ \@for\bbl@tempb:=#2\do{%
+ \expandafter\in@\expandafter{\expandafter,\bbl@tempb,}{,#1,}%
+ \ifin@
+% \end{macrocode}
+% When a match is found the definition of |\bbl@tempa| is changed.
+% \begin{macrocode}
+ \let\bbl@tempa\@firstoftwo
+ \else
+ \fi}%
+% \end{macrocode}
+% Finally we execute |\bbl@tempa|.
+% \begin{macrocode}
+ \bbl@tempa
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@clear@ttribs}
+% This macro removes all the attribute code from \LaTeX's memory at
+% |\begin{document}| time (if any is present).
+% \changes{babel~3.7e}{1999/09/24}{When \cs{bbl@attributes} is
+% undefined this should be a no-op}
+% \begin{macrocode}
+\def\bbl@clear@ttribs{%
+ \ifx\bbl@attributes\@undefined\else
+ \@for\bbl@tempa:=\bbl@attributes\do{%
+ \expandafter\bbl@clear@ttrib\bbl@tempa.
+ }%
+ \let\bbl@attributes\@undefined
+ \fi
+ }
+\def\bbl@clear@ttrib#1-#2.{%
+ \expandafter\let\csname#1@attr@#2\endcsname\@undefined}
+\AtBeginDocument{\bbl@clear@ttribs}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Support for saving macro definitions}
+%
+% To save the meaning of control sequences using |\babel@save|, we
+% use temporary control sequences. To save hash table entries for
+% these control sequences, we don't use the name of the control
+% sequence to be saved to construct the temporary name. Instead we
+% simply use the value of a counter, which is reset to zero each
+% time we begin to save new values. This works well because we
+% release the saved meanings before we begin to save a new set of
+% control sequence meanings (see |\selectlanguage| and
+% |\originalTeX|).
+%
+% \begin{macro}{\babel@savecnt}
+% \changes{babel~3.2}{1991/11/10}{Added macro}
+% \begin{macro}{\babel@beginsave}
+% \changes{babel~3.2}{1991/11/10}{Added macro}
+% The initialization of a new save cycle: reset the counter to
+% zero.
+% \begin{macrocode}
+\def\babel@beginsave{\babel@savecnt\z@}
+% \end{macrocode}
+% Before it's forgotten, allocate the counter and initialize all.
+% \begin{macrocode}
+\newcount\babel@savecnt
+\babel@beginsave
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\babel@save}
+% \changes{babel~3.2}{1991/11/10}{Added macro}
+% The macro |\babel@save|\meta{csname} saves the current meaning of
+% the control sequence \meta{csname} to
+% |\originalTeX|\footnote{\cs{originalTeX} has to be
+% expandable, i.\,e.\ you shouldn't let it to \cs{relax}.}.
+% To do this, we let the current meaning to a temporary control
+% sequence, the restore commands are appended to |\originalTeX| and
+% the counter is incremented.
+% \changes{babel~3.2c}{1992/03/17}{missing backslash led to errors
+% when executing \cs{originalTeX}}
+% \changes{babel~3.2d}{1992/07/02}{saving in \cs{babel@i} and
+% restoring from \cs{@babel@i} doesn't work very well...}
+% \begin{macrocode}
+\def\babel@save#1{%
+ \expandafter\let\csname babel@\number\babel@savecnt\endcsname #1\relax
+ \begingroup
+ \toks@\expandafter{\originalTeX \let#1=}%
+ \edef\x{\endgroup
+ \def\noexpand\originalTeX{\the\toks@ \expandafter\noexpand
+ \csname babel@\number\babel@savecnt\endcsname\relax}}%
+ \x
+ \advance\babel@savecnt\@ne}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\babel@savevariable}
+% \changes{babel~3.2}{1991/11/10}{Added macro}
+% The macro |\babel@savevariable|\meta{variable} saves the value of
+% the variable. \meta{variable} can be anything allowed after the
+% |\the| primitive.
+% \begin{macrocode}
+\def\babel@savevariable#1{\begingroup
+ \toks@\expandafter{\originalTeX #1=}%
+ \edef\x{\endgroup
+ \def\noexpand\originalTeX{\the\toks@ \the#1\relax}}%
+ \x}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@frenchspacing}
+% \begin{macro}{\bbl@nonfrenchspacing}
+% Some languages need to have |\frenchspacing| in effect. Others
+% don't want that. The command |\bbl@frenchspacing| switches it on
+% when it isn't already in effect and |\bbl@nonfrenchspacing|
+% switches it off if necessary.
+% \begin{macrocode}
+\def\bbl@frenchspacing{%
+ \ifnum\the\sfcode`\.=\@m
+ \let\bbl@nonfrenchspacing\relax
+ \else
+ \frenchspacing
+ \let\bbl@nonfrenchspacing\nonfrenchspacing
+ \fi}
+\let\bbl@nonfrenchspacing\nonfrenchspacing
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Support for extending macros}
+%
+% \begin{macro}{\addto}
+% For each language four control sequences have to be defined that
+% control the language-specific definitions. To be able to add
+% something to these macro once they have been defined the macro
+% |\addto| is introduced. It takes two arguments, a \meta{control
+% sequence} and \TeX-code to be added to the \meta{control
+% sequence}.
+%
+% If the \meta{control sequence} has not been defined before it is
+% defined now.
+% \changes{babel~3.1}{1991/11/05}{Added macro}
+% \changes{babel~3.4}{1994/02/04}{Changed to use toks register}
+% \changes{babel~3.6b}{1996/12/30}{Also check if control sequence
+% expands to \cs{relax}}
+% \begin{macrocode}
+\def\addto#1#2{%
+ \ifx#1\@undefined
+ \def#1{#2}%
+ \else
+% \end{macrocode}
+% The control sequence could also expand to |\relax|, in which case
+% a circular definition results. The net result is a stack overflow.
+% \begin{macrocode}
+ \ifx#1\relax
+ \def#1{#2}%
+ \else
+% \end{macrocode}
+% Otherwise the replacement text for the \meta{control sequence} is
+% expanded and stored in a token register, together with the
+% \TeX-code to be added. Finally the \meta{control sequence} is
+% \emph{re}defined, using the contents of the token register.
+% \begin{macrocode}
+ {\toks@\expandafter{#1#2}%
+ \xdef#1{\the\toks@}}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Macros common to a number of languages}
+%
+% \begin{macro}{\allowhyphens}
+% \changes{babel~3.2b}{1992/02/16}{Moved macro from language
+% definition files}
+% \changes{babel~3.7a}{1998/03/12}{Make \cs{allowhyphens} a no-op for
+% T1 fontencoding}
+% This macro makes hyphenation possible. Basically its definition
+% is nothing more than |\nobreak| |\hskip| \texttt{0pt plus
+% 0pt}\footnote{\TeX\ begins and ends a word for hyphenation at a
+% glue node. The penalty prevents a linebreak at this glue node.}.
+% \begin{macrocode}
+\def\bbl@t@one{T1}
+\def\allowhyphens{%
+ \ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi}
+\def\bbl@allowhyphens{\nobreak\hskip\z@skip}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\set@low@box}
+% \changes{babel~3.2b}{1992/02/16}{Moved macro from language
+% definition files}
+% The following macro is used to lower quotes to the same level as
+% the comma. It prepares its argument in box register~0.
+% \begin{macrocode}
+\def\set@low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}%
+ \dimen\z@\ht\z@ \advance\dimen\z@ -\ht\tw@%
+ \setbox\z@\hbox{\lower\dimen\z@ \box\z@}\ht\z@\ht\tw@ \dp\z@\dp\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\save@sf@q}
+% \changes{babel~3.2b}{1992/02/16}{Moved macro from language
+% definition files}
+% The macro |\save@sf@q| is used to save and reset the current
+% space factor.
+% \changes{babel~3.7f}{2000/09/19}{PR3119, don't start a paragraph in
+% a local group}
+% \begin{macrocode}
+\def\save@sf@q #1{\leavevmode
+ \begingroup
+ \edef\@SF{\spacefactor \the\spacefactor}#1\@SF
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@disc}
+% \changes{babel~3.5f}{1996/01/24}{Macro moved from language
+% definition files}
+% For some languages the macro |\bbl@disc| is used to ease the
+% insertion of discretionaries for letters that behave `abnormally'
+% at a breakpoint.
+% \begin{macrocode}
+\def\bbl@disc#1#2{%
+ \nobreak\discretionary{#2-}{}{#1}\allowhyphens}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{babel~3.5c}{1995/06/14}{Repaired a typo (itlaic, PR1652)}
+%
+% \subsection{Making glyphs available}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion, and was last revised on
+% \filedate.} makes a number of glyphs available that either do not
+% exist in the \texttt{OT1} encoding and have to be `faked', or
+% that are not accessible through \file{T1enc.def}.
+%
+% \subsection{Quotation marks}
+%
+% \begin{macro}{\quotedblbase}
+% In the \texttt{T1} encoding the opening double quote at the
+% baseline is available as a separate character, accessible via
+% |\quotedblbase|. In the \texttt{OT1} encoding it is not
+% available, therefor we make it available by lowering the normal
+% open quote character to the baseline.
+% \begin{macrocode}
+\ProvideTextCommand{\quotedblbase}{OT1}{%
+ \save@sf@q{\set@low@box{\textquotedblright\/}%
+ \box\z@\kern-.04em\allowhyphens}}
+% \end{macrocode}
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used this glyph can still be typeset.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\quotedblbase}{%
+ \UseTextSymbol{OT1}{\quotedblbase}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\quotesinglbase}
+% We also need the single quote character at the baseline.
+% \begin{macrocode}
+\ProvideTextCommand{\quotesinglbase}{OT1}{%
+ \save@sf@q{\set@low@box{\textquoteright\/}%
+ \box\z@\kern-.04em\allowhyphens}}
+% \end{macrocode}
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used this glyph can still be typeset.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\quotesinglbase}{%
+ \UseTextSymbol{OT1}{\quotesinglbase}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\guillemotleft}
+% \begin{macro}{\guillemotright}
+% The guillemet characters are not available in \texttt{OT1}
+% encoding. They are faked.
+% \begin{macrocode}
+\ProvideTextCommand{\guillemotleft}{OT1}{%
+ \ifmmode
+ \ll
+ \else
+ \save@sf@q{\nobreak
+ \raise.2ex\hbox{$\scriptscriptstyle\ll$}\allowhyphens}%
+ \fi}
+\ProvideTextCommand{\guillemotright}{OT1}{%
+ \ifmmode
+ \gg
+ \else
+ \save@sf@q{\nobreak
+ \raise.2ex\hbox{$\scriptscriptstyle\gg$}\allowhyphens}%
+ \fi}
+% \end{macrocode}
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used these glyphs can still be typeset.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\guillemotleft}{%
+ \UseTextSymbol{OT1}{\guillemotleft}}
+\ProvideTextCommandDefault{\guillemotright}{%
+ \UseTextSymbol{OT1}{\guillemotright}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\guilsinglleft}
+% \begin{macro}{\guilsinglright}
+% The single guillemets are not available in \texttt{OT1}
+% encoding. They are faked.
+% \begin{macrocode}
+\ProvideTextCommand{\guilsinglleft}{OT1}{%
+ \ifmmode
+ <%
+ \else
+ \save@sf@q{\nobreak
+ \raise.2ex\hbox{$\scriptscriptstyle<$}\allowhyphens}%
+ \fi}
+\ProvideTextCommand{\guilsinglright}{OT1}{%
+ \ifmmode
+ >%
+ \else
+ \save@sf@q{\nobreak
+ \raise.2ex\hbox{$\scriptscriptstyle>$}\allowhyphens}%
+ \fi}
+% \end{macrocode}
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used these glyphs can still be typeset.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\guilsinglleft}{%
+ \UseTextSymbol{OT1}{\guilsinglleft}}
+\ProvideTextCommandDefault{\guilsinglright}{%
+ \UseTextSymbol{OT1}{\guilsinglright}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Letters}
+%
+% \begin{macro}{\ij}
+% \begin{macro}{\IJ}
+% The dutch language uses the letter `ij'. It is available in
+% \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded
+% fonts. Therefor we fake it for the \texttt{OT1} encoding.
+% \changes{dutch-3.7a}{1995/02/04}{Changed the kerning in the faked ij
+% to match the dc-version of it}
+% \begin{macrocode}
+\DeclareTextCommand{\ij}{OT1}{%
+ \allowhyphens i\kern-0.02em j\allowhyphens}
+\DeclareTextCommand{\IJ}{OT1}{%
+ \allowhyphens I\kern-0.02em J\allowhyphens}
+\DeclareTextCommand{\ij}{T1}{\char188}
+\DeclareTextCommand{\IJ}{T1}{\char156}
+% \end{macrocode}
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used these glyphs can still be typeset.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\ij}{%
+ \UseTextSymbol{OT1}{\ij}}
+\ProvideTextCommandDefault{\IJ}{%
+ \UseTextSymbol{OT1}{\IJ}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\dj}
+% \begin{macro}{\DJ}
+% The croatian language needs the letters |\dj| and |\DJ|; they are
+% available in the \texttt{T1} encoding, but not in the
+% \texttt{OT1} encoding by default.
+%
+% Some code to construct these glyphs for the \texttt{OT1} encoding
+% was made available to me by Stipcevic Mario,
+% (\texttt{stipcevic@olimp.irb.hr}).
+% \changes{babel~3.5f}{1996/03/28}{New definition of \cs{dj}, see PR
+% 2058}
+% \begin{macrocode}
+\def\crrtic@{\hrule height0.1ex width0.3em}
+\def\crttic@{\hrule height0.1ex width0.33em}
+%
+\def\ddj@{%
+ \setbox0\hbox{d}\dimen@=\ht0
+ \advance\dimen@1ex
+ \dimen@.45\dimen@
+ \dimen@ii\expandafter\rem@pt\the\fontdimen\@ne\font\dimen@
+ \advance\dimen@ii.5ex
+ \leavevmode\rlap{\raise\dimen@\hbox{\kern\dimen@ii\vbox{\crrtic@}}}}
+\def\DDJ@{%
+ \setbox0\hbox{D}\dimen@=.55\ht0
+ \dimen@ii\expandafter\rem@pt\the\fontdimen\@ne\font\dimen@
+ \advance\dimen@ii.15ex % correction for the dash position
+ \advance\dimen@ii-.15\fontdimen7\font % correction for cmtt font
+ \dimen\thr@@\expandafter\rem@pt\the\fontdimen7\font\dimen@
+ \leavevmode\rlap{\raise\dimen@\hbox{\kern\dimen@ii\vbox{\crttic@}}}}
+%
+\DeclareTextCommand{\dj}{OT1}{\ddj@ d}
+\DeclareTextCommand{\DJ}{OT1}{\DDJ@ D}
+% \end{macrocode}
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used these glyphs can still be typeset.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\dj}{%
+ \UseTextSymbol{OT1}{\dj}}
+\ProvideTextCommandDefault{\DJ}{%
+ \UseTextSymbol{OT1}{\DJ}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SS}
+% For the \texttt{T1} encoding |\SS| is defined and selects a
+% specific glyph from the font, but for other encodings it is not
+% available. Therefor we make it available here.
+% \begin{macrocode}
+\DeclareTextCommand{\SS}{OT1}{SS}
+\ProvideTextCommandDefault{\SS}{\UseTextSymbol{OT1}{\SS}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Shorthands for quotation marks}
+%
+% Shorthands are provided for a number of different quotation
+% marks, which make them usable both outside and inside mathmode.
+%
+% \begin{macro}{\glq}
+% \begin{macro}{\grq}
+% \changes{babel~3.7a}{1997/04/25}{Make the definition of \cs{grq}
+% dependent on the font encoding}
+% \changes{babel~3.8b}{2004/05/02}{Made \cs{glq} fontencoding
+% dependent as well}
+% The `german' single quotes.
+% \begin{macrocode}
+\ProvideTextCommand{\glq}{OT1}{%
+ \textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}
+\ProvideTextCommand{\glq}{T1}{%
+ \textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}
+\ProvideTextCommandDefault{\glq}{\UseTextSymbol{OT1}\glq}
+% \end{macrocode}
+% The definition of |\grq| depends on the fontencoding. With
+% \texttt{T1} encoding no extra kerning is needed.
+% \begin{macrocode}
+\ProvideTextCommand{\grq}{T1}{%
+ \textormath{\textquoteleft}{\mbox{\textquoteleft}}}
+\ProvideTextCommand{\grq}{OT1}{%
+ \save@sf@q{\kern-.0125em%
+ \textormath{\textquoteleft}{\mbox{\textquoteleft}}%
+ \kern.07em\relax}}
+\ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\glqq}
+% \begin{macro}{\grqq}
+% \changes{babel~3.7a}{1997/04/25}{Make the definition of \cs{grqq}
+% dependent on the font encoding}
+% \changes{babel~3.8b}{2004/05/02}{Made \cs{grqq} fontencoding
+% dependent as well}
+% The `german' double quotes.
+% \begin{macrocode}
+\ProvideTextCommand{\glqq}{OT1}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\ProvideTextCommand{\glqq}{T1}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\ProvideTextCommandDefault{\glqq}{\UseTextSymbol{OT1}\glqq}
+% \end{macrocode}
+% The definition of |\grqq| depends on the fontencoding. With
+% \texttt{T1} encoding no extra kerning is needed.
+% \begin{macrocode}
+\ProvideTextCommand{\grqq}{T1}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\ProvideTextCommand{\grqq}{OT1}{%
+ \save@sf@q{\kern-.07em%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}%
+ \kern.07em\relax}}
+\ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\flq}
+% \begin{macro}{\frq}
+% \changes{babel~3.5f}{1995/08/07}{corrected spelling of
+% \cs{quilsingl...}}
+% \changes{babel~3.5f}{1995/09/05}{now use \cs{textormath} in these
+% definitions}
+% \changes{babel~3.8b}{2004/05/02}{Made \cs{flq} and \cs{frq}
+% fontencoding dependent}
+% The `french' single guillemets.
+% \begin{macrocode}
+\ProvideTextCommand{\flq}{OT1}{%
+ \textormath{\guilsinglleft}{\mbox{\guilsinglleft}}}
+\ProvideTextCommand{\flq}{T1}{%
+ \textormath{\guilsinglleft}{\mbox{\guilsinglleft}}}
+\ProvideTextCommandDefault{\flq}{\UseTextSymbol{OT1}\flq}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProvideTextCommand{\frq}{OT1}{%
+ \textormath{\guilsinglright}{\mbox{\guilsinglright}}}
+\ProvideTextCommand{\frq}{T1}{%
+ \textormath{\guilsinglright}{\mbox{\guilsinglright}}}
+\ProvideTextCommandDefault{\frq}{\UseTextSymbol{OT1}\frq}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\flqq}
+% \begin{macro}{\frqq}
+% \changes{babel~3.5f}{1995/08/07}{corrected spelling of
+% \cs{quillemot...}}
+% \changes{babel~3.5f}{1995/09/05}{now use \cs{textormath} in these
+% definitions}
+% \changes{babel~3.8b}{2004/05/02}{Made \cs{flqq} and \cs{frqq}
+% fontencoding dependent}
+% The `french' double guillemets.
+% \begin{macrocode}
+\ProvideTextCommand{\flqq}{OT1}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\ProvideTextCommand{\flqq}{T1}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\ProvideTextCommandDefault{\flqq}{\UseTextSymbol{OT1}\flqq}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProvideTextCommand{\frqq}{OT1}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+\ProvideTextCommand{\frqq}{T1}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+\ProvideTextCommandDefault{\frqq}{\UseTextSymbol{OT1}\frqq}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Umlauts and trema's}
+%
+% The command |\"| needs to have a different effect for different
+% languages. For German for instance, the `umlaut' should be
+% positioned lower than the default position for placing it over
+% the letters a, o, u, A, O and U. When placed over an e, i, E or I
+% it can retain its normal position. For Dutch the same glyph is
+% always placed in the lower position.
+%
+% \begin{macro}{\umlauthigh}
+% \changes{v3.8a}{2004/02/19}{Use \cs{leavevmode}\cs{bgroup} to
+% prevent problems when this command occurs in vertical mode.}
+% \begin{macro}{\umlautlow}
+% To be able to provide both positions of |\"| we provide two
+% commands to switch the positioning, the default will be
+% |\umlauthigh| (the normal positioning).
+% \begin{macrocode}
+\def\umlauthigh{%
+ \def\bbl@umlauta##1{\leavevmode\bgroup%
+ \expandafter\accent\csname\f@encoding dqpos\endcsname
+ ##1\allowhyphens\egroup}%
+ \let\bbl@umlaute\bbl@umlauta}
+\def\umlautlow{%
+ \def\bbl@umlauta{\protect\lower@umlaut}}
+\def\umlautelow{%
+ \def\bbl@umlaute{\protect\lower@umlaut}}
+\umlauthigh
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\lower@umlaut}
+% The command |\lower@umlaut| is used to position the |\"| closer
+% the the letter.
+%
+% We want the umlaut character lowered, nearer to the letter. To do
+% this we need an extra \meta{dimen} register.
+% \begin{macrocode}
+\expandafter\ifx\csname U@D\endcsname\relax
+ \csname newdimen\endcsname\U@D
+\fi
+% \end{macrocode}
+% The following code fools \TeX's \texttt{make\_accent} procedure
+% about the current x-height of the font to force another placement
+% of the umlaut character.
+% \begin{macrocode}
+\def\lower@umlaut#1{%
+% \end{macrocode}
+% First we have to save the current x-height of the font, because
+% we'll change this font dimension and this is always done
+% globally.
+% \changes{v3.8a}{2004/02/19}{Use \cs{leavevmode}\cs{bgroup} to
+% prevent problems when this command occurs in vertical mode.}
+% \begin{macrocode}
+ \leavevmode\bgroup
+ \U@D 1ex%
+% \end{macrocode}
+% Then we compute the new x-height in such a way that the umlaut
+% character is lowered to the base character. The value of
+% \texttt{.45ex} depends on the \MF\ parameters with which the
+% fonts were built. (Just try out, which value will look best.)
+% \begin{macrocode}
+ {\setbox\z@\hbox{%
+ \expandafter\char\csname\f@encoding dqpos\endcsname}%
+ \dimen@ -.45ex\advance\dimen@\ht\z@
+% \end{macrocode}
+% If the new x-height is too low, it is not changed.
+% \begin{macrocode}
+ \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
+% \end{macrocode}
+% Finally we call the |\accent| primitive, reset the old x-height
+% and insert the base character in the argument.
+% \changes{babel~3.5f}{1996/04/02}{Added a \cs{allowhyphens}}
+% \changes{babel~3.5f}{1996/06/25}{removed \cs{allowhyphens}}
+% \begin{macrocode}
+ \expandafter\accent\csname\f@encoding dqpos\endcsname
+ \fontdimen5\font\U@D #1%
+ \egroup}
+% \end{macrocode}
+% \end{macro}
+%
+% For all vowels we declare |\"| to be a composite command which
+% uses |\bbl@umlauta| or |\bbl@umlaute| to position the umlaut
+% character. We need to be sure that these definitions override the
+% ones that are provided when the package \pkg{fontenc} with
+% option \Lopt{OT1} is used. Therefor these declarations are
+% postponed until the beginning of the document.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \DeclareTextCompositeCommand{\"}{OT1}{a}{\bbl@umlauta{a}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{e}{\bbl@umlaute{e}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{i}{\bbl@umlaute{\i}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{\i}{\bbl@umlaute{\i}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{o}{\bbl@umlauta{o}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{u}{\bbl@umlauta{u}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{A}{\bbl@umlauta{A}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{E}{\bbl@umlaute{E}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{I}{\bbl@umlaute{I}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{O}{\bbl@umlauta{O}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{U}{\bbl@umlauta{U}}%
+}
+% \end{macrocode}
+%
+% \subsection{The redefinition of the style commands}
+%
+% The rest of the code in this file can only be processed by
+% \LaTeX, so we check the current format. If it is plain \TeX,
+% processing should stop here. But, because of the need to limit
+% the scope of the definition of |\format|, a macro that is used
+% locally in the following |\if|~statement, this comparison is done
+% inside a group. To prevent \TeX\ from complaining about an
+% unclosed group, the processing of the command |\endinput| is
+% deferred until after the group is closed. This is accomplished by
+% the command |\aftergroup|.
+% \begin{macrocode}
+{\def\format{lplain}
+\ifx\fmtname\format
+\else
+ \def\format{LaTeX2e}
+ \ifx\fmtname\format
+ \else
+ \aftergroup\endinput
+ \fi
+\fi}
+% \end{macrocode}
+%
+% Now that we're sure that the code is seen by \LaTeX\ only, we
+% have to find out what the main (primary) document style is
+% because we want to redefine some macros. This is only necessary
+% for releases of \LaTeX\ dated before December~1991. Therefor
+% this part of the code can optionally be included in
+% \file{babel.def} by specifying the \texttt{docstrip} option
+% \texttt{names}.
+% \begin{macrocode}
+%<*names>
+% \end{macrocode}
+%
+% The standard styles can be distinguished by checking whether some
+% macros are defined. In table~\ref{styles} an overview is given of
+% the macros that can be used for this purpose.
+% \begin{table}[htb]
+% \begin{center}
+% \DeleteShortVerb{\|}
+% \begin{tabular}{|lcp{8cm}|}
+% \hline
+% article & : & both the \verb+\chapter+ and \verb+\opening+
+% macros are undefined\\
+% report and book & : & the \verb+\chapter+ macro is defined and
+% the \verb+\opening+ is undefined\\
+% letter & : & the \verb+\chapter+ macro is undefined and
+% the \verb+\opening+ is defined\\
+% \hline
+% \end{tabular}
+% \caption{How to determine the main document style}\label{styles}
+% \MakeShortVerb{\|}
+% \end{center}
+% \end{table}
+%
+% \noindent The macros that have to be redefined for the
+% \texttt{report} and \texttt{book} document styles happen to be
+% the same, so there is no need to distinguish between those two
+% styles.
+%
+% \begin{macro}{\doc@style}
+% First a parameter |\doc@style| is defined to identify the current
+% document style. This parameter might have been defined by a
+% document style that already uses macros instead of hard-wired
+% texts, such as \file{artikel1.sty}~\cite{BEP}, so the existence of
+% |\doc@style| is checked. If this macro is undefined, i.\,e., if
+% the document style is unknown and could therefore contain
+% hard-wired texts, |\doc@style| is defined to the default
+% value~`0'.
+% \changes{babel~3.0d}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \begin{macrocode}
+\ifx\@undefined\doc@style
+ \def\doc@style{0}%
+% \end{macrocode}
+% This parameter is defined in the following \texttt{if}
+% construction (see table~\ref{styles}):
+%
+% \begin{macrocode}
+ \ifx\@undefined\opening
+ \ifx\@undefined\chapter
+ \def\doc@style{1}%
+ \else
+ \def\doc@style{2}%
+ \fi
+ \else
+ \def\doc@style{3}%
+ \fi%
+\fi%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{babel~3.1}{1991/11/05}{Removed definition of
+% \cs{if@restonecol}}
+%
+% \subsubsection{Redefinition of macros}
+%
+% Now here comes the real work: we start to redefine things and
+% replace hard-wired texts by macros. These redefinitions should be
+% carried out conditionally, in case it has already been done.
+%
+% For the \texttt{figure} and \texttt{table} environments we have
+% in all styles:
+% \begin{macrocode}
+\@ifundefined{figurename}{\def\fnum@figure{\figurename{} \thefigure}}{}
+\@ifundefined{tablename}{\def\fnum@table{\tablename{} \thetable}}{}
+% \end{macrocode}
+%
+% The rest of the macros have to be treated differently for each
+% style. When |\doc@style| still has its default value nothing
+% needs to be done.
+% \begin{macrocode}
+\ifcase \doc@style\relax
+\or
+% \end{macrocode}
+%
+% This means that \file{babel.def} is read after the
+% \texttt{article} style, where no |\chapter| and |\opening|
+% commands are defined\footnote{A fact that was pointed out to me
+% by Nico Poppelier and was already used in Piet van Oostrum's
+% document style option~\texttt{nl}.}.
+%
+% First we have the |\tableofcontents|,
+% |\listoffigures| and |\listoftables|:
+% \begin{macrocode}
+\@ifundefined{contentsname}%
+ {\def\tableofcontents{\section*{\contentsname\@mkboth
+ {\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
+ \@starttoc{toc}}}{}
+
+\@ifundefined{listfigurename}%
+ {\def\listoffigures{\section*{\listfigurename\@mkboth
+ {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}%
+ \@starttoc{lof}}}{}
+
+\@ifundefined{listtablename}%
+ {\def\listoftables{\section*{\listtablename\@mkboth
+ {\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
+ \@starttoc{lot}}}{}
+% \end{macrocode}
+%
+% Then the |\thebibliography| and |\theindex| environments.
+%
+% \begin{macrocode}
+\@ifundefined{refname}%
+ {\def\thebibliography#1{\section*{\refname
+ \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}%
+ \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \usecounter{enumi}}%
+ \def\newblock{\hskip.11em plus.33em minus.07em}%
+ \sloppy\clubpenalty4000\widowpenalty\clubpenalty
+ \sfcode`\.=1000\relax}}{}
+
+\@ifundefined{indexname}%
+ {\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
+ \columnseprule \z@
+ \columnsep 35pt\twocolumn[\section*{\indexname}]%
+ \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
+ \thispagestyle{plain}%
+ \parskip\z@ plus.3pt\parindent\z@\let\item\@idxitem}}{}
+% \end{macrocode}
+%
+% The |abstract| environment:
+%
+% \begin{macrocode}
+\@ifundefined{abstractname}%
+ {\def\abstract{\if@twocolumn
+ \section*{\abstractname}%
+ \else \small
+ \begin{center}%
+ {\bf \abstractname\vspace{-.5em}\vspace{\z@}}%
+ \end{center}%
+ \quotation
+ \fi}}{}
+% \end{macrocode}
+%
+% And last but not least, the macro |\part|:
+%
+% \begin{macrocode}
+\@ifundefined{partname}%
+{\def\@part[#1]#2{\ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart
+ \hspace{1em}#1}\else
+ \addcontentsline{toc}{part}{#1}\fi
+ {\parindent\z@ \raggedright
+ \ifnum \c@secnumdepth >\m@ne
+ \Large \bf \partname{} \thepart
+ \par \nobreak
+ \fi
+ \huge \bf
+ #2\markboth{}{}\par}%
+ \nobreak
+ \vskip 3ex\@afterheading}%
+}{}
+% \end{macrocode}
+%
+% This is all that needs to be done for the \texttt{article} style.
+%
+% \begin{macrocode}
+\or
+% \end{macrocode}
+%
+% The next case is formed by the two styles \texttt{book} and
+% \texttt{report}. Basically we have to do the same as for the
+% \texttt{article} style, except now we must also change the
+% |\chapter| command.
+%
+% The tables of contents, figures and tables:
+% \begin{macrocode}
+\@ifundefined{contentsname}%
+ {\def\tableofcontents{\@restonecolfalse
+ \if@twocolumn\@restonecoltrue\onecolumn
+ \fi\chapter*{\contentsname\@mkboth
+ {\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
+ \@starttoc{toc}%
+ \csname if@restonecol\endcsname\twocolumn
+ \csname fi\endcsname}}{}
+
+\@ifundefined{listfigurename}%
+ {\def\listoffigures{\@restonecolfalse
+ \if@twocolumn\@restonecoltrue\onecolumn
+ \fi\chapter*{\listfigurename\@mkboth
+ {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}%
+ \@starttoc{lof}%
+ \csname if@restonecol\endcsname\twocolumn
+ \csname fi\endcsname}}{}
+
+\@ifundefined{listtablename}%
+ {\def\listoftables{\@restonecolfalse
+ \if@twocolumn\@restonecoltrue\onecolumn
+ \fi\chapter*{\listtablename\@mkboth
+ {\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
+ \@starttoc{lot}%
+ \csname if@restonecol\endcsname\twocolumn
+ \csname fi\endcsname}}{}
+% \end{macrocode}
+%
+% Again, the |bibliography| and |index| environments; notice that
+% in this case we use |\bibname| instead of |\refname| as in the
+% definitions for the \texttt{article} style. The reason for this
+% is that in the \texttt{article} document style the term
+% `References' is used in the definition of |\thebibliography|. In
+% the \texttt{report} and \texttt{book} document styles the term
+% `Bibliography' is used.
+% \begin{macrocode}
+\@ifundefined{bibname}%
+ {\def\thebibliography#1{\chapter*{\bibname
+ \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}%
+ \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
+ \leftmargin\labelwidth \advance\leftmargin\labelsep
+ \usecounter{enumi}}%
+ \def\newblock{\hskip.11em plus.33em minus.07em}%
+ \sloppy\clubpenalty4000\widowpenalty\clubpenalty
+ \sfcode`\.=1000\relax}}{}
+
+\@ifundefined{indexname}%
+ {\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
+ \columnseprule \z@
+ \columnsep 35pt\twocolumn[\@makeschapterhead{\indexname}]%
+ \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
+ \thispagestyle{plain}%
+ \parskip\z@ plus.3pt\parindent\z@ \let\item\@idxitem}}{}
+% \end{macrocode}
+%
+% Here is the |abstract| environment:
+% \begin{macrocode}
+\@ifundefined{abstractname}%
+ {\def\abstract{\titlepage
+ \null\vfil
+ \begin{center}%
+ {\bf \abstractname}%
+ \end{center}}}{}
+% \end{macrocode}
+%
+% And last but not least the |\chapter|, |\appendix| and
+% |\part| macros.
+% \begin{macrocode}
+\@ifundefined{chaptername}{\def\@chapapp{\chaptername}}{}
+%
+\@ifundefined{appendixname}%
+ {\def\appendix{\par
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \def\@chapapp{\appendixname}%
+ \def\thechapter{\Alph{chapter}}}}{}
+%
+\@ifundefined{partname}%
+ {\def\@part[#1]#2{\ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart
+ \hspace{1em}#1}\else
+ \addcontentsline{toc}{part}{#1}\fi
+ \markboth{}{}%
+ {\centering
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bf \partname{} \thepart
+ \par
+ \vskip 20pt \fi
+ \Huge \bf
+ #1\par}\@endpart}}{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\or
+% \end{macrocode}
+%
+% Now we address the case where \file{babel.def} is read after the
+% \texttt{letter} style. The \texttt{letter} document style
+% defines the macro |\opening| and some other macros that are
+% specific to \texttt{letter}. This means that we have to redefine
+% other macros, compared to the previous two cases.
+%
+% First two macros for the material at the end of a letter, the
+% |\cc| and |\encl| macros.
+% \begin{macrocode}
+\@ifundefined{ccname}%
+ {\def\cc#1{\par\noindent
+ \parbox[t]{\textwidth}%
+ {\@hangfrom{\rm \ccname : }\ignorespaces #1\strut}\par}}{}
+
+\@ifundefined{enclname}%
+ {\def\encl#1{\par\noindent
+ \parbox[t]{\textwidth}%
+ {\@hangfrom{\rm \enclname : }\ignorespaces #1\strut}\par}}{}
+% \end{macrocode}
+%
+% The last thing we have to do here is to redefine the
+% \texttt{headings} pagestyle:
+% \changes{babel~3.3}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \begin{macrocode}
+\@ifundefined{headtoname}%
+ {\def\ps@headings{%
+ \def\@oddhead{\sl \headtoname{} \ignorespaces\toname \hfil
+ \@date \hfil \pagename{} \thepage}%
+ \def\@oddfoot{}}}{}
+% \end{macrocode}
+%
+% This was the last of the four standard document styles, so if
+% |\doc@style| has another value we do nothing and just close the
+% \texttt{if} construction.
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+% Here ends the code that can be optionally included when a version
+% of \LaTeX\ is in use that is dated \emph{before} December~1991.
+% \begin{macrocode}
+%</names>
+%</core>
+% \end{macrocode}
+%
+% \subsection{Cross referencing macros}
+%
+% The \LaTeX\ book states:
+% \begin{quote}
+% The \emph{key} argument is any sequence of letters, digits, and
+% punctuation symbols; upper- and lowercase letters are regarded as
+% different.
+% \end{quote}
+% When the above quote should still be true when a document is
+% typeset in a language that has active characters, special care
+% has to be taken of the category codes of these characters when
+% they appear in an argument of the cross referencing macros.
+%
+% When a cross referencing command processes its argument, all
+% tokens in this argument should be character tokens with category
+% `letter' or `other'.
+%
+% The only way to accomplish this in most cases is to use the trick
+% described in the \TeX book~\cite{DEK} (Appendix~D, page~382).
+% The primitive |\meaning| applied to a token expands to the
+% current meaning of this token. For example, `|\meaning\A|' with
+% |\A| defined as `|\def\A#1{\B}|' expands to the characters
+% `|macro:#1->\B|' with all category codes set to `other' or
+% `space'.
+%
+% \begin{macro}{\bbl@redefine}
+% \changes{babel~3.5f}{1995/11/15}{Macro added}
+% To redefine a command, we save the old meaning of the macro.
+% Then we redefine it to call the original macro with the
+% `sanitized' argument. The reason why we do it this way is that
+% we don't want to redefine the \LaTeX\ macros completely in case
+% their definitions change (they have changed in the past).
+%
+% Because we need to redefine a number of commands we define the
+% command |\bbl@redefine| which takes care of this. It creates a
+% new control sequence, |\org@...|
+% \begin{macrocode}
+%<*core|shorthands>
+\def\bbl@redefine#1{%
+ \edef\bbl@tempa{\expandafter\@gobble\string#1}%
+ \expandafter\let\csname org@\bbl@tempa\endcsname#1
+ \expandafter\def\csname\bbl@tempa\endcsname}
+% \end{macrocode}
+%
+% This command should only be used in the preamble of the document.
+% \begin{macrocode}
+\@onlypreamble\bbl@redefine
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@redefine@long}
+% \changes{babel~3.6f}{1997/01/14}{Macro added}
+% This version of |\babel@redefine| can be used to redefine |\long|
+% commands such as |\ifthenelse|.
+% \begin{macrocode}
+\def\bbl@redefine@long#1{%
+ \edef\bbl@tempa{\expandafter\@gobble\string#1}%
+ \expandafter\let\csname org@\bbl@tempa\endcsname#1
+ \expandafter\long\expandafter\def\csname\bbl@tempa\endcsname}
+\@onlypreamble\bbl@redefine@long
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@redefinerobust}
+% \changes{babel~3.5f}{1995/11/15}{Macro added}
+% For commands that are redefined, but which \textit{might} be
+% robust we need a slightly more intelligent macro. A robust
+% command |foo| is defined to expand to |\protect|\verb*|\foo |. So
+% it is necessary to check whether \verb*|\foo | exists.
+% \begin{macrocode}
+\def\bbl@redefinerobust#1{%
+ \edef\bbl@tempa{\expandafter\@gobble\string#1}%
+ \expandafter\ifx\csname \bbl@tempa\space\endcsname\relax
+ \expandafter\let\csname org@\bbl@tempa\endcsname#1
+ \expandafter\edef\csname\bbl@tempa\endcsname{\noexpand\protect
+ \expandafter\noexpand\csname\bbl@tempa\space\endcsname}%
+ \else
+ \expandafter\let\csname org@\bbl@tempa\expandafter\endcsname
+ \csname\bbl@tempa\space\endcsname
+ \fi
+% \end{macrocode}
+% The result of the code above is that the command that is being
+% redefined is always robust afterwards. Therefor all we need to do
+% now is define \verb*|\foo |.
+% \changes{babel~3.5f}{1996/04/09}{Define \cs*{foo } instead of
+% \cs{foo}}
+% \begin{macrocode}
+ \expandafter\def\csname\bbl@tempa\space\endcsname}
+% \end{macrocode}
+%
+% This command should only be used in the preamble of the document.
+% \begin{macrocode}
+\@onlypreamble\bbl@redefinerobust
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newlabel}
+% \changes{babel~3.5f}{1995/11/15}{Now use \cs{bbl@redefine}}
+% The macro |\label| writes a line with a |\newlabel| command
+% into the |.aux| file to define labels.
+% \begin{macrocode}
+%\bbl@redefine\newlabel#1#2{%
+% \@safe@activestrue\org@newlabel{#1}{#2}\@safe@activesfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@newl@bel}
+% \changes{babel~3.6i}{1997/03/01}{Now redefine \cs{@newl@bel} instead
+% of \cs{@lbibitem} and \cs{newlabel}}
+% We need to change the definition of the \LaTeX-internal macro
+% |\@newl@bel|. This is needed because we need to make sure that
+% shorthand characters expand to their non-active version.
+%
+%^^A The following lines commented out in preparation for a change
+%^^A in the LaTeX definition of \@enwl@bel... JLB 2000/10/01
+%^^A
+%^^A To play it safe when redefining a \LaTeX-internal command we
+%^^A first check whether its definition didn't change.
+%^^A \begin{macrocode}
+%^^A\CheckCommand*\@newl@bel[3]{%
+%^^A \@ifundefined{#1@#2}%
+%^^A \relax
+%^^A {\gdef \@multiplelabels {%
+%^^A \@latex@warning@no@line{There were multiply-defined labels}}%
+%^^A \@latex@warning@no@line{Label `#2' multiply defined}}%
+%^^A \global\@namedef{#1@#2}{#3}}
+%^^A \end{macrocode}
+%^^A Then we give the new definition.
+% \begin{macrocode}
+\def\@newl@bel#1#2#3{%
+% \end{macrocode}
+% First we open a new group to keep the changed setting of
+% |\protect| local and then we set the |@safe@actives| switch to
+% true to make sure that any shorthand that appears in any of the
+% arguments immediately expands to its non-active self.
+% \changes{babel~3.7a}{1997/12/19}{Call \cs{@safe@activestrue}
+% directly}
+% \begin{macrocode}
+ {%
+ \@safe@activestrue
+ \@ifundefined{#1@#2}%
+ \relax
+ {%
+ \gdef \@multiplelabels {%
+ \@latex@warning@no@line{There were multiply-defined labels}}%
+ \@latex@warning@no@line{Label `#2' multiply defined}%
+ }%
+ \global\@namedef{#1@#2}{#3}%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@testdef}
+% An internal \LaTeX\ macro used to test if the labels that have
+% been written on the |.aux| file have changed. It is called by
+% the |\enddocument| macro. This macro needs to be completely
+% rewritten, using |\meaning|. The reason for this is that in some
+% cases the expansion of |\#1@#2| contains the same characters as
+% the |#3|; but the character codes differ. Therefor \LaTeX\ keeps
+% reporting that the labels may have changed.
+% \changes{babel~3.4g}{1994/08/30}{Moved the \cs{def} inside the
+% macrocode environment}
+% \changes{babel~3.5f}{1995/11/15}{Now use \cs{bbl@redefine}}
+% \changes{babel~3.5f}{1996/01/09}{Complete rewrite of this macro as
+% the same character ended up with different category codes in the
+% labels that are being compared. Now use \cs{meaning}}
+% \changes{babel~3.5f}{1996/01/16}{Use \cs{strip@prefix} only on
+% \cs{bbl@tempa} when it is not \cs{relax}}
+% \changes{babel~3.6i}{1997/02/28}{Make sure that shorthands don't get
+% expanded at the wrong moment.}
+% \changes{babel~3.6i}{1997/03/01}{\cs{@safe@activesfalse} is now
+% part of the label definition}
+% \changes{babel~3.7a}{1998/03/13}{Removed \cs{@safe@activesfalse}
+% from the label definition}
+% \begin{macrocode}
+\CheckCommand*\@testdef[3]{%
+ \def\reserved@a{#3}%
+ \expandafter \ifx \csname #1@#2\endcsname \reserved@a
+ \else
+ \@tempswatrue
+ \fi}
+% \end{macrocode}
+% Now that we made sure that |\@testdef| still has the same
+% definition we can rewrite it. First we make the shorthands
+% `safe'.
+% \begin{macrocode}
+\def\@testdef #1#2#3{%
+ \@safe@activestrue
+% \end{macrocode}
+% Then we use |\bbl@tempa| as an `alias' for the macro that
+% contains the label which is being checked.
+% \begin{macrocode}
+ \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname
+% \end{macrocode}
+% Then we define |\bbl@tempb| just as |\@newl@bel| does it.
+% \begin{macrocode}
+ \def\bbl@tempb{#3}%
+ \@safe@activesfalse
+% \end{macrocode}
+% When the label is defined we replace the definition of
+% |\bbl@tempa| by its meaning.
+% \begin{macrocode}
+ \ifx\bbl@tempa\relax
+ \else
+ \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}%
+ \fi
+% \end{macrocode}
+% We do the same for |\bbl@tempb|.
+% \begin{macrocode}
+ \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}%
+% \end{macrocode}
+% If the label didn't change, |\bbl@tempa| and |\bbl@tempb| should
+% be identical macros.
+% \begin{macrocode}
+ \ifx \bbl@tempa \bbl@tempb
+ \else
+ \@tempswatrue
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ref}
+% \begin{macro}{\pageref}
+% The same holds for the macro |\ref| that references a label
+% and |\pageref| to reference a page. So we redefine |\ref| and
+% |\pageref|. While we change these macros, we make them robust as
+% well (if they weren't already) to prevent problems if they should
+% become expanded at the wrong moment.
+% \changes{babel~3.5b}{1995/03/07}{Made \cs{ref} and \cs{pageref}
+% robust (PR1353)}
+% \changes{babel~3.5d}{1995/07/04}{use a different control sequence
+% while making \cs{ref} and \cs{pageref} robust}
+% \changes{babel~3.5f}{1995/11/06}{redefine \cs*{ref } if it exists
+% instead of \cs{ref}}
+% \changes{babel~3.5f}{1995/11/15}{Now use \cs{bbl@redefinerobust}}
+% \changes{babel~3.5f}{1996/01/19}{redefine \cs{\@setref} instead of
+% \cs{ref} and \cs{pageref} in \LaTeXe.}
+% \changes{babel~3.5f}{1996/01/21}{Reverse the previous change as it
+% inhibits the use of active characters in labels}
+% \begin{macrocode}
+\bbl@redefinerobust\ref#1{%
+ \@safe@activestrue\org@ref{#1}\@safe@activesfalse}
+\bbl@redefinerobust\pageref#1{%
+ \@safe@activestrue\org@pageref{#1}\@safe@activesfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@citex}
+% \changes{babel~3.5f}{1995/11/15}{Now use \cs{bbl@redefine}}
+% The macro used to cite from a bibliography, |\cite|, uses an
+% internal macro, |\@citex|.
+% It is this internal macro that picks up the argument(s),
+% so we redefine this internal macro and leave |\cite| alone. The
+% first argument is used for typesetting, so the shorthands need
+% only be deactivated in the second argument.
+% \changes{babel~3.7g}{2000/10/01}{The shorthands need to be
+% deactivated for the second argument of \cs{@citex} only.}
+% \begin{macrocode}
+\bbl@redefine\@citex[#1]#2{%
+ \@safe@activestrue\edef\@tempa{#2}\@safe@activesfalse
+ \org@@citex[#1]{\@tempa}}
+% \end{macrocode}
+% Unfortunately, the packages \pkg{natbib} and \pkg{cite} need a
+% different definition of |\@citex|...
+% To begin with, \pkg{natbib} has a definition for |\@citex| with
+% \emph{three} arguments... We only know that a package is loaded
+% when |\begin{document}| is executed, so we need to postpone the
+% different redefinition.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifpackageloaded{natbib}{%
+% \end{macrocode}
+% Notice that we use |\def| here instead of |\bbl@redefine| because
+% |\org@@citex| is already defined and we don't want to overwrite
+% that definition (it would result in parameter stack overflow
+% because of a circular definition).
+% \begin{macrocode}
+ \def\@citex[#1][#2]#3{%
+ \@safe@activestrue\edef\@tempa{#3}\@safe@activesfalse
+ \org@@citex[#1][#2]{\@tempa}}%
+ }{}}
+% \end{macrocode}
+% The package \pkg{cite} has a definition of |\@citex| where the
+% shorthands need to be turned off in both arguments.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifpackageloaded{cite}{%
+ \def\@citex[#1]#2{%
+ \@safe@activestrue\org@@citex[#1]{#2}\@safe@activesfalse}%
+ }{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\nocite}
+% \changes{babel~3.5f}{1995/11/15}{Now use \cs{bbl@redefine}}
+% The macro |\nocite| which is used to instruct BiB\TeX\ to
+% extract uncited references from the database.
+% \begin{macrocode}
+\bbl@redefine\nocite#1{%
+ \@safe@activestrue\org@nocite{#1}\@safe@activesfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bibcite}
+% \changes{babel~3.5f}{1995/11/15}{Now use \cs{bbl@redefine}}
+% The macro that is used in the |.aux| file to define citation
+% labels. When packages such as \pkg{natbib} or \pkg{cite} are not
+% loaded its second argument is used to typeset the citation
+% label. In that case, this second argument can contain active
+% characters but is used in an environment where
+% |\@safe@activestrue| is in effect. This switch needs to be reset
+% inside the |\hbox| which contains the citation label. In order to
+% determine during \file{.aux} file processing which definition of
+% |\bibcite| is needed we define |\bibcite| in such a way that it
+% redefines itself with the proper definition.
+% \changes{babel~3.6s}{1999/04/13}{Need to determine `online' which
+% definition of \cs{bibcite} is needed}
+% \changes{babel~3.6v}{1999/04/21}{Also check for \pkg{cite} it can't
+% handle \cs{@safe@activesfalse} in its second argument}
+% \begin{macrocode}
+\bbl@redefine\bibcite{%
+% \end{macrocode}
+% We call |\bbl@cite@choice| to select the proper definition for
+% |\bibcite|. This new definition is then activated.
+% \begin{macrocode}
+ \bbl@cite@choice
+ \bibcite}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@bibcite}
+% \changes{babel~3.6v}{1999/04/21}{Macro \cs{bbl@bibcite} added}
+% The macro |\bbl@bibcite| holds the definition of |\bibcite|
+% needed when neither \pkg{natbib} nor \pkg{cite} is loaded.
+% \begin{macrocode}
+\def\bbl@bibcite#1#2{%
+ \org@bibcite{#1}{\@safe@activesfalse#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bbl@cite@choice}
+% \changes{babel~3.6v}{1999/04/21}{Macro \cs{bbl@cite@choice} added}
+% The macro |\bbl@cite@choice| determines which definition of
+% |\bibcite| is needed.
+% \begin{macrocode}
+\def\bbl@cite@choice{%
+% \end{macrocode}
+% First we give |\bibcite| its default definition.
+% \begin{macrocode}
+ \global\let\bibcite\bbl@bibcite
+% \end{macrocode}
+% Then, when \pkg{natbib} is loaded we restore the original
+% definition of |\bibcite| .
+% \begin{macrocode}
+ \@ifpackageloaded{natbib}{\global\let\bibcite\org@bibcite}{}%
+% \end{macrocode}
+% For \pkg{cite} we do the same.
+% \begin{macrocode}
+ \@ifpackageloaded{cite}{\global\let\bibcite\org@bibcite}{}%
+% \end{macrocode}
+% Make sure this only happens once.
+% \begin{macrocode}
+ \global\let\bbl@cite@choice\relax
+ }
+% \end{macrocode}
+%
+% When a document is run for the first time, no \file{.aux} file is
+% available, and |\bibcite| will not yet be properly defined. In
+% this case, this has to happen before the document starts.
+% \begin{macrocode}
+\AtBeginDocument{\bbl@cite@choice}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@bibitem}
+% \changes{babel~3.5f}{1995/11/15}{Now use \cs{bbl@redefine}}
+% One of the two internal \LaTeX\ macros called by |\bibitem|
+% that write the citation label on the |.aux| file.
+% \begin{macrocode}
+\bbl@redefine\@bibitem#1{%
+ \@safe@activestrue\org@@bibitem{#1}\@safe@activesfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{marks}
+%
+% \begin{macro}{\markright}
+% \begin{macro}{\markboth}
+% \changes{babel~3.6i}{1997/03/15}{Added redefinition of \cs{mark...}
+% commands}
+% Because the output routine is asynchronous, we must
+% pass the current language attribute to the head lines, together
+% with the text that is put into them. To achieve this we need to
+% adapt the definition of |\markright| and |\markboth| somewhat.
+% \changes{babel~3.7c}{1999/04/08}{Removed the use of \cs{head@lang}
+% (PR 2990)}
+% \changes{babel~3.7c}{1999/04/09}{Avoid expanding the arguments by
+% storing them in token registers}
+% \changes{babel~3.7m}{2003/11/15}{added \cs{bbl@restore@actives} to
+% the mark}
+% \changes{babel~3.8c}{2004/05/26}{No need to add \emph{anything} to
+% an empty mark; prevented this by checking the contents of the
+% argument}
+% \changes{babel~3.8f}{2005/05/15}{Make the definition independent of
+% the original definition; expand \cs{languagename} before passing
+% it into the token registers}
+% \begin{macrocode}
+\bbl@redefine\markright#1{%
+% \end{macrocode}
+% First of all we temporarily store the language switching command,
+% using an expanded definition in order to get the current value of
+% |\languagename|.
+% \begin{macrocode}
+ \edef\bbl@tempb{\noexpand\protect
+ \noexpand\foreignlanguage{\languagename}}%
+% \end{macrocode}
+% Then, we check whether the argument is empty; if it is, we
+% just make sure the scratch token register is empty.
+% \begin{macrocode}
+ \def\bbl@arg{#1}%
+ \ifx\bbl@arg\@empty
+ \toks@{}%
+ \else
+% \end{macrocode}
+% Next, we store the argument to |\markright| in the scratch token
+% register, together with the expansion of |\bbl@tempb| (containing
+% the language switching command) as defined before. This way
+% these commands will not be expanded by using |\edef| later
+% on, and we make sure that the text is typeset using the
+% correct language settings. While doing so, we make sure that
+% active characters that may end up in the mark are not disabled by
+% the output routine kicking in while \cs{@safe@activestrue} is in
+% effect.
+% \begin{macrocode}
+ \expandafter\toks@\expandafter{%
+ \bbl@tempb{\protect\bbl@restore@actives#1}}%
+ \fi
+% \end{macrocode}
+% Then we define a temporary control sequence using |\edef|.
+% \begin{macrocode}
+ \edef\bbl@tempa{%
+% \end{macrocode}
+% When |\bbl@tempa| is executed, only |\languagename| will be
+% expanded, because of the way the token register was filled.
+% \begin{macrocode}
+ \noexpand\org@markright{\the\toks@}}%
+ \bbl@tempa
+}
+% \end{macrocode}
+% The definition of |\markboth| is equivalent to that of
+% |\markright|, except that we need two token registers.
+% \changes{babel~3.7m}{2003/11/15}{added \cs{bbl@restore@actives} to
+% the mark}
+% \changes{babel~3.8c}{2004/05/26}{No need to add \emph{anything} to
+% an empty mark, prevented this by checking the contents of the
+% arguments}
+% \changes{babel~3.8f}{2005/05/15}{Make the definition independent of
+% the original definition; expand \cs{languagename} before passing
+% it into the token registers}
+% \begin{macrocode}
+\bbl@redefine\markboth#1#2{%
+ \edef\bbl@tempb{\noexpand\protect
+ \noexpand\foreignlanguage{\languagename}}%
+ \def\bbl@arg{#1}%
+ \ifx\bbl@arg\@empty
+ \toks@{}%
+ \else
+ \expandafter\toks@\expandafter{%
+ \bbl@tempb{\protect\bbl@restore@actives#1}}%
+ \fi
+ \def\bbl@arg{#2}%
+ \ifx\bbl@arg\@empty
+ \toks8{}%
+ \else
+ \expandafter\toks8\expandafter{%
+ \bbl@tempb{\protect\bbl@restore@actives#2}}%
+ \fi
+ \edef\bbl@tempa{%
+ \noexpand\org@markboth{\the\toks@}{\the\toks8}}%
+ \bbl@tempa
+}
+%</core|shorthands>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Encoding issues (part 2)}
+%
+% \changes{babel~3.7c}{1999/04/16}{Removed redefinition of \cs{@roman}
+% and \cs{@Roman}}
+%
+% \begin{macro}{\TeX}
+% \begin{macro}{\LaTeX}
+% \changes{babel~3.7a}{1998/03/12}{Make \TeX\ and \LaTeX\ logos
+% encoding-independent}
+% Because documents may use font encodings other than one of the
+% latin encodings, we make sure that the logos of \TeX\ and
+% \LaTeX\ always come out in the right encoding.
+% \begin{macrocode}
+%<*core>
+\bbl@redefine\TeX{\textlatin{\org@TeX}}
+\bbl@redefine\LaTeX{\textlatin{\org@LaTeX}}
+%</core>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Preventing clashes with other packages}
+%
+% \subsubsection{\pkg{ifthen}}
+%
+% \begin{macro}{\ifthenelse}
+% \changes{babel~3.5g}{1996/08/11}{Redefinition of \cs{ifthenelse}
+% added to circumvent problems with \cs{pageref} in the argument of
+% \cs{isodd}}
+% Sometimes a document writer wants to create a special effect
+% depending on the page a certain fragment of text appears on. This
+% can be achieved by the following piece of code:
+% \begin{verbatim}
+% \ifthenelse{\isodd{\pageref{some:label}}}
+% {code for odd pages}
+% {code for even pages}
+% \end{verbatim}
+% In order for this to work the argument of |\isodd| needs to be
+% fully expandable. With the above redefinition of |\pageref| it is
+% not in the case of this example. To overcome that, we add some
+% code to the definition of |\ifthenelse| to make things work.
+%
+% The first thing we need to do is check if the package
+% \pkg{ifthen} is loaded. This should be done at |\begin{document}|
+% time.
+% \begin{macrocode}
+%<*package>
+\AtBeginDocument{%
+ \@ifpackageloaded{ifthen}{%
+% \end{macrocode}
+% Then we can redefine |\ifthenelse|:
+% \changes{babel~3.6f}{1997/01/14}{\cs{ifthenelse} needs to be long}
+% \begin{macrocode}
+ \bbl@redefine@long\ifthenelse#1#2#3{%
+% \end{macrocode}
+% We want to revert the definition of |\pageref| to its original
+% definition for the duration of |\ifthenelse|, so we first need to
+% store its current meaning.
+% \begin{macrocode}
+ \let\bbl@tempa\pageref
+ \let\pageref\org@pageref
+% \end{macrocode}
+% Then we can set the |\@safe@actives| switch and call the original
+% |\ifthenelse|. In order to be able to use shorthands in the
+% second and third arguments of |\ifthenelse| the resetting of the
+% switch \emph{and} the definition of |\pageref| happens inside
+% those arguments.
+% \changes{babel~3.6i}{1997/02/25}{Now reset the @safe@actives switch
+% inside the 2nd and 3rd arguments of \cs{ifthenelse}}
+% \changes{babel~3.7f}{2000/06/29}{\cs{pageref} needs to have its
+% babel definition reinstated in the second and third arguments}
+% \begin{macrocode}
+ \@safe@activestrue
+ \org@ifthenelse{#1}{%
+ \let\pageref\bbl@tempa
+ \@safe@activesfalse
+ #2}{%
+ \let\pageref\bbl@tempa
+ \@safe@activesfalse
+ #3}%
+ }%
+% \end{macrocode}
+% When the package wasn't loaded we do nothing.
+% \begin{macrocode}
+ }{}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\pkg{varioref}}
+%
+% \begin{macro}{\@@vpageref}
+% \changes{babel~3.6a}{1996/10/29}{Redefinition of \cs{@@vpageref}
+% added to circumvent problems with active \texttt{:} in the
+% argument of \cs{vref} when \pkg{varioref} is used}
+% \begin{macro}{\vrefpagenum}
+% \changes{babel~3.7o}{2003/11/18}{Added redefinition of
+% \cs{vrefpagenum} which deals with ranges of pages}
+% \begin{macro}{\Ref}
+% \changes{babel~3.8g}{2005/05/21}{We also need to adapt \cs{Ref}
+% which needs to be able to uppercase the first letter of the
+% expansion of \cs{ref}}
+% When the package varioref is in use we need to modify its
+% internal command |\@@vpageref| in order to prevent problems when
+% an active character ends up in the argument of |\vref|.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifpackageloaded{varioref}{%
+ \bbl@redefine\@@vpageref#1[#2]#3{%
+ \@safe@activestrue
+ \org@@@vpageref{#1}[#2]{#3}%
+ \@safe@activesfalse}%
+% \end{macrocode}
+% The same needs to happen for |\vrefpagenum|.
+% \begin{macrocode}
+ \bbl@redefine\vrefpagenum#1#2{%
+ \@safe@activestrue
+ \org@vrefpagenum{#1}{#2}%
+ \@safe@activesfalse}%
+% \end{macrocode}
+% The package \pkg{varioref} defines |\Ref| to be a robust command
+% wich uppercases the first character of the reference text. In
+% order to be able to do that it needs to access the exandable form
+% of |\ref|. So we employ a little trick here. We redefine the
+% (internal) command \verb*|\Ref | to call |\org@ref| instead of
+% |\ref|. The disadvantgage of this solution is that whenever the
+% derfinition of |\Ref| changes, this definition needs to be updated
+% as well.
+% \begin{macrocode}
+ \expandafter\def\csname Ref \endcsname#1{%
+ \protected@edef\@tempa{\org@ref{#1}}\expandafter\MakeUppercase\@tempa}
+ }{}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{\pkg{hhline}}
+%
+% \begin{macro}{\hhline}
+% Delaying the activation of the shorthand characters has introduced
+% a problem with the \pkg{hhline} package. The reason is that it
+% uses the `:' character which is made active by the french support
+% in \babel. Therefor we need to \emph{reload} the package when
+% the `:' is an active character.
+%
+% So at |\begin{document}| we check whether \pkg{hhline} is loaded.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifpackageloaded{hhline}%
+% \end{macrocode}
+% Then we check whether the expansion of |\normal@char:| is not
+% equal to |\relax|.
+% \changes{babel~3.8b}{2004/04/19}{added \cs{string} to prevent
+% unwanted expansion of the colon}
+% \begin{macrocode}
+ {\expandafter\ifx\csname normal@char\string:\endcsname\relax
+ \else
+% \end{macrocode}
+% In that case we simply reload the package. Note that this happens
+% \emph{after} the category code of the @-sign has been changed to
+% other, so we need to temporarily change it to letter again.
+% \begin{macrocode}
+ \makeatletter
+ \def\@currname{hhline}\input{hhline.sty}\makeatother
+ \fi}%
+ {}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{General}
+%
+% \begin{macro}{\FOREIGNLANGUAGE}
+% The package \pkg{fancyhdr} treats the running head and fout lines
+% somewhat differently as the standard classes. A symptom of this is
+% that the command |\foreignlanguage| which \babel\ adds to the
+% marks can end up inside the argument of |\MakeUppercase|. To
+% prevent unexpected results we need to define |\FOREIGNLANGUAGE|
+% here.
+% \changes{babel~3.7j}{2003/05/23}{Define \cs{FOREIGNLANGUAGE}
+% unconditionally}
+% \begin{macrocode}
+\DeclareRobustCommand{\FOREIGNLANGUAGE}[1]{%
+ \lowercase{\foreignlanguage{#1}}}
+%</package>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\nfss@catcodes}
+% \changes{babel~3.5g}{1996/08/18}{Need to add the double quote and
+% acute characters to \cs{nfss@catcodes} to prevent problems when
+% reading in .fd files}
+% \LaTeX's font selection scheme sometimes wants to read font
+% definition files in the middle of processing the document. In
+% order to guard against any characters having the wrong
+% |\catcode|s it always calls |\nfss@catcodes| before loading a
+% file. Unfortunately, the characters |"| and |'| are not dealt
+% with. Therefor we have to add them until \LaTeX\ does that
+% herself.
+% \begin{macrocode}
+%<*core|shorthands>
+\ifx\nfss@catcodes\@undefined
+\else
+ \addto\nfss@catcodes{%
+ \@makeother\'%
+ \@makeother\"%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</core|shorthands>
+% \end{macrocode}
+%
+% \section{Local Language Configuration}
+%
+% \begin{macro}{\loadlocalcfg}
+% At some sites it may be necessary to add site-specific actions to
+% a language definition file. This can be done by creating a file
+% with the same name as the language definition file, but with the
+% extension \file{.cfg}. For instance the file \file{norsk.cfg}
+% will be loaded when the language definition file \file{norsk.ldf}
+% is loaded.
+%
+% \changes{babel~3.5d}{1995/06/22}{Added macro}
+% \begin{macrocode}
+%<*core>
+% \end{macrocode}
+% For plain-based formats we don't want to override the definition
+% of |\loadlocalcfg| from \file{plain.def}.
+% \begin{macrocode}
+\ifx\loadlocalcfg\@undefined
+ \def\loadlocalcfg#1{%
+ \InputIfFileExists{#1.cfg}
+ {\typeout{*************************************^^J%
+ * Local config file #1.cfg used^^J%
+ *}%
+ }
+ {}}
+\fi
+% \end{macrocode}
+% Just to be compatible with \LaTeX$\:$2.09 we add a few more lines
+% of code:
+% \begin{macrocode}
+\ifx\@unexpandable@protect\@undefined
+ \def\@unexpandable@protect{\noexpand\protect\noexpand}
+ \long\def \protected@write#1#2#3{%
+ \begingroup
+ \let\thepage\relax
+ #2%
+ \let\protect\@unexpandable@protect
+ \edef\reserved@a{\write#1{#3}}%
+ \reserved@a
+ \endgroup
+ \if@nobreak\ifvmode\nobreak\fi\fi
+ }
+\fi
+%</core>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \clearpage
+% \section{Driver files for the documented source code}
+%
+% Since \babel\ version 3.4 all source files that are part of the
+% \babel\ system can be typeset separately. But to typeset
+% them all in one document, the file \file{babel.drv} can be used.
+% If you only want the information on how to use the \babel\ system
+% and what goodies are provided by the language-specific files, you
+% can run the file \file{user.drv} through \LaTeX\ to get a user
+% guide.
+%
+% \changes{babel~3.4b}{1994/05/18}{Use the ltxdoc class instead of
+% article}
+% \changes{babel~3.7a}{1997/05/21}{Now need packages t1enc and
+% supertabular to be loaded; the documentation for icelandic needs
+% its \file{.ldf} file to be present}
+% \changes{babel~3.8a}{2004/02/20}{Also load package url}
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{url,t1enc,supertabular}
+\usepackage[icelandic,english]{babel}
+\DoNotIndex{\!,\',\,,\.,\-,\:,\;,\?,\/,\^,\`,\@M}
+\DoNotIndex{\@,\@ne,\@m,\@afterheading,\@date,\@endpart}
+\DoNotIndex{\@hangfrom,\@idxitem,\@makeschapterhead,\@mkboth}
+\DoNotIndex{\@oddfoot,\@oddhead,\@restonecolfalse,\@restonecoltrue}
+\DoNotIndex{\@starttoc,\@unused}
+\DoNotIndex{\accent,\active}
+\DoNotIndex{\addcontentsline,\advance,\Alph,\arabic}
+\DoNotIndex{\baselineskip,\begin,\begingroup,\bf,\box,\c@secnumdepth}
+\DoNotIndex{\catcode,\centering,\char,\chardef,\clubpenalty}
+\DoNotIndex{\columnsep,\columnseprule,\crcr,\csname}
+\DoNotIndex{\day,\def,\dimen,\discretionary,\divide,\dp,\do}
+\DoNotIndex{\edef,\else,\@empty,\end,\endgroup,\endcsname,\endinput}
+\DoNotIndex{\errhelp,\errmessage,\expandafter,\fi,\filedate}
+\DoNotIndex{\fileversion,\fmtname,\fnum@figure,\fnum@table,\fontdimen}
+\DoNotIndex{\gdef,\global}
+\DoNotIndex{\hbox,\hidewidth,\hfil,\hskip,\hspace,\ht,\Huge,\huge}
+\DoNotIndex{\ialign,\if@twocolumn,\ifcase,\ifcat,\ifhmode,\ifmmode}
+\DoNotIndex{\ifnum,\ifx,\immediate,\ignorespaces,\input,\item}
+\DoNotIndex{\kern}
+\DoNotIndex{\labelsep,\Large,\large,\labelwidth,\lccode,\leftmargin}
+\DoNotIndex{\lineskip,\leavevmode,\let,\list,\ll,\long,\lower}
+\DoNotIndex{\m@ne,\mathchar,\mathaccent,\markboth,\month,\multiply}
+\DoNotIndex{\newblock,\newbox,\newcount,\newdimen,\newif,\newwrite}
+\DoNotIndex{\nobreak,\noexpand,\noindent,\null,\number}
+\DoNotIndex{\onecolumn,\or}
+\DoNotIndex{\p@,par, \parbox,\parindent,\parskip,\penalty}
+\DoNotIndex{\protect,\ps@headings}
+\DoNotIndex{\quotation}
+\DoNotIndex{\raggedright,\raise,\refstepcounter,\relax,\rm,\setbox}
+\DoNotIndex{\section,\setcounter,\settowidth,\scriptscriptstyle}
+\DoNotIndex{\sfcode,\sl,\sloppy,\small,\space,\spacefactor,\strut}
+\DoNotIndex{\string}
+\DoNotIndex{\textwidth,\the,\thechapter,\thefigure,\thepage,\thepart}
+\DoNotIndex{\thetable,\thispagestyle,\titlepage,\tracingmacros}
+\DoNotIndex{\tw@,\twocolumn,\typeout,\uppercase,\usecounter}
+\DoNotIndex{\vbox,\vfil,\vskip,\vspace,\vss}
+\DoNotIndex{\widowpenalty,\write,\xdef,\year,\z@,\z@skip}
+% \end{macrocode}
+%
+% Here |\dlqq| is defined so that an example of |"'| can be
+% given.
+% \begin{macrocode}
+\makeatletter
+\gdef\dlqq{{\setbox\tw@=\hbox{,}\setbox\z@=\hbox{''}%
+ \dimen\z@=\ht\z@ \advance\dimen\z@-\ht\tw@
+ \setbox\z@=\hbox{\lower\dimen\z@\box\z@}\ht\z@=\ht\tw@
+ \dp\z@=\dp\tw@ \box\z@\kern-.04em}}
+% \end{macrocode}
+%
+% The code lines are numbered within sections,
+% \begin{macrocode}
+%<*!user>
+\@addtoreset{CodelineNo}{section}
+\renewcommand\theCodelineNo{%
+ \reset@font\scriptsize\thesection.\arabic{CodelineNo}}
+% \end{macrocode}
+% which should also be visible in the index; hence this
+% redefinition of a macro from \file{doc.sty}.
+% \begin{macrocode}
+\renewcommand\codeline@wrindex[1]{\if@filesw
+ \immediate\write\@indexfile
+ {\string\indexentry{#1}%
+ {\number\c@section.\number\c@CodelineNo}}\fi}
+% \end{macrocode}
+%
+% The glossary environment is used or the change log, but its
+% definition needs changing for this document.
+% \begin{macrocode}
+\renewenvironment{theglossary}{%
+ \glossary@prologue%
+ \GlossaryParms \let\item\@idxitem \ignorespaces}%
+ {}
+%</!user>
+\makeatother
+% \end{macrocode}
+%
+% A few shorthands used in the documentation
+% \changes{babel~3.5g}{1996/07/06}{Added definition of \cs{Babel}}
+% \begin{macrocode}
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\m[1]{\mbox{$\langle$\it#1\/$\rangle$}}
+\newcommand*\langvar{\m{lang}}
+% \end{macrocode}
+%
+% Some more definitions needed in the documentation.
+% \begin{macrocode}
+%\newcommand*\note[1]{\textbf{#1}}
+\newcommand*\note[1]{}
+\newcommand*\bsl{\protect\bslash}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+\newcommand*\langdeffile[1]{%
+%<-user> \clearpage
+ \DocInput{#1}}
+% \end{macrocode}
+%
+% When a full index should be generated uncomment the line with
+% |\EnableCrossrefs|. Beware, processing may take some time.
+% Use |\DisableCrossrefs| when the index is ready.
+% \begin{macrocode}
+% \EnableCrossrefs
+\DisableCrossrefs
+% \end{macrocode}
+%
+% Inlude the change log.
+% \begin{macrocode}
+%<-user>\RecordChanges
+% \end{macrocode}
+% The index should use the linenumbers of the code.
+% \begin{macrocode}
+%<-user>\CodelineIndex
+% \end{macrocode}
+%
+% Set everything in |\MacroFont| instead of |\AltMacroFont|
+% \begin{macrocode}
+\setcounter{StandardModuleDepth}{1}
+% \end{macrocode}
+%
+% For the user guide we only want the description parts of all the
+% files.
+% \begin{macrocode}
+%<+user>\OnlyDescription
+% \end{macrocode}
+% Here starts the document
+% \begin{macrocode}
+\begin{document}
+\DocInput{babel.dtx}
+% \end{macrocode}
+%
+% All the language definition files.
+% \changes{babel~3.2e}{1992/07/07}{Added slovak}
+% \changes{babel~3.3}{1993/07/11}{Added catalan and galician}
+% \changes{babel~3.3}{1993/07/11}{Added turkish}
+% \changes{babel~3.4}{1994/02/28}{Added bahasa}
+% \changes{babel~3.5a}{1995/02/16}{Added breton, irish, scottish}
+% \changes{babel~3.5b}{1995/05/19}{Added lsorbian, usorbian}
+% \changes{babel~3.5c}{1995/06/14}{Changed the order of including the
+% language files somewhat (PR1652)}
+% \changes{babel~3.5g}{1996/07/06}{Added greek}
+% \changes{babel~3.6a}{1996/12/14}{Added welsh}
+%^^A \changes{babel~3.6i}{1997/02/07}{Added sanskrit}
+% \changes{babel~3.6i}{1997/02/22}{Added basque}
+^^A% \changes{babel~3.6i}{1997/02/22}{Added kannada}
+% \changes{babel~3.7a}{1997/05/21}{Added icelandic}
+% \changes{babel~3.7b}{1998/06/25}{Added Latin}
+% \changes{babel~3.7c}{1999/03/09}{Added ukrainian}
+% \changes{babel~3.7c}{1999/05/09}{Added hebrew and serbian}
+% \changes{babel~3.7e}{1999/11/22}{Added missing hebrew files}
+% \changes{babel~3.7f}{2000/09/21}{Added bulgarian}
+% \changes{babel~3.7f}{2000/09/26}{Added samin}
+% \changes{babel~3.8a}{2004/02/20}{Added interlingua}
+% \begin{macrocode}
+%<+user>\clearpage
+\langdeffile{esperanto.dtx}
+\langdeffile{interlingua.dtx}
+%
+\langdeffile{dutch.dtx}
+\langdeffile{english.dtx}
+\langdeffile{germanb.dtx}
+\langdeffile{ngermanb.dtx}
+%
+\langdeffile{breton.dtx}
+\langdeffile{welsh.dtx}
+\langdeffile{irish.dtx}
+\langdeffile{scottish.dtx}
+%
+\langdeffile{greek.dtx}
+%
+\langdeffile{frenchb.dtx}
+\langdeffile{italian.dtx}
+\langdeffile{latin.dtx}
+\langdeffile{portuges.dtx}
+\langdeffile{spanish.dtx}
+\langdeffile{catalan.dtx}
+\langdeffile{galician.dtx}
+\langdeffile{basque.dtx}
+\langdeffile{romanian.dtx}
+%
+\langdeffile{danish.dtx}
+\langdeffile{icelandic.dtx}
+\langdeffile{norsk.dtx}
+\langdeffile{swedish.dtx}
+\langdeffile{samin.dtx}
+%
+\langdeffile{finnish.dtx}
+\langdeffile{magyar.dtx}
+\langdeffile{estonian.dtx}
+%
+\langdeffile{croatian.dtx}
+\langdeffile{czech.dtx}
+\langdeffile{polish.dtx}
+\langdeffile{serbian.dtx}
+\langdeffile{slovak.dtx}
+\langdeffile{slovene.dtx}
+\langdeffile{russianb.dtx}
+\langdeffile{bulgarian.dtx}
+\langdeffile{ukraineb.dtx}
+%
+\langdeffile{lsorbian.dtx}
+\langdeffile{usorbian.dtx}
+\langdeffile{turkish.dtx}
+%
+\langdeffile{hebrew.dtx}
+\DocInput{hebinp.dtx}
+\DocInput{hebrew.fdd}
+\DocInput{heb209.dtx}
+\langdeffile{bahasa.dtx}
+%\langdeffile{sanskrit.dtx}
+%\langdeffile{kannada.dtx}
+%\langdeffile{nagari.dtx}
+%\langdeffile{tamil.dtx}
+\clearpage
+\DocInput{bbplain.dtx}
+% \end{macrocode}
+% Finally print the index and change log (not for the user guide).
+% \begin{macrocode}
+%<*!user>
+\clearpage
+\def\filename{index}
+\PrintIndex
+\clearpage
+\def\filename{changes}
+\PrintChanges
+%</!user>
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% \Finale
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
+
diff --git a/Master/texmf-dist/source/generic/babel/babel.ins b/Master/texmf-dist/source/generic/babel/babel.ins
new file mode 100644
index 00000000000..c4680ba4555
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/babel.ins
@@ -0,0 +1,250 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+%% Copyright 2005 Johannes L. Braams
+%%
+%% This file is part of the `babel' system.
+%%
+\def\filedate{2004/02/20}
+\def\batchfile{babel.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\ifx\askonceonly\undefined
+ \let\OriginalAsk\Ask
+ \def\askonceonly{%
+ \def\Ask##1##2{%
+ \OriginalAsk{##1}{##2}%
+ \global\let\Ask\OriginalAsk
+ \Ask\noprompt{%
+ By default you will be asked this question for every file.^^J%
+ If you enter `y' now,^^J%
+ I will asssume `y' for all future questions^^J%
+ without prompting.}%
+ \ifx\y\noprompt\let\noprompt\yes\fi
+ \ifx\yes\noprompt\gdef\Ask####1####2{\def####1{y}}\fi}}
+ }
+\fi
+%% This is the preamble that will be placed on
+%% unpacked files
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+\askonceonly
+%
+% Make some arrangements to use docstrip files in subdirectories
+% unchanged...
+% To do this I need to insert a path in front of the source file
+% name, for this purpose I need to save the definition of an
+% internal docstrip macro:
+\let\ds@@from\@from
+%
+% Then it is convenient to have a special command to load docstrip
+% files in subdirectories, it takes the directory path in the first
+% argument, the name of the file in the second:
+\def\BblInstallSubDir#1#2{%
+ \def\@from##1{\ds@@from{#1/##1}}
+ \batchinput{#1/#2.ins}
+ \let\@from\ds@@from}
+%
+% When a flat distribution is used a much simpler command
+% is needed.
+\def\BblInstallFlat#1#2{%
+ \batchinput{#2.ins}}
+
+% Now choose which installation to use.
+\let\BblInstall\BblInstallFlat %% For now...
+
+\usepreamble\mainpreamble
+\usedir{tex/generic/babel}
+%
+% First produce the base files for the babel system
+%
+\BblInstall{base}{base}
+%
+% Languages have their own subdirectory
+%
+\BblInstall{bahasa}{bahasa}
+\BblInstall{basque}{basque}
+\BblInstall{breton}{breton}
+\BblInstall{bulgarian}{bulgarian}
+\BblInstall{catalan}{catalan}
+\BblInstall{croatian}{croatian}
+\BblInstall{cyrillic}{russianb}
+\BblInstall{cyrillic}{ukraineb}
+\BblInstall{czech}{czech}
+\BblInstall{danish}{danish}
+\BblInstall{dutch}{dutch}
+\BblInstall{english}{english}
+\BblInstall{esperanto}{esperanto}
+\BblInstall{estonian}{estonian}
+\BblInstall{finnish}{finnish}
+\BblInstall{frenchb}{frenchb}
+\BblInstall{galician}{galician}
+\BblInstall{german}{german}
+\BblInstall{greek}{greek}
+\BblInstall{hebrew}{hebrew}
+\BblInstall{icelandic}{icelandic}
+\BblInstall{interlingua}{interlingua}
+\BblInstall{irish}{irish}
+\BblInstall{italian}{italian}
+%\BblInstall{kannada}{kannada}
+\BblInstall{latin}{latin}
+\BblInstall{magyar}{magyar}
+%\BblInstall{nagari}{nagari}
+\BblInstall{norsk}{norsk}
+\BblInstall{polish}{polish}
+\BblInstall{portuges}{portuges}
+\BblInstall{romanian}{romanian}
+%\BblInstall{tamil}{tamil}
+\BblInstall{samin}{samin}
+%\BblInstall{sanskrit}{sanskrit}
+\BblInstall{scottish}{scottish}
+\BblInstall{serbian}{serbian}
+\BblInstall{slovak}{slovak}
+\BblInstall{slovene}{slovene}
+\BblInstall{sorbian}{sorbian}
+\BblInstall{spanish}{spanish}
+\BblInstall{swedish}{swedish}
+\BblInstall{turkish}{turkish}
+\BblInstall{welsh}{welsh}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move all the files}
+\Msg{* with names ending in .ldf, .sty, .def or .fd into a}
+\Msg{* directory searched by TeX}
+\Msg{*}
+\Msg{* For making a format the following files have to be in a}
+\Msg{* directory which is searched by IniTeX:}
+\Msg{* \space\space hyphen.cfg}
+\Msg{* \space\space language.dat}
+\Msg{* \space\space and files with hyphenation patterns}
+\Msg{*}
+\Msg{* To produce source listings you can run files with names}
+\Msg{* ending in .dtx and/or .drv through LaTeX}
+\Msg{*}
+\Msg{* To produce the complete source listing MakeIndex needs to be}
+\Msg{* able to find the following files}
+\Msg{* \space\space bbind.ist}
+\Msg{* \space\space bbglo.ist}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{*}
+\Msg{***********************************************************}
+
+
diff --git a/Master/texmf-dist/source/generic/babel/bahasa.dtx b/Master/texmf-dist/source/generic/babel/bahasa.dtx
new file mode 100644
index 00000000000..c679c2e4a33
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/bahasa.dtx
@@ -0,0 +1,243 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{86}
+%\iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{bahasa.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{bahasa}
+%\fi
+%\ProvidesFile{bahasa.dtx}
+ [2005/03/29 v1.0i Bahasa support from the babel system]
+%\iffalse
+%% File `bahasa.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Bahasa Language Definition File
+%% Copyright (C) 1994 - 2005
+%% by J"org Knappen, (joerg.knappen at alpha.ntp.springer.de)
+% Terry Mart (mart at vkpmzd.kph.uni-mainz.de)
+% Institut f\"ur Kernphysik
+% Johannes Gutenberg-Universit\"at Mainz
+% D-55099 Mainz
+% Germany
+%
+%% Please report errors to: J"org Knappen
+%% knappen at alpha.ntp.springer.de
+%% J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the bahasa indonesia / bahasa melayu language definition
+% file. The original version of this file was written by Terry
+% Mart (mart@vkpmzd.kph.uni-mainz.de) and J"org Knappen
+% (knappen@vkpmzd.kph.uni-mainz.de).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{bahasa.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{bahasa.dtx}
+%
+% \changes{bahasa-0.9c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{bahasa-1.0d}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{bahasa-1.0e}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Bahasa language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% bahasa indonesia / bahasa melayu language. Bahasa just means
+% `language' in bahasa indonesia / bahasa melayu. Since both
+% national versions of the language use the same writing, although
+% differing in pronounciation, this file can be used for both
+% languages.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{bahasa-1.0e}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{bahasa}\captionsbahasa
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{bahasa} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@bahasa| to see whether we have to do something here.
+%
+% \changes{bahasa-0.9c}{1994/06/26}{Now use \cs{@patterns} to produce
+% the warning}
+% \begin{macrocode}
+\ifx\l@bahasa\@undefined
+ \@nopatterns{Bahasa}
+ \adddialect\l@bahasa0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Bahasa language.
+%
+% \begin{macro}{\captionsbahasa}
+% The macro |\captionsbahasa| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{bahasa-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{bahasa-1.0d}{1996/07/09}{Replaced `Proof' by `Bukti'
+% (PR2214)}
+% \changes{bahasa-1.0h}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{bahasa-1.0i}{2003/11/17}{Inserted translation for Glossary}
+% \begin{macrocode}
+\addto\captionsbahasa{%
+ \def\prefacename{Pendahuluan}%
+ \def\refname{Pustaka}%
+ \def\abstractname{Ringkasan}% (sometime it's called 'intisari'
+ % or 'ikhtisar')
+ \def\bibname{Bibliografi}%
+ \def\chaptername{Bab}%
+ \def\appendixname{Lampiran}%
+ \def\contentsname{Daftar Isi}%
+ \def\listfigurename{Daftar Gambar}%
+ \def\listtablename{Daftar Tabel}%
+ \def\indexname{Indeks}%
+ \def\figurename{Gambar}%
+ \def\tablename{Tabel}%
+ \def\partname{Bagian}%
+% Subject: Subyek
+% From: Dari
+ \def\enclname{Lampiran}%
+ \def\ccname{cc}%
+ \def\headtoname{Kepada}%
+ \def\pagename{Halaman}%
+% Notes (Endnotes): Catatan
+ \def\seename{lihat}%
+ \def\alsoname{lihat juga}%
+ \def\proofname{Bukti}%
+ \def\glossaryname{Daftar Istilah}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebahasa}
+% The macro |\datebahasa| redefines the command |\today| to produce
+% Bahasa dates.
+% \changes{bahasa-1.0f}{1997/10/01}{Use \cs{edef} to define \cs{today}}
+% \changes{bahasa~1.0f}{1998/03/28}{use \cs{def} instead of \cs{edef}
+% to save memory}
+% \changes{bahasa-1.0g}{1999/03/12}{Februari should be spelled as
+% Pebruari}
+% \begin{macrocode}
+\def\datebahasa{%
+ \def\today{\number\day~\ifcase\month\or
+ Januari\or Pebruari\or Maret\or April\or Mei\or Juni\or
+ Juli\or Agustus\or September\or Oktober\or Nopember\or Desember\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\extrasbahasa}
+% \begin{macro}{\noextrasbahasa}
+% The macro |\extrasbahasa| will perform all the extra definitions
+% needed for the Bahasa language. The macro |\extrasbahasa| is used
+% to cancel the actions of |\extrasbahasa|. For the moment these
+% macros are empty but they are defined for compatibility with the
+% other language definition files.
+%
+% \begin{macrocode}
+\addto\extrasbahasa{}
+\addto\noextrasbahasa{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bahasahyphenmins}
+% The bahasa hyphenation patterns should be used with
+% |\lefthyphenmin| set to~2 and |\righthyphenmin| set to~2.
+% \changes{bahasa-1.0e}{1996/08/07}{use \cs{bahasahyphenmins} to store
+% the correct values}
+% \changes{bahasa-1.0h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{bahasa-1.0e}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{bahasa}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/bahasa.ins b/Master/texmf-dist/source/generic/babel/bahasa.ins
new file mode 100644
index 00000000000..a444a015e17
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/bahasa.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{bahasa.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{bahasa.ldf}{\from{bahasa.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/base.ins b/Master/texmf-dist/source/generic/babel/base.ins
new file mode 100644
index 00000000000..7f13287fd29
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/base.ins
@@ -0,0 +1,299 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+%% Copyright 2004 Johannes L. Braams
+%%
+%% This file is part of the `babel' system.
+%%
+%% You are allowed to distribute this file together with all files
+%% mentioned in manifest.bbl.
+%%
+%% You are not allowed to modify its contents.
+%%
+\def\filedate{2004/02/20}
+\def\batchfile{base.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+% The following command will be added to dostrip in the next LaTeX
+% release ...
+\ifx\askonceonly\undefined
+ \let\OriginalAsk\Ask
+ \def\askonceonly{%
+ \def\Ask##1##2{%
+ \OriginalAsk{##1}{##2}%
+ \global\let\Ask\OriginalAsk
+ \Ask\noprompt{%
+ By default you will be asked this question for every file.^^J%
+ If you enter `y' now,^^J%
+ I will asssume `y' for all future questions^^J%
+ without prompting.}%
+ \ifx\y\noprompt\let\noprompt\yes\fi
+ \ifx\yes\noprompt\gdef\Ask####1####2{\def####1{y}}\fi}}
+ }
+\fi
+%% This is the preamble that will be placed on
+%% unpacked files
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\declarepreamble\drvpreamble
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+Copyright (C) 2004 Johannes Braams. All rights reserved.
+
+To produce the documentation in the way you like you are allowed
+to change this driver file.
+
+\endpreamble
+
+\declarepreamble\istpreamble
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+Copyright (C) 2004 Johannes Braams. All rights reserved.
+
+This file is a style file for the MakeIndex program
+
+\endpreamble
+
+\declarepostamble\istpost
+\endpostamble
+
+\keepsilent
+\askonceonly
+
+\usepreamble\mainpreamble
+\usedir{tex/generic/babel}
+
+\generate{\file{babel.sty}{\from{babel.dtx}{package}}
+ \file{babel.def}{\from{babel.dtx}{core}}
+ \file{switch.def}{\from{babel.dtx}{kernel}}
+ \file{hyphen.cfg}{\from{babel.dtx}{kernel,patterns}}
+ }
+% Support for plain users
+\generate{\file{plain.def}{\from{bbplain.dtx}{code}}
+ \file{bplain.tex}{\from{bbplain.dtx}{bplain}}
+ \file{blplain.tex}{\from{bbplain.dtx}{blplain}}
+ }
+
+% compatibility files
+
+\usepreamble\mainpreamble
+
+\def\compatfile#1{\file{#1.sty}{\from{bbcompat.dtx}{#1}}}
+
+\generate{%
+ \compatfile{esperanto}
+ \compatfile{afrikaans}
+ \compatfile{dutch}
+ \compatfile{american}
+ \compatfile{british}
+ \compatfile{english}
+ \compatfile{UKenglish}
+ \compatfile{USenglish}
+ \compatfile{germanb}
+ \compatfile{austrian}
+ \compatfile{ngermanb}
+ \compatfile{naustrian}
+ \compatfile{irish}
+ \compatfile{scottish}
+ \compatfile{welsh}
+ \compatfile{breton}
+ }
+\generate{%
+ \compatfile{francais}
+ \compatfile{italian}
+ \compatfile{portuges}
+ \compatfile{spanish}
+ \compatfile{catalan}
+ \compatfile{galician}
+ \compatfile{danish}
+ \compatfile{norsk}
+ \compatfile{swedish}
+ \compatfile{finnish}
+ \compatfile{magyar}
+ \compatfile{greek}
+ \compatfile{croatian}
+ \compatfile{czech}
+ \compatfile{slovak}
+ \compatfile{polish}
+ }
+\generate{%
+ \compatfile{estonian}
+ \compatfile{romanian}
+ \compatfile{slovene}
+ \compatfile{russianb}
+ \compatfile{ukraineb}
+ \compatfile{turkish}
+ \compatfile{lsorbian}
+ \compatfile{usorbian}
+ \compatfile{bahasa}
+ \compatfile{hebrew}
+ %\compatfile{sanskrit}
+ \compatfile{basque}
+ \compatfile{latin}
+ \compatfile{icelandic}
+ \compatfile{serbian}
+ \compatfile{bulgarian}
+ }
+\generate{%
+ \compatfile{samin}
+ \compatfile{interlingua}
+ }
+
+% driver files
+
+\usepreamble\drvpreamble
+
+\generate{\file{babel.drv}{\from{babel.dtx}{driver}}
+ \file{user.drv}{\from{babel.dtx}{driver,user}}}
+
+% MakeIndex style files
+
+\usepreamble\istpreamble
+\usepostamble\istpost
+
+\generate{\file{bbind.ist}{\from{bbidxglo.dtx}{idx}}
+ \file{bbglo.ist}{\from{bbidxglo.dtx}{glo}}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move all the files}
+\Msg{* with names ending in .ldf, .sty, .def or .fd into a}
+\Msg{* directory searched by TeX}
+\Msg{*}
+\Msg{* For making a format the following files have to be in a}
+\Msg{* directory which is searched by IniTeX:}
+\Msg{* \space\space hyphen.cfg}
+\Msg{* \space\space language.dat}
+\Msg{* \space\space and files with hyphenation patterns}
+\Msg{*}
+\Msg{* To produce source listings you can run files with names}
+\Msg{* ending in .dtx and/or .drv through LaTeX}
+\Msg{*}
+\Msg{* To produce the complete source listing MakeIndex needs to be}
+\Msg{* able to find the following files}
+\Msg{* \space\space bbind.ist}
+\Msg{* \space\space bbglo.ist}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{*}
+\Msg{***********************************************************}
+
+
diff --git a/Master/texmf-dist/source/generic/babel/basque.dtx b/Master/texmf-dist/source/generic/babel/basque.dtx
new file mode 100644
index 00000000000..33789ccdfd4
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/basque.dtx
@@ -0,0 +1,390 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{193}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{basque.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{basque}
+%\fi
+%\ProvidesFile{basque.dtx}
+ [2005/03/29 v1.0f Basque support from the babel system]
+%\iffalse
+%% File `Basque.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Basque Language Definition File
+%% Copyright (C) 1997 - 2005
+%% by Juan M. Aguirregabiria
+% The University of the Basque Country
+% Dept. of Theoretical Physics
+% Apdo. 644
+% E-48080 Bilbao
+% Spain
+% tel: +34 946 012 593
+% fax: +34 944 648 500
+% e-mail: wtpagagj at lg.ehu.es
+% WWW: http://tp.lc.ehu.es/jma.html
+% based on the
+% Spanish Language Definition File
+% Copyright (C) 1991 - 1998
+% by Julio Sanchez
+% GMV, SA
+% c/ Isaac Newton 11
+% PTM - Tres Cantos
+% E-28760 Madrid
+% Spain
+% tel: +34 1 807 21 85
+% fax +34 1 807 21 99
+% jsanchez at gmv.es
+%
+% Acknowledgements: I am indebted to Zunbeltz Izaola,
+% who suggested the use of \discretionary in "-
+%
+%% Please report errors to: Juan M. Aguirregabiria <wtpagagj at lg.ehu.es>
+%% (or J.L. Braams <babel at braams.cistron.nl>)
+%
+% This file is part of the babel system, it provides the source
+% code for the basque language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{basque.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{basque.dtx}
+%
+% \section{The Basque language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author is Juan M. Aguirregabiria,
+% (\texttt{wtpagagj@lg.ehu.es}) and is based on the Spanish file
+% by Julio S\'anchez,
+% (\texttt{jsanchez@gmv.es}).} defines all the language definition
+% macro's for the Basque language.
+%
+% For this language the characters |~| and |"| are made
+% active. In table~\ref{tab:basque-quote} an overview is given of
+% their purpose.
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% |"<| & for French left double quotes (similar to $<<$).\\
+% |">| & for French right double quotes (similar to $>>$).\\
+% |~n| & a n with tilde. Works for uppercase too.
+% \end{tabular}
+% \caption{The extra definitions made by \file{basque.ldf}}
+% \label{tab:basque-quote}
+% \end{table}
+% These active accent characters behave according to their original
+% definitions if not followed by one of the characters indicated in
+% that table.
+%
+% \changes{basque-1.0f}{2002/01/07}{Changed url's for the patterns
+% file}
+% This option includes support for working with extended, 8-bit
+% fonts, if available. Support is based on
+% providing an appropriate definition for the accent macros on
+% entry to the Basque language. This is automatically done by
+% \LaTeXe\ or NFSS2. If T1 encoding is chosen, and provided that
+% adequate hyphenation patterns\footnote{One source for such
+% patterns is the archive at \texttt{tp.lc.ehu.es} that can be
+% accessed by anonymous FTP or in
+% \texttt{http://tp.lc.ehu.es/jma/basque.html}} are available.
+% The easiest way to use the new encoding with \LaTeXe{} is
+% to load the package \texttt{t1enc} with |\usepackage|. This must
+% be done before loading \babel.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{basque}\captionsbasque
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{basque} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@basque| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@basque\@undefined
+ \@nopatterns{Basque}
+ \adddialect\l@basque0
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Basque language.
+%
+% \begin{macro}{\captionsbasque}
+% The macro |\captionsbasque| defines all strings used in
+% the four standard documentclasses provided with \LaTeX.
+% \changes{basque-1.0e}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{basque-1.0f}{2002/01/07}{Added translation for Glossary}
+% \begin{macrocode}
+\addto\captionsbasque{%
+ \def\prefacename{Hitzaurrea}%
+ \def\refname{Erreferentziak}%
+ \def\abstractname{Laburpena}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Kapitulua}%
+ \def\appendixname{Eranskina}%
+ \def\contentsname{Gaien Aurkibidea}%
+ \def\listfigurename{Irudien Zerrenda}%
+ \def\listtablename{Taulen Zerrenda}%
+ \def\indexname{Kontzeptuen Aurkibidea}%
+ \def\figurename{Irudia}%
+ \def\tablename{Taula}%
+ \def\partname{Atala}%
+ \def\enclname{Erantsia}%
+ \def\ccname{Kopia}%
+ \def\headtoname{Nori}%
+ \def\pagename{Orria}%
+ \def\seename{Ikusi}%
+ \def\alsoname{Ikusi, halaber}%
+ \def\proofname{Frogapena}%
+ \def\glossaryname{Glosarioa}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebasque}
+% The macro |\datebasque| redefines the command |\today| to
+% produce Basque
+% \changes{basque-1.0b}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{basque-1.0b}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \changes{basque-1.0c}{1999/11/22}{fixed typo in April's name}
+% \begin{macrocode}
+\def\datebasque{%
+ \def\today{\number\year.eko\space\ifcase\month\or
+ urtarrilaren\or otsailaren\or martxoaren\or apirilaren\or
+ maiatzaren\or ekainaren\or uztailaren\or abuztuaren\or
+ irailaren\or urriaren\or azaroaren\or
+ abenduaren\fi~\number\day}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasbasque}
+% \begin{macro}{\noextrasbasque}
+% The macro |\extrasbasque| will perform all the extra definitions
+% needed for the Basque language. The macro |\noextrasbasque| is
+% used to cancel the actions of |\extrasbasque|. For Basque, some
+% characters are made active or are redefined. In particular, the
+% \texttt{"} character and the |~| character receive new
+% meanings. Therefore these characters have to be treated as
+% `special' characters.
+%
+% \begin{macrocode}
+\addto\extrasbasque{\languageshorthands{basque}}
+\initiate@active@char{"}
+\initiate@active@char{~}
+\addto\extrasbasque{%
+ \bbl@activate{"}%
+ \bbl@activate{~}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{basque-1.0d}{1999/12/16}{Deactivate shorthands ouside of
+% Basque}
+% \begin{macrocode}
+\addto\noextrasbasque{
+ \bbl@deactivate{"}\bbl@deactivate{~}}
+% \end{macrocode}
+%
+% Apart from the active characters some other macros get a new
+% definition. Therefore we store the current one to be able to
+% restore them later.
+% \begin{macrocode}
+\addto\extrasbasque{%
+ \babel@save\"%
+ \babel@save\~%
+ \def\"{\protect\@umlaut}%
+ \def\~{\protect\@tilde}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\basquehyphenmins}
+% Basque hyphenation uses |\lefthyphenmin| and |\righthyphenmin|
+% both set to~2.
+% \changes{basque-1.0e}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dieresia}
+% \begin{macro}{\texttilde}
+% The original definition of |\"| is stored as |\dieresia|, because
+% the we do not know what is its definition, since it depends on
+% the encoding we are using or on special macros that the user
+% might have loaded. The expansion of the macro might use the \TeX\
+% |\accent| primitive using some particular accent that the font
+% provides or might check if a combined accent exists in the font.
+% These two cases happen with respectively OT1 and T1 encodings.
+% For this reason we save the definition of |\"| and use that in
+% the definition of other macros. We do likewise for |\'| and
+% |\~|. The present coding of this option file is incorrect in that
+% it can break when the encoding changes. We do not use
+% |\tilde| as the macro name because it is already defined as
+% |\mathaccent|.
+% \begin{macrocode}
+\let\dieresia\"
+\let\texttilde\~
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@umlaut}
+% \begin{macro}{\@tilde}
+% We check the encoding and if not using T1, we make the accents
+% expand but enabling hyphenation beyond the accent. If this is the
+% case, not all break positions will be found in words that contain
+% accents, but this is a limitation in \TeX. An unsolved problem
+% here is that the encoding can change at any time. The definitions
+% below are made in such a way that a change between two 256-char
+% encodings are supported, but changes between a 128-char and a
+% 256-char encoding are not properly supported. We check if T1 is
+% in use. If not, we will give a warning and proceed redefining the
+% accent macros so that \TeX{} at least finds the breaks that are
+% not too close to the accent. The warning will only be printed to
+% the log file.
+% \begin{macrocode}
+\ifx\DeclareFontShape\@undefined
+ \wlog{Warning: You are using an old LaTeX}
+ \wlog{Some word breaks will not be found.}
+ \def\@umlaut#1{\allowhyphens\dieresia{#1}\allowhyphens}
+ \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}
+\else
+ \edef\bbl@next{T1}
+ \ifx\f@encoding\bbl@next
+ \let\@umlaut\dieresia
+ \let\@tilde\texttilde
+ \else
+ \wlog{Warning: You are using encoding \f@encoding\space
+ instead of T1.}
+ \wlog{Some word breaks will not be found.}
+ \def\@umlaut#1{\allowhyphens\dieresia{#1}\allowhyphens}
+ \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Now we can define our shorthands: the french quotes,
+% \changes{basque-1.0b}{1997/04/03}{Removed empty groups after
+% guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{basque}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{basque}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% ordinals\footnote{The code for the ordinals was taken from the
+% answer provided by Raymond Chen
+% (\texttt{raymond@math.berkeley.edu}) to a question by Joseph Gil
+% (\texttt{yogi@cs.ubc.ca}) in \texttt{comp.text.tex}.},
+% \begin{macrocode}
+ \declare@shorthand{basque}{''}{%
+ \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
+% \end{macrocode}
+% tildes,
+% \begin{macrocode}
+\declare@shorthand{basque}{~n}{\textormath{\~n}{\@tilde n}}
+\declare@shorthand{basque}{~N}{\textormath{\~N}{\@tilde N}}
+% \end{macrocode}
+% and some additional commands.
+%
+% The shorthand |"-| should be used in places where a word contains
+% an explictit hyphenation character. According to the Academy of
+% the Basque language, when a word break occurs at an explicit
+% hyphen it must appear \emph{both} at the end of the first line
+% \emph{and} at the beginning of the second line.
+% \changes{changes-1.0f}{2002/01/07}{The hyphen char needs to appear
+% at the beginning of the line as well.}
+% \begin{macrocode}
+\declare@shorthand{basque}{"-}{%
+ \nobreak\discretionary{-}{-}{-}\bbl@allowhyphens}
+\declare@shorthand{basque}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{basque}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/basque.ins b/Master/texmf-dist/source/generic/babel/basque.ins
new file mode 100644
index 00000000000..ccebb561bae
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/basque.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{basque.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{basque.ldf}{\from{basque.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/bbcompat.dtx b/Master/texmf-dist/source/generic/babel/bbcompat.dtx
new file mode 100644
index 00000000000..b90991e12fb
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/bbcompat.dtx
@@ -0,0 +1,261 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{251}
+%
+% \iffalse
+%<*dtx>
+\ProvidesFile{bbcompat.dtx}[2004/02/19 v1.2h]
+%</dtx>
+%
+%% File 'bbcompat.dtx'
+%% Copyright (C) 1989 -- 2004 by Johannes Braams,
+%% TeXniek
+%% all rights reserved.
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{bbcompat.dtx}
+\end{document}
+%</filedriver>
+% \fi
+%
+% \GetFileInfo{bbcompat.dtx}
+% \StopEventually{}
+%
+% \changes{bbcompat-1.2}{1996/11/02}{Added the check for \cs{LdfInit}}
+% \changes{bbcompat-1.2d}{1999/04/12}{When these files are read by a
+% non-babel plain format the @ has still category code `other' so
+% can't use \cd{@undefined}}
+% \begin{macrocode}
+\ifx\LdfInit\undefined
+ \def\LdfInit{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+ \input babel.def\relax
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \LdfInit}
+\fi
+% \end{macrocode}
+% It seems that these files, although meant for compatibility with
+% \file{plain.tex} are also used as packages in \LaTeXe. The
+% disadvantage of that is that a number of compatibility measures
+% with other packages that are part of \file{babel.sty} are not
+% present. Therefore we issue an error and then load
+% \file{babel.def} to let the user continue processing his
+% document (at his own risk).
+%
+% First we determine whether we are loaded from \LaTeX\ by checking
+% whether |\PackageError| is defined.
+% \begin{macrocode}
+\ifx\PackageError\undefined
+% \end{macrocode}
+% In this case we are not being loaded by \LaTeXe, so just define
+% |\ProvidesLanguage| to prevent an error when the \file{.ldf} file
+% is loaded.
+% \begin{macrocode}
+ \def\ProvidesLanguage#1[#2 #3 #4]{%
+ \wlog{Language: #1 #4 #3 <#2>}}%
+\else
+% \end{macrocode}
+% Now we define an error message which `deletes' itself from
+% memory.
+% \begin{macrocode}
+ \def\bblstyerror{%
+ \PackageError{babel}%
+ {You have used an old interface to call babel\MessageBreak
+ You may expect compatibility problems wit other packages}%
+ {You could proceed but don't complain if you run into errors}%
+ \let\bblstyerror\@undefined
+ }
+% \end{macrocode}
+% Now we can issue the error, it should appear when these files are
+% loaded from \LaTeXe, with \emph{or} without \file{hyphen.cfg}
+% preloaded in the format.
+% \changes{bbcompat-1.2e}{1999/04/20}{Added a check for
+% \cs{ProvidesLanguage}}
+% \begin{macrocode}
+ \ifx\ProvidesLanguage\undefined
+% \end{macrocode}
+% In this case \file{hyphen.cfg} wasn't loaded in the \LaTeXe\
+% format so we also need to provide a suitable definition for
+% |\ProvidesLanguage|.
+% \begin{macrocode}
+ \bblstyerror
+ \def\ProvidesLanguage{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+ \input babel.def\relax
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \ProvidesLanguage}
+% \end{macrocode}
+% When we end up here, \file{hyphen.cfg} was loaded into the
+% format; we only need to issue the error from \LaTeXe.
+% \begin{macrocode}
+ \else
+ \bblstyerror
+ \fi
+\fi
+% \end{macrocode}
+% \changes{bbcompat-1.2}{1996/07/13}{Added \file{.sty} files and
+% definition of \cs{CurrentOption} for language definition files
+% that are loaded by more than one option.}
+% \changes{bbcompat-1.2}{1996/12/14}{Added \file{welsh.sty}}
+% \changes{bbcompat-1.2b}{1997/02/07}{Added \file{sanskrit.sty}}
+% \changes{bbcompat-1.2c}{1998/03/24}{Added \file{hebrew.sty}}
+% \changes{bbcompat-1.2d}{1999/03/09}{Added \file{ukraineb.sty}}
+% \changes{bbcompat-1.2d}{1999/04/10}{Added \file{ngerman.sty} and
+% \file{naustrian.sty}}
+% \changes{bbcompat-1.2f}{2000/09/26}{Added \file{icelandic.sty},
+% \file{bulgarian.sty} and \file{samin.sty}}
+% \changes{bbcompat-1.2f}{2000/09/27}{Define \cs{CurrentOption} in
+% each file}
+% \changes{bbcompat-1.2g}{2001/01/19}{Added code for usenglish and
+% ukenglish.sty}
+% \changes{bbcompat-1.2h}{2003/11/13}{Added \file{interlingua.sty}}
+% \begin{macrocode}
+%<+american>\def\CurrentOption{american}
+%<+USenglish>\def\CurrentOption{USenglish}
+%<+british>\def\CurrentOption{british}
+%<+english>\def\CurrentOption{english}
+%<+UKenglish>\def\CurrentOption{UKenglish}
+%<american|british|english|UKenglish|USenglish>\input english.ldf\relax
+%<+bahasa>\def\CurrentOption{bahasa}}
+%<+bahasa>\input bahasa.ldf\relax
+%<+breton>\def\CurrentOption{breton}
+%<+breton>\input breton.ldf\relax
+%<+bulgarian>\def\CurrentOption{bulgarian}
+%<+bulgarian>\input bulgarian.ldf\relax
+%<+catalan>\def\CurrentOption{catalan}
+%<+catalan>\input catalan.ldf\relax
+%<+croatian>\def\CurrentOption{croatian}
+%<+croatian>\input croatian.ldf\relax
+%<+czech>\def\CurrentOption{czech}
+%<+czech>\input czech.ldf\relax
+%<+danish>\def\CurrentOption{danish}
+%<+danish>\input danish.ldf\relax
+%<+afrikaans>\def\CurrentOption{afrikaans}
+%<+dutch>\def\CurrentOption{dutch}
+%<+afrikaans|dutch>\input dutch.ldf\relax
+%<+esperanto>\def\CurrentOption{esperanto}
+%<+esperanto>\input esperanto.ldf\relax
+%<+estonian>\def\CurrentOption{estonian}
+%<+estonian>\input estonian.ldf\relax
+%<+finnish>\def\CurrentOption{finnish}
+%<+finnish>\input finnish.ldf\relax
+%<+francais>\def\CurrentOption{francais}
+%<+french>\def\CurrentOption{french}
+%<+francais|french>\input frenchb.ldf\relax
+%<+galician>\def\CurrentOption{galician}
+%<+galician>\input galician.ldf\relax
+%<+austrian>\def\CurrentOption{austrian}
+%<+german>\def\CurrentOption{german}
+%<+germanb>\def\CurrentOption{german}
+%<+austrian|german|germanb>\input germanb.ldf\relax
+%<+naustrian>\def\CurrentOption{naustrian}
+%<+ngerman>\def\CurrentOption{ngerman}
+%<+naustrian|ngerman>\input ngermanb.ldf\relax
+%<+greek>\def\CurrentOption{greek}
+%<+greek>\input greek.ldf\relax
+%<+icelandic>\def\CurrentOption{icelandic}
+%<+icelandic>\input icelandic.ldf\relax
+%<+interlingua>\def\CurrentOption{interlingua}
+%<+interlingua>\input interlingua.ldf\relax
+%<+irish>\def\CurrentOption{irish}
+%<+irish>\input irish.ldf\relax
+%<+italian>\def\CurrentOption{italian}
+%<+italian>\input italian.ldf\relax
+%<+lsorbian>\def\CurrentOption{lsorbian}
+%<+lsorbian>\input lsorbian.ldf\relax
+%<+magyar>\def\CurrentOption{magyar}
+%<+hungarian>\def\CurrentOption{hungarian}
+%<+magyar|hungarian>\input magyar.ldf\relax
+%<+norsk>\def\CurrentOption{norsk}
+%<+nynorsk>\def\CurrentOption{nynorsk}
+%<+norsk|nynorsk>\input norsk.ldf\relax
+%<+polish>\def\CurrentOption{polish}
+%<+polish>\input polish.ldf\relax
+%<+portuges>\def\CurrentOption{portuges}
+%<+portuguese>\def\CurrentOption{portuguese}
+%<+brazil>\def\CurrentOption{brazil}
+%<+brazilian>\def\CurrentOption{brazilian}
+%<+portuges|portuguese|brazil|brazilian>\input portuges.ldf\relax
+%<+romanian>\def\CurrentOption{romanian}
+%<+romanian>\input romanian.ldf\relax
+%<+russianb>\def\CurrentOption{russianb}
+%<+russianb>\input russianb.ldf\relax
+%<+ukraineb>\def\CurrentOption{ukraineb}
+%<+ukraineb>\input ukraineb.ldf\relax
+%<+samin>\def\CurrentOption{samin}
+%<+samin>\input samin.ldf\relax
+%<+sanskrit>\def\CurrentOption{sanskrit}
+%<+sanskrit>\input sanskrit.ldf\relax
+%<+scottish>\def\CurrentOption{scottish}
+%<+scottish>\input scottish.ldf\relax
+%<+slovak>\def\CurrentOption{slovak}
+%<+slovak>\input slovak.ldf\relax
+%<+slovene>\def\CurrentOption{slovene}
+%<+slovene>\input slovene.ldf\relax
+%<+spanish>\def\CurrentOption{spanish}
+%<+spanish>\input spanish.ldf\relax
+%<+swedish>\def\CurrentOption{swedish}
+%<+swedish>\input swedish.ldf\relax
+%<+turkish>\def\CurrentOption{turkish}
+%<+turkish>\input turkish.ldf\relax
+%<+usorbian>\def\CurrentOption{usorbian}
+%<+usorbian>\input usorbian.ldf\relax
+%<+welsh>\def\CurrentOption{welsh}
+%<+welsh>\input welsh.ldf\relax
+%<+hebrew>\def\CurrentOption{hebrew}
+%<+hebrew>\input rlbabel.def\input hebrew.ldf\relax
+% \end{macrocode}
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/bbidxglo.dtx b/Master/texmf-dist/source/generic/babel/bbidxglo.dtx
new file mode 100644
index 00000000000..f58e44890a3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/bbidxglo.dtx
@@ -0,0 +1,124 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{66}
+%
+% \iffalse
+%
+% \begin{macrocode}
+%<*driver>
+\ProvidesFile{bbidxglo.drv}[2004/02/19 v1.0b]
+\documentclass{ltxdoc}
+\GetFileInfo{bbidxglo.drv}
+\newcommand{\babel}{\textsf{babel}}
+\newcommand{\mkidx}{\texttt{MakeIndex}}
+\newcommand{\file}[1]{\texttt{#1}}
+\newcommand{\Lopt}[1]{\textsf{#1}}
+\begin{document}
+\DocInput{bbidxglo.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% \fi
+% \title{Generating the index and chage log for the Babel system}
+% \author{Johannes Braams}
+% \date{\filedate}
+% \maketitle
+%
+% \section{Description}
+%
+% This file contains the source for the style files for the \mkidx\
+% program. These are needed to produce the index for the complete
+% source listing and to produce the listing of the changes.
+%
+% \StopEventually{}
+%
+% \section{The index and the list of changes } Most of the entries are
+% the same as in the files \file{gind.ist} and \file{gglo.ist} from
+% the \Lopt{doc} package.
+%
+% \begin{macrocode}
+%<*idx|glo>
+actual '='
+quote '!'
+level '>'
+%</idx|glo>
+% \end{macrocode}
+%
+% Because the \babel\ system consists of so many files the default
+% codeline numbering scheme of the \Lopt{doc} package has been
+% adapted. The line numbers consist of two parts seperated with a
+% dot. This has to made known to the \mkidx\ program when it
+% produces the index.
+%
+% \begin{macrocode}
+%<+idx>page_compositor "."
+% \end{macrocode}
+%
+% Any further entries are again copied from \file{gind.ist} and
+% \file{gglo.ist}.
+%
+% \begin{macrocode}
+%<*idx>
+preamble
+"\n \\begin{theindex} \n \\makeatletter\\scan@allowedfalse\n"
+postamble
+"\n\n \\end{theindex}\n"
+%</idx>
+%<*glo>
+preamble
+"\n \\begin{theglossary} \n
+ \\makeatletter\\scan@allowedfalse\n"
+postamble
+"\n\n \\end{theglossary}\n"
+keyword "\\glossaryentry"
+%</glo>
+%<+idx|glo>item_x1 "\\efill \n \\subitem "
+%<+idx>item_x2 "\\efill \n \\subsubitem "
+%<+glo>item_x2 "\\ "
+%<*idx|glo>
+delim_0 "\\pfill "
+delim_1 "\\pfill "
+delim_2 "\\pfill "
+% The next lines will produce some warnings when
+% running Makeindex as they try to cover two different
+% versions of the program:
+lethead_prefix "{\\bfseries\\hfil "
+lethead_suffix "\\hfil}\\nopagebreak\n"
+%</idx|glo>
+%<+idx>lethead_flag 1
+%<+glo>lethead_flag 0
+%<*idx|glo>
+heading_prefix "{\\bfseries\\hfil "
+heading_suffix "\\hfil}\\nopagebreak\n"
+%</idx|glo>
+%<+idx>headings_flag 1
+%<+glo>headings_flag 0
+% \end{macrocode}
+%
diff --git a/Master/texmf-dist/source/generic/babel/bbplain.dtx b/Master/texmf-dist/source/generic/babel/bbplain.dtx
new file mode 100644
index 00000000000..ba2aad20de2
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/bbplain.dtx
@@ -0,0 +1,717 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{795}
+%
+% \iffalse
+%<*dtx>
+\ProvidesFile{bbplain.dtx}
+ [2004/02/19 v1.0r Babel support for plain-based formats]
+%</dtx>
+%
+%% File `bbplain.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2004
+%% by Johannes Braams
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the extra definitions needed to be able to use babel
+% with a plain-based format.
+%<*filedriver>
+\documentclass{ltxdoc}
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \it lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\pkg}[1]{\textsf{#1}}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{bbplain.dtx}
+\end{document}
+%</filedriver>
+% \fi
+%
+% \GetFileInfo{bbplain.dtx}
+% \StopEventually{}
+% \changes{bbplain-1.0n}{1998/06/08}{Added the source for the format
+% wrapper files}
+%
+% \section{Not renaming \file{hyphen.tex}}
+% As Don Knuth has declared that the filename \file{hyphen.tex} may
+% only be used to designate \emph{his} version of the american
+% English hyphenation patterns, a new solution has to be found in
+% order to be able to load hyphenation patterns for other languages
+% in a plain-based \TeX-format.
+% When asked he responded:
+% \begin{quote}
+% That file name is "sacred", and if anybody changes it they will
+% cause severe upward/downward compatibility headaches.
+%
+% People can have a file localhyphen.tex or whatever they like,
+% but they mustn't diddle with hyphen.tex (or plain.tex except to
+% preload additional fonts).
+% \end{quote}
+%
+% The files \file{bplain.tex} and \file{blplain.tex} can be used as
+% replacement wrappers around \file{plain.tex} and
+% \file{lplain.tex} to acheive the desired effect, based on the
+% \pkg{babel} package. If you load each of them with ini\TeX, you
+% will get a file called either \file{bplain.fmt} or
+% \file{blplain.fmt}, which you can use as replacements for
+% \file{plain.fmt} and \file{lplain.fmt}.
+%
+% As these files are going to be read as the first thing ini\TeX\
+% sees, we need to set some category codes just to be able to
+% change the definition of |\input|
+% \begin{macrocode}
+%<*bplain|blplain>
+\catcode`\{=1 % left brace is begin-group character
+\catcode`\}=2 % right brace is end-group character
+\catcode`\#=6 % hash mark is macro parameter character
+% \end{macrocode}
+% Now let's see if a file called \file{hyphen.cfg} can be found
+% somewhere on \TeX's input path by trying to open it for
+% reading...
+% \begin{macrocode}
+\openin 0 hyphen.cfg
+% \end{macrocode}
+% If the file wasn't found the following test turns out true.
+% \begin{macrocode}
+\ifeof0
+\else
+% \end{macrocode}
+% When \file{hyphen.cfg} could be opened we make sure that
+% \emph{it} will be read instead of the file \file{hyphen.tex}
+% which should (according to Don Knuth's ruling) contain the
+% american English hyphenation patterns and nothing else.
+%
+% We do this by first saving the original meaning of |\input| (and
+% I use a one letter control sequence for that so as not to waste
+% multi-letter control sequence on this in the format).
+% \begin{macrocode}
+ \let\a\input
+% \end{macrocode}
+% Then |\input| is defined to forget about its argument and load
+% \file{hyphen.cfg} instead.
+% \begin{macrocode}
+ \def\input #1 {%
+ \let\input\a
+ \a hyphen.cfg
+% \end{macrocode}
+% Once that's done the original meaning of |\input| can be restored
+% and the definition of |\a| can be forgotten.
+% \begin{macrocode}
+ \let\a\undefined
+ }
+\fi
+%</bplain|blplain>
+% \end{macrocode}
+% Now that we have made sure that \file{hyphen.cfg} will be loaded
+% at the right moment it is time to load \file{plain.tex}.
+% \begin{macrocode}
+%<bplain>\a plain.tex
+%<blplain>\a lplain.tex
+% \end{macrocode}
+% Finally we change the contents of |\fmtname| to indicate that
+% this is \emph{not} the plain format, but a format based on plain
+% with the \pkg{babel} package preloaded.
+% \begin{macrocode}
+%<bplain>\def\fmtname{babel-plain}
+%<blplain>\def\fmtname{babel-lplain}
+% \end{macrocode}
+%
+% When you are using a different format, based on plain.tex you can
+% make a copy of blplain.tex, rename it and replace \file{plain.tex}
+% with the name of your format file.
+%
+% \section{Support for formats based on \textsc{plain}\TeX}
+%
+% The following code duplicates or emulates parts of \LaTeXe\ that
+% are needed for \babel.
+%
+% \changes{bbplain-1.0f}{1996/07/09}{Consistently use \cs{@undefined}
+% instead of \cs{undefined}}
+% \changes{bbplain-1.0f}{1996/07/09}{added \cs{@empty}}
+% \changes{bbplain-1.0h}{1996/10/07}{Only load the necessary parts
+% into the format, let this file be read agian by babel.def}
+% \begin{macrocode}
+%<*code>
+\ifx\adddialect\@undefined
+% \end{macrocode}
+% When |\adddialect| is still undefined we are making a
+% format. In that case only the first part of this file is needed.
+% \begin{macrocode}
+ \def\@empty{}
+% \end{macrocode}
+% We need to define |\loadlocalcfg| for plain users as the
+% \LaTeX\ definition uses |\InputIfFileExists|.
+% \changes{bbplain-1.0c}{1995/07/26}{Added definition of
+% \cs{loadlocalcfg}}
+% \changes{bbplain-1.0d}{1996/01/08}{Also reset category codes after
+% loading the configuration file as \cs{AtEndOfPackage} is
+% undefined in this case}
+% \begin{macrocode}
+ \def\loadlocalcfg#1{%
+ \openin0#1.cfg
+ \ifeof0
+ \closein0
+ \else
+ \closein0
+ {\immediate\write16{*************************************}%
+ \immediate\write16{* Local config file #1.cfg used}%
+ \immediate\write16{*}%
+ }
+ \input #1.cfg\relax
+ \fi
+% \end{macrocode}
+% We have to execute \cs{@endofldf} in this case
+% \begin{macrocode}
+ \@endofldf
+ }
+% \end{macrocode}
+%
+% \changes{bbplain-1.0c}{1995/11/08}{Moved the \cs{dump} code here from
+% \file{babel.dtx}}
+%
+% \changes{bbplain-0.1}{1991/10/31}{Added redefinition of \cs{dump} to
+% add a message to \cs{everyjob}}
+% We want to add a message to the message \LaTeX$\:$2.09 puts in
+% the |\everyjob| register. This could be done by the following
+% code:
+% \begin{verbatim}
+% \let\orgeveryjob\everyjob
+% \def\everyjob#1{%
+% \orgeveryjob{#1}%
+% \orgeveryjob\expandafter{\the\orgeveryjob\immediate\write16{%
+% hyphenation patterns for \the\loaded@patterns loaded.}}%
+% \let\everyjob\orgeveryjob\let\orgeveryjob\@undefined}
+% \end{verbatim}
+% The code above redefines the control sequence \cs{everyjob}
+% in order to be able to add something to the current contents of
+% the register. This is necessary because the processing of
+% hyphenation patterns happens long before \LaTeX\ fills the
+% register.\\
+% There are some problems with this approach though.
+% \begin{itemize}
+% \item When someone wants to use several hyphenation patterns with
+% \SliTeX\ the above scheme won't work. The reason is that \SliTeX\
+% overwrites the contents of the |\everyjob| register with its own
+% message.
+% \item Plain \TeX\ does not use the |\everyjob| register so the
+% message would not be displayed.
+% \end{itemize}
+% To circumvent this a `dirty trick' can be used. As this code is
+% only processed when creating a new format file there is one
+% command that is sure to be used, |\dump|. Therefore the original
+% |\dump| is saved in |\org@dump| and a new definition is supplied.
+% \begin{macrocode}
+ \let\orig@dump=\dump
+ \def\dump{%
+% \end{macrocode}
+% To make sure that \LaTeX$\:$2.09 executes the
+% |\@begindocumenthook| we would want to alter |\begin{document}|,
+% but as this done too often already, we add the new code at the
+% front of |\@preamblecmds|. But we can only do that after it has
+% been defined, so we add this piece of code to |\dump|.
+% \changes{bbplain-1.0c}{1995/11/19}{Add execution of
+% \cs{@begindocumenthook} to \cs{@preamblecmds}}
+% \changes{bbplain-1.0i}{1997/01/02}{\cs{document} is not a
+% \LaTeX2.09-only command; AMS\TeX defines it too; now use
+% \cs{@ztryfc} to detect \LaTeX2.09}
+% \changes{bbplain-1.0j}{1997/01/07}{Add the definition of
+% \cs{@begindocumenthook} to the \LaTeX2.09 format}
+% \begin{macrocode}
+ \ifx\@ztryfc\@undefined
+ \else
+ \toks0=\expandafter{\@preamblecmds}
+ \edef\@preamblecmds{\noexpand\@begindocumenthook\the\toks0}
+ \def\@begindocumenthook{}
+ \fi
+% \end{macrocode}
+% This new definition starts by adding an instruction to write a
+% message on the terminal and in the transcript file to inform the
+% user of the preloaded hyphenation patterns.
+% \changes{bbplain-1.0f}{1996/07/09}{Use \cs{toks8} instead of
+% \cs{patterns@loaded}}
+% \begin{macrocode}
+ \everyjob\expandafter{\the\everyjob%
+ \immediate\write16{\the\toks8 loaded.}}%
+% \end{macrocode}
+% Then everything is restored to the old situation and the format
+% is dumped.
+% \begin{macrocode}
+ \let\dump\orig@dump\let\orig@dump\@undefined\dump}
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% The rest of this file is not processed by ini\TeX\ but during the
+% normal document run.
+% A number of \LaTeX\ macro's that are needed later on.
+% \changes{bbplain-1.0n}{1998/06/10}{Added \cs{@secondoftwo}}
+% \changes{bbplain-1.0q}{1999/09/16}{Added \cs{@ifundefined}}
+% \begin{macrocode}
+\long\def\@firstofone#1{#1}
+\long\def\@firstoftwo#1#2{#1}
+\long\def\@secondoftwo#1#2{#2}
+\def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
+\def\@star@or@long#1{%
+ \@ifstar
+ {\let\l@ngrel@x\relax#1}%
+ {\let\l@ngrel@x\long#1}}
+\let\l@ngrel@x\relax
+\def\@car#1#2\@nil{#1}
+\def\@cdr#1#2\@nil{#2}
+\let\@typeset@protect\relax
+\long\def\@gobble#1{}
+\edef\@backslashchar{\expandafter\@gobble\string\\}
+\def\strip@prefix#1>{}
+\def\g@addto@macro#1#2{{%
+ \toks@\expandafter{#1#2}%
+ \xdef#1{\the\toks@}}}
+\def\@namedef#1{\expandafter\def\csname #1\endcsname}
+\def\@ifundefined#1{%
+ \expandafter\ifx\csname#1\endcsname\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+% \end{macrocode}
+% \LaTeXe\ has the command |\@onlypreamble| which adds commands to
+% a list of commands that are no longer needed after
+% |\begin{document}|.
+% \begin{macrocode}
+\ifx\@preamblecmds\@undefined
+ \def\@preamblecmds{}
+\fi
+\def\@onlypreamble#1{%
+ \expandafter\gdef\expandafter\@preamblecmds\expandafter{%
+ \@preamblecmds\do#1}}
+\@onlypreamble\@onlypreamble
+% \end{macrocode}
+% Mimick \LaTeX's |\AtBeginDocument|; for this to work the user
+% needs to add |\begindocument| to his file.
+% \begin{macrocode}
+\def\begindocument{%
+ \@begindocumenthook
+ \global\let\@begindocumenthook\@undefined
+ \def\do##1{\global\let ##1\@undefined}%
+ \@preamblecmds
+ \global\let\do\noexpand
+ }
+% \end{macrocode}
+%
+% \changes{bbplain-1.0j}{1997/01/07}{\cs{@begindocumenthook} might
+% already be defined}
+% \changes{bbplain-1.0k}{1997/01/14}{missing \cs{@undefined} added}
+% \begin{macrocode}
+\ifx\@begindocumenthook\@undefined
+ \def\@begindocumenthook{}
+\fi
+\@onlypreamble\@begindocumenthook
+\def\AtBeginDocument{\g@addto@macro\@begindocumenthook}
+% \end{macrocode}
+% We also have to mimick \LaTeX's |\AtEndOfPackage|. Our
+% replacement macro is much simpler; it stores its argument in
+% |\@endofldf|.
+% \begin{macrocode}
+\def\AtEndOfPackage#1{\g@addto@macro\@endofldf{#1}}
+\@onlypreamble\AtEndOfPackage
+\def\@endofldf{}
+\@onlypreamble\@endofldf
+% \end{macrocode}
+% \LaTeX\ needs to be able to switch off writing to its auxiliary
+% files; plain doesn't have them by default.
+% \changes{bbplain-1.0m}{1997/04/28}{Set \cs{if@filesw} to
+% \cs{iffalse} only for plain \TeX}
+% \changes{bbplain-1.0n}{1997/09/11}{Repaired typo and added missing
+% \cs{endcsname}}
+% \begin{macrocode}
+\ifx\if@filesw\@undefined
+ \expandafter\let\csname if@filesw\expandafter\endcsname
+ \csname iffalse\endcsname
+\fi
+% \end{macrocode}
+% Mimick \LaTeX's commands to define control sequences.
+% \changes{bbplain-1.0e}{1996/02/22}{Provide a more complete emulation
+% of \cs{DeclareRobustCommand} and \cs{newcommand}}
+% \begin{macrocode}
+\def\newcommand{\@star@or@long\new@command}
+\def\new@command#1{%
+ \@testopt{\@newcommand#1}0}
+\def\@newcommand#1[#2]{%
+ \@ifnextchar [{\@xargdef#1[#2]}%
+ {\@argdef#1[#2]}}
+\long\def\@argdef#1[#2]#3{%
+ \@yargdef#1\@ne{#2}{#3}}
+\long\def\@xargdef#1[#2][#3]#4{%
+ \expandafter\def\expandafter#1\expandafter{%
+ \expandafter\@protected@testopt\expandafter #1%
+ \csname\string#1\expandafter\endcsname{#3}}%
+ \expandafter\@yargdef \csname\string#1\endcsname
+ \tw@{#2}{#4}}
+\long\def\@yargdef#1#2#3{%
+ \@tempcnta#3\relax
+ \advance \@tempcnta \@ne
+ \let\@hash@\relax
+ \edef\reserved@a{\ifx#2\tw@ [\@hash@1]\fi}%
+ \@tempcntb #2%
+ \@whilenum\@tempcntb <\@tempcnta
+ \do{%
+ \edef\reserved@a{\reserved@a\@hash@\the\@tempcntb}%
+ \advance\@tempcntb \@ne}%
+ \let\@hash@##%
+ \l@ngrel@x\expandafter\def\expandafter#1\reserved@a}
+\let\providecommand\newcommand
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\DeclareRobustCommand{\@star@or@long\declare@robustcommand}
+\def\declare@robustcommand#1{%
+ \edef\reserved@a{\string#1}%
+ \def\reserved@b{#1}%
+ \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}%
+ \edef#1{%
+ \ifx\reserved@a\reserved@b
+ \noexpand\x@protect
+ \noexpand#1%
+ \fi
+ \noexpand\protect
+ \expandafter\noexpand\csname
+ \expandafter\@gobble\string#1 \endcsname
+ }%
+ \expandafter\new@command\csname
+ \expandafter\@gobble\string#1 \endcsname
+}
+\def\x@protect#1{%
+ \ifx\protect\@typeset@protect\else
+ \@x@protect#1%
+ \fi
+}
+\def\@x@protect#1\fi#2#3{%
+ \fi\protect#1%
+}
+% \end{macrocode}
+%
+% The following little macro |\in@| is taken from latex.ltx; it
+% checks whether its first argument is part of its second
+% argument. It uses the boolean |\in@|; allocating a new boolean
+% inside conditionally executed code is not possible, hence the
+% construct with the temporary definition of |\bbl@tempa|.
+% \changes{bbplain-1.0o}{1998/07/02}{Added definition of \cs{in@}}
+% \begin{macrocode}
+\def\bbl@tmpa{\csname newif\endcsname\ifin@}
+\ifx\in@\@undefined
+ \def\in@#1#2{%
+ \def\in@@##1#1##2##3\in@@{%
+ \ifx\in@##2\in@false\else\in@true\fi}%
+ \in@@#2#1\in@\in@@}
+\else
+ \let\bbl@tmpa\@empty
+\fi
+\bbl@tmpa
+% \end{macrocode}
+%
+% \LaTeX\ has a macro to check whether a certain package was loaded
+% with specific options. The command has two extra arguments which
+% are code to be executed in either the true or false case.
+% This is used to detect whether the document needs one of the
+% accents to be activated (\Lopt{activegrave} and
+% \Lopt{activeacute}). For plain \TeX\ we assume that the user
+% wants them to be active by default. Therefore the only thing we
+% do is execute the third argument (the code for the true case).
+%
+% \begin{macrocode}
+\def\@ifpackagewith#1#2#3#4{%
+ #3}
+% \end{macrocode}
+% The \LaTeX\ macro |\@ifl@aded| checks whether a file was
+% loaded. This functionality is not needed for plain \TeX\ but we
+% need the macro to be defined as a no-op.
+% \changes{bbplain-1.0p}{1999/04/27}{Added \cs{@ifl@aded} as a no-op}
+% \begin{macrocode}
+\def\@ifl@aded#1#2#3#4{}
+% \end{macrocode}
+%
+% \changes{bbplain-1.0e}{1996/01/15}{Added the \cs{newcommand} code}
+% For the following code we need to make sure that the commands
+% |\newcommand| and |\providecommand| exist with some sensible
+% definition. They are not fully equivalent to their \LaTeXe\
+% versions; just enough to make things work in plain~\TeX
+% environments.
+%
+% \changes{bbplain-1.0k}{1997/01/14}{\cs{newcount} is an \cs{outer}
+% command, can't use it inside an \cs{if} construct}
+% \changes{bbplain-1.0l}{1997/01/19}{Mixed up the definition of
+% \cs{@tempcntb}}
+% \begin{macrocode}
+\ifx\@tempcnta\@undefined
+ \csname newcount\endcsname\@tempcnta\relax
+\fi
+\ifx\@tempcntb\@undefined
+ \csname newcount\endcsname\@tempcntb\relax
+\fi
+% \end{macrocode}
+% To prevent wasting two counters in \LaTeX$\:$2.09 (because
+% counters with the same name are allocated later by it) we reset
+% the counter that holds the next free counter (|\count10|).
+% \begin{macrocode}
+\ifx\bye\@undefined
+ \advance\count10 by -2\relax
+\fi
+\ifx\@ifnextchar\@undefined
+ \def\@ifnextchar#1#2#3{%
+ \let\reserved@d=#1%
+ \def\reserved@a{#2}\def\reserved@b{#3}%
+ \futurelet\@let@token\@ifnch}
+ \def\@ifnch{%
+ \ifx\@let@token\@sptoken
+ \let\reserved@c\@xifnch
+ \else
+ \ifx\@let@token\reserved@d
+ \let\reserved@c\reserved@a
+ \else
+ \let\reserved@c\reserved@b
+ \fi
+ \fi
+ \reserved@c}
+ \def\:{\let\@sptoken= } \: % this makes \@sptoken a space token
+ \def\:{\@xifnch} \expandafter\def\: {\futurelet\@let@token\@ifnch}
+\fi
+\def\@testopt#1#2{%
+ \@ifnextchar[{#1}{#1[#2]}}
+\def\@protected@testopt#1{%%
+ \ifx\protect\@typeset@protect
+ \expandafter\@testopt
+ \else
+ \@x@protect#1%
+ \fi}
+\long\def\@whilenum#1\do #2{\ifnum #1\relax #2\relax\@iwhilenum{#1\relax
+ #2\relax}\fi}
+\long\def\@iwhilenum#1{\ifnum #1\expandafter\@iwhilenum
+ \else\expandafter\@gobble\fi{#1}}
+% \end{macrocode}
+% Code from \file{ltoutenc.dtx}, adapted for use in the plain \TeX\
+% environment.
+% \begin{macrocode}
+\def\DeclareTextCommand{%
+ \@dec@text@cmd\providecommand
+}
+\def\ProvideTextCommand{%
+ \@dec@text@cmd\providecommand
+}
+\def\DeclareTextSymbol#1#2#3{%
+ \@dec@text@cmd\chardef#1{#2}#3\relax
+}
+\def\@dec@text@cmd#1#2#3{%
+ \expandafter\def\expandafter#2%
+ \expandafter{%
+ \csname#3-cmd\expandafter\endcsname
+ \expandafter#2%
+ \csname#3\string#2\endcsname
+ }%
+% \let\@ifdefinable\@rc@ifdefinable
+ \expandafter#1\csname#3\string#2\endcsname
+}
+\def\@current@cmd#1{%
+ \ifx\protect\@typeset@protect\else
+ \noexpand#1\expandafter\@gobble
+ \fi
+}
+\def\@changed@cmd#1#2{%
+ \ifx\protect\@typeset@protect
+ \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax
+ \expandafter\ifx\csname ?\string#1\endcsname\relax
+ \expandafter\def\csname ?\string#1\endcsname{%
+ \@changed@x@err{#1}%
+ }%
+ \fi
+ \global\expandafter\let
+ \csname\cf@encoding \string#1\expandafter\endcsname
+ \csname ?\string#1\endcsname
+ \fi
+ \csname\cf@encoding\string#1%
+ \expandafter\endcsname
+ \else
+ \noexpand#1%
+ \fi
+}
+\def\@changed@x@err#1{%
+ \errhelp{Your command will be ignored, type <return> to proceed}%
+ \errmessage{Command \protect#1 undefined in encoding \cf@encoding}}
+\def\DeclareTextCommandDefault#1{%
+ \DeclareTextCommand#1?%
+}
+\def\ProvideTextCommandDefault#1{%
+ \ProvideTextCommand#1?%
+}
+\expandafter\let\csname OT1-cmd\endcsname\@current@cmd
+\expandafter\let\csname?-cmd\endcsname\@changed@cmd
+\def\DeclareTextAccent#1#2#3{%
+ \DeclareTextCommand#1{#2}[1]{\accent#3 ##1}
+}
+\def\DeclareTextCompositeCommand#1#2#3#4{%
+ \expandafter\let\expandafter\reserved@a\csname#2\string#1\endcsname
+ \edef\reserved@b{\string##1}%
+ \edef\reserved@c{%
+ \expandafter\@strip@args\meaning\reserved@a:-\@strip@args}%
+ \ifx\reserved@b\reserved@c
+ \expandafter\expandafter\expandafter\ifx
+ \expandafter\@car\reserved@a\relax\relax\@nil
+ \@text@composite
+ \else
+ \edef\reserved@b##1{%
+ \def\expandafter\noexpand
+ \csname#2\string#1\endcsname####1{%
+ \noexpand\@text@composite
+ \expandafter\noexpand\csname#2\string#1\endcsname
+ ####1\noexpand\@empty\noexpand\@text@composite
+ {##1}%
+ }%
+ }%
+ \expandafter\reserved@b\expandafter{\reserved@a{##1}}%
+ \fi
+ \expandafter\def\csname\expandafter\string\csname
+ #2\endcsname\string#1-\string#3\endcsname{#4}
+ \else
+ \errhelp{Your command will be ignored, type <return> to proceed}%
+ \errmessage{\string\DeclareTextCompositeCommand\space used on
+ inappropriate command \protect#1}
+ \fi
+}
+\def\@text@composite#1#2#3\@text@composite{%
+ \expandafter\@text@composite@x
+ \csname\string#1-\string#2\endcsname
+}
+\def\@text@composite@x#1#2{%
+ \ifx#1\relax
+ #2%
+ \else
+ #1%
+ \fi
+}
+%
+\def\@strip@args#1:#2-#3\@strip@args{#2}
+\def\DeclareTextComposite#1#2#3#4{%
+ \def\reserved@a{\DeclareTextCompositeCommand#1{#2}{#3}}%
+ \bgroup
+ \lccode`\@=#4%
+ \lowercase{%
+ \egroup
+ \reserved@a @%
+ }%
+}
+%
+\def\UseTextSymbol#1#2{%
+% \let\@curr@enc\cf@encoding
+% \@use@text@encoding{#1}%
+ #2%
+% \@use@text@encoding\@curr@enc
+}
+\def\UseTextAccent#1#2#3{%
+% \let\@curr@enc\cf@encoding
+% \@use@text@encoding{#1}%
+% #2{\@use@text@encoding\@curr@enc\selectfont#3}%
+% \@use@text@encoding\@curr@enc
+}
+\def\@use@text@encoding#1{%
+% \edef\f@encoding{#1}%
+% \xdef\font@name{%
+% \csname\curr@fontshape/\f@size\endcsname
+% }%
+% \pickup@font
+% \font@name
+% \@@enc@update
+}
+\def\DeclareTextSymbolDefault#1#2{%
+ \DeclareTextCommandDefault#1{\UseTextSymbol{#2}#1}%
+}
+\def\DeclareTextAccentDefault#1#2{%
+ \DeclareTextCommandDefault#1{\UseTextAccent{#2}#1}%
+}
+\def\cf@encoding{OT1}
+% \end{macrocode}
+% Currently we only use the \LaTeXe\ method for accents for those
+% that are known to be made active in \emph{some} language
+% definition file.
+% \begin{macrocode}
+\DeclareTextAccent{\"}{OT1}{127}
+\DeclareTextAccent{\'}{OT1}{19}
+\DeclareTextAccent{\^}{OT1}{94}
+\DeclareTextAccent{\`}{OT1}{18}
+\DeclareTextAccent{\~}{OT1}{126}
+% \end{macrocode}
+% The following control sequences are used in \file{babel.def}
+% but are not defined for \textsc{plain} \TeX.
+% \changes{bbplain-1.0f}{1996/07/10}{Added \cs{textquotedblright} and
+% \cs{textquoteright}}
+% \changes{bbplain-1.0g}{1996/08/15}{Added \cs{ss} and \cs{i}}
+% \changes{bbplain-1.0r}{2000/10/02}{Added \cs{textquotedblleft} and
+% \cs{textquoteleft}}
+% \begin{macrocode}
+\DeclareTextSymbol{\textquotedblleft}{OT1}{92}
+\DeclareTextSymbol{\textquotedblright}{OT1}{`\"}
+\DeclareTextSymbol{\textquoteleft}{OT1}{`\`}
+\DeclareTextSymbol{\textquoteright}{OT1}{`\'}
+\DeclareTextSymbol{\i}{OT1}{16}
+\DeclareTextSymbol{\ss}{OT1}{25}
+% \end{macrocode}
+% For a couple of languages we need the \LaTeX-control sequence
+% |\scriptsize| to be available. Because plain \TeX\ doesn't have
+% such a sofisticated font mechanism as \LaTeX\ has, we just |\let|
+% it to |\sevenrm|.
+% \changes{bbplain-1.0f}{1996/07/10}{Added definition of
+% \cs{scriptsize}}
+% \begin{macrocode}
+\ifx\scriptsize\@undefined
+ \let\scriptsize\sevenrm
+\fi
+%</code>
+% \end{macrocode}
+%
+\endinput
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
diff --git a/Master/texmf-dist/source/generic/babel/breton.dtx b/Master/texmf-dist/source/generic/babel/breton.dtx
new file mode 100644
index 00000000000..e87500aaf14
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/breton.dtx
@@ -0,0 +1,365 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{263}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{breton.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{breton}
+%\fi
+%\ProvidesFile{breton.dtx}
+ [2005/03/29 v1.0h Breton support from the babel system]
+%\iffalse
+%% File `breton.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Breton Language Definition File
+%% Copyright (C) 1994 - 2005
+%% by Christian Rolland
+% Universite de Bretagne occidentale
+% Departement d'informatique
+% 6, avenue Le Gorgeu
+% BP 452
+% 29275 Brest Cedex -- FRANCE
+% Christian.Rolland at univ-brest.fr (Internet)
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Breton language definition file. It is based on the
+% language definition file for french, version 4.5c
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{breton.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{breton.dtx}
+% \changes{breton-1.0e}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \changes{breton-1.0}{1994/09/21}{First release}
+%
+% \section{The Breton language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language-specific macros for the Breton
+% language.
+%
+% There are not really typographic rules for the Breton
+% language. It is a local language (it's one of the celtic
+% languages) which is spoken in Brittany (West of France). So we
+% have a synthesis between french typographic rules and english
+% typographic rules. The characters \texttt{:}, \texttt{;},
+% \texttt{!} and \texttt{?} are made active in order to get a
+% whitespace automatically before these characters.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{breton-1.0e}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{breton}\captionsbreton
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{breton} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@breton| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@breton\@undefined
+ \@nopatterns{Breton}
+ \adddialect\l@breton0\fi
+% \end{macrocode}
+% The next step consists of defining commands to switch to the
+% English language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsbreton}
+% The macro |\captionsbreton| defines all strings used in the
+% four standard document classes provided with \LaTeX.
+% \changes{breton-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{breton-1.0h}{2000/09/19}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsbreton{%
+ \def\prefacename{Rakskrid}%
+ \def\refname{Daveenno\`u}%
+ \def\abstractname{Dvierra\~n}%
+ \def\bibname{Lennadurezh}%
+ \def\chaptername{Pennad}%
+ \def\appendixname{Stagadenn}%
+ \def\contentsname{Taolenn}%
+ \def\listfigurename{Listenn ar Figurenno\`u}%
+ \def\listtablename{Listenn an taolenno\`u}%
+ \def\indexname{Meneger}%
+ \def\figurename{Figurenn}%
+ \def\tablename{Taolenn}%
+ \def\partname{Lodenn}%
+ \def\enclname{Diello\`u kevret}%
+ \def\ccname{Eilskrid da}%
+ \def\headtoname{evit}
+ \def\pagename{Pajenn}%
+ \def\seename{Gwelout}%
+ \def\alsoname{Gwelout ivez}%
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebreton}
+% The macro |\datebreton| redefines the command
+% |\today| to produce Breton dates.
+% \changes{breton-1.0f}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{breton-1.0f}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\datebreton{%
+ \def\today{\ifnum\day=1\relax 1\/$^{\rm a\tilde{n}}$\else
+ \number\day\fi \space a\space viz\space\ifcase\month\or
+ Genver\or C'hwevrer\or Meurzh\or Ebrel\or Mae\or Mezheven\or
+ Gouere\or Eost\or Gwengolo\or Here\or Du\or Kerzu\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasbreton}
+% \begin{macro}{\noextrasbreton}
+% The macro |\extrasbreton| will perform all the extra
+% definitions needed for the Breton language. The macro
+% |\noextrasbreton| is used to cancel the actions of
+% |\extrasbreton|.
+%
+% The category code of the characters \texttt{:}, \texttt{;},
+% \texttt{!} and \texttt{?} is made |\active| to insert a little
+% white space.
+% \changes{breton-1.0b}{1995/03/07}{Use the new mechanism for dealing
+% with active chars}
+% \begin{macrocode}
+\initiate@active@char{:}
+\initiate@active@char{;}
+\initiate@active@char{!}
+\initiate@active@char{?}
+% \end{macrocode}
+% We specify that the breton group of shorthands should be used.
+% \begin{macrocode}
+\addto\extrasbreton{\languageshorthands{breton}}
+% \end{macrocode}
+% These characters are `turned on' once, later their definition may
+% vary.
+% \begin{macrocode}
+\addto\extrasbreton{%
+ \bbl@activate{:}\bbl@activate{;}%
+ \bbl@activate{!}\bbl@activate{?}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{breton-1.0g}{1999/12/16}{Deactivate shorthands ouside of Breton}
+% \begin{macrocode}
+\addto\noextrasbreton{%
+ \bbl@deactivate{:}\bbl@deactivate{;}%
+ \bbl@deactivate{!}\bbl@deactivate{?}}
+% \end{macrocode}
+%
+% The last thing |\extrasbreton| needs to do is to make sure that
+% |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasbreton| will switch it of again.
+% \begin{macrocode}
+\addto\extrasbreton{\bbl@frenchspacing}
+\addto\noextrasbreton{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\breton@sh@;@}
+% We have to reduce the amount of white space before \texttt{;},
+% \texttt{:} and \texttt{!} when the user types a space in front of
+% these characters. This should only happen outside mathmode, hence
+% the test with |\ifmmode|.
+%
+% \begin{macrocode}
+\declare@shorthand{breton}{;}{%
+ \ifmmode
+ \string;\space
+ \else\relax
+% \end{macrocode}
+% In horizontal mode we check for the presence of a `space' and
+% replace it by a |\thinspace|.
+% \begin{macrocode}
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \fi
+ \fi
+ \string;\space
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\breton@sh@:@}
+% \begin{macro}{\breton@sh@!@}
+% Because these definitions are very similar only one is displayed
+% in a way that the definition can be easily checked.
+% \begin{macrocode}
+\declare@shorthand{breton}{:}{%
+ \ifmmode\string:\space
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@\unskip\penalty\@M\thinspace\fi
+ \fi
+ \string:\space
+ \fi}
+\declare@shorthand{breton}{!}{%
+ \ifmmode\string!\space
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@\unskip\penalty\@M\thinspace\fi
+ \fi
+ \string!\space
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\breton@sh@?@}
+% For the question mark something different has to be done. In this
+% case the amount of white space that replaces the space character
+% depends on the dimensions of the font.
+% \begin{macrocode}
+\declare@shorthand{breton}{?}{%
+ \ifmmode
+ \string?\space
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip
+ \kern\fontdimen2\font
+ \kern-1.4\fontdimen3\font
+ \fi
+ \fi
+ \string?\space
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% All that is left to do now is provide the breton user with some
+% extra utilities.
+%
+% Some definitions for special characters.
+% \begin{macrocode}
+\DeclareTextSymbol{\at}{OT1}{64}
+\DeclareTextSymbol{\at}{T1}{64}
+\DeclareTextSymbolDefault{\at}{OT1}
+\DeclareTextSymbol{\boi}{OT1}{92}
+\DeclareTextSymbol{\boi}{T1}{16}
+\DeclareTextSymbolDefault{\boi}{OT1}
+\DeclareTextSymbol{\circonflexe}{OT1}{94}
+\DeclareTextSymbol{\circonflexe}{T1}{2}
+\DeclareTextSymbolDefault{\circonflexe}{OT1}
+\DeclareTextSymbol{\tild}{OT1}{126}
+\DeclareTextSymbol{\tild}{T1}{3}
+\DeclareTextSymbolDefault{\tild}{OT1}
+\DeclareTextSymbol{\degre}{OT1}{23}
+\DeclareTextSymbol{\degre}{T1}{6}
+\DeclareTextSymbolDefault{\degre}{OT1}
+% \end{macrocode}
+%
+% The following macros are used in the redefinition of |\^| and
+% |\"| to handle the letter i.
+% \changes{breton-1.0c}{1995/07/07}{Postpone the
+% \cs{DeclareTextCompositeCommand}s untill \cs{AtBeginDocument}}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i}
+ \DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i}}
+% \end{macrocode}
+%
+% And some more macros for numbering.
+% \begin{macrocode}
+\def\kentan{1\/${}^{\rm a\tilde{n}}$}
+\def\eil{2\/${}^{\rm l}$}
+\def\re{\/${}^{\rm re}$}
+\def\trede{3\re}
+\def\pevare{4\re}
+\def\vet{\/${}^{\rm vet}$}
+\def\pempvet{5\vet}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{breton-1.0e}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{breton}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/breton.ins b/Master/texmf-dist/source/generic/babel/breton.ins
new file mode 100644
index 00000000000..595e0cba1bd
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/breton.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{breton.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{breton.ldf}{\from{breton.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/bulgarian.dtx b/Master/texmf-dist/source/generic/babel/bulgarian.dtx
new file mode 100644
index 00000000000..decff6c221b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/bulgarian.dtx
@@ -0,0 +1,1037 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{1266}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{bulgarian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{bulgarian}
+ [2005/03/29 v1.0d Bulgarian support from the babel system]
+%
+%% File `bulgarian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989-2005
+%% by Johannes Braams,TeXniek
+%
+%% Bulgarian Language Definition File
+%% Copyright (C) 1995-2005
+%% by Georgi.Boshnakov <georgi.boshnakov at umist.ac.uk>
+%% Johannes Braams,TeXniek
+%
+%% Adapted from russianb.dtx
+%% by Georgi.Boshnakov <georgi.boshnakov at umist.ac.uk>
+%
+%% Please report errors to:J.L.Braams
+%% babal at braams.cistron.nl
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand\TeXhax{\TeX hax}
+\newcommand\babel{\textsf{babel}}
+\newcommand\langvar{$\langle\it lang \rangle$}
+\newcommand\note[1]{}
+\newcommand\Lopt[1]{\textsf{#1}}
+\newcommand\file[1]{\texttt{#1}}
+\newcommand\pkg[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{bulgarian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{bulgarian.dtx}
+%
+% \changes{bulgarian-0.99}{2000/06/10}{%
+% This is a prerelease version of this file.
+% Features needing further testing are removed.}
+%
+% \section{The Bulgarian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. This file was initially derived from the August-1998
+% version of \file{russianb.dtx}.
+%
+% It is (reasonably) backward compatible with the 1994/1996
+% (non-babel) bulgarian style (bulgaria.sty) by Georgi
+% Boshnakov---files prepared for that style should compile
+% successfully (with vastly improved appearance due to usage of
+% standard fonts).} provides the language-specific macros for the
+% Bulgarian language.
+%
+% Users should take note of the vaious ``cyrillic'' dashes
+% available now (see below). These should remove many causes of
+% headache. Also, although by default the Bulgarian quotation marks
+% will appear automatically when typesetting in Bulgarian, it is
+% better to use the new commands \cs{"'} and \cs{"'} which
+% explicitly typeset them.
+% Note: automatic switch to Bulgarian quotation is withdrawn
+% for the moment and may not be reintroduced at all.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:bulgarian-quote} an overview is given of its
+% purpose.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |"---| & Cyrillic emdash in plain text. \\
+% |"--~| & Cyrillic emdash in compound names (surnames). \\
+% |"--*| & Cyrillic emdash for denoting direct speech. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compound words with hyphen, e.g.\ |x-""y|
+% or some other signs as ``disable/enable''). \\
+% |"~| & for a compound word mark without a breakpoint. \\
+% |"=| & for a compound word mark with a breakpoint, allowing
+% hyphenation in the composing words. \\
+% |",| & thinspace for initials with a breakpoint
+% in following surname. \\
+% |"`| & for German left double quotes
+% (looks like ,\kern-0.08em,). \\
+% |"'| & for German right double quotes (looks like ``). \\%''
+% |"<| & for French left double quotes (looks like $<\!\!<$).\\
+% |">| & for French right double quotes (looks like $>\!\!>$).\\
+% \end{tabular}
+% \caption{The extra definitions made
+% by\file{bulgarian}}\label{tab:bulgarian-quote}
+% \end{center}
+% \end{table}
+%
+% The quotes in table~\ref{tab:bulgarian-quote} can also be typeset
+% by using the commands in table~\ref{tab:bmore-quote}.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |\cdash---| & Cyrillic emdash in plain text. \\
+% |\cdash--~| & Cyrillic emdash in compound names (surnames). \\
+% |\cdash--*| & Cyrillic emdash for denoting direct speech. \\
+% |\glqq| & for German left double quotes
+% (looks like,\kern-0.08em,). \\
+% |\grqq| & for German right double quotes (looks like ``).\\%''
+% |\flqq| & for French left double quotes (looks like $<\!\!<$).\\
+% |\frqq| & for French right double quotes (looks like $>\!\!>$).\\
+% |\dq| & the original quotes character (|"|).
+% \end{tabular}
+% \caption{More commands which produce quotes, defined
+% by \babel}\label{tab:bmore-quote}
+% \end{center}
+% \end{table}
+%
+% The French quotes are also available as ligatures `|<<|' and
+% `|>>|' in 8-bit Cyrillic font encodings (\texttt{LCY},
+% \texttt{X2}, \texttt{T2*}) and as `|<|' and `|>|' characters in
+% 7-bit Cyrillic font encodings (\texttt{OT2} and \texttt{LWN}).
+%
+% The quotation marks traditionally used in Bulgarian were borrowed
+% from German o they keep their original names. French quotation
+% marks may be seen as well in older books.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+%
+% \begin{macrocode}
+%<*code>
+\LdfInit{bulgarian}{captionsbulgarian}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{bulgarian} will be an `unknown' language, in
+% which case we have to make it known. So we check for the
+% existence of |\l@bulgarian| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\l@bulgarian\@undefined
+ \@nopatterns{Bulgarian}
+ \adddialect\l@bulgarian0
+\fi
+% \end{macrocode}
+%
+%
+%
+% \begin{macro}{\latinencoding}
+%
+% We need to know the encoding for text that is supposed to be
+% which is active at the end of the \babel\ package. If the
+% \pkg{fontenc} package is loaded later, then \ldots too bad!
+%
+% \begin{macrocode}
+\let\latinencoding\cf@encoding
+% \end{macrocode}
+%
+% \end{macro}
+%
+% The user may choose between different available Cyrillic
+% encodings---e.g., \texttt{X2}, \texttt{LCY}, or \texttt{LWN}.
+% If the user wants to use a font encoding other than the default
+% (\texttt{T2A}), he has to load the corresponding file
+% \emph{before} \file{bulgarian.sty}.
+% This may be done in the following way:
+%
+% \begin{verbatim}
+% \usepackage[LCY,OT1]{fontenc} %overwrite the default encoding;
+% \usepackage[english,bulgarian]{babel}
+% \end{verbatim}
+% \unskip
+%
+% Note: most people would prefer the \texttt{T2A} to \texttt{X2},
+% because \texttt{X2} does not contain Latin letters, and users
+% should be very careful to switch the language every time they
+% want to typeset a Latin word inside a Bulgarian phrase or vice
+% versa. On the other hand, switching the language is a good
+% practice anyway. With a decent text processing program it does
+% not involve more work than switching between the Bulgarian and
+% English keyboard. Moreover that the far most common disruption
+% occurs as a result of forgetting to switch back to cyrillic
+% keyboard.
+%
+% We parse the |\cdp@list| containing the encodings known to
+% \LaTeX\ in the order they were loaded. We set the
+% |\cyrillicencoding| to the \emph{last} loaded encoding in the
+% list of supported Cyrillic encodings: \texttt{OT2}, \texttt{LWN},
+% \texttt{LCY}, \texttt{X2}, \texttt{T2C}, \texttt{T2B},
+% \texttt{T2A}, if any.
+%
+%
+% \begin{macrocode}
+\def\reserved@a#1#2{%
+ \edef\reserved@b{#1}%
+ \edef\reserved@c{#2}%
+ \ifx\reserved@b\reserved@c
+ \let\cyrillicencoding\reserved@c
+ \fi}
+\def\cdp@elt#1#2#3#4{%
+ \reserved@a{#1}{OT2}%
+ \reserved@a{#1}{LWN}%
+ \reserved@a{#1}{LCY}%
+ \reserved@a{#1}{X2}%
+ \reserved@a{#1}{T2C}%
+ \reserved@a{#1}{T2B}%
+ \reserved@a{#1}{T2A}}
+\cdp@list
+% \end{macrocode}
+%
+% Now, if |\cyrillicencoding| is undefined, then the user did not
+% load any of supported encodings. So, we have to set
+% |\cyrillicencoding| to some default value. We test the presence
+% of the encoding definition files in the order from less
+% preferable to more preferable encodings. We use the lowercase
+% names (i.e., \file{lcyenc.def} instead of \file{LCYenc.def}).
+%
+% \begin{macrocode}
+\ifx\cyrillicencoding\undefined
+ \IfFileExists{ot2enc.def}{\def\cyrillicencoding{OT2}}\relax
+ \IfFileExists{lwnenc.def}{\def\cyrillicencoding{LWN}}\relax
+ \IfFileExists{lcyenc.def}{\def\cyrillicencoding{LCY}}\relax
+ \IfFileExists{x2enc.def}{\def\cyrillicencoding{X2}}\relax
+ \IfFileExists{t2cenc.def}{\def\cyrillicencoding{T2C}}\relax
+ \IfFileExists{t2benc.def}{\def\cyrillicencoding{T2B}}\relax
+ \IfFileExists{t2aenc.def}{\def\cyrillicencoding{T2A}}\relax
+% \end{macrocode}
+%
+% If |\cyrillicencoding| is still undefined, then the user seems
+% not to have a properly installed distribution. A fatal error.
+%
+% \begin{macrocode}
+\ifx\cyrillicencoding\undefined
+ \PackageError{babel}%
+ {No Cyrillic encoding definition files were found}%
+ {Your installation is incomplete. \MessageBreak
+ You need at least one of the following files: \MessageBreak
+ \space\space
+ x2enc.def, t2aenc.def, t2benc.def, t2cenc.def, \MessageBreak
+ \space\space
+ lcyenc.def, lwnenc.def, ot2enc.def.}%
+ \else
+% \end{macrocode}
+%
+% We avoid |\usepackage[\cyrillicencoding]{fontenc}| because we
+% don't want to force the switch of |\encodingdefault|.
+%
+% \begin{macrocode}
+ \lowercase
+ \expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{verbatim}
+% \PackageInfo{babel}
+% {Using `\cyrillicencoding' as a default Cyrillic encoding}%
+% \end{verbatim}
+% \unskip
+%
+%
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\Bulgarian}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\bulgarianhyphenmins
+ \language\l@bulgarian}
+\DeclareRobustCommand{\English}{%
+ \fontencoding\latinencoding\selectfont
+ \let\encodingdefault\latinencoding
+ \expandafter\set@hyphenmins\englishhyphenmins
+ \language\l@english}
+\let\Bul\Bulgarian
+\let\Bg\Bulgarian
+\let\cyrillictext\Bulgarian
+\let\cyr\Bulgarian
+\let\Eng\English
+\def\selectenglanguage{\selectlanguage{english}}
+\def\selectbglanguage{\selectlanguage{bulgarian}}
+% \end{macrocode}
+%
+% Since the \texttt{X2} encoding does not contain Latin letters,we
+% should make some redefinitions of \LaTeX\ macros which implicitly
+% produce Latin letters.
+%
+%
+% \begin{macrocode}
+\expandafter\ifx\csname T@X2\endcsname\relax\else
+% \end{macrocode}
+%
+% We put |\latinencoding| in braces to avoid problems with |\@alph|
+% inside minipages (e.g., footnotes inside minipages) where
+% |\@alph| is expanded and we get for example `|\fontencoding OT1|'
+% (|\fontencoding| is robust).
+%
+% \changes{bulgarian-1.0c}{2003/06/14}{Added missing closing brace}
+% \begin{macrocode}
+ \def\@Alph@eng#1{{\fontencoding{\latinencoding}\selectfont
+ \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
+ K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or
+ X\or Y\or Z\else \@ctrerr\fi}}%
+ \def\@alph@eng#1{{\fontencoding{\latinencoding}\selectfont
+ \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
+ k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or
+ x\or y\or z\else \@ctrerr\fi}}%
+ \let\@Alph\@Alph@eng
+ \let\@alph\@alph@eng
+% \end{macrocode}
+%
+% Unfortunately, the commands |\AA| and |\aa| are not encoding
+% dependent in \LaTeX\ (unlike e.g., |\oe| or |\DH|). They are
+% defined as |\r{A}| and |\r{a}|. This leads to unpredictable
+% results when the font encoding does not contain the Latin letters
+% `A' and `a' (like \texttt{X2}).
+%
+% \begin{macrocode}
+ \DeclareTextSymbolDefault{\AA}{OT1}
+ \DeclareTextSymbolDefault{\aa}{OT1}
+ \DeclareTextCommand{\AA}{OT1}{\r A}
+ \DeclareTextCommand{\aa}{OT1}{\r a}
+\fi
+% \end{macrocode}
+%
+% The following block redefines the character class of uppercase
+% Greek letters and some accents, if it is equal to 7 (variable
+% family), to avoid incorrect results if the font encoding in some
+% math family does not contain these characters in places of OT1
+% encoding. The code was taken from |amsmath.dtx|. See comments and
+% further explanation there.
+%
+% \begin{macrocode}
+\begingroup\catcode`\"=12
+% uppercase greek letters:
+\def\@tempa#1{\expandafter\@tempb\meaning#1\relax\relax\relax\relax
+ "0000\@nil#1}
+\def\@tempb#1"#2#3#4#5#6\@nil#7{%
+\ifnum"#2=7 \count@"1#3#4#5\relax
+\ifnum\count@<"1000 \else \global\mathchardef#7="0#3#4#5\relax \fi
+ \fi}
+\@tempa\Gamma\@tempa\Delta\@tempa\Theta\@tempa\Lambda\@tempa\Xi
+\@tempa\Pi\@tempa\Sigma\@tempa\Upsilon\@tempa\Phi\@tempa\Psi
+\@tempa\Omega
+% some accents:
+\def\@tempa#1#2\@nil{\def\@tempc{#1}}\def\@tempb{\mathaccent}
+\expandafter\@tempa\hat\relax\relax\@nil
+\ifx\@tempb\@tempc
+\def\@tempa#1\@nil{#1}%
+\def\@tempb#1{\afterassignment\@tempa\mathchardef\@tempc=}%
+\def\do#1"#2{}
+\def\@tempd#1{\expandafter\@tempb#1\@nil
+ \ifnum\@tempc>"FFF
+ \xdef#1{\mathaccent"\expandafter\do\meaning\@tempc\space}%
+ \fi}
+\@tempd\hat\@tempd\check\@tempd\tilde\@tempd\acute\@tempd\grave
+\@tempd\dot\@tempd\ddot\@tempd\breve\@tempd\bar
+\fi
+\endgroup
+% \end{macrocode}
+%
+% The user should use the \pkg{inputenc} package when any 8-bit
+% Cyrillic font encoding is used, selecting one of the Cyrillic
+% input encodings. We do not assume any default input encoding, so
+% the user should explicitly call the \pkg{inputenc} package by
+% |\usepackage{inputenc}|. We also removed |\AtBeginDocument|, so
+% \pkg{inputenc} should be used before \babel.
+%
+% \begin{macrocode}
+\@ifpackageloaded{inputenc}{}{%
+\def\reserved@a{LWN}%
+\ifx\reserved@a\cyrillicencoding\else
+\def\reserved@a{OT2}%
+\ifx\reserved@a\cyrillicencoding\else
+\PackageWarning{babel}%
+{No input encoding specified for Bulgarian language}\fi\fi}
+% \end{macrocode}
+%
+% Now we define two commands that offer the possibility to switch
+% between Cyrillic and Roman encodings.
+%
+% \begin{macro}{\cyrillictext}
+% \begin{macro}{\latintext}
+%
+% The command |\cyrillictext| will switch from Latin font encoding
+% to the Cyrillic font encoding, the command |\latintext| switches
+% back. This assumes that the `normal' font encoding is a Latin
+% one. These commands are \emph{declarations}, for shorter peaces
+% of text the commands |\textlatin| and |\textcyrillic| can be
+% used.
+%
+% We comment out |\latintext| since it is defined in the core of
+% babel (babel.def). We add the shorthand |\lat| for |\latintext|.
+% Note that |\cyrillictext| has been defined above.
+%
+% \begin{macrocode}
+% \DeclareRobustCommand{\latintext}{%
+% \fontencoding{\latinencoding}\selectfont
+% \def\encodingdefault{\latinencoding}}
+\let\lat\latintext
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\textcyrillic}
+% \begin{macro}{\textlatin}
+%
+% These commands take an argument which is then typeset using the
+% requested font encoding.
+% |\textlatin| is commented out since it is defined in the core of
+% babel. (It is defined there with |\DeclareRobustCommand| instead.)
+%
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+% \DeclareTextFontCommand{\textlatin}{\latintext}
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Bulgarian language.
+%
+% \begin{macro}{\captionsbulgarian}
+%
+% The macro |\captionsbulgarian| defines all strings used in the
+% four standard document classes provided with \LaTeX. The two
+% commands |\cyr| and |\lat| activate Cyrillic resp. Latin encoding.
+%
+% \begin{macrocode}
+\addto\captionsbulgarian{%
+ \def\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrg\cyro\cyrv\cyro\cyrr}}%
+ \def\refname{%
+ {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \def\abstractname{%
+ {\cyr\CYRA\cyrb\cyrs\cyrt\cyrr\cyra\cyrk\cyrt}}%
+ \def\bibname{%
+ {\cyr\CYRB\cyri\cyrb\cyrl\cyri\cyro\cyrg\cyrr\cyra\cyrf\cyri\cyrya}}%
+ \def\chaptername{%
+ {\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre}}%
+ \def\contentsname{%
+ {\cyr\CYRS\cyrhrdsn\cyrd\cyrhrdsn\cyrr\cyrzh\cyra\cyrn\cyri\cyre}}%
+ \def\listfigurename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyrhrdsn\cyrk\ \cyrn\cyra\ \cyrf\cyri\cyrg\cyru\cyrr\cyri\cyrt\cyre}}%
+ \def\listtablename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyrhrdsn\cyrk\ \cyrn\cyra\ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyri\cyrt\cyre}}%
+ \def\indexname{%
+ {\cyr\CYRA\cyrz\cyrb\cyru\cyrch\cyre\cyrn\ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl}}%
+ \def\authorname{%
+ {\cyr\CYRI\cyrm\cyre\cyrn\cyre\cyrn\ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl}}%
+ \def\figurename{%
+ {\cyr\CYRF\cyri\cyrg\cyru\cyrr\cyra}}%
+ \def\tablename{%
+ {\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
+ \def\partname{%
+ {\cyr\CYRCH\cyra\cyrs\cyrt}}%
+ \def\enclname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyrya}}%
+ \def\ccname{%
+ {\cyr\cyrk\cyro\cyrp\cyri\cyrya}}%
+ \def\headtoname{%
+ {\cyr\CYRZ\cyra}}%
+ \def\pagename{%
+ {\cyr\CYRS\cyrt\cyrr.}}%
+ \def\seename{%
+ {\cyr\cyrv\cyrzh.}}%
+ \def\alsoname{%
+ {\cyr\cyrv\cyrzh.\ \cyrs\cyrhrdsn\cyrshch\cyro\ \cyri}}%
+ \def\proofname{Proof}% <-- Needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+%%
+% \begin{macro}{\datebulgarian}
+%
+% The macro |\datebulgarian| redefines the command |\today| to
+% produce Bulgarian dates.
+% It also provides the command |\todayRoman| which produces the
+% date with the month in capital roman numerals, a popular format
+% for dates in Bulgarian.
+%
+% \begin{macrocode}
+\def\datebulgarian{%
+ \def\month@bulgarian{\ifcase\month\or
+ \cyrya\cyrn\cyru\cyra\cyrr\cyri\or
+ \cyrf\cyre\cyrv\cyrr\cyru\cyra\cyrr\cyri\or
+ \cyrm\cyra\cyrr\cyrt\or
+ \cyra\cyrp\cyrr\cyri\cyrl\or
+ \cyrm\cyra\cyrishrt\or
+ \cyryu\cyrn\cyri\or
+ \cyryu\cyrl\cyri\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\or
+ \cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrv\cyrr\cyri\or
+ \cyro\cyrk\cyrt\cyro\cyrm\cyrv\cyrr\cyri\or
+ \cyrn\cyro\cyre\cyrm\cyrv\cyrr\cyri\or
+ \cyrd\cyre\cyrk\cyre\cyrm\cyrv\cyrr\cyri\fi}%
+ \def\month@Roman{\expandafter\@Roman\month}%
+ \def\today{\number\day~\month@bulgarian\ \number\year~\cyrg.}%
+ \def\todayRoman{\number\day.\,\month@Roman.\,\number\year~\cyrg.}%
+}
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\todayRoman}
+%
+% The month is often written with roman numbers in Bulgarian dates.
+% Here we define date in this format:
+%
+% \begin{macrocode}
+\def\Romannumeral#1{\uppercase\expandafter{\romannumeral #1}}
+\def\todayRoman{\number\day.\Romannumeral{\month}.\number\year~\cyrg.}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\extrasbulgarian}
+%
+% The macro |\extrasbulgarian| will perform all the extra
+% definitions needed for the Bulgarian language.
+% The macro |\noextrasbulgarian| is used to cancel the actions of
+% |\extrasbulgarian|.
+%
+% The first action we define is to switch on the selected Cyrillic
+% encoding whenever we enter `bulgarian'.
+%
+% \begin{macrocode}
+\addto\extrasbulgarian{\cyrillictext}
+% \end{macrocode}
+%
+% When the encoding definition file was processed by \LaTeX\ the
+% current font encoding is stored in |\latinencoding|, assuming
+% that \LaTeX\ uses \texttt{T1} or \texttt{OT1} as
+% default. Therefore we switch back to |\latinencoding| whenever
+% the Bulgarian language is no longer `active'.
+%
+% \begin{macrocode}
+\addto\noextrasbulgarian{\latintext}
+% \end{macrocode}
+%
+% For Bulgarian the \texttt{"} character also is made active.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% The code above is necessary because we need extra active
+% characters. The character |"| is used as indicated in
+% table~\ref{tab:bulgarian-quote}. We specify that the Bulgarian
+% group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasbulgarian{\languageshorthands{bulgarian}}
+% \end{macrocode}
+%
+% These characters are `turned on' once, later their definition may
+% vary.
+%
+% \begin{macrocode}
+\addto\extrasbulgarian{%
+ \bbl@activate{"}}
+\addto\noextrasbulgarian{%
+ \bbl@deactivate{"}}
+% \end{macrocode}
+%
+% The \texttt{X2} and \texttt{T2*} encodings do not contain
+% |spanish_shriek| and |spanish_query| symbols; as a consequence,
+% the ligatures `|?`|' and `|!`|' do not work with them (these
+% characters are useless for Cyrillic texts anyway). But we define
+% the shorthands to emulate these ligatures (optionally).
+%
+% We do not use |\latinencoding| here (but instead explicitly use
+% \texttt{OT1}) because the user may choose \texttt{T2A} to be the
+% primary encoding, but it does not contain these characters.
+%
+% \begin{macrocode}
+%<*spanishligs>
+\declare@shorthand{bulgarian}{?`}{\UseTextSymbol{OT1}\textquestiondown}
+\declare@shorthand{bulgarian}{!`}{\UseTextSymbol{OT1}\textexclamdown}
+%</spanishligs>
+% \end{macrocode}
+%
+% To be able to define the function of `|"|', we first define a
+% couple of `support' macros.
+%
+% \begin{macro}{\dq}
+%
+% We save the original double quote character in |\dq| to keep it
+% available, the math accent |\"|can now be typed as `|"|'.
+% \changes{bulgarian-1.0c}{2003/04/10}{repaired typo}
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019}
+ \def\dq{"}}
+\reserved@a
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Now we can define the doublequote macros: german and french
+% quotes. We use definitions of these quotes made in babel.sty.
+% The french quotes are contained in the \texttt{T2*} encodings.
+%
+% \begin{macrocode}
+\declare@shorthand{bulgarian}{"`}{\glqq}
+\declare@shorthand{bulgarian}{"'}{\grqq}
+\declare@shorthand{bulgarian}{"<}{\flqq}
+\declare@shorthand{bulgarian}{">}{\frqq}
+% \end{macrocode}
+%
+% Some additional commands:
+%
+% \begin{macrocode}
+\declare@shorthand{bulgarian}{""}{\hskip\z@skip}
+\declare@shorthand{bulgarian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{bulgarian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{bulgarian}{"|}{%
+\textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+\allowhyphens}{}}
+% \end{macrocode}
+%
+% The next two macros for |"-| and |"---| are somewhat different.
+% We must check whether the second token is a hyphen character:
+%
+% \begin{macrocode}
+\declare@shorthand{bulgarian}{"-}{%
+% \end{macrocode}
+%
+% If the next token is `|-|', we typeset an emdash, otherwise a
+% hyphen sign:
+%
+% \begin{macrocode}
+ \def\bulgarian@sh@tmp{%
+ \if\bulgarian@sh@next-\expandafter\bulgarian@sh@emdash
+ \else\expandafter\bulgarian@sh@hyphen\fi
+ }%
+% \end{macrocode}
+%
+% \TeX\ looks for the next token after the first `|-|': the meaning
+% of this token is written to |\bulgarian@sh@next| and
+% |\bulgarian@sh@tmp| is called.
+%
+% \begin{macrocode}
+ \futurelet\bulgarian@sh@next\bulgarian@sh@tmp}
+% \end{macrocode}
+%
+% Here are the definitions of hyphen and emdash. First the hyphen:
+%
+% \begin{macrocode}
+\def\bulgarian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
+% \end{macrocode}
+%
+% For the emdash definition, there are the two parameters: we must
+% `eat' two last hyphen signs of our emdash \dots :
+%
+% \begin{macrocode}
+\def\bulgarian@sh@emdash#1#2{\cdash-#1#2}
+% \end{macrocode}
+%
+% \begin{macro}{\cdash}
+%
+% \dots\ these two parameters are useful for another macro:
+% |\cdash|:
+%
+% \begin{macrocode}
+\ifx\cdash\undefined % should be defined earlier
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def empb@{~}\def empc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+% \end{macrocode}
+%
+% second parameter (or third for |\cdash|) shows what kind of emdash
+% to create in next step
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"---| & ordinary (plain) Cyrillic emdash inside text:
+% an unbreakable thinspace will be inserted before only in case of
+% a \textit{space} before the dash (it is necessary for dashes after
+% display maths formulae: there could be lists, enumerations etc.\
+% started with ``---where $a$ is ...'' i.e., the dash starts a line).
+% (Firstly there were planned rather soft rules for user:he may put
+% a space before the dash or not. But it is difficult to place this
+% thinspace automatically, i.e., by checking modes because after
+% display formulae \TeX{} uses horizontal mode. Maybe there is a
+% misunderstanding? Maybe there is another way?) After a dash
+% a breakable thinspace is always placed; \\
+% \end{tabular}
+% \end{center}
+%
+%
+% \begin{macrocode}
+% What is more grammatically: .2em or .2\fontdimen6\font?
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+\cyrdash\hskip.2em\ignorespaces}%
+% \end{macrocode}
+%
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--~| & emdash in compound names or surnames
+% (like Mendeleev--Klapeiron); this dash has no space characters
+% around; after the dash some space is added
+% |\exhyphenalty| \\
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+% \end{macrocode}
+%
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--*| & for denoting direct speech (a space like |\enskip|
+% must follow the emdash); \\
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+%\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\cyrdash}
+%
+% Finally the macro for ``body'' of the Cyrillic emdash.
+% The |\cyrdash| macro will be defined in case this macro hasn't
+% been defined in a fontenc file. For T2*fonts, cyrdash will be
+% placed in the code of the English emdash thus it uses ligature
+% |---|.
+%
+% \begin{macrocode}
+% Is there an IF necessary?
+\ifx\cyrdash\undefined
+\def\cyrdash{\hbox to.8em{--\hss--}}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Here a really new macro---to place thinspace between initials.
+% This macro used instead of |\,| allows hyphenation in the
+% following surname.
+%
+% \begin{macrocode}
+\declare@shorthand{bulgarian}{",}{\nobreak\hskip.2em\ignorespaces}
+% \end{macrocode}
+%
+% The Bulgarian hyphenation patterns can be used with
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{bulgarian-1.0b}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\fi
+% \end{macrocode}
+%
+% Now the action |\extrasbulgarian| has to execute is to make sure
+% that the command |\frenchspacing| is in effect. If this is not
+% the case the execution of |\noextrasbulgarian| will switch it off
+% again.
+%
+% \begin{macrocode}
+\addto\extrasbulgarian{\bbl@frenchspacing}
+\addto\noextrasbulgarian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% Make the double quotes produce the traditional quotes
+% used in Bulgarian texts (these are the German quotes).
+%
+% \begin{macrocode}
+% \initiate@active@char{`}
+% \initiate@active@char{'}
+% \addto\extrasbulgarian{%
+% \bbl@activate{`}}
+% \addto\extrasbulgarian{%
+% \bbl@activate{'}}
+% \addto\noextrasbulgarian{%
+% \bbl@deactivate{`}}
+% \addto\noextrasbulgarian{%
+% \bbl@deactivate{'}}
+% \def\mlron{\bbl@activate{`}\bbl@activate{'}}
+% \def\mlroff{\bbl@deactivate{`}\bbl@deactivate{'}}
+% \declare@shorthand{bulgarian}{``}{\glqq}
+% \declare@shorthand{bulgarian}{''}{\grqq}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Next we add a new enumeration style for Bulgarian manuscripts with
+% Cyrillic letters,and later on we define some math operator names in
+% accordance with Bulgarian typesetting traditions.
+%
+% \begin{macro}{\@Alph@bul}
+%
+% We begin by defining |\@Alph@bul| which works like |\@Alph|, but
+% produces (uppercase) Cyrillic letters intead of Latin ones. The
+% letters ISHRT, HRDSN and SFTSN are skipped, as usual for such
+% enumeration.
+%
+% \begin{macrocode}
+\def\enumBul{\let\@Alph\@Alph@bul \let\@alph\@alph@bul}
+\def\enumEng{\let\@Alph\@Alph@eng \let\@alph\@alph@eng}
+\def\enumLat{\let\@Alph\@Alph@eng \let\@alph\@alph@eng}
+\addto\extrasbulgarian{\enumBul}
+\addto\noextrasbulgarian{\enumLat}
+\def\@Alph@bul#1{%
+ \ifcase#1\or
+ \CYRA\or \CYRB\or \CYRV\or \CYRG\or \CYRD\or \CYRE\or \CYRZH\or
+ \CYRZ\or \CYRI\or \CYRK\or \CYRL\or \CYRM\or \CYRN\or \CYRO\or
+ \CYRP\or \CYRR\or \CYRS\or \CYRT\or \CYRU\or \CYRF\or \CYRH\or
+ \CYRC\or \CYRCH\or \CYRSH\or \CYRSHCH\or \CYRYU\or \CYRYA\else
+ \@ctrerr\fi
+ }
+\def\@Alph@eng#1{%
+ \ifcase#1\or
+ A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M\or
+ N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\else
+ \@ctrerr\fi
+ }
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\@alph@bul}
+%
+% The macro |\@alph@bul| is similar to |\@Alph@bul|;
+% it produces lowercase Bulgarian letters.
+%
+% \begin{macrocode}
+\def\@alph@bul#1{%
+ \ifcase#1\or
+ \cyra\or \cyrb\or \cyrv\or \cyrg\or \cyrd\or \cyre\or \cyrzh\or
+ \cyrz\or \cyri\or \cyrk\or \cyrl\or \cyrm\or \cyrn\or \cyro\or
+ \cyrp\or \cyrr\or \cyrs\or \cyrt\or \cyru\or \cyrf\or \cyrh\or
+ \cyrc\or \cyrch\or \cyrsh\or \cyrshch\or \cyryu\or \cyrya\else
+ \@ctrerr\fi
+ }
+\def\@alph@eng#1{%
+ \ifcase#1\or
+ a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m\or
+ n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else
+ \@ctrerr\fi
+ }
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Set up default Cyrillic math alphabets. To use Cyrillic letters
+% in math mode user should load the |textmath| package
+% \emph{before} loading fontenc package (or \babel). Note,that by
+% default Cyrillic letters are taken from upright font in math mode
+% (unlike Latin letters).
+%
+% \begin{macrocode}
+%\RequirePackage{textmath}
+\@ifundefined{sym\cyrillicencoding letters}{}{%
+\SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
+ \rmdefault\bfdefault\updefault
+\DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}
+% \end{macrocode}
+%
+% And we need a few commands to be able to switch to different
+% variants.
+%
+% \begin{macrocode}
+\DeclareMathAlphabet\cyrmathbf\cyrillicencoding
+ \rmdefault\bfdefault\updefault
+\DeclareMathAlphabet\cyrmathsf\cyrillicencoding
+ \sfdefault\mddefault\updefault
+\DeclareMathAlphabet\cyrmathit\cyrillicencoding
+ \rmdefault\mddefault\itdefault
+\DeclareMathAlphabet\cyrmathtt\cyrillicencoding
+ \ttdefault\mddefault\updefault
+\SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
+ \sfdefault\bfdefault\updefault
+\SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
+ \rmdefault\bfdefault\itdefault
+}
+% \end{macrocode}
+%
+% Some math functions in Bulgarian math books have other names:
+% e.g., \texttt{sinh} in Bulgarian is written as \texttt{sh}
+% etc. So we define a number of new math operators.
+%
+% |\sinh|:
+%
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+% \end{macrocode}
+%
+% |\cosh|:
+%
+% \begin{macrocode}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+% \end{macrocode}
+%
+% |\tan|:
+%
+% \begin{macrocode}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+% \end{macrocode}
+%
+% |\arctan|:
+%
+% \begin{macrocode}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+% \end{macrocode}
+%
+% |\arccot|:
+%
+% \begin{macrocode}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+% \end{macrocode}
+%
+% The following macro conflicts with |\th| defined in Latin~1
+% encoding:
+% |\tanh|:
+% \changes{bulgarian-1.0d}{2004/05/21}{Change definition of \cs{th}
+% only for this language}
+% \begin{macrocode}
+\addto\extrasrussian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+% \end{macrocode}
+%
+% |\cot|:
+%
+% \begin{macrocode}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+% \end{macrocode}
+%
+% |\coth|:
+%
+% \begin{macrocode}
+\def\cth{\mathop{\operator@font cth}\nolimits}
+% \end{macrocode}
+%
+% |\csc|:
+%
+% \begin{macrocode}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+% \end{macrocode}
+%
+% This is for compatibility with older Bulgarian packages.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\No}{%
+ \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a configuration
+% file, setting the main language to be switched on at
+% |\begin{document}| and resetting the category code of \texttt{@}
+% to its original value.
+%
+% \begin{macrocode}
+\ldf@finish{bulgarian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/bulgarian.ins b/Master/texmf-dist/source/generic/babel/bulgarian.ins
new file mode 100644
index 00000000000..85fa800211d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/bulgarian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2000/09/21}
+\def\batchfile{bulgarian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{bulgarian.ldf}{\from{bulgarian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/babel/catalan.dtx b/Master/texmf-dist/source/generic/babel/catalan.dtx
new file mode 100644
index 00000000000..b8185af4df8
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/catalan.dtx
@@ -0,0 +1,712 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{517}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{catalan.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{catalan}
+%\fi
+%\ProvidesFile{catalan.dtx}
+ [2005/03/29 v2.2p Catalan support from the babel system]
+%\iffalse
+%% File `catalan.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Catalan Language Definition File
+%% Copyright (C) 1991 - 2005
+%% by Goncal Badenes <badenes at imec.be>
+%% Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams babel at braams.cistron.nl
+%%
+% This file is part of the babel system, it provides the source
+% code for the Catalan language definition file.
+% This file was developped out of spanish.sty and suggestions by
+% Goncal Badenes <badenes at imec.be> and Joerg Knappen
+% <knappen at vkpmzd.kph.uni-mainz.de>.
+%
+% The file spanish.sty was written by Julio Sanchez,
+% (jsanchez@gmv.es) The code for the catalan language has been
+% removed and now is in this file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{catalan.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{catalan.dtx}
+%
+% \changes{catalan-2.0b}{1993/09/23}{Incorporated the changes from
+% \file{spanish.sty}}
+% \changes{catalan-2.1}{1994/02/27}{Update for \LaTeXe}
+% \changes{catalan-2.1d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{catalan-2.2b}{1995/07/04}{Made the activation of the grave
+% and acute accents optional}
+% \changes{catalan-2.2c}{1995/07/08}{Removed the use of the tilde for
+% catalan}
+% \changes{catalan-2.2f}{1996/07/13}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{catalan-2.2g}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+% \changes{catalan-2.2k}{1999/05/05}{A wrong \cs{changes} entry made
+% typesetting impossible}
+%
+% \section{The Catalan language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language-specific macro's for the
+% Catalan language.
+%
+% For this language only the double quote character (|"|) is made
+% active by default. In table~\ref{tab:catalan-quote-def} an
+% overview is given of the new macros defined and the new meanings
+% of |"|. Additionally to that, the user can explicitly activate
+% the acute accent or apostrophe (|'|) and/or the grave accent
+% (|`|) characters by using the \Lopt{activeacute} and
+% \Lopt{activegrave} options. In that case, the definitions shown
+% in table~\ref{tab:catalan-quote-opt} also become
+% available\footnote{Please note that if the acute accent character
+% is active, it is necessary to take special care of coding
+% apostrophes in a way which cannot be confounded with
+% accents. Therefore, it is necessary to type \texttt{l'\{\}estri}
+% instead of \texttt{l'estri}.}.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |\l.l| & geminated-l digraph (similar to
+% l$\cdot$l). |\L.L| produces the uppercase version.\\
+% |\lgem| & geminated-l digraph (similar to
+% l$\cdot$l). |\Lgem| produces the uppercase version.\\
+% |\up| & Macro to help typing raised ordinals, like {1\raise
+% 1ex\hbox{\small er}}. Takes one argument.\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% |"i| & i with diaeresis, allowing hyphenation
+% in the rest of the word. Valid for the following vowels:
+% i, u (both lowercase and uppercase).\\
+% |"c| & c-cedilla (\c{c}). Valid for both uppercase and
+% lowercase c.\\
+% |"l| & geminated-l digraph (similar to
+% l$\cdot$l). Valid for both uppercase and lowercase l.\\
+% |"<| & French left double quotes (similar to $<<$).\\
+% |">| & French right double quotes (similar to $>>$).\\
+% |"-| & explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% \verb="|= & disable ligature at this position.
+% \end{tabular}
+% \caption{Extra definitions made by file \file{catalan.ldf}
+% (activated by default)}
+% \label{tab:catalan-quote-def}
+% \end{table}
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |'e| & acute accented a, allowing hyphenation
+% in the rest of the word. Valid for the following
+% vowels: e, i, o, u (both lowercase and uppercase).\\
+% |`a| & grave accented a, allowing hyphenation
+% in the rest of the word. Valid for the following
+% vowels: a, e, o (both lowercase and uppercase).
+% \end{tabular}
+% \caption{Extra definitions made by file \file{catalan.ldf}
+% (activated only when using the options \Lopt{activeacute} and
+% \Lopt{activegrave})}
+% \label{tab:catalan-quote-opt}
+% \end{table}
+% These active accents characters behave according to their original
+% definitions if not followed by one of the characters indicated in
+% that table.
+%
+% \StopEventually{}
+%
+% \changes{catalan-2.0}{1993/07/11}{Removed code to load
+% \file{latexhax.com}}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{catalan-2.2g}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{catalan}\captionscatalan
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{catalan} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@catalan| to see whether we have to do something here.
+%
+% \changes{catalan-2.1d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@catalan\@undefined
+ \@nopatterns{Catalan}
+ \adddialect\l@catalan0
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Catalan language.
+%
+% \begin{macro}{\catalanhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{catalan-2.2n}{2001/02/19}{Set the hyphenation parameters
+% both to two as required by \texttt{cahyph.tex}}
+% \begin{macrocode}
+\providehyphenmins{catalan}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionscatalan}
+% The macro |\captionscatalan| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{catalan-1.1}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{catalan-2.0}{1993/07/11}{Added some names}
+% \changes{catalan-2.1d}{1994/11/09}{Added a few missing translations}
+% \changes{catalan-2.2b}{1995/07/03}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{catalan-2.2d}{1995/07/10}{added translation of Proof}
+% \changes{catalan-2.2d}{1995/11/15}{Translations revised}
+% \changes{catalan-2.2m}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{catalan-2.2p}{2003/11/17}{Inserted translation for
+% Glossary}
+% \begin{macrocode}
+\addto\captionscatalan{%
+ \def\prefacename{Pr\`oleg}%
+ \def\refname{Refer\`encies}%
+ \def\abstractname{Resum}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Cap\'{\i}tol}%
+ \def\appendixname{Ap\`endix}%
+ \def\contentsname{\'Index}%
+ \def\listfigurename{\'Index de figures}%
+ \def\listtablename{\'Index de taules}%
+ \def\indexname{\'Index alfab\`etic}%
+ \def\figurename{Figura}%
+ \def\tablename{Taula}%
+ \def\partname{Part}%
+ \def\enclname{Adjunt}%
+ \def\ccname{C\`opies a}%
+ \def\headtoname{A}%
+ \def\pagename{P\`agina}%
+ \def\seename{Vegeu}%
+ \def\alsoname{Vegeu tamb\'e}%
+ \def\proofname{Demostraci\'o}%
+ \def\glossaryname{Glossari}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datecatalan}
+% The macro |\datecatalan| redefines the command |\today| to
+% produce Catalan dates. Months are written in
+% lowercase\footnote{This seems to be the common practice. See for
+% example: E.~Coromina, \emph{El 9 Nou: Manual de redacci\'o i
+% estil}, Ed.~Eumo, Vic, 1993}.
+% \changes{catalan-2.2b}{1995/06/18}{Month names in lowercase}
+% \changes{catalan-2.2i}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{catalan-2.2i}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\datecatalan{%
+ \def\today{\number\day~\ifcase\month\or
+ de gener\or de febrer\or de mar\c{c}\or d'abril\or de maig\or
+ de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or
+ de novembre\or de desembre\fi
+ \space de~\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrascatalan}
+% \changes{catalan-2.0}{1993/07/11}{Macro completely rewritten}
+% \changes{catalan-2.2a}{1995/03/11}{Handling of active characters
+% completely rewritten}
+%
+% \begin{macro}{\noextrascatalan}
+% \changes{catalan-2.0}{1993/07/11}{Macro completely rewritten}
+%
+% The macro |\extrascatalan| will perform all the extra definitions
+% needed for the Catalan language. The macro |\noextrascatalan| is
+% used to cancel the actions of |\extrascatalan|.
+%
+% \changes{catalan-2.2e}{1995/11/10}{Now give the apostrophe a
+% lowercase code}
+% To improve hyphenation we give the grave character (\texttt{'}) a
+% non-zero lower case code; when we do that \TeX\ will find more
+% breakpoints in words that contain this character in its r\^ole as
+% apostrophe.
+% \begin{macrocode}
+\addto\extrascatalan{%
+ \lccode`'=`'}
+\addto\noextrascatalan{%
+ \lccode`'=0}
+% \end{macrocode}
+%
+% For Catalan, some characters are made active or are redefined. In
+% particular, the \texttt{"} character receives a new meaning; this
+% can also happen for the \texttt{'} character and the \texttt{`}
+% character when the options \Lopt{activegrave} and/or
+% \Lopt{activeacute} are specified.
+%
+% \changes{catalan-2.2b}{1995/07/07}{Make activating the accent
+% characters optional}
+% \changes{catalan-2.2e}{1995/08/17}{Need to split up the
+% \cs{@ifpackagewith} statements}
+% \begin{macrocode}
+\addto\extrascatalan{\languageshorthands{catalan}}
+\initiate@active@char{"}
+\addto\extrascatalan{\bbl@activate{"}}
+% \end{macrocode}
+% Because the grave character is being used in constructs such as
+% |\catcode``=\active| it needs to have it's original category code%''
+% when the auxiliary file is being read. Note that this file is
+% read twice, once at the beginning of the document; then there is
+% no problem; but the second time it is read at the end of the
+% document to check whether any labels changes. It's this second
+% time round that the actived grave character leads to error
+% messages.
+% \changes{catalan-2.2l}{1999/11/29}{Make sure that the grave accent
+% has catcode 12 \emph{before} it is made \cs{active}}
+% \begin{macrocode}
+\@ifpackagewith{babel}{activegrave}{%
+ \AtBeginDocument{%
+ \if@filesw\immediate\write\@auxout{\catcode096=12}\fi}
+ \initiate@active@char{`}%
+ }{}
+\@ifpackagewith{babel}{activegrave}{%
+ \addto\extrascatalan{\bbl@activate{`}}%
+ }{}
+\@ifpackagewith{babel}{activeacute}{%
+ \initiate@active@char{'}%
+ }{}
+\@ifpackagewith{babel}{activeacute}{%
+ \addto\extrascatalan{\bbl@activate{'}}%
+ }{}
+% \end{macrocode}
+% Now make sure that the characters that have been turned into
+% shorthanfd characters expand to `normal' characters outside the
+% catalan environment.
+% \changes{catalan-2.2l}{1999/12/16}{Don't forget do deactivate the
+% shorthands}
+% \begin{macrocode}
+\addto\noextrascatalan{\bbl@deactivate{"}}
+\@ifpackagewith{babel}{activegrave}{%
+ \addto\noextrascatalan{\bbl@deactivate{`}}}{}
+\@ifpackagewith{babel}{activeacute}{%
+ \addto\noextrascatalan{\bbl@deactivate{'}}}{}
+% \end{macrocode}
+%
+% \changes{catalan-2.2a}{1995/03/11}{All the code for handling active
+% characters is now moved to \file{babel.def}}
+%
+% Apart from the active characters some other macros get a new
+% definition. Therefore we store the current ones to be able
+% to restore them later.
+% When their current meanings are saved, we can safely redefine
+% them.
+%
+% We provide new definitions for the accent macros when one or
+% both of the options \Lopt{activegrave} or \Lopt{activeacute}
+% were specified.
+%
+% \changes{catalan-2.2h}{1997/01/08}{Added some comment signs to
+% prevent unwanted spaces in the output}
+% \begin{macrocode}
+\addto\extrascatalan{%
+ \babel@save\"%
+ \def\"{\protect\@umlaut}}%
+\@ifpackagewith{babel}{activegrave}{%
+ \babel@save\`%
+ \addto\extrascatalan{\def\`{\protect\@grave}}
+ }{}
+\@ifpackagewith{babel}{activeacute}{%
+ \babel@save\'%
+ \addto\extrascatalan{\def\'{\protect\@acute}}
+ }{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% All the code above is necessary because we need a few extra
+% active characters. These characters are then used as indicated in
+% tables~\ref{tab:catalan-quote-def}
+% and~\ref{tab:catalan-quote-opt}.
+%
+% \begin{macro}{\dieresis}
+% \begin{macro}{\textacute}
+% \changes{catalan-2.1d}{1994/06/26}{Renamed from \cs{acute} as that
+% is a \cs{mathaccent}}
+% \begin{macro}{\textgrave}
+%
+% The original definition of |\"| is stored as |\dieresis|, because
+% the definition of |\"| might not be the default plain \TeX\
+% one. If the user uses \textsc{PostScript} fonts with the Adobe
+% font encoding the \texttt{"} character is not in the same
+% position as in Knuth's font encoding. In this case |\"| will not
+% be defined as |\accent"7F 1|, but as |\accent'310 #1|. Something
+% similar happens when using fonts that follow the Cork
+% encoding. For this reason we save the definition of |\"| and use
+% that in the definition of other macros. We do likewise for |\`|,
+% and |\'|.
+% \begin{macrocode}
+\let\dieresis\"
+\@ifpackagewith{babel}{activegrave}{\let\textgrave\`}{}
+\@ifpackagewith{babel}{activeacute}{\let\textacute\'}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@umlaut}
+% \begin{macro}{\@acute}
+% \begin{macro}{\@grave}
+% We check the encoding and if not using T1, we make the accents
+% expand but enabling hyphenation beyond the accent. If this is the
+% case, not all break positions will be found in words that contain
+% accents, but this is a limitation in \TeX. An unsolved problem
+% here is that the encoding can change at any time. The definitions
+% below are made in such a way that a change between two 256-char
+% encodings are supported, but changes between a 128-char and a
+% 256-char encoding are not properly supported. We check if T1 is
+% in use. If not, we will give a warning and proceed redefining the
+% accent macros so that \TeX{} at least finds the breaks that are
+% not too close to the accent. The warning will only be printed to
+% the log file.
+%
+% \begin{macrocode}
+\ifx\DeclareFontShape\@undefined
+ \wlog{Warning: You are using an old LaTeX}
+ \wlog{Some word breaks will not be found.}
+ \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
+ \@ifpackagewith{babel}{activeacute}{%
+ \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
+ \@ifpackagewith{babel}{activegrave}{%
+ \def\@grave#1{\allowhyphens\textgrave{#1}\allowhyphens}}{}
+\else
+ \ifx\f@encoding\bbl@t@one
+ \let\@umlaut\dieresis
+ \@ifpackagewith{babel}{activeacute}{%
+ \let\@acute\textacute}{}
+ \@ifpackagewith{babel}{activegrave}{%
+ \let\@grave\textgrave}{}
+ \else
+ \wlog{Warning: You are using encoding \f@encoding\space
+ instead of T1.}
+ \wlog{Some word breaks will not be found.}
+ \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
+ \@ifpackagewith{babel}{activeacute}{%
+ \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
+ \@ifpackagewith{babel}{activegrave}{%
+ \def\@grave#1{\allowhyphens\textgrave{#1}\allowhyphens}}{}
+ \fi
+\fi
+% \end{macrocode}
+% If the user setup has extended fonts, the Ferguson macros are
+% required to be defined. We check for their existance and, if
+% defined, expand to whatever they are defined to. For instance,
+% |\'a| would check for the existance of a |\@ac@a| macro. It is
+% assumed to expand to the code of the accented letter. If it is
+% not defined, we assume that no extended codes are available and
+% expand to the original definition but enabling hyphenation beyond
+% the accent. This is as best as we can do. It is better if you
+% have extended fonts or ML-\TeX{} because the hyphenation
+% algorithm can work on the whole word. The following macros are
+% directly derived from ML-\TeX{}.\footnote{A problem is perceived
+% here with these macros when used in a multilingual environment
+% where extended hyphenation patterns are available for some but
+% not all languages. Assume that no extended patterns exist at some
+% site for French and that \file{french.sty} would adopt this
+% scheme too. In that case, \mbox{\texttt{'e}} in French would
+% produce the combined accented letter, but hyphenation around it
+% would be suppressed. Both language options would need an
+% independent method to know whether they have extended patterns
+% available. The precise impact of this problem and the possible
+% solutions are under study.}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{catalan-2.2a}{1995/03/14}{All the code to deal with active
+% characters is now in \file{babel.def}}
+%
+% Now we can define our shorthands: the diaeresis and ``ela
+% geminada'' support,
+% \begin{macrocode}
+\declare@shorthand{catalan}{"i}{\textormath{\@umlaut\i}{\ddot\imath}}
+\declare@shorthand{catalan}{"l}{\lgem{}}
+\declare@shorthand{catalan}{"u}{\textormath{\@umlaut u}{\ddot u}}
+\declare@shorthand{catalan}{"I}{\textormath{\@umlaut I}{\ddot I}}
+\declare@shorthand{catalan}{"L}{\Lgem{}}
+\declare@shorthand{catalan}{"U}{\textormath{\@umlaut U}{\ddot U}}
+% \end{macrocode}
+% cedille,
+% \changes{catalan-2.2c}{1995/07/08}{cedile now produced by double
+% quote shorthand}
+% \begin{macrocode}
+\declare@shorthand{catalan}{"c}{\textormath{\c c}{^{\prime} c}}
+\declare@shorthand{catalan}{"C}{\textormath{\c C}{^{\prime} C}}
+% \end{macrocode}
+% `french' quote characters,
+% \changes{catalan-2.2c}{1995/07/08}{Added shorthands for guillemets}
+% \changes{catalan-2.2i}{1997/04/03}{Removed empty groups after
+% guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{catalan}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{catalan}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% grave accents,
+% \changes{catalan-2.2e}{1996/03/05}{Added `{}` as an axtra shorthand}
+% \begin{macrocode}
+\@ifpackagewith{babel}{activegrave}{%
+ \declare@shorthand{catalan}{`a}{\textormath{\@grave a}{\grave a}}
+ \declare@shorthand{catalan}{`e}{\textormath{\@grave e}{\grave e}}
+ \declare@shorthand{catalan}{`o}{\textormath{\@grave o}{\grave o}}
+ \declare@shorthand{catalan}{`A}{\textormath{\@grave A}{\grave A}}
+ \declare@shorthand{catalan}{`E}{\textormath{\@grave E}{\grave E}}
+ \declare@shorthand{catalan}{`O}{\textormath{\@grave O}{\grave O}}
+ \declare@shorthand{catalan}{``}{\textquotedblleft}%''
+ }{}
+% \end{macrocode}
+% acute accents,
+% \changes{catalan-2.2b}{1995/07/03}{Changed mathmode definition of
+% acute shorthands to expand to a single prime followed by the next
+% character in the input}
+% \changes{catalan-2.2e}{1995/09/05}{Added vertical bar as argument to
+% active acute}
+% \begin{macrocode}
+\@ifpackagewith{babel}{activeacute}{%
+ \declare@shorthand{catalan}{'a}{\textormath{\@acute a}{^{\prime} a}}
+ \declare@shorthand{catalan}{'e}{\textormath{\@acute e}{^{\prime} e}}
+ \declare@shorthand{catalan}{'i}{\textormath{\@acute\i{}}{^{\prime} i}}
+ \declare@shorthand{catalan}{'o}{\textormath{\@acute o}{^{\prime} o}}
+ \declare@shorthand{catalan}{'u}{\textormath{\@acute u}{^{\prime} u}}
+ \declare@shorthand{catalan}{'A}{\textormath{\@acute A}{^{\prime} A}}
+ \declare@shorthand{catalan}{'E}{\textormath{\@acute E}{^{\prime} E}}
+ \declare@shorthand{catalan}{'I}{\textormath{\@acute I}{^{\prime} I}}
+ \declare@shorthand{catalan}{'O}{\textormath{\@acute O}{^{\prime} O}}
+ \declare@shorthand{catalan}{'U}{\textormath{\@acute U}{^{\prime} U}}
+ \declare@shorthand{catalan}{'|}{%
+ \textormath{\csname normal@char\string'\endcsname}{^{\prime}}}
+% \end{macrocode}
+% the acute accent,
+% \changes{catalan-2.2c}{1995/07/08}{Added '{}' as an axtra shorthand,
+% removed 'n as a shorthand}
+% \begin{macrocode}
+ \declare@shorthand{catalan}{''}{%
+ \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
+ }{}
+% \end{macrocode}
+% and finally, some support definitions
+% \begin{macrocode}
+\declare@shorthand{catalan}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{catalan}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+% \end{macrocode}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% unfortunate for Catalan but not as much as for Dutch or German,
+% where long compound words are quite normal and all one needs is a
+% means to indicate an extra hyphenation position on top of the
+% ones that \TeX\ can generate from the hyphenation
+% patterns. However, the average length of words in Catalan makes
+% this desirable and so it is kept here.
+%
+% \begin{macrocode}
+\addto\extrascatalan{%
+ \babel@save{\-}%
+ \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lgem}
+% \begin{macro}{\Lgem}
+% \changes{catalan-2.2b}{1995/06/18}{Added support for typing the
+% catalan ``ela geminada'' with the macros \cs{lgem} and \cs{Lgem}}
+% \changes{catalan-2.2f}{1996/09/20}{Added a check for math mode as
+% the use of \cs{lgem} and \cs{Lgem} in math mode is not sensible.}
+%
+% Here we define a macro for typing the catalan ``ela geminada''
+% (geminated l). The macros |\lgem| and |\Lgem| have been chosen
+% for its lowercase and uppercase representation,
+% respectively\footnote{The macro names \cs{ll} and \cs{LL} were
+% not taken because of the fact that \cs{ll} is already used in
+% mathematical mode.}.
+%
+% The code used in the actual macro used is a combination of the
+% one proposed by Feruglio and Fuster\footnote{G.~Valiente and
+% R.~Fuster, Typesetting Catalan Texts with \TeX, \emph{TUGboat}
+% \textbf{14}(3), 1993.} and the proposal\footnote{G. Valiente,
+% Modern Catalan Typographical Conventions, \emph{TUGboat}
+% \textbf{16}(3), 1995.} from Valiente presented at the \TeX\ Users
+% Group Annual Meeting in 1995. This last proposal has not been
+% fully implemented due to its limitation to CM fonts.
+% \begin{macrocode}
+\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
+\def\lgem{%
+ \ifmmode
+ \csname normal@char\string"\endcsname l%
+ \else
+ \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
+ \setbox0\hbox{l}\setbox1\hbox{l\/}\setbox2\hbox{.}%
+ \advance\raiselldim by \the\fontdimen5\the\font
+ \advance\raiselldim by -\ht2%
+ \leftllkern=-.25\wd0%
+ \advance\leftllkern by \wd1%
+ \advance\leftllkern by -\wd0%
+ \rightllkern=-.25\wd0%
+ \advance\rightllkern by -\wd1%
+ \advance\rightllkern by \wd0%
+ \allowhyphens\discretionary{l-}{l}%
+ {\hbox{l}\kern\leftllkern\raise\raiselldim\hbox{.}%
+ \kern\rightllkern\hbox{l}}\allowhyphens
+ \fi
+ }
+\def\Lgem{%
+ \ifmmode
+ \csname normal@char\string"\endcsname L%
+ \else
+ \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
+ \setbox0\hbox{L}\setbox1\hbox{L\/}\setbox2\hbox{.}%
+ \advance\raiselldim by .5\ht0%
+ \advance\raiselldim by -.5\ht2%
+ \leftllkern=-.125\wd0%
+ \advance\leftllkern by \wd1%
+ \advance\leftllkern by -\wd0%
+ \rightllkern=-\wd0%
+ \divide\rightllkern by 6%
+ \advance\rightllkern by -\wd1%
+ \advance\rightllkern by \wd0%
+ \allowhyphens\discretionary{L-}{L}%
+ {\hbox{L}\kern\leftllkern\raise\raiselldim\hbox{.}%
+ \kern\rightllkern\hbox{L}}\allowhyphens
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\l.l}
+% \begin{macro}{\L.L}
+% \changes{catalan-2.2e}{1996/06/26}{Added redefinition of \cs{l} and
+% \cs{L}}
+% It seems to be the most natural way of entering the ``ela
+% geminda'' to use the sequences |\l.l| and |\L.L|. These are not
+% really macro's by themselves but the macros |\l| and |\L| with
+% delimited arguments. Therefor we define two macros that check if
+% the next character is a period. If not the ``polish l'' will be
+% typeset, otherwise a ``ela geminada'' will be typeset and the
+% next two tokens will be `eaten'.
+% \changes{catalan-2.2o}{2003/09/19}{Postpone the redefinition of
+% \cs{l} and \cs{L} until begin document to prevent overwriting by
+% fontenc}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \let\lslash\l
+ \let\Lslash\L
+ \DeclareRobustCommand\l{\@ifnextchar.\bbl@l\lslash}
+ \DeclareRobustCommand\L{\@ifnextchar.\bbl@L\Lslash}}
+\def\bbl@l#1#2{\lgem}
+\def\bbl@L#1#2{\Lgem}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\up}
+%
+% A macro for typesetting things like 1\raise1ex\hbox{\small er} as
+% proposed by Raymon Seroul\footnote{This macro has been borrowed
+% from francais.dtx}.
+% \changes{catalan-2.2b}{1995/06/18}{Added definition of macro
+% \cs{up}, which can be used to type ordinals}
+% \changes{catalan-2.2e}{1996/02/29}{Now use \cs{textsuperscript} and
+% make \cs{up} robust}
+% \begin{macrocode}
+\DeclareRobustCommand*{\up}[1]{\textsuperscript{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{catalan-2.2g}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{catalan}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/catalan.ins b/Master/texmf-dist/source/generic/babel/catalan.ins
new file mode 100644
index 00000000000..982e9b8bbaf
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/catalan.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{catalan.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{catalan.ldf}{\from{catalan.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/croatian.dtx b/Master/texmf-dist/source/generic/babel/croatian.dtx
new file mode 100644
index 00000000000..3389033b0b4
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/croatian.dtx
@@ -0,0 +1,226 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{87}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{croatian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{croatian}
+%\fi
+%\ProvidesFile{croatian.dtx}
+ [2005/03/29 v1.3l Croatian support from the babel system]
+%\iffalse
+%% File `croatian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Croatian language definition file. A contribution
+% was made by Alan Pai\'{c} (paica@cernvm.cern.ch)
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{croatian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{croatian.dtx}
+%
+% \changes{croatian-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{croatian-1.0c}{1992/01/25}{Removed some typos}
+% \changes{croatian-1.1}{1992/02/15}{Brought up-to-date with babel 3.2a}
+% \changes{croatian-1.3}{1994/02/27}{Update for \LaTeXe}
+% \changes{croatian-1.3g}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Croatian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Alan Pai\'{c}
+% (\texttt{paica@cernvm.cern.ch}).} defines all the
+% language definition macros for the Croatian language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{croatian-1.3g}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{croatian}\captionscroatian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{croatian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@croatian| to see whether we have to do something here.
+%
+% \changes{croatian-1.0b}{1991/10/07}{Removed use of
+% \cs{@ifundefined}}
+% \changes{croatian-1.1}{1992/02/15}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \begin{macrocode}
+\ifx\l@croatian\@undefined
+ \@nopatterns{Croatian}
+ \adddialect\l@croatian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Croatian language.
+%
+% \begin{macro}{\captionscroatian}
+% The macro |\captionscroatian| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{croatian-1.1}{1992/02/15}{Added \cs{seename},
+% \cs{alsoname} and \cs{prefacename}}
+% \changes{croatian-1.2}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{croatian-1.3d}{1995/05/08}{Added a few translations}
+% \changes{croatian-1.3e}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{croatian-1.3f}{1996/01/18}{Added translation of Proof}
+% \changes{croatian-1.3i}{1997/09/11}{Replaced some of the
+% translations with `better' words}
+% \changes{croatian-1.3k}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{croatian-1.3l}{2003/11/17}{Inserted translation for Glossary}
+% \begin{macrocode}
+\addto\captionscroatian{%
+ \def\prefacename{Predgovor}%
+ \def\refname{Literatura}%
+ \def\abstractname{Sa\v{z}etak}%
+ \def\bibname{Bibliografija}%
+ \def\chaptername{Poglavlje}%
+ \def\appendixname{Dodatak}%
+ \def\contentsname{Sadr\v{z}aj}%
+ \def\listfigurename{Popis slika}%
+ \def\listtablename{Popis tablica}%
+ \def\indexname{Indeks}%
+ \def\figurename{Slika}%
+ \def\tablename{Tablica}%
+ \def\partname{Dio}%
+ \def\enclname{Prilozi}%
+ \def\ccname{Kopije}%
+ \def\headtoname{Prima}%
+ \def\pagename{Stranica}%
+ \def\seename{Vidjeti}%
+ \def\alsoname{Vidjeti i}%
+ \def\proofname{Dokaz}%
+ \def\glossaryname{Kazalo}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datecroatian}
+% The macro |\datecroatian| redefines the command |\today| to
+% produce Croatian dates.
+% \changes{croatian-1.3f}{1996/01/18}{in croatian language, the
+% genitive for the name of the month has to be used}
+% \changes{croatian-1.3h}{1997/02/06}{\texttt{sijev\{c\}nja} should be
+% \texttt{seij\cs{v}\{c\}nja} and there should be a period after
+% the year}
+% \changes{croatian-1.3i}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{croatian-1.3i}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{croatian-1.3j}{1999/03/12}{changed \cs{od} into \cs{or}}
+% \begin{macrocode}
+\def\datecroatian{%
+ \def\today{\number\day.~\ifcase\month\or
+ sije\v{c}nja\or velja\v{c}e\or o\v{z}ujka\or travnja\or svibnja\or
+ lipnja\or srpnja\or kolovoza\or rujna\or listopada\or studenog\or
+ prosinca\fi \space \number\year.}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrascroatian}
+% \begin{macro}{\noextrascroatian}
+% The macro |\extrascroatian| will perform all the extra
+% definitions needed for the Croatian language. The macro
+% |\noextrascroatian| is used to cancel the actions of
+% |\extrascroatian|. For the moment these macros are empty but
+% they are defined for compatibility with the other language
+% definition files.
+%
+% \begin{macrocode}
+\addto\extrascroatian{}
+\addto\noextrascroatian{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{croatian-1.3g}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{croatian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/croatian.ins b/Master/texmf-dist/source/generic/babel/croatian.ins
new file mode 100644
index 00000000000..babb296ae01
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/croatian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{croatian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{croatian.ldf}{\from{croatian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/czech.dtx b/Master/texmf-dist/source/generic/babel/czech.dtx
new file mode 100644
index 00000000000..16f72d3f9bc
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/czech.dtx
@@ -0,0 +1,276 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{190}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{czech.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{czech}
+%\fi
+%\ProvidesFile{czech.dtx}
+ [2005/03/29 v1.3k Czech support from the babel system]
+%\iffalse
+%% File `czech.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Czech language definition file.
+% Contributions were made by Milos Lokajicek (LOKAJICK@CERNVM).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{czech.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{czech.dtx}
+%
+% \changes{czech-1.0a}{1991/07/15}{Renamed babel.sty in babel.com}
+% \changes{czech-1.1}{1992/02/15}{Brought up-to-date with babel 3.2a}
+% \changes{czech-1.2}{1993/07/11}{Included some features from Kasal's
+% czech.sty}
+% \changes{czech-1.3}{1994/02/27}{Update for \LaTeXe}
+% \changes{czech-1.3d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{czech-1.3h}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Czech language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Milos Lokajicek
+% (\texttt{LOKAJICK@CERNVM}).} defines all the language definition
+% macros for the Czech language.
+%
+% For this language |\frenchspacing| is set and two macros |\q| and
+% |\w| for easy access to two accents are defined.
+%
+% The command |\q| is used with the letters (\texttt{t},
+% \texttt{d}, \texttt{l}, and \texttt{L}) and adds a \texttt{'} to
+% them to simulate a `hook' that should be there. The result looks
+% like t\kern-2pt\char'47. The command |\w| is used to put the
+% ring-accent which appears in \aa ngstr\o m over the letters
+% \texttt{u} and \texttt{U}.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{czech-1.3h}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{czech}\captionsczech
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{czech} will be an `unknown' language in which case
+% we have to make it known. So we check for the existence of
+% |\l@czech| to see whether we have to do something here.
+%
+% \changes{czech-1.0b}{1991/10/27}{Removed use of \cs{@ifundefined}}
+% \changes{czech-1.1}{1992/02/15}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{czech-1.3d}{1994/06/26}{Now use \cs{@nopatterns} to produce
+% the warning}
+% \begin{macrocode}
+\ifx\l@czech\@undefined
+ \@nopatterns{Czech}
+ \adddialect\l@czech0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Czech language.
+%
+% \begin{macro}{\captionsczech}
+% The macro |\captionsczech| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{czech-1.1}{1992/02/15}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{czech-1.3f}{1995/07/04}{Added \cs{proofname} for AMS-\LaTeX}
+% \changes{czech-1.3g}{1996/02/12}{Fixed two errors and provided
+% translation for `proof'}
+% \changes{czech-1.3j}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{czech-1.3k}{2004/02/18}{Added translation for Glossary}
+% \begin{macrocode}
+\addto\captionsczech{%
+ \def\prefacename{P\v redmluva}%
+ \def\refname{Reference}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literatura}%
+ \def\chaptername{Kapitola}%
+ \def\appendixname{Dodatek}%
+ \def\contentsname{Obsah}%
+ \def\listfigurename{Seznam obr\'azk\r{u}}%
+ \def\listtablename{Seznam tabulek}%
+ \def\indexname{Index}%
+ \def\figurename{Obr\'azek}%
+ \def\tablename{Tabulka}%
+ \def\partname{\v{C}\'ast}%
+ \def\enclname{P\v{r}\'{\i}loha}%
+ \def\ccname{Na v\v{e}dom\'{\i}:}%
+ \def\headtoname{Komu}%
+ \def\pagename{Strana}%
+ \def\seename{viz}%
+ \def\alsoname{viz tak\'e}%
+ \def\proofname{D\r{u}kaz}%
+ \def\glossaryname{Glos\'a\v r}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateczech}
+% The macro |\dateczech| redefines the command |\today| to produce
+% Czech dates.
+% \changes{czech-1.3i}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{czech-1.3i}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\dateczech{%
+ \def\today{\number\day.~\ifcase\month\or
+ ledna\or \'unora\or b\v{r}ezna\or dubna\or kv\v{e}tna\or
+ \v{c}ervna\or \v{c}ervence\or srpna\or z\'a\v{r}\'{\i}\or
+ \v{r}\'{\i}jna\or listopadu\or prosince\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasczech}
+% \begin{macro}{\noextrasczech}
+% The macro |\extrasczech| will perform all the extra definitions
+% needed for the Czech language. The macro |\noextrasczech| is used
+% to cancel the actions of |\extrasczech|. This means saving the
+% meaning of two one-letter control sequences before defining them.
+%
+% \changes{czech-1.1a}{1992/07/07}{Removed typo, \cs{q} was restored
+% twice, once too many.}
+% \changes{czech-1.3e}{1995/03/15}{Use \LaTeX's \cs{v} and \cs{r}
+% accent commands}
+% \begin{macrocode}
+\addto\extrasczech{\babel@save\q\let\q\v}
+\addto\extrasczech{\babel@save\w\let\w\r}
+% \end{macrocode}
+% For Czech texts |\frenchspacing| should be in effect. We make
+% sure this is the case and reset it if necessary.
+% \changes{czech-1.3e}{1995/03/14}{now use \cs{bbl@frenchspacing} and
+% \cs{bbl@nonfrenchspacing}}
+% \begin{macrocode}
+\addto\extrasczech{\bbl@frenchspacing}
+\addto\noextrasczech{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\v}
+% \LaTeX's normal |\v| accent places a caron over the letter that
+% follows it (\v{o}). This is not what we want for the letters d,
+% t, l and L; for those the accent should change shape. This is
+% acheived by the following.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \DeclareTextCompositeCommand{\v}{OT1}{t}{%
+ t\kern-.23em\raise.24ex\hbox{'}}
+ \DeclareTextCompositeCommand{\v}{OT1}{d}{%
+ d\kern-.13em\raise.24ex\hbox{'}}
+ \DeclareTextCompositeCommand{\v}{OT1}{l}{\lcaron{}}
+ \DeclareTextCompositeCommand{\v}{OT1}{L}{\Lcaron{}}}
+% \end{macrocode}
+%
+% \begin{macro}{\lcaron}
+% \begin{macro}{\Lcaron}
+% Fot the letters \texttt{l} and \texttt{L} we want to disinguish
+% between normal fonts and monospaced fonts.
+% \begin{macrocode}
+\def\lcaron{%
+ \setbox0\hbox{M}\setbox\tw@\hbox{i}%
+ \ifdim\wd0>\wd\tw@\relax
+ l\kern-.13em\raise.24ex\hbox{'}\kern-.11em%
+ \else
+ l\raise.45ex\hbox to\z@{\kern-.35em '\hss}%
+ \fi}
+\def\Lcaron{%
+ \setbox0\hbox{M}\setbox\tw@\hbox{i}%
+ \ifdim\wd0>\wd\tw@\relax
+ L\raise.24ex\hbox to\z@{\kern-.28em'\hss}%
+ \else
+ L\raise.45ex\hbox to\z@{\kern-.40em '\hss}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{czech-1.3h}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{czech}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/czech.ins b/Master/texmf-dist/source/generic/babel/czech.ins
new file mode 100644
index 00000000000..06743474603
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/czech.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{czech.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{czech.ldf}{\from{czech.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/danish.dtx b/Master/texmf-dist/source/generic/babel/danish.dtx
new file mode 100644
index 00000000000..d0b6a0d7807
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/danish.dtx
@@ -0,0 +1,304 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{138}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{danish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{danish}
+%\fi
+%\ProvidesFile{danish.dtx}
+ [2005/03/30 v1.3p Danish support from the babel system]
+%\iffalse
+%% File `danish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Danish language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{danish.dtx}
+\end{document}
+%</filedriver>
+% A contribution was made by Henning Larsen (larsen@cernvm.cern.ch)
+%\fi
+% \GetFileInfo{danish.dtx}
+%
+% \changes{danish-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{danish-1.1}{1992/02/15}{Brought up-to-date with babel 3.2a}
+% \changes{danish-1.3}{1994/02/27}{Update for \LaTeXe}
+% \changes{danish-1.3f}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{danish-1.3g}{1995/06/08}{Added the active double quote
+% character as suggested by Peter Busk Laursen}
+% \changes{danish-1.3j}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Danish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Henning Larsen
+% (\texttt{larsen@cernvm.cern.ch})} defines all the
+% language definition macros for the Danish language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:danish-quote} an overview is given of its purpose.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |""| & like \verb="-=, but producing no hyphen sign (for
+% words that should break at some sign such as
+% ``entrada/salida.''\\
+% |"`| & lowered double left quotes (looks like ,,)\\
+% |"'| & normal double right quotes\\
+% |"<| & for French left double quotes (similar to $<<$).\\
+% |">| & for French right double quotes (similar to $>>$).\\
+% \end{tabular}
+% \caption{The extra definitions made by \file{danish.ldf}}
+% \label{tab:danish-quote}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{danish-1.3j}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{danish}\captionsdanish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{danish} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@danish| to see whether we have to do something here.
+%
+% \changes{danish-1.0b}{1991/10/27}{Removed use of \cs{@ifundefined}}
+% \changes{danish-1.1}{1992/02/15}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{danish-1.3f}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@danish\@undefined
+ \@nopatterns{Danish}
+ \adddialect\l@danish0\fi
+% \end{macrocode}
+%
+% \begin{macro}{\englishhyphenmins}
+% \changes{danish-1.3p}{2003/11/17}{Added default for setting of
+% hyphenmin parameters}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\@ne\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Danish language.
+%
+% \begin{macro}{\captionsdanish}
+% The macro |\captionsdanish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{danish-1.1}{1992/02/15}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{danish-1.2}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{danish-1.2b}{1993/10/23}{Added a few translations}
+% \changes{danish-1.3c}{1994/06/04}{Included some revisions from Peter
+% Busk Larsen}
+% \changes{danish-1.3h}{1995/07/02}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{danish-1.3i}{1995/07/13}{Added translation of `Proof'}
+% \changes{danish-1.3n}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{danish-1.3o}{2003/04/10}{Added translation of `Glossary'}
+% \begin{macrocode}
+\addto\captionsdanish{%
+ \def\prefacename{Forord}%
+ \def\refname{Litteratur}%
+ \def\abstractname{Resum\'e}%
+ \def\bibname{Litteratur}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Bilag}%
+ \def\contentsname{Indhold}%
+ \def\listfigurename{Figurer}%
+ \def\listtablename{Tabeller}%
+ \def\indexname{Indeks}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabel}%
+ \def\partname{Del}%
+ \def\enclname{Vedlagt}%
+ \def\ccname{Kopi til}% or Kopi sendt til
+ \def\headtoname{Til}% in letter
+ \def\pagename{Side}%
+ \def\seename{Se}%
+ \def\alsoname{Se ogs{\aa}}%
+ \def\proofname{Bevis}%
+ \def\glossaryname{Gloseliste}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datedanish}
+% The macro |\datedanish| redefines the command |\today| to produce
+% Danish dates.
+% \changes{danish-1.3a}{1994/03/23}{Added `.' to definition of
+% \cs{today}}
+% \changes{danish-1.3k}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{danish-1.3k}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\datedanish{%
+ \def\today{\number\day.~\ifcase\month\or
+ januar\or februar\or marts\or april\or maj\or juni\or
+ juli\or august\or september\or oktober\or november\or december\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasdanish}
+% \changes{danish-1.3h}{1995/07/02}{Added \cs{bbl@frenchspacing}}
+% \begin{macro}{\noextrasdanish}
+% \changes{danish-1.3h}{1995/07/02}{Added \cs{bbl@nonfrenchspacing}}
+% The macro |\extrasdanish| will perform all the extra definitions
+% needed for the Danish language. The macro |\noextrasdanish| is
+% used to cancel the actions of |\extrasdanish|.
+%
+% Danish typesetting requires |\frenchspacing| to be in effect.
+% \begin{macrocode}
+\addto\extrasdanish{\bbl@frenchspacing}
+\addto\noextrasdanish{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+%
+% For Danish the \texttt{"} character is made active. This is
+% done once, later on its definition may vary. Other languages in
+% the same document may also use the \texttt{"} character for
+% shorthands; we specify that the danish group of shorthands
+% should be used.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasdanish{\languageshorthands{danish}}
+\addto\extrasdanish{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{danish-1.3m}{1999/12/16}{Deactivate shorthands ouside of
+% Danish}
+% \begin{macrocode}
+\addto\noextrasdanish{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% First we define access to the low opening double quote and
+% guillemets for quotations,
+% \changes{danish-1.3j}{1996/08/15}{Changed definition of \texttt{"'}
+% to print \texttt{``} instead of \texttt{''}}
+% \changes{danish-1.3k}{1997/04/03}{Removed empty groups after double
+% quote and guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{danish}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{danish}{"'}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\declare@shorthand{danish}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{danish}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define to be able to specify hyphenation
+% breakpoints that behave a little different from |\-|.
+% \changes{danish-1.3j}{1996/08/15}{Added definition of
+% \texttt{"\char126} and \texttt{"\char61}}
+% \begin{macrocode}
+\declare@shorthand{danish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{danish}{""}{\hskip\z@skip}
+\declare@shorthand{danish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{danish}{"=}{\nobreak-\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{danish}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{danish-1.3j}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{danish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/danish.ins b/Master/texmf-dist/source/generic/babel/danish.ins
new file mode 100644
index 00000000000..203cff95ab9
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/danish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{danish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{danish.ldf}{\from{danish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/dutch.dtx b/Master/texmf-dist/source/generic/babel/dutch.dtx
new file mode 100644
index 00000000000..24e2031922d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/dutch.dtx
@@ -0,0 +1,560 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{300}
+%\iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{dutch.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{dutch}
+%\fi
+%\ProvidesFile{dutch.dtx}
+ [2005/03/30 v3.8i Dutch support from the babel system]
+%\iffalse
+%% File `dutch.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Dutch Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Dutch language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\makeatletter
+\gdef\dlqq{{\setbox\tw@=\hbox{,}\setbox\z@=\hbox{''}%
+ \dimen\z@=\ht\z@ \advance\dimen\z@-\ht\tw@
+ \setbox\z@=\hbox{\lower\dimen\z@\box\z@}\ht\z@=\ht\tw@
+ \dp\z@=\dp\tw@ \box\z@\kern-.04em}}
+\makeatother
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{dutch.dtx}
+\end{document}
+%</filedriver>
+% \fi
+% \GetFileInfo{dutch.dtx}
+%
+% \changes{dutch-2.0a}{1990/04/02}{Added checking of format}
+% \changes{dutch-2.0b}{1990/04/02}{Added extrasdutch}
+% \changes{dutch-2.0c}{1990/04/18}{Added grqq macros}
+% \changes{dutch-2.1}{1990/04/24}{reflect change to version 2.1 in
+% babel and changes in german v2.3}
+% \changes{dutch-2.1a}{1990/05/01}{Incorporated Nico's comments}
+% \changes{dutch-2.1b}{1990/07/04}{Incorporated more comments by Nico}
+% \changes{dutch-2.1c}{1990/07/16}{Fixed some typos}
+% \changes{dutch-2.2}{1990/07/16}{Fixed problem with the use of
+% \texttt{"} in moving arguments while \texttt{"} is active}
+% \changes{dutch-2.3}{1990/07/30}{When using PostScript fonts with the
+% Adobe font-encoding, the dieresis-accent is located elsewhere,
+% modified code}
+% \changes{dutch-2.3a}{1990/08/27}{Modified the documentation somewhat}
+% \changes{dutch-3.0}{1991/04/23}{Modified for babel 3.0}
+% \changes{dutch-3.0a}{1991/05/25}{Removed some problems in change log}
+% \changes{dutch-3.1}{1991/05/29}{Removed bug found by van der Meer}
+% \changes{dutch-3.2a}{1991/07/15}{Renamed babel.sty in babel.com}
+% \changes{dutch-3.3}{1991/10/31}{Rewritten parts of the code to use
+% the new features of babel version 3.1}
+% \changes{dutch-3.6}{1994/02/02}{Update or LaTeX2e}
+% \changes{dutch-3.6c}{1994/06/26}{Removed the use of \cs{filedate},
+% moved identification after the loading of babel.def}
+% \changes{dutch-3.7a}{1995/02/03}{Moved identification code to the
+% top of the file}
+% \changes{dutch-3.7a}{1995/02/04}{Rewrote the code with respect to
+% the active double quote character}
+% \changes{dutch-3.7f}{1996/07/11}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{dutch-3.8a}{1996/10/04}{Merged in the definitions for
+% `afrikaans'}
+%
+% \section{The Dutch language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion, and was last revised on
+% \filedate.} defines all the language-specific macros for the Dutch
+% language and the `Afrikaans' version\footnote{contributed by
+% Stoffel Lombard (\texttt{lombc@b31pc87.up.ac.za})} of it.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:dutch-quote} an overview is given of its purpose.
+% One of the reasons for this is that in the Dutch language a word
+% with a dieresis can be hyphenated just before the letter with the
+% umlaut, but the dieresis has to disappear if the word is broken
+% between the previous letter and the accented letter.
+%
+% In~\cite{treebus} the quoting conventions for the Dutch language
+% are discussed. The preferred convention is the single-quote
+% Anglo-American convention, i.e. `This is a quote'. An
+% alternative is the slightly old-fashioned Dutch method with
+% initial double quotes lowered to the baseline, \dlqq This is a
+% quote'', which should be typed as \texttt{"`This is a quote"'}.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |"a| & |\"a| which hyphenates as |-a|;
+% also implemented for the other letters. \\
+% |"y| & puts a negative kern between \texttt{i} and \texttt{j}\\
+% |"Y| & puts a negative kern between \texttt{I} and \texttt{J}\\
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |"~| & to produce a hyphencharcter without the following
+% |\discretionary{}{}{}|.\\
+% |""| & to produce an invisible `breakpoint'.\\
+% |"`| & lowered double left quotes (see example below).\\
+% |"'| & normal double right quotes. \\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word.
+% \end{tabular}
+% \caption{The extra definitions made by \file{dutch.ldf}}
+% \label{tab:dutch-quote}
+% \end{table}
+%
+% \StopEventually{}
+%
+% \changes{dutch-3.2c}{1991/10/22}{Removed code to load
+% \file{latexhax.com}}
+% \changes{dutch-3.2a}{1991/07/15}{Added reset of catcode of @ before
+% \cs{endinput}.}
+% \changes{dutch-3.2c}{1991/10/22}{removed use of \cs{@ifundefined}}
+% \changes{dutch-3.3a}{1991/11/11}{Moved code to the beginning of the
+% file and added \cs{selectlanguage} call}
+% \begin{macrocode}
+% \changes{dutch-3.8a}{1996/10/04}{made check dependant on
+% \cs{CurrentOption}}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{dutch-3.8a}{1996/10/30}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{dutch} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@dutch| or |l@afrikaans| to see whether we have to do
+% something here.
+%
+% First we try to establish with which option we are being
+% processed.
+%
+% \changes{dutch-3.0}{1991/04/23}{Now use \cs{adddialect} if language
+% undefined}
+% \changes{dutch-3.2c}{1991/10/22}{removed use of \cs{@ifundefined}}
+% \changes{dutch-3.3b}{1992/01/25}{Added warning, if no dutch patterns
+% loaded}
+% \changes{dutch-3.6c}{1994/06/26}{Now use \cs{@nopatterns} to produce
+% the warning}
+% \changes{dutch-3.8a}{1996/10/04}{this needs a more complicated check
+% as `afrikaans' may or may not have its own hyphenation patterns}
+% \begin{macrocode}
+\def\bbl@tempa{dutch}
+\ifx\CurrentOption\bbl@tempa
+% \end{macrocode}
+% If it is \Lopt{dutch} then we first check if the Dutch
+% hyphenation patterns wer loaded,
+% \begin{macrocode}
+ \ifx\l@dutch\undefined
+% \end{macrocode}
+% if no we issue a warning and make dutch a `dialect' of either the
+% hyphenation patterns that were loaded in slot 0 or of `afrikaans'
+% when it is available.
+% \begin{macrocode}
+ \@nopatterns{Dutch}
+ \ifx\l@afrikaans\undefined
+ \adddialect\l@dutch0
+ \else
+ \adddialect\l@dutch\l@afrikaans
+ \fi
+ \fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Dutch language.
+%
+% \begin{macro}{\captionsdutch}
+% The macro |\captionsdutch| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \changes{dutch-3.1a}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{dutch-3.1a}{1991/06/06}{\cs{pagename} should be
+% \cs{headpagename}}
+% \changes{dutch-3.3a}{1991/11/11}{added \cs{seename} and
+% \cs{alsoname}}
+% \changes{dutch-3.3b}{1992/01/25}{added \cs{prefacename}}
+% \changes{dutch-3.5}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{dutch-3.7c}{1995/06/08}{We need the \texttt{"} to be active
+% while defining \cs{captionsdutch}}
+% \changes{dutch-3.7d}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{dutch-3.8b}{1997/01/06}{Use \texttt{Bew"ys} instead of
+% \texttt{Bewijs}}
+% \changes{dutch-3.8h}{2000/09/19}{Added \cs{glossaryname}}
+% \begin{macrocode}
+ \begingroup
+ \catcode`\"\active
+ \def\x{\endgroup
+ \def\captionsdutch{%
+ \def\prefacename{Voorwoord}%
+ \def\refname{Referenties}%
+ \def\abstractname{Samenvatting}%
+ \def\bibname{Bibliografie}%
+ \def\chaptername{Hoofdstuk}%
+ \def\appendixname{B"ylage}%
+ \def\contentsname{Inhoudsopgave}%
+ \def\listfigurename{L"yst van figuren}%
+ \def\listtablename{L"yst van tabellen}%
+ \def\indexname{Index}%
+ \def\figurename{Figuur}%
+ \def\tablename{Tabel}%
+ \def\partname{Deel}%
+ \def\enclname{B"ylage(n)}%
+ \def\ccname{cc}%
+ \def\headtoname{Aan}%
+ \def\pagename{Pagina}%
+ \def\seename{zie}%
+ \def\alsoname{zie ook}%
+ \def\proofname{Bew"ys}%
+ \def\glossaryname{Verklarende Woordenl"yst}%
+ }
+ }\x
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datedutch}
+% The macro |\datedutch| redefines the command |\today| to produce
+% Dutch dates.
+% \changes{dutch-3.1a}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{dutch-3.8e}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{dutch-3.8e}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+ \def\datedutch{%
+ \def\today{\number\day~\ifcase\month\or
+ januari\or februari\or maart\or april\or mei\or juni\or
+ juli\or augustus\or september\or oktober\or november\or
+ december\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% When the option with which this file is being process was not
+% \Lopt{dutch} we assume it was \Lopt{afrikaans}. We perform a
+% similar check on the availability of the hyphenation paterns.
+% \begin{macrocode}
+\else
+ \ifx\l@afrikaans\undefined
+ \@nopatterns{Afrikaans}
+ \ifx\l@dutch\undefined
+ \adddialect\l@afrikaans0
+ \else
+ \adddialect\l@afrikaans\l@dutch
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\captionsafrikaans}
+% Now is the time to define the words for `Afrikaans'.
+% \begin{macrocode}
+ \def\captionsafrikaans{%
+ \def\prefacename{Voorwoord}%
+ \def\refname{Verwysings}%
+ \def\abstractname{Samevatting}%
+ \def\bibname{Bibliografie}%
+ \def\chaptername{Hoofstuk}%
+ \def\appendixname{Bylae}%
+ \def\contentsname{Inhoudsopgawe}%
+ \def\listfigurename{Lys van figure}%
+ \def\listtablename{Lys van tabelle}%
+ \def\indexname{Inhoud}%
+ \def\figurename{Figuur}%
+ \def\tablename{Tabel}%
+ \def\partname{Deel}%
+ \def\enclname{Bylae(n)}%
+ \def\ccname{a.a.}%
+ \def\headtoname{Aan}%
+ \def\pagename{Bladsy}%
+ \def\seename{sien}%
+ \def\alsoname{sien ook}%
+ \def\proofname{Bewys}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateafrikaans}
+% Here is the `Afrikaans' version of the date macro.
+% \changes{dutch-3.8e}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{dutch-3.8e}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+ \def\dateafrikaans{%
+ \def\today{\number\day~\ifcase\month\or
+ Januarie\or Februarie\or Maart\or April\or Mei\or Junie\or
+ Julie\or Augustus\or September\or Oktober\or November\or
+ Desember\fi
+ \space \number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasdutch}
+% \begin{macro}{\extrasafrikaans}
+% \changes{dutch-3.0b}{1991/05/29}{added some comment chars to prevent
+% white space}
+% \changes{dutch-3.1a}{1991/06/6}{Removed \cs{global} definitions}
+% \changes{dutch-3.2}{1991/07/02}{Save all redefined macros}
+% \changes{dutch-3.3}{1991/10/31}{Macro complete rewritten}
+% \changes{dutch-3.3b}{1992/01/25}{modified handling of
+% \cs{dospecials} and \cs{@sanitize}}
+%
+% \begin{macro}{\noextrasdutch}
+% \begin{macro}{\noextrasafrikaans}
+% \changes{dutch-2.3}{1990/07/30}{Added \cs{dieresis}}
+% \changes{dutch-3.0b}{1991/05/29}{added some comment chars to prevent
+% white space}
+% \changes{dutch-3.1a}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{dutch-3.2}{1991/07/02}{Try to restore everything to its
+% former state}
+% \changes{dutch-3.3}{1991/10/31}{Macro complete rewritten}
+% \changes{dutch-3.3b}{1992/01/25}{modified handling of \cs{dospecials}
+% and \cs{@sanitize}}
+% \changes{dutch-3.8a}{1996/10/04}{Made all definitions dependant on
+% \cs{CurrentOption}}
+%
+% The macros |\extrasdutch| and |\captionsafrikaans| will perform
+% all the extra definitions needed for the Dutch language. The
+% macros |\noextrasdutch| and |noextrasafrikaans| is used
+% to cancel the actions of |\extrasdutch| and |\captionsafrikaans|.
+%
+% For Dutch the \texttt{"} character is made active. This is done
+% once, later on its definition may vary. Other languages in the
+% same document may also use the \texttt{"} character for
+% shorthands; we specify that the dutch group of shorthands should
+% be used.
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+% Both version of the language use the same set of shorthand
+% definitions althoug the `ij' is not used in Afrikaans.
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{\languageshorthands{dutch}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+%
+% The `umlaut' character should be positioned lower on \emph{all}
+% vowels in Dutch texts.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \umlautlow\umlautelow}
+\@namedef{noextras\CurrentOption}{%
+ \umlauthigh}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\dutchhyphenmins}
+% \begin{macro}{\afrikaanshyphenmins}
+% The dutch hyphenation patterns can be used with |\lefthyphenmin|
+% set to~2 and |\righthyphenmin| set to~3.
+% \changes{dutch-3.7a}{1995/05/13}{use \cs{dutchhyphenmins} to store
+% the correct values}
+% \changes{dutch-3.8h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{dutch-3.3a}{1991/11/11}{Added \cs{save@sf@q} macro from
+% germanb and rewrote all quote macros to use it}
+% \changes{dutch-3.4b}{1991/02/16}{moved definition of
+% \cs{allowhyphens}, \cs{set@low@box} and \cs{save@sf@q} to
+% \file{babel.com}}
+% \changes{dutch-3.7a}{1995/02/04}{Removed \cs{dlqq}, \cs{@dlqq},
+% \cs{drqq}, \cs{@drqq} and \cs{dieresis}}
+% \changes{dutch-3.7a}{1995/02/15}{moved the definition of the double
+% quote character at the baseline to \file{glyhps.def}}
+%
+% \begin{macro}{\@trema}
+% In the Dutch language vowels with a trema are treated
+% specially. If a hyphenation occurs before a vowel-plus-trema, the
+% trema should disappear. To be able to do this we could first
+% define the hyphenation break behaviour for the five vowels, both
+% lowercase and uppercase, in terms of |\discretionary|. But this
+% results in a large |\if|-construct in the definition of the
+% active |"|. Because we think a user should not use |"| when he
+% really means something like |''| we chose not to distinguish
+% between vowels and consonants. Therefore we have one macro
+% |\@trema| which specifies the hyphenation break behaviour for all
+% letters.
+%
+% \changes{dutch-2.3}{1990/07/30}{\cs{dieresis} instead of
+% \cs{accent127}}
+% \changes{dutch-3.3a}{1991/11/11}{renamed \cs{@umlaut} to
+% \cs{@trema}}
+% \begin{macrocode}
+\def\@trema#1{\allowhyphens\discretionary{-}{#1}{\"{#1}}\allowhyphens}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{dutch-3.7a}{1995/02/15}{Moved the definition of \cs{ij} and
+% \cs{IJ} to \file{glyphs.def}}
+% \changes{dutch-3.7a}{1995/02/03}{The support macros for the active
+% double quote have been moved to \file{babel.def}}
+%
+% Now we can define the doublequote macros: the tremas,
+%
+% \changes{dutch-2.3}{1990/07/30}{\cs{dieresis} instead of
+% \cs{accent127}}
+% \changes{dutch-3.2}{1991/07/02}{added case for \texttt{"y} and
+% \texttt{"Y}}
+% \changes{dutch-3.2b}{1991/07/16}{removed typo (allowhpyhens)}
+% \changes{dutch-3.7a}{1995/02/03}{Now use \cs{Declaredq{dutch}} to
+% define the functions of the active double quote}
+% \changes{dutch-3.7a}{1995/02/03}{Use \cs{ddot} instead of
+% \cs{@MATHUMLAUT}}
+% \changes{dutch-3.7a}{1995/03/05}{Use more general mechanism of
+% \cs{declare@shorthand}}
+% \begin{macrocode}
+\declare@shorthand{dutch}{"a}{\textormath{\@trema a}{\ddot a}}
+\declare@shorthand{dutch}{"e}{\textormath{\@trema e}{\ddot e}}
+\declare@shorthand{dutch}{"i}{\textormath
+ {\allowhyphens\discretionary{-}{i}{\"{\i}}\allowhyphens}%
+ {\ddot \imath}}
+\declare@shorthand{dutch}{"o}{\textormath{\@trema o}{\ddot o}}
+\declare@shorthand{dutch}{"u}{\textormath{\@trema u}{\ddot u}}
+% \end{macrocode}
+% dutch quotes,
+% \changes{dutch-3.8e}{1997/04/03}{Removed empty groups after double
+% quote characters}
+% \begin{macrocode}
+\declare@shorthand{dutch}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{dutch}{"'}{%
+ \textormath{\textquotedblright}{\mbox{\textquotedblright}}}
+% \end{macrocode}
+% and some additional commands:
+% \changes{dutch-3.7b}{1995/06/04}{Added \texttt{""} shorthand}
+% \changes{dutch-3.8c}{1997/01/14}{Added the \texttt{"\~{}} shorthand}
+% \changes{dutch-3.8e}{1997/04/01}{Forgot to replace `german' by
+% `dutch' when copying definition for \texttt{"\~{}}}
+% \begin{macrocode}
+\declare@shorthand{dutch}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{dutch}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{dutch}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+\declare@shorthand{dutch}{""}{\hskip\z@skip}
+\declare@shorthand{dutch}{"y}{\textormath{\ij{}}{\ddot y}}
+\declare@shorthand{dutch}{"Y}{\textormath{\IJ{}}{\ddot Y}}
+% \end{macrocode}
+% To enable hyphenation in two words, written together but
+% separated by a slash, as in `uitdrukking/opmerking' we define the
+% command |"/|.
+% \changes{dutch-3.8e}{1997/10/03}{Added a shorthand with the slash
+% character}
+% \changes{dutch-3.8i}{2003/09/15}{\texttt{"/} should use
+% \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\declare@shorthand{dutch}{"/}{\textormath
+ {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}
+% \end{macrocode}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% very unfortunate for languages such as Dutch and German, where
+% long compound words are quite normal and all one needs is a means
+% to indicate an extra hyphenation position on top of the ones that
+% \TeX\ can generate from the hyphenation patterns.
+% \changes{dutch-3.8i}{2003/09/15}{\cs{-} should use
+% \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\-}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{dutch-3.8a}{1996/10/30}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/dutch.ins b/Master/texmf-dist/source/generic/babel/dutch.ins
new file mode 100644
index 00000000000..1437c660a7e
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/dutch.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{dutch.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{dutch.ldf}{\from{dutch.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/english.dtx b/Master/texmf-dist/source/generic/babel/english.dtx
new file mode 100644
index 00000000000..9054cc2957b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/english.dtx
@@ -0,0 +1,451 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{360}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{english.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{english}
+%\fi
+%\ProvidesFile{english.dtx}
+ [2005/03/30 v3.3o English support from the babel system]
+%\iffalse
+%% File 'english.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the English language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \mathit lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{english.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{english.dtx}
+%
+% \changes{english-2.0a}{1990/04/02}{Added checking of format}
+% \changes{english-2.1}{1990/04/24}{Reflect changes in babel 2.1}
+% \changes{english-2.1a}{1990/05/14}{Incorporated Nico's comments}
+% \changes{english-2.1b}{1990/05/14}{merged \file{USenglish.sty} into
+% this file}
+% \changes{english-2.1c}{1990/05/22}{fixed typo in definition for
+% american language found by Werenfried Spit (nspit@fys.ruu.nl)}
+% \changes{english-2.1d}{1990/07/16}{Fixed some typos}
+% \changes{english-3.0}{1991/04/23}{Modified for babel 3.0}
+% \changes{english-3.0a}{1991/05/29}{Removed bug found by van der Meer}
+% \changes{english-3.0c}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{english-3.1}{1991/11/05}{Rewrote parts of the code to use
+% the new features of babel version 3.1}
+% \changes{english-3.3}{1994/02/08}{Update or \LaTeXe}
+% \changes{english-3.3c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved the identification after the loading of
+% \file{babel.def}}
+% \changes{english-3.3g}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{english-3.3h}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The English language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% English language as well as for the American and Australian
+% version of this language. For the Australian version the British
+% hyphenation patterns will be used, if available, for the Canadian
+% variant the American patterns are selected.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{english-3.3h}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{date\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{english} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@english| to see whether we have to do something here.
+%
+% \changes{english-3.0}{1991/04/23}{Now use \cs{adddialect} if
+% language undefined}
+% \changes{english-3.0d}{1991/10/22}{removed use of \cs{@ifundefined}}
+% \changes{english-3.3c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \changes{english-3.3g}{1996/07/10}{Allow british as the name of the
+% UK patterns}
+% \changes{english-3.3j}{2000/01/21}{Also allow american english
+% hyphenation patterns to be used for `english'}
+% We allow for the british english patterns to be loaded as either
+% `british', or `UKenglish'. When neither of those is
+% known we try to define |\l@english| as an alias for |\l@american|
+% or |\l@USenglish|.
+% \changes{english-3.3k}{2001/02/07}{Added support for canadian}
+% \changes{english-3.3n}{2004/06/12}{Added support for australian and
+% newzealand}
+% \begin{macrocode}
+\ifx\l@english\@undefined
+ \ifx\l@UKenglish\@undefined
+ \ifx\l@british\@undefined
+ \ifx\l@american\@undefined
+ \ifx\l@USenglish\@undefined
+ \ifx\l@canadian\@undefined
+ \ifx\l@australian\@undefined
+ \ifx\l@newzealand\@undefined
+ \@nopatterns{English}
+ \adddialect\l@english0
+ \else
+ \let\l@english\l@newzealand
+ \fi
+ \else
+ \let\l@english\l@australian
+ \fi
+ \else
+ \let\l@english\l@canadian
+ \fi
+ \else
+ \let\l@english\l@USenglish
+ \fi
+ \else
+ \let\l@english\l@american
+ \fi
+ \else
+ \let\l@english\l@british
+ \fi
+ \else
+ \let\l@english\l@UKenglish
+ \fi
+\fi
+% \end{macrocode}
+% Because we allow `british' to be used as the babel option we need
+% to make sure that it will be recognised by |\selectlanguage|. In
+% the code above we have made sure that |\l@english| was defined.
+% Now we want to make sure that |\l@british| and |\l@UKenglish| are
+% defined as well. When either of them is we make them equal to
+% each other, when neither is we fall back to the default,
+% |\l@english|.
+% \changes{english-3.3o}{2004/06/14}{Make sure that british patterns
+% are used if they were loaded}
+% \begin{macrocode}
+\ifx\l@british\@undefined
+ \ifx\l@UKenglish\@undefined
+ \adddialect\l@british\l@english
+ \adddialect\l@UKenglish\l@english
+ \else
+ \let\l@british\l@UKenglish
+ \fi
+\else
+ \let\l@UKenglish\l@british
+\fi
+% \end{macrocode}
+% `American' is a version of `English' which can have its own
+% hyphenation patterns. The default english patterns are in fact
+% for american english. We allow for the patterns to be loaded as
+% `english' `american' or `USenglish'.
+% \changes{english-3.0}{1990/04/23}{Now use \cs{adddialect} for
+% american}
+% \changes{english-3.0b}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{english-3.3d}{1995/02/01}{Only define american as a
+% dialect when no separate patterns have been loaded}
+% \changes{english-3.3g}{1996/07/10}{Allow USenglish as the name of
+% the american patterns}
+% \begin{macrocode}
+\ifx\l@american\@undefined
+ \ifx\l@USenglish\@undefined
+% \end{macrocode}
+% When the patterns are not know as `american' or `USenglish' we
+% add a ``dialect''.
+% \begin{macrocode}
+ \adddialect\l@american\l@english
+ \else
+ \let\l@american\l@USenglish
+ \fi
+\else
+% \end{macrocode}
+% Make sure that USenglish is known, even if the patterns were
+% loaded as `american'.
+% \changes{english-3.3j}{2000/01/21}{Ensure that \cs{l@USenglish} is
+% alway defined}
+% \changes{english-3.3l}{2001/04/15}{Added missing backslash}
+% \begin{macrocode}
+ \ifx\l@USenglish\@undefined
+ \let\l@USenglish\l@american
+ \fi
+\fi
+% \end{macrocode}
+%
+
+% \changes{english-3.3k}{2001/02/07}{Added support for canadian}
+% `Canadian' english spelling is a hybrid of British and American
+% spelling. Although so far no special `translations' have been
+% reported we allow this file to be loaded by the option
+% \Lopt{candian} as well.
+% \begin{macrocode}
+\ifx\l@canadian\@undefined
+ \adddialect\l@canadian\l@american
+\fi
+% \end{macrocode}
+%
+% \changes{english-3.3n}{2004/06/12}{Added support for australian and
+% newzealand}
+% `Australian' and `New Zealand' english spelling seem to be the
+% same as British spelling. Although so far no special
+% `translations' have been reported we allow this file to be loaded
+% by the options \Lopt{australian} and \Lopt{newzealand} as well.
+% \begin{macrocode}
+\ifx\l@australian\@undefined
+ \adddialect\l@australian\l@british
+\fi
+\ifx\l@newzealand\@undefined
+ \adddialect\l@newzealand\l@british
+\fi
+% \end{macrocode}
+%
+
+% \begin{macro}{\englishhyphenmins}
+% \changes{english-3.3m}{2003/11/17}{Added default for setting of
+% hyphenmin parameters}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+%
+% The next step consists of defining commands to switch to (and
+% from) the English language.
+% \begin{macro}{\captionsenglish}
+% The macro |\captionsenglish| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \changes{english-3.0b}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{english-3.0b}{1991/06/06}{\cs{pagename} should be
+% \cs{headpagename}}
+% \changes{english-3.1a}{1991/11/11}{added \cs{seename} and
+% \cs{alsoname}}
+% \changes{english-3.1b}{1992/01/26}{added \cs{prefacename}}
+% \changes{english-3.2}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{english-3.3e}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{english-3.3g}{1996/07/10}{Construct control sequence on the
+% fly}
+% \changes{english-3.3j}{2000/09/19}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Preface}%
+ \def\refname{References}%
+ \def\abstractname{Abstract}%
+ \def\bibname{Bibliography}%
+ \def\chaptername{Chapter}%
+ \def\appendixname{Appendix}%
+ \def\contentsname{Contents}%
+ \def\listfigurename{List of Figures}%
+ \def\listtablename{List of Tables}%
+ \def\indexname{Index}%
+ \def\figurename{Figure}%
+ \def\tablename{Table}%
+ \def\partname{Part}%
+ \def\enclname{encl}%
+ \def\ccname{cc}%
+ \def\headtoname{To}%
+ \def\pagename{Page}%
+ \def\seename{see}%
+ \def\alsoname{see also}%
+ \def\proofname{Proof}%
+ \def\glossaryname{Glossary}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateenglish}
+% In order to define |\today| correctly we need to know whether it
+% should be `english', `australian', or `american'. We can find
+% this out by checking the value of |\CurrentOption|.
+% \changes{english-3.3j}{2000/01/21}{Make sure that the value of
+% \cs{today} is correct for both options `american' and
+% `USenglish'}
+% \changes{english-3.3n}{2004/06/12}{Added support for `Australian'
+% and `Newzealand'}
+% \changes{english-3.3o}{2004/06/14}{Explicitly choose the UK form of
+% date}
+% \begin{macrocode}
+\def\bbl@tempa{british}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{UK}\fi
+\def\bbl@tempa{UKenglish}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{UK}\fi
+\def\bbl@tempa{american}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{US}\fi
+\def\bbl@tempa{USenglish}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{US}\fi
+\def\bbl@tempa{canadian}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{US}\fi
+\def\bbl@tempa{australian}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{AU}\fi
+\def\bbl@tempa{newzealand}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{AU}\fi
+% \end{macrocode}
+%
+% The macro |\dateenglish| redefines the command |\today| to
+% produce English dates.
+% \changes{english-3.0b}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{english-3.3g}{1996/07/10}{Construct control sequence on the
+% fly}
+% \changes{english-3.3i}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{english-3.3i}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\bbl@tempa{UK}
+\ifx\bbl@tempa\bbl@tempb
+ \@namedef{date\CurrentOption}{%
+ \def\today{\ifcase\day\or
+ 1st\or 2nd\or 3rd\or 4th\or 5th\or
+ 6th\or 7th\or 8th\or 9th\or 10th\or
+ 11th\or 12th\or 13th\or 14th\or 15th\or
+ 16th\or 17th\or 18th\or 19th\or 20th\or
+ 21st\or 22nd\or 23rd\or 24th\or 25th\or
+ 26th\or 27th\or 28th\or 29th\or 30th\or
+ 31st\fi~\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or
+ December\fi\space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateaustralian}
+% Now, test for `australian' or `american'.
+% \changes{english-3.3n}{2004/06/12}{Add australian date}
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% The macro |\dateaustralian| redefines the command |\today| to
+% produce Australian resp.\ New Zealand dates.
+% \begin{macrocode}
+ \def\bbl@tempa{AU}
+ \ifx\bbl@tempa\bbl@tempb
+ \@namedef{date\CurrentOption}{%
+ \def\today{\number\day~\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or
+ December\fi\space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateamerican}
+% The macro |\dateamerican| redefines the command |\today| to
+% produce American dates.
+% \changes{english-3.0b}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{english-3.3i}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{english-3.3i}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+ \else
+ \@namedef{date\CurrentOption}{%
+ \def\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or
+ December\fi \space\number\day, \number\year}}
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasenglish}
+% \begin{macro}{\noextrasenglish}
+% The macro |\extrasenglish| will perform all the extra definitions
+% needed for the English language. The macro |\noextrasenglish| is
+% used to cancel the actions of |\extrasenglish|. For the moment
+% these macros are empty but they are defined for compatibility
+% with the other language definition files.
+%
+% \changes{english-3.3g}{1996/07/10}{Construct control sequences on
+% the fly}
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{}
+\@namedef{noextras\CurrentOption}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{english-3.3h}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/english.ins b/Master/texmf-dist/source/generic/babel/english.ins
new file mode 100644
index 00000000000..67c897423da
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/english.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{english.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{english.ldf}{\from{english.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/esperanto.dtx b/Master/texmf-dist/source/generic/babel/esperanto.dtx
new file mode 100644
index 00000000000..6a98c77ceb3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/esperanto.dtx
@@ -0,0 +1,341 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{259}
+%\iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{esperanto.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{esperanto}
+%\fi
+%\ProvidesFile{esperant.dtx}
+ [2005/03/30 v1.4r Esperanto support from the babel system]
+%\iffalse
+%% File 'esperanto.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Esperanto language definition file. A contribution
+% was made by Ruiz-Altaba Marti (ruizaltb@cernvm.cern.ch) Code from
+% esperant.sty version 1.1 by Joerg Knappen
+% (\texttt{knappen@vkpmzd.kph.uni-mainz.de}) was included in
+% version 1.2.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{esperanto.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{esperanto.dtx}
+%
+% \changes{esperanto-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{esperanto-1.1}{1992/02/15}{Brought up-to-date with
+% babel~3.2a}
+% \changes{esperanto-1.2}{1992/02/18}{Included code from
+% \texttt{esperant.sty}}
+% \changes{esperanto-1.4a}{1994/02/04}{Updated for \LaTeXe}
+% \changes{esperanto-1.4d}{1994/06/25}{Removed the use of
+% \cs{filedate}, moved Identification after loading of
+% \file{babel.def}}
+% \changes{esperanto-1.4e}{1995/02/09}{Moved identification code to
+% the top of the file}
+% \changes{esperanto-1.4f}{1995/06/14}{Corrected typos (PR1652)}
+% \changes{esperanto-1.4i}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{esperanto-1.4i}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Esperanto language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Ruiz-Altaba Marti
+% (\texttt{ruizaltb@cernvm.cern.ch}). Code from the file
+% \texttt{esperant.sty} by J\"org Knappen
+% (\texttt{knappen@vkpmzd.kph.uni-mainz.de}) was included.} defines
+% all the language-specific macros for the Esperanto language.
+%
+% For this language the character |^| is made active.
+% In table~\ref{tab:esp-act} an overview is given of its purpose.
+% \changes{esperanto-1.4j}{1997/01/06}{fixed typo in table caption
+% (funtion instead of function)}
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |^c| & gives \^c with hyphenation in the rest of the word
+% allowed, this works for c, C, g, G, H, J, s, S, z, Z\\
+% |^h| & prevents h\llap{\^{}} from becoming too tall\\
+% |^j| & gives \^\j\\
+% |^u| & gives \u u, with hyphenation in the rest of the word
+% allowed\\
+% |^U| & gives \u U, with hyphenation in the rest of the word
+% allowed\\
+% \verb=^|= & inserts a |\discretionary{-}{}{}|\\
+% \end{tabular}
+% \caption{The functions of the active character for Esperanto.}
+% \label{tab:esp-act}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{esperanto-1.4i}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{esperanto}\captionsesperanto
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{esperanto} will be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@esperanto| to see whether we have to do
+% something here.
+%
+% \changes{esperanto-1.0b}{1991/10/29}{Removed use of
+% \cs{makeatletter}}
+% \changes{esperanto-1.1}{1992/02/15}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{esperanto-1.4d}{1994/06/25}{Use \cs{@nopatterns} for the
+% warning}
+% \begin{macrocode}
+\ifx\l@esperanto\@undefined
+ \@nopatterns{Esperanto}
+ \adddialect\l@esperanto0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the
+% Esperanto language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsesperanto}
+% The macro |\captionsesperanto| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{esperanto-1.1}{1992/02/15}{Added \cs{seename},
+% \cs{alsoname} and \cs{prefacename}}
+% \changes{esperanto-1.3}{1993/07/10}{Repaired a number of mistakes,
+% indicated by D. Ederveen}
+% \changes{esperanto-1.3}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{esperanto-1.4a}{1994/02/04}{added missing closing brace}
+% \changes{esperanto-1.4g}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{esperanto-1.4i}{1996/07/06}{Replaced `Proof' by `Pruvo'
+% PR 2207}
+% \changes{esperanto-1.4p}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{esperanto-1.4q}{2002/01/07}{Added translation for Glossary}
+% \begin{macrocode}
+\addto\captionsesperanto{%
+ \def\prefacename{Anta\u{u}parolo}%
+ \def\refname{Cita\^\j{}oj}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Bibliografio}%
+ \def\chaptername{{\^C}apitro}%
+ \def\appendixname{Apendico}%
+ \def\contentsname{Enhavo}%
+ \def\listfigurename{Listo de figuroj}%
+ \def\listtablename{Listo de tabeloj}%
+ \def\indexname{Indekso}%
+ \def\figurename{Figuro}%
+ \def\tablename{Tabelo}%
+ \def\partname{Parto}%
+ \def\enclname{Aldono(j)}%
+ \def\ccname{Kopie al}%
+ \def\headtoname{Al}%
+ \def\pagename{Pa\^go}%
+ \def\subjectname{Temo}%
+ \def\seename{vidu}% a^u: vd.
+ \def\alsoname{vidu anka\u{u}}% a^u vd. anka\u{u}
+ \def\proofname{Pruvo}%
+ \def\glossaryname{Glosaro}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateesperanto}
+% The macro |\dateesperanto| redefines the command |\today| to
+% produce Esperanto dates.
+% \changes{esperanto-1.3}{1993/07/10}{Removed the capitals from
+% \cs{today}}
+% \changes{esperanto-1.4k}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{esperanto-1.4k}{1998/03/27}{Removed Rthe use of \cs{edef}
+% again}
+% \begin{macrocode}
+\def\dateesperanto{%
+ \def\today{\number\day{--a}~de~\ifcase\month\or
+ januaro\or februaro\or marto\or aprilo\or majo\or junio\or
+ julio\or a\u{u}gusto\or septembro\or oktobro\or novembro\or
+ decembro\fi,\space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasesperanto}
+% \begin{macro}{\noextrasesperanto}
+% The macro |\extrasesperanto| performs all the extra definitions
+% needed for the Esperanto language. The macro |\noextrasesperanto|
+% is used to cancel the actions of |\extrasesperanto|.
+%
+% For Esperanto the |^| character is made active. This is done
+% once, later on its definition may vary.
+%
+% \begin{macrocode}
+\initiate@active@char{^}
+% \end{macrocode}
+% Because the character |^| is used in math mode with quite a
+% different purpose we need to add an extra level of evaluation to
+% the definition of the active |^|. It checks whether math mode is
+% active; if so the shorthand mechanism is bypassed by a direct
+% call of |\normal@char^|.
+% \changes{esperanto-1.4n}{1999/09/30}{Added a check for math mode to
+% the definition of the shorthand character}
+% \changes{esperant0-1.4o}{1999/12/18}{Moved the check for math to
+% babel.def}
+% \begin{macrocode}
+\addto\extrasesperanto{\languageshorthands{esperanto}}
+\addto\extrasesperanto{\bbl@activate{^}}
+\addto\noextrasesperanto{\bbl@deactivate{^}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% In order to prevent problems with the active |^| we add a
+% shorthand on system level which expands to a `normal |^|.
+% \changes{esperanto-1.4l}{1999/04/11}{Added a shorthand definition on
+% system level}
+% \begin{macrocode}
+\declare@shorthand{system}{^}{\csname normal@char\string^\endcsname}
+% \end{macrocode}
+% And here are the uses of the active |^|:
+% \changes{esperanto-1.4h}{1995/07/27}{Added a few shorthands}
+% \begin{macrocode}
+\declare@shorthand{esperanto}{^c}{\^{c}\allowhyphens}
+\declare@shorthand{esperanto}{^C}{\^{C}\allowhyphens}
+\declare@shorthand{esperanto}{^g}{\^{g}\allowhyphens}
+\declare@shorthand{esperanto}{^G}{\^{G}\allowhyphens}
+\declare@shorthand{esperanto}{^h}{h\llap{\^{}}\allowhyphens}
+\declare@shorthand{esperanto}{^H}{\^{H}\allowhyphens}
+\declare@shorthand{esperanto}{^j}{\^{\j}\allowhyphens}
+\declare@shorthand{esperanto}{^J}{\^{J}\allowhyphens}
+\declare@shorthand{esperanto}{^s}{\^{s}\allowhyphens}
+\declare@shorthand{esperanto}{^S}{\^{S}\allowhyphens}
+\declare@shorthand{esperanto}{^u}{\u u\allowhyphens}
+\declare@shorthand{esperanto}{^U}{\u U\allowhyphens}
+\declare@shorthand{esperanto}{^|}{\discretionary{-}{}{}\allowhyphens}
+% \end{macrocode}
+%
+% \begin{macro}{\Esper}
+% \begin{macro}{\esper}
+% In \file{esperant.sty} J\"org Knappen provides the macros
+% |\esper| and |\Esper| that can be used instead of |\alph| and
+% |\Alph|. These macros are available in this file as well.
+%
+% Their definition takes place in two steps. First the toplevel.
+% \begin{macrocode}
+\def\esper#1{\@esper{\@nameuse{c@#1}}}
+\def\Esper#1{\@Esper{\@nameuse{c@#1}}}
+% \end{macrocode}
+% Then the second level.
+% \changes{esperanto-1.4q}{2002/01/08}{Removed the extra level of
+% expansion for more than five items, as was done in \LaTeX}
+% \begin{macrocode}
+\def\@esper#1{%
+ \ifcase#1\or a\or b\or c\or \^c\or d\or e\or f\or g\or \^g\or
+ h\or h\llap{\^{}}\or i\or j\or \^\j\or k\or l\or m\or n\or o\or
+ p\or s\or \^s\or t\or u\or \u{u}\or v\or z\else\@ctrerr\fi}
+\def\@Esper#1{%
+ \ifcase#1\or A\or B\or C\or \^C\or D\or E\or F\or G\or \^G\or
+ H\or \^H\or I\or J\or \^J\or K\or L\or M\or N\or O\or
+ P\or S\or \^S\or T\or U\or \u{U}\or V\or Z\else\@ctrerr\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\hodiau}
+% \begin{macro}{\hodiaun}
+% In \file{esperant.sty} J\"org Knappen provides two alternative
+% macros for |\today|, |\hodiau| and |\hodiaun|. The second macro
+% produces an accusative version of the date in Esperanto.
+% \begin{macrocode}
+\addto\dateesperanto{\def\hodiau{la \today}}
+\def\hodiaun{la \number\day --an~de~\ifcase\month\or
+ januaro\or februaro\or marto\or aprilo\or majo\or junio\or
+ julio\or a\u{u}gusto\or septembro\or oktobro\or novembro\or
+ decembro\fi, \space \number\year}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{esperanto-1.4i}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{esperanto}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/esperanto.ins b/Master/texmf-dist/source/generic/babel/esperanto.ins
new file mode 100644
index 00000000000..25e39025572
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/esperanto.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2000/09/26}
+\def\batchfile{esperanto.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{esperanto.ldf}{\from{esperanto.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/estonian.dtx b/Master/texmf-dist/source/generic/babel/estonian.dtx
new file mode 100644
index 00000000000..74bbb9a3384
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/estonian.dtx
@@ -0,0 +1,426 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{330}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{estonian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{estonian}
+%\fi
+%\ProvidesFile{estonian.dtx}
+ [2005/03/30 v1.0h Estonian support from the babel system]
+%\iffalse
+%% File `estonian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Estonian language Definition File
+%% Copyright (C) 1991 - 2005
+%% by Enn Saar, Tartu Astrophysical Observatory
+% Tartu Astrophysical Observatory
+% EE-2444 T\~oravere
+% Estonia
+% tel: +372 7 410 267
+% fax: +372 7 410 205
+% saar@aai.ee
+%
+% Johannes Braams, TeXniek
+%
+%% Please report errors to: Enn Saar saar at aai.ee
+%% (or J.L. Braams babel atbraams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Estonian language definition file. The original
+% version of this file was written by Enn Saar,
+% (saar@aai.ee).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{estonian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \changes{estonian-1.0b}{1995/06/16}{corrected typos}
+% \changes{estonian-1.0e}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \GetFileInfo{estonian.dtx}
+%
+% \section{The Estonian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author is Enn Saar,
+% (\texttt{saar@aai.ee}).} defines the language definition macro's
+% for the Estonian language.
+%
+% This file was written as part of the TWGML project, and borrows
+% heavily from the \babel\ German and Spanish language files
+% \file{germanb.ldf} and \file{spanish.ldf}.
+%
+% Estonian has the same umlauts as German (\"a, \"o, \"u), but in
+% addition to this, we have also \~o, and two recent characters
+% \v s and \v z, so we need at least two active characters.
+% We shall use |"| and |~| to type Estonian accents on ASCII
+% keyboards (in the 7-bit character world). Their use is given in
+% table~\ref{tab:estonian-quote}.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |~o| & |\~o|, (and uppercase); \\
+% |"a| & |\"a|, (and uppercase); \\
+% |"o| & |\"o|, (and uppercase); \\
+% |"u| & |\"u|, (and uppercase); \\
+% |~s| & |\v s|, (and uppercase); \\
+% |~z| & |\v z|, (and uppercase); \\
+% \verb="|= & disable ligature at this position;\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word;\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word; \\
+% |"`| & for Estonian low left double quotes (same as German);\\
+% |"'| & for Estonian right double quotes;\\
+% |"<| & for French left double quotes (also rather popular)\\
+% |">| & for French right double quotes.\\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{estonian.ldf}}\label{tab:estonian-quote}
+% \end{center}
+% \end{table}
+% These active accent characters behave according to their original
+% definitions if not followed by one of the characters indicated in
+% that table; the original quote character can be typed using the
+% macro |\dq|.
+%
+% We support also the T1 output encoding (and Cork-encoded text
+% input). You can choose the T1 encoding by the command
+% |\usepackage[T1]{fontenc}|. This package must be loaded before
+% \babel. As the standard Estonian hyphenation file
+% \file{eehyph.tex} is in the Cork encoding, choosing this encoding
+% will give you better hyphenation.
+%
+% As mentioned in the Spanish style file, it may happen that some
+% packages fail (usually in a \cs{message}). In this case you
+% should change the order of the \cs{usepackage} declarations
+% or the order of the style options in \cs{documentclass}.
+%
+% \StopEventually{}
+%
+% \subsection{Implementation}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{estonian-1.0e}{1996/10/30}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{estonian}\captionsestonian
+% \end{macrocode}
+%
+% If Estonian is not included in the format file (does not have
+% hyphenation patterns), we shall use English hyphenation.
+%
+% \begin{macrocode}
+\ifx\l@estonian\@undefined
+ \@nopatterns{Estonian}
+ \adddialect\l@estonian0
+\fi
+% \end{macrocode}
+%
+% Now come the commands to switch to (and from) Estonian.
+%
+% \begin{macro}{\captionsestonian}
+% The macro |\captionsestonian| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+%
+% \changes{estonian-1.0c}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{estonian-1.0d}{1995/07/27}{Added translation of `Proof'}
+% \changes{estonian-1.0h}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsestonian{%
+ \def\prefacename{Sissejuhatus}%
+ \def\refname{Viited}%
+ \def\bibname{Kirjandus}%
+ \def\appendixname{Lisa}%
+ \def\contentsname{Sisukord}%
+ \def\listfigurename{Joonised}%
+ \def\listtablename{Tabelid}%
+ \def\indexname{Indeks}%
+ \def\figurename{Joonis}%
+ \def\tablename{Tabel}%
+ \def\partname{Osa}%
+ \def\enclname{Lisa(d)}%
+ \def\ccname{Koopia(d)}%
+ \def\headtoname{}%
+ \def\pagename{Lk.}%
+ \def\seename{vt.}%
+ \def\alsoname{vt. ka}%
+ \def\proofname{Korrektuur}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }
+% \end{macrocode}
+%
+% These captions contain accented characters.
+%
+% \begin{macrocode}
+\begingroup \catcode`\"\active
+\def\x{\endgroup
+\addto\captionsestonian{%
+ \def\abstractname{Kokkuv~ote}%
+ \def\chaptername{Peat"ukk}}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateestonian}
+% The macro |\dateestonian| redefines the command |\today| to
+% produce Estonian dates.
+% \changes{estonian-1.0f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{estonian-1.0f}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\begingroup \catcode`\"\active
+\def\x{\endgroup
+ \def\month@estonian{\ifcase\month\or
+ jaanuar\or veebruar\or m"arts\or aprill\or mai\or juuni\or
+ juuli\or august\or september\or oktoober\or november\or
+ detsember\fi}}
+\x
+\def\dateestonian{%
+ \def\today{\number\day.\space\month@estonian
+ \space\number\year.\space a.}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasestonian}
+% \begin{macro}{\noextrasestonian}
+% The macro |\extrasestonian| will perform all the extra
+% definitions needed for Estonian. The macro |\noextrasestonian| is
+% used to cancel the actions of |\extrasestonian|. For Estonian,
+% |"| is made active and has to be treated as `special' (|~| is
+% active already).
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\initiate@active@char{~}
+\addto\extrasestonian{\languageshorthands{estonian}}
+\addto\extrasestonian{\bbl@activate{"}\bbl@activate{~}}
+% \end{macrocode}
+% Store the original macros, and redefine accents.
+%
+% \begin{macrocode}
+\addto\extrasestonian{\babel@save\"\umlautlow\babel@save\~\tildelow}
+% \end{macrocode}
+%
+% \changes{estonian-1.0d}{1995/07/27}{Removed the code that changes
+% category, lower case, uper case and space factor codes }
+%
+% Estonian does not use extra spaces after sentences.
+%
+% \begin{macrocode}
+\addto\extrasestonian{\bbl@frenchspacing}
+\addto\noextrasestonian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\estonianhyphenmins}
+% For Estonian, |\lefthyphenmin| and |\righthyphenmin| are
+% both~2.
+% \changes{estonian-1.0h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tildelow}
+% \begin{macro}{\gentilde}
+% \begin{macro}{\newtilde}
+% \begin{macro}{\newcheck}
+% The standard \TeX\ accents are too high for Estonian typography,
+% we have to lower them (following the \babel\ German style). For
+% a detailed explanation see the file \file{glyphs.dtx}.
+%
+% \begin{macrocode}
+\def\tildelow{\def\~{\protect\gentilde}}
+\def\gentilde#1{\if#1o\newtilde{#1}\else\if#1O\newtilde{#1}%
+ \else\newcheck{#1}%
+ \fi\fi}
+\def\newtilde#1{\leavevmode\allowhyphens
+ {\U@D 1ex%
+ {\setbox\z@\hbox{\char126}\dimen@ -.45ex\advance\dimen@\ht\z@
+ \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
+ \accent126\fontdimen5\font\U@D #1}\allowhyphens}
+\def\newcheck#1{\leavevmode\allowhyphens
+ {\U@D 1ex%
+ {\setbox\z@\hbox{\char20}\dimen@ -.45ex\advance\dimen@\ht\z@
+ \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
+ \accent20\fontdimen5\font\U@D #1}\allowhyphens}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% We save the double quote character in |\dq|, and tilde in |\til|,
+% and store the original definitions of |\"| and |\~| as |\dieresis|
+% and |\texttilde|.
+%
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\edef\x{\endgroup
+ \def\noexpand\dq{"}
+ \def\noexpand\til{~}}
+\x
+\let\dieresis\"
+\let\texttilde\~
+% \end{macrocode}
+%
+% This part follows closely \file{spanish.ldf}. We check the
+% encoding and if it is T1, we have to tell \TeX\ about our
+% redefined accents.
+%
+% \changes{estonian-1.0g}{1999/04/11}{use \cs{bbl@t@one} instead of
+% \cs{bbl@next}}
+% \begin{macrocode}
+\ifx\f@encoding\bbl@t@one
+ \let\@umlaut\dieresis
+ \let\@tilde\texttilde
+ \DeclareTextComposite{\~}{T1}{s}{178}
+ \DeclareTextComposite{\~}{T1}{S}{146}
+ \DeclareTextComposite{\~}{T1}{z}{186}
+ \DeclareTextComposite{\~}{T1}{Z}{154}
+ \DeclareTextComposite{\"}{T1}{'}{17}
+ \DeclareTextComposite{\"}{T1}{`}{18}
+ \DeclareTextComposite{\"}{T1}{<}{19}
+ \DeclareTextComposite{\"}{T1}{>}{20}
+% \end{macrocode}
+%
+% If the encoding differs from T1, we expand the accents, enabling
+% hyphenation beyond the accent. In this case \TeX\ will not find
+% all possible breaks, and we have to warn people.
+%
+% \begin{macrocode}
+\else
+ \wlog{Warning: Hyphenation would work better for the T1 encoding.}
+ \let\@umlaut\newumlaut
+ \let\@tilde\gentilde
+\fi
+% \end{macrocode}
+%
+% Now we define the shorthands.
+%
+% \changes{estonian-1.0d}{1995/07/27}{The second argument was missing
+% in the definition of some of the double-quote shorthands}
+% \begin{macrocode}
+\declare@shorthand{estonian}{"a}{\textormath{\"{a}}{\ddot a}}
+\declare@shorthand{estonian}{"A}{\textormath{\"{A}}{\ddot A}}
+\declare@shorthand{estonian}{"o}{\textormath{\"{o}}{\ddot o}}
+\declare@shorthand{estonian}{"O}{\textormath{\"{O}}{\ddot O}}
+\declare@shorthand{estonian}{"u}{\textormath{\"{u}}{\ddot u}}
+\declare@shorthand{estonian}{"U}{\textormath{\"{U}}{\ddot U}}
+% \end{macrocode}
+% german and french quotes,
+% \changes{estonian-1.0f}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{estonian}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{estonian}{"'}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\declare@shorthand{estonian}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{estonian}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\declare@shorthand{estonian}{~o}{\textormath{\@tilde o}{\tilde o}}
+\declare@shorthand{estonian}{~O}{\textormath{\@tilde O}{\tilde O}}
+\declare@shorthand{estonian}{~s}{\textormath{\@tilde s}{\check s}}
+\declare@shorthand{estonian}{~S}{\textormath{\@tilde S}{\check S}}
+\declare@shorthand{estonian}{~z}{\textormath{\@tilde z}{\check z}}
+\declare@shorthand{estonian}{~Z}{\textormath{\@tilde Z}{\check Z}}
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{estonian}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{estonian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{estonian}{""}{\dq}
+\declare@shorthand{estonian}{~~}{\til}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{estonian-1.0e}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{estonian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/estonian.ins b/Master/texmf-dist/source/generic/babel/estonian.ins
new file mode 100644
index 00000000000..ed51cbad940
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/estonian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{estonian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{estonian.ldf}{\from{estonian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/finnish.dtx b/Master/texmf-dist/source/generic/babel/finnish.dtx
new file mode 100644
index 00000000000..ccd3b9e62e4
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/finnish.dtx
@@ -0,0 +1,362 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{172}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{finnish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{finnish}
+%\fi
+%\ProvidesFile{finnish.dtx}
+ [2005/03/30 v1.3p Finnish support from the babel system]
+%\iffalse
+%% File `finnish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Finnish language definition file. A contribution
+% was made by Mikko KANERVA (KANERVA@CERNVM) and Keranen Reino
+% (KERANEN@CERNVM).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{finnish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{finnish.dtx}
+%
+% \changes{finnish-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{finnish-1.1}{1991/02/15}{Brought up-to-date with babel 3.2a}
+% \changes{finnish-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{finnish-1.3c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{finnish-1.3d}{1994/06/30}{Removed a few references to
+% \file{babel.com}}
+% \changes{finnish-1.3i}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Finnish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Mikko KANERVA
+% (\texttt{KANERVA@CERNVM}) and Keranen Reino
+% (\texttt{KERANEN@CERNVM}).} defines all the language definition
+% macros for the Finnish language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:finnish-quote} an overview is given of its purpose.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |"=| & an explicit hyphen sign for expressions such as
+% ``pakastekaapit ja -arkut''.\\
+% |""| & like \verb="-=, but producing no hyphen sign (for
+% words that should break at some sign such as
+% ``entrada/salida.''\\
+% |"`| & lowered double left quotes (looks like ,,)\\
+% |"'| & normal double right quotes\\
+% |"<| & for French left double quotes (similar to $<<$).\\
+% |">| & for French right double quotes (similar to $>>$).\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word.
+% \end{tabular}
+% \caption{The extra definitions made by \file{finnish.ldf}}
+% \label{tab:finnish-quote}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{finnish-1.3i}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{finnish}\captionsfinnish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{finnish} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@finnish| to see whether we have to do something here.
+%
+% \changes{finnish-1.0b}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{finnish-1.1}{1992/02/15}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{finnish-1.3c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@finnish\@undefined
+ \@nopatterns{Finnish}
+ \adddialect\l@finnish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the
+% Finnish language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsfinnish}
+% The macro |\captionsfinnish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{finnish-1.1}{1992/02/15}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{finnish-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{finnish-1.1.2}{1993/09/16}{Added translations}
+% \changes{finnish-1.3g}{1995/07/02}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{finnish-1.3h}{1995/07/25}{Added finnish word for `Proof'}
+% \changes{finnish-1.3n}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{finnish-1.3o}{2001/03/12}{Provided translation for
+% Glossary}
+% \begin{macrocode}
+\addto\captionsfinnish{%
+ \def\prefacename{Esipuhe}%
+ \def\refname{Viitteet}%
+ \def\abstractname{Tiivistelm\"a}
+ \def\bibname{Kirjallisuutta}%
+ \def\chaptername{Luku}%
+ \def\appendixname{Liite}%
+ \def\contentsname{Sis\"alt\"o}% /* Could be "Sis\"allys" as well */
+ \def\listfigurename{Kuvat}%
+ \def\listtablename{Taulukot}%
+ \def\indexname{Hakemisto}%
+ \def\figurename{Kuva}%
+ \def\tablename{Taulukko}%
+ \def\partname{Osa}%
+ \def\enclname{Liitteet}%
+ \def\ccname{Jakelu}%
+ \def\headtoname{Vastaanottaja}%
+ \def\pagename{Sivu}%
+ \def\seename{katso}%
+ \def\alsoname{katso my\"os}%
+ \def\proofname{Todistus}%
+ \def\glossaryname{Sanasto}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datefinnish}
+% The macro |\datefinnish| redefines the command |\today| to
+% produce Finnish dates.
+% \changes{finnish-1.3e}{1994/07/12}{Added a`.' after the number of
+% the day}
+% \changes{finnish-1.3k}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{finnish-1.3k}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\datefinnish{%
+ \def\today{\number\day.~\ifcase\month\or
+ tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
+ toukokuuta\or kes\"akuuta\or hein\"akuuta\or elokuuta\or
+ syyskuuta\or lokakuuta\or marraskuuta\or joulukuuta\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasfinnish}
+% \begin{macro}{\noextrasfinnish}
+% Finnish has many long words (some of them compound, some not).
+% For this reason hyphenation is very often the only solution in
+% line breaking. For this reason the values of |\hyphenpenalty|,
+% |\exhyphenpenalty| and |\doublehyphendemerits| should be
+% decreased. (In one of the manuals of style Matti Rintala noticed
+% a paragraph with ten lines, eight of which ended in a hyphen!)
+%
+% Matti Rintala noticed that with these changes \TeX\ handles
+% Finnish very well, although sometimes the values of |\tolerance|
+% and |\emergencystretch| must be increased. However, I don't think
+% changing these values in \file{finnish.ldf} is appropriate, as
+% the looseness of the font (and the line width) affect the correct
+% choice of these parameters.
+% \changes{finnish-1.3f}{1995/05/13}{Added the setting of more
+% hyphenation parameters, according to PR1027}
+% \begin{macrocode}
+\addto\extrasfinnish{%
+ \babel@savevariable\hyphenpenalty\hyphenpenalty=30%
+ \babel@savevariable\exhyphenpenalty\exhyphenpenalty=30%
+ \babel@savevariable\doublehyphendemerits\doublehyphendemerits=5000%
+ \babel@savevariable\finalhyphendemerits\finalhyphendemerits=5000%
+ }
+\addto\noextrasfinnish{}
+% \end{macrocode}
+%
+% Another thing |\extrasfinnish| needs to do is to ensure that
+% |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasfinnish| will switch it of again.
+% \changes{finnish-1.3f}{1995/05/15}{Added the setting of
+% \cs{frenchspacing}}
+% \begin{macrocode}
+\addto\extrasfinnish{\bbl@frenchspacing}
+\addto\noextrasfinnish{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% For Finnish the \texttt{"} character is made active. This is
+% done once, later on its definition may vary. Other languages in
+% the same document may also use the \texttt{"} character for
+% shorthands; we specify that the finnish group of shorthands
+% should be used.
+% \changes{finnish-1.3g}{1995/07/02}{Added the active double quote}
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasfinnish{\languageshorthands{finnish}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{finnish-1.3n}{1999/12/16}{Deactive shorthands ouside of Finnish}
+% \begin{macrocode}
+\addto\extrasfinnish{\bbl@activate{"}}
+\addto\noextrasfinnish{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+%
+% The `umlaut' character should be positioned lower on \emph{all}
+% vowels in Finnish texts.
+% \begin{macrocode}
+\addto\extrasfinnish{\umlautlow\umlautelow}
+\addto\noextrasfinnish{\umlauthigh}
+% \end{macrocode}
+%
+% First we define access to the low opening double quote and
+% guillemets for quotations,
+% \changes{finnish-1.3k}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \changes{finnish-1.3m}{1999/04/13}{Added misisng closing brace}
+% \begin{macrocode}
+\declare@shorthand{finnish}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{finnish}{"'}{%
+ \textormath{\textquotedblright}{\mbox{\textquotedblright}}}
+\declare@shorthand{finnish}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{finnish}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behave a little different from |\-|.
+% \changes{finnish-1.3p}{2001/11/13}{\texttt{"=} should also use
+% \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\declare@shorthand{finnish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{finnish}{""}{\hskip\z@skip}
+\declare@shorthand{finnish}{"=}{\hbox{-}\bbl@allowhyphens}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{finnish}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% very unfortunate for languages such as Dutch, Finnish and German,
+% where long compound words are quite normal and all one needs is a
+% means to indicate an extra hyphenation position on top of the
+% ones that \TeX\ can generate from the hyphenation patterns.
+% \changes{finnish-1.3g}{1995/07/02}{Added change of \cs{-}}
+% \changes{finnish-1.3n}{2000/09/19}{\cs{allowhyphens} should have
+% been \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\addto\extrasfinnish{\babel@save\-}
+\addto\extrasfinnish{\def\-{\bbl@allowhyphens
+ \discretionary{-}{}{}\bbl@allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\finishhyphenmins}
+% The finnish hyphenation patterns can be used with |\lefthyphenmin|
+% set to~2 and |\righthyphenmin| set to~2.
+% \changes{finnish-1.3f}{1995/05/13}{use \cs{finnishhyphenmins} to
+% store the correct values}
+% \changes{finnish-1.3n}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{finnish-1.3i}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{finnish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
+
diff --git a/Master/texmf-dist/source/generic/babel/finnish.ins b/Master/texmf-dist/source/generic/babel/finnish.ins
new file mode 100644
index 00000000000..370fbf37b29
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/finnish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{finnish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{finnish.ldf}{\from{finnish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/frenchb.dtx b/Master/texmf-dist/source/generic/babel/frenchb.dtx
new file mode 100644
index 00000000000..279ee712f9b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/frenchb.dtx
@@ -0,0 +1,2477 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{1985}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript. Nothing to write to the .cfg file, if generated.
+%<*dtx>
+\ProvidesFile{frenchb.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{french}
+%\ProvidesFile{frenchb.dtx}
+%<*!cfg>
+ [2005/02/06 v1.6g French support from the babel system]
+%</!cfg>
+%<*cfg>
+%% frenchb.cfg: configuration file for frenchb.ldf
+%% Daniel Flipo Daniel.Flipo at univ-lille1.fr
+%</cfg>
+%% File `frenchb.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%<*!cfg>
+%% Frenchb language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%% Daniel Flipo, GUTenberg
+%
+%% Please report errors to: Daniel Flipo, GUTenberg
+%% Daniel.Flipo at univ-lille1.fr
+%</!cfg>
+%
+% This file is part of the babel system, it provides the source
+% code for the French language definition file.
+% For differences with francais.sty (author J. Braams) and with
+% french.sty (author B. Gaulle), see documentation printed by
+% |latex frenchb.dtx|.
+%
+%<*filedriver>
+\documentclass[a4paper]{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \mathit lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+\parindent = 0pt
+\begin{center}
+ \textbf{\Large A Babel language definition file for French}\\[3mm]^^A\]
+ Daniel \textsc{Flipo}\\
+ \texttt{Daniel.Flipo@univ-lille1.fr}
+\end{center}
+ \DocInput{frenchb.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{frenchb.dtx}
+%
+% \changes{frenchb-1.1}{1995/12/23}{Added a hook to insert space or
+% not before `double punctuation'.}
+%
+% \changes{frenchb-1.1b}{1996/08/07}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+%
+% \changes{frenchb-1.1b}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \changes{frenchb-1.3f}{1999/04/11}{Deleted sectioning command
+% \cs{section}\{About French Typography\}.}
+%
+% \section{The French language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.}, derived from \file{frenchy.sty}, defines all
+% the language definition macros for the French language.
+%
+% Customization for the French language is achieved following the
+% book ``Lexique des r\`egles typographiques en usage \`a
+% l'Imprimerie nationale'' troisi\`eme \'edition (1994),
+% ISBN-2-11-081075-0.
+%
+% This file has been designed to be used with \LaTeXe, \LaTeX-2.09
+% and Plain\TeX{} formats. If you are still using \LaTeX-2.09, you
+% \emph{should} consider switching to \LaTeXe!
+%
+% The command |\selectlanguage{french}| switches to the French
+% language%
+% \footnote{\texttt{\textbackslash selectlanguage\{francais\}}
+% and \texttt{\textbackslash selectlanguage\{frenchb\}} are kept
+% for backward compatibility but should no longer be used.},
+% with the following effects:
+% \begin{enumerate}
+% \item French hyphenation patterns are made active;
+% \item `double punctuation' is made active for correct spacing
+% in French;
+% \item |\today| prints the date in French;
+% \item the caption names are translated into French
+% (\LaTeX{} only);
+% \item the default items in itemize environment are set to `--'
+% instead of \textbullet, and all vertical spacing and glue
+% is deleted, a hook to reset standard \LaTeX{} spacing
+% is provided (|\FrenchItemizeSpacingfalse|);
+% it is possible to change `--' to something else (`---'
+% for instance) by redefining |\FrenchLabelItem|;
+% apart from the global hook |\FrenchLabelItem|, it is
+% also possible to change the `labelitems' at any level
+% (1 to 4) in French, using the standard \LaTeX{} syntax,
+% for instance: |\renewcommand{\labelitemii}{\textbullet}|;
+% in order to be effective in French, the redefinitions
+% have to be made when French is the current language
+% (i.e.\ \emph{after} the |\begin{document}|), the changes are
+% saved when switching to another language and will be
+% remembered of, when switching back to French;
+% \item vertical spacing in general \LaTeX{} lists is
+% shortened, a hook to reset standard \LaTeX{} settings
+% is provided (|\FrenchListSpacingfalse|) ;
+% \item the first paragraph of each section is indented
+% (\LaTeX{} only);
+% \item the space after |\dots| is removed in French.
+% \end{enumerate}
+%
+% Some commands are provided in |frenchb| to make typesetting
+% easier:
+% \begin{enumerate}
+% \item French quotation marks can be entered using the commands
+% |\og| and |\fg| which work in \LaTeXe, \LaTeX-2.09 and
+% Plain\TeX{}, their appearance depending on what is
+% available to draw them; if you use \LaTeXe{} \emph{and}
+% |T1|-encoding you can also enter them as
+% |<<~French quotation marks~>>| but then
+% \emph{don't forget} the unbreakable spaces, (|\og| and
+% |\fg| provide for correct line breaks and better
+% horizontal spacing).
+% |\og| and |\fg| can be used outside French, they provide
+% then English quotes `` and ''.
+% \item A command |\up| is provided to typeset superscripts like
+% |M\up{me}| (abbreviation for ``Madame''), |1\up{er}| (for
+% ``premier'').
+% \item Family names should be typeset in small capitals and never
+% be hyphenated, the macro |\bsc| (boxed small caps) does
+% this, e.g., |Leslie~\bsc{Lamport}| will produce
+% Leslie~\mbox{\textsc{Lamport}}.
+% \item Commands |\primo|, |\secundo|, |\tertio| and |\quarto|
+% may be used to enumerate in lists.
+% \item Abbreviations for ``Num\'ero'' and ``num\'ero'' are
+% obtained via the commands |\No|, |\no|.
+% \item Two commands are provided to typeset the symbol for
+% ``degr\'e'': |\degre| prints the raw character and
+% |\degres| should be used to typeset temperatures (e.g.,
+% ``|20~\degres C|'' with an unbreakable space), or for
+% alcohols' strengths (e.g., ``|45\degres|'' with \emph{no}
+% space in French).
+% \item In math mode the comma has to be surrounded with
+% braces to avoid a spurious space being inserted after it,
+% in decimal numbers for instance (see the \TeX{}book p.~134).
+% The command |\DecimalMathComma| makes the comma be an
+% ordinary character \emph{in French only} (no space added);
+% as a counterpart, if |\DecimalMathComma| is active, an
+% explicit space has to be added in lists and intervals:
+% |$[0,\ 1]$|, |$(x,\ y)$|. |\StandardMathComma| switches back
+% to the standard behaviour of the comma.
+% \item A command |\nombre| is provided to easily typeset numbers:
+% it works both in text and in math mode: inputting
+% |\nombre{3141,592653}| will format this number properly
+% according to the current language (French or non-French):
+% each slice of three digits will be separated either with
+% a comma in English or with a space in French (if you prefer
+% a thin space instead of a normal space, just add the command
+% |\ThinSpaceInFrenchNumbers| to the preamble of your document,
+% or to |frenchb.cfg|).
+% The command |\nombre| is a contribution of Vincent Jalby
+% using ideas of David Carlisle in comma.sty.
+% \item |frenchb| has been designed to take advantage of the |xspace|
+% package if present: adding |\usepackage{xspace}| in the
+% preamble will force macros like |\fg|, |\ier|, |\ieme|,
+% |\dots|, \dots, to respect the spaces you type after them,
+% for instance typing `|1\ier juin|' will print
+% `1\textsuperscript{er} juin' (no need for a forced space
+% after |1\ier|).
+% \item Two commands, |\FrenchLayout| and |\StandardLayout| (to be
+% used \emph{only in the preamble}) are provided to unify the
+% layout of multilingual documents (it mainly concerns lists)
+% regardless the current language (see section~\ref{sec-global}
+% for details).
+% \item Two commands |\AddThinSpaceBeforeFootnotes| and
+% |\FrenchFootnotes| enable to customize the layout of
+% footnotes following the French IN's specifications;
+% the first one, which can only be used \emph{before} the
+% |\begin{document}|, adds a thinspace in the running text
+% before the number or symbol calling the footnote; the
+% second one modifies the footnote's layout: it typesets
+% leading numbers as `1.\hspace{.5em}' instead of
+% `$\hbox{}^1$'. |\FrenchFootnotes| has no effect on footnotes
+% numbered with symbols (as in the |\thanks| command).
+%
+% None of these commands are active by default, both can
+% be best added to |frenchb.cfg| or to the preamble of the
+% document. |\FrenchFootnotes| and |\StandardFootnotes|,
+% which cancels the effect of |\FrenchFootnotes| for the
+% text coming next, can be used anywhere in the document.
+% The command |\StandardFootnotes| may be useful when
+% some footnotes are numbered with letters (inside minipages
+% for instance).
+%
+% |\AddThinSpaceBeforeFootnotes| and |\FrenchFootnotes| act
+% on \emph{all} footnotes whatever the current language is.
+% \end{enumerate}
+%
+% \vspace{\baselineskip}
+% All commands previously available in |francais.ldf| have been
+% included in |frenchb.ldf| for compatibility, sometimes with
+% updated definitions.
+%
+% The |french| package, by Bernard~\textsc{Gaulle}, was not
+% designed to run with \babel\ (although the latest versions claim
+% to be \babel\ compatible), but rather as a stand-alone package
+% for the French language.
+% It provides many more functionalities (like |\lettrine|,
+% |\sommaire|\dots) not available in |frenchb|,
+% at the cost of a much greater complexity and possible
+% incompatibilities with other languages.
+%
+% As |french| is known to produce the best layout available for
+% French typography, I have borrowed many ideas from Bernard's file.
+% I did my best to help users of both packages (|french| and
+% |frenchb|) to exchange their sources files easily (see the example
+% configuration file below in section~\ref{sec-cfg}), with one
+% exception which affects the way French quotation marks are
+% entered: |frenchb| uses \emph{macros} (|\og| and |\fg|) while
+% |french| uses active characters (|<<| and |>>|).
+%
+% \vspace{\baselineskip}
+% French typographic rules specify that some white space should be
+% present before `double punctuation' characters. These characters
+% are |;| |!| |?| and |:|.
+% In order to get this white space automatically, the category code
+% of these characters is made |\active|. In French, the user
+% \emph{should} input these four characters preceded with a space,
+% but as many people forget about it (even among native French
+% writers!), the default behaviour of |frenchb| is to automatically
+% add a |\thinspace| before `|;|' `|!|' `|?|' and a normal
+% (unbreakable) space before~`|:|' (this is the rule in French
+% typography). It's up to the user to add or not a space
+% \emph{after} `double punctuation' characters: usually a space is
+% necessary, but not always (before a full point or a closing brace
+% for instance), so this cannot done automatically.
+%
+% In (rare) cases where no space should be added before a `double
+% punctuation', either use |\string;| |\string:| |\string!|
+% |\string?| instead of |;| |:| |!| |?|, or switch locally to
+% English. For instance you can type |C\string:TEX| or
+% |\begin{otherlanguage}{english}{C:TEX}\end{otherlanguage}| to
+% avoid the space before~|:| in a MS-DOS path.
+%
+% Some users dislike this automatic insertion of a space before
+% `double punctuation', and prefer to decide themselves whether a
+% space should be added or not; so a hook |\NoAutoSpaceBeforeFDP|
+% is provided: if this command is added (in file |frenchb.cfg|, or
+% anywhere in a document) |frenchb| will respect your typing, and
+% introduce a suitable space before `double punctuation' \emph{if
+% and only if} a space is typed in the source file before those
+% signs.
+%
+% The command |\AutoSpaceBeforeFDP| switches back to the
+% default behaviour of |frenchb|.
+%
+% \vspace{\baselineskip}
+% Once you have built your format, a good precaution would be to
+% perform some basic tests about hyphenation in French. For
+% \LaTeXe{} I suggest this:
+% \begin{itemize}
+% \item run the following file, with the encoding suitable for
+% your machine (\textit{my-encoding} will be |latin1| for
+% \textsc{unix} machines and PCs running~Windows, |applemac|
+% for Macintoshs, or |cp850| for PCs running~DOS). \\[3mm]^^A\]
+% |%%% Test file for French hyphenation.|\\
+% |\documentclass{article}|\\
+% |\usepackage[|\textit{my-encoding}|]{inputenc}|\\
+% |\usepackage[T1]{fontenc} % Use EC fonts for French|\\
+% |%\usepackage{aeguill} % Uncomment this line and|\\
+% | % comment out the preceeding one|\\
+% | % to use AE virtual fonts.|\\
+% |\usepackage[francais]{babel}|\\
+% |\begin{document}|\\
+% |\showhyphens{signal container \'ev\'enement alg\`ebre}|\\
+% |\showhyphens{|\texttt{signal container \'ev\'enement
+% alg\`ebre}|}|\\
+% |\end{document}|
+% \item check the hyphenations proposed by \TeX{} in your log-file;
+% in French you should get with both 7-bit and 8-bit encodings\\
+% \texttt{si-gnal contai-ner \'ev\'e-ne-ment al-g\`ebre}.\\
+% Do not care about how accented characters are displayed in the
+% log-file, what matters is the position of the `|-|' hyphen
+% signs \emph{only}.
+% \end{itemize}
+% If they are all correct, your installation (probably) works fine,
+% if one (or more) is (are) wrong, ask a local wizard to see what's
+% going wrong and perform the test again (or e-mail me about what
+% happens).\\
+% Frequent mismatches:
+% \begin{itemize}
+% \item you get |sig-nal con-tainer|, this probably means that the
+% hyphenation patterns you are using are for US-English, not for
+% French;
+% \item you get no hyphen at all in \texttt{\'ev\'e-ne-ment}, this
+% probably means that you are using CM fonts and the macro
+% |\accent| to produce accented characters.
+% Using EC fonts with built-in accented characters or Ml\TeX{}
+% with CM fonts avoids this type of mismatch.
+% \end{itemize}
+%
+% \vspace{\baselineskip}
+% |frenchb| has been improved using helpful suggestions from many
+% people, the main contributions came from Vincent~Jalby.
+% Thanks to all of them!
+%
+% \subsection*{Changes}
+%
+% First version released: 1.1 as of 1996/05/31 part of
+% \babel-3.6beta.
+%
+% \textbf{Changes in version 1.1b}: update for \babel-3.6.
+%
+% \textbf{Changes in version 1.2}: new command |\nombre| to
+% format numbers; removed command |\fup| borrowed from the
+% |french| package (|\up| does a better job in \LaTeXe);
+% also removed aliases |\french| and |\english| (frenchb.cfg
+% is a better place for these).
+%
+% \textbf{Changes in version 1.3}:
+% \begin{itemize}
+% \item The `xspace' package, when present, now controls
+% spacing after all (sensible) macros, formerly `xspace'
+% worked on |\fg| (suggested by Vincent~Jalby);
+% \item spacing after opening and before closing guillemets
+% improved as suggested by Thierry~Bouche;
+% \item a replacement for poor looking guillemets in OT1 encoding
+% (\emph{math} fonts are used to emulate them) is provided
+% if the file |ot2wncyr.fd| is found: this file defines an
+% OT2 encoding using AMS Cyrillic fonts; these
+% have built-in guillemets, they are \emph{text} fonts,
+% are free, and are distributed as METAFONT and Type1 fonts
+% (good for pdftex!), the replacement was suggested by
+% G\'erard~Degrez; if the files |ot2wncyr.fd|, |wncy*.mf|,
+% |wncy*.tfm|, and |wncy*.pfb| aren't available on your
+% system, you \emph{should} get them from \mbox{CTAN};
+% if your system complains about missing |wncy*.tfm| fonts,
+% it means your \TeX{} system is \emph{incomplete}, as a
+% quick fix, you can either remove |ot2wncyr.fd| or add the
+% command |\LasyGuillemets| to the preamble of your document
+% or to |frenchb.cfg|, then |frenchb| will behave as it did
+% in the previous versions.\\
+% In case Cyrillic guillemets do not fit, it is possible
+% to pick French guillemets from any font using the
+% command |\FrenchGuillemetsFrom| which requires 4 arguments
+% |\FrenchGuillemetsFrom{|{\it coding}|}{|{\it font}\relax
+% |}{|{\it char-left}|}{|{\it char-right}|}|, for instance,
+% add |\FrenchGuillemetsFrom{T1}{ppl}{19}{20}| to the
+% preamble of your document or to |frenchb.cfg|, to pick
+% French guillemets from Palatino (fontname=ppl, char 19
+% and 20 are left and right guillemets in T1-encoding).
+% This was suggested by Michel~Bovani.
+% \item the environment `itemize' has been redesigned in French
+% according to specifications from Jacques~Andr\'e
+% and Thierry~Bouche; it is possible to switch back to the
+% settings of version~1.2: add |\FrenchItemizeSpacingfalse|
+% \emph{after} loading |frenchb| in the preamble (this can
+% be useful to process old documents);
+% \item two switches have been added to go back to standard
+% \LaTeX{} list spacing |\FrenchItemizeSpacingfalse|
+% and |\FrenchListSpacingfalse|;
+% \item |\nombre| now properly handles signs in \LaTeXe;
+% \item definition of |\dots| changed in French;
+% \item in French, with the standard \LaTeX{} classes, captions
+% in figures and tables are printed with an endash instead
+% of a colon.
+% \end{itemize}
+%
+% \textbf{Changes in version 1.4}:
+% \begin{itemize}
+% \item the redefinition of|\@makecaption| is changed not to
+% overwrite the changes made by some classes (koma-script,
+% amsart, ua-thesis\dots) as pointed out by Werner~Lemberg;
+% \item a hook, |\FrenchGuillemetsFrom|, is provided to pick
+% French guillemets from any font (suggested by
+% Michel~Bovani, works \emph{only} in OT1-encoding);
+% \item a hook, |\FrenchLabelItem|, is provided to enable marks
+% other than `--' (|\textendash|) in French lists
+% (also suggested by Michel~Bovani);
+% \item |\DecimalMathComma|, |\StandardMathComma|,
+% |\ThinSpaceInFrenchNumbers| added;
+% \item |\FrenchLayout| and |\StandardLayout| added;
+% \item an example of customization file |frenchb.cfg| is
+% included in |frenchb.dtx|.
+% \end{itemize}
+%
+% \textbf{Changes in version 1.5}:
+% \begin{itemize}
+% \item The settings for spacing in French lists are no longer
+% tuned at the |\@trivlist| level but within |\list|; this
+% enables the users to provide their own settings for the
+% lists they define with |\list| (suggested by P. Pichaureau).
+% Although the layout of the standard lists
+% \emph{has not changed}, some lists, based directly on
+% |\@trivlist| or |\trivlist|, could possibly be typeset
+% differently when upgrading from version 1.4 to 1.5.
+% The command |\FrenchOldTrivlisttrue| could then, be useful
+% to process older documents.
+% \item Apart from the global hook |\FrenchLabelItem|, it is
+% now also possible to change the `labelitems' at any level
+% (1 to 4) in French, using the standard \LaTeX{} syntax,
+% for instance: |\renewcommand{\labelitemii}{\textbullet}|.
+% \item The internal name for the French language has been
+% changed from |frenchb| to |french|, it means that
+% |\captionsfrench|, |\datefrench|, |\extrasfrench|,
+% |\noextrasfrench|, are to be used now instead of
+% |\captionsfrenchb|, |\datefrenchb|, |\extrasfrenchb|,
+% |\noextrasfrenchb|.
+% \item From version 1.5f on, it is possible to customize
+% the space inserted before a colon in French; its default
+% value is |\space| (as in previous versions of |frenchb|),
+% but it can now be changed to |\thinspace| by redefining
+% |\Fcolonspace|.
+% \end{itemize}
+%
+% \textbf{Changes in version 1.6}:
+% \begin{itemize}
+% \item Two new commands are provided:
+% |\AddThinSpaceBeforeFootnotes| and |\FrenchFootnotes|;
+% they enable to typeset footnotes according to the
+% French IN's specifications (suggested by Jacques~Andr\'e).
+% \item |frenchb| will make use of |\textdegree| (TS1 encoding)
+% to typeset degrees whenever possible.
+% \item Default guillemets have been changed \emph{in OT1
+% encoding only} in version~1.6c: the former ones were picked
+% up in the wncyr fonts, which forced the cyrillic encoding to
+% OT2 when \babel{} was loaded with option |frenchb| before a
+% cyrillic language (|russian|, |ukrainian| or |bulgarian|).
+% Now, LM fonts for T1-encoding are available, we pick up the
+% guillemets from them, for OT1-encoding.
+% \item The config file |frenchb.cfg| is now loaded only when
+% \LaTeXe{} is used (from version~1.6g).
+% \item The command |\degres| now works also in math mode (from
+% version~1.6g), but not in bold versions (it is a text
+% character basically).
+% \end{itemize}
+%
+% \StopEventually{}
+%
+% \subsection*{Customizing frenchb: an example of configuration file}
+% \label{sec-cfg}
+%
+% \changes{frenchb-1.4d}{1999/12/19}{Do NOT set catcodes of French
+% quotes to 12 before launching \cs{initiate@active@char} in
+% frenchb.cfg, (problem on Mac reported by M.Bovani).}
+%
+% \begin{macrocode}
+%<*cfg>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% If you want to customize frenchb, please DO NOT hack into the code,
+%% copy this file into a directory searched by TeX, preferably a
+%% personal one on multi-user systems, and customize it as you like.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% WARNING: If you exchange your documents with colleagues using
+%% a different TeX installation, it is best NOT TO HAVE a frenchb.cfg
+%% file, and add instead the customization commands to the preamble
+%% of your documents after babel and frenchb have been loaded.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Uncomment the following line if you dislike frenchb automatically
+%% adding a space before French double punctuation (see frenchb.dtx
+%% for more information).
+%%
+%%\NoAutoSpaceBeforeFDP
+%%
+%% frenchb inserts a normal space before a colon in French (following
+%% I.N. specifications), but some people prefer a thinspace instead;
+%% uncomment the following line if you prefer a thinspace.
+%%
+%%\renewcommand{\Fcolonspace}{\thinspace}
+%%
+%% Uncomment the following line to force lasy font emulation for
+%% French guillemets in OT1 encoding; Polish guillemets are
+%% FAR BETTER LOOKING, you should normally leave this line commented out.
+%%
+%%\LasyGuillemets
+%%
+%% The following option is for backward compatibility ONLY
+%% (it might conflict with the russian option of babel).
+%% Uncomment the following line if you want to get back to
+%% the default guillemets used in versions $<$ 1.6b for OT1-encoding
+%% (no effect in T1-encoding).
+%%
+%%\CyrillicGuillemets
+%%
+%% If you dislike Polish guillemets in OT1-encoding, you can easily
+%% pick up yours from other fonts, examples below: Palatino or
+%% cyrillic CMR T2A encoded font.
+%% The four arguments are: encoding, font name, character codes of
+%% the opening and closing guillemets in the selected font.
+%%
+%%\FrenchGuillemetsFrom{T1}{ppl}{19}{20}
+%%\FrenchGuillemetsFrom{T2A}{cmr}{190}{191}
+%%
+%% Uncomment the following line if you don't want frenchb to change
+%% LaTeX standard settings for vertical spacing in 'itemize' lists.
+%% LaTeX standard settings were used by frenchb in versions < 1.3,
+%% so you may want to uncomment the following line to process older
+%% documents.
+%%
+%%\FrenchItemizeSpacingfalse
+%%
+%% frenchb tunes vertical spaces in all lists (at \list level),
+%% uncomment the following line if you prefer LaTeX standard settings
+%% (this flag is new in version 1.3). When \ifFrenchItemizeSpacing is
+%% `true' (default setting), this flag has no effect on itemize lists.
+%%
+%%\FrenchListSpacingfalse
+%%
+%% The command \FrenchLabelItem can be used to set the `labelitems'
+%% for all levels in French. For instance, to get long dashes, use:
+%%
+%%\renewcommand{\FrenchLabelItem}{\textemdash}
+%%
+%% You can also have different `labelitems' for each level in French:
+%%
+%%\renewcommand{\Frlabelitemi}{\textemdash}
+%%\renewcommand{\Frlabelitemii}{\bfseries\textendash}
+%%\renewcommand{\Frlabelitemiii}{\textbullet}
+%%\renewcommand{\Frlabelitemiv}{}
+%%
+%% Uncomment the following line if you want a thinspace to be added
+%% in the running text before the footnote number or symbol.
+%%
+%%\AddThinSpaceBeforeFootnotes
+%%
+%% Uncomment the following line if you want footnotes to be typeset
+%% according the specifications of the French `Imprimerie Nationale'.
+%%
+%%\FrenchFootnotes
+%%
+%% Uncomment the following line if you want the command \nombre to
+%% insert thin spaces (1/6em) instead of normal spaces (0.3em)
+%% between slices of 3 digits when typesetting numbers in French.
+%%
+%%\ThinSpaceInFrenchNumbers
+%%
+%% If you are bored to type {,} every time you want a decimal comma in
+%% math mode, uncomment the following line (and don't forget to add a
+%% forced space after the comma in lists and intervals: $(x,\ y)$ and
+%% $[0,\ 1]$). I suggest NOT TO UNCOMMENT the following line,
+%% and to switch between the decimal comma and the standard comma
+%% using \DecimalMathComma and \StandardMathComma inside the document.
+%%
+%%\DecimalMathComma
+%%
+%% If you do not want the appearance of lists to depend on the current
+%% language, add ONE of these two commands: \FrenchLayout (for a
+%% document mainly in French) or \StandardLayout (for a document
+%% mainly in English).
+%%
+%%\FrenchLayout
+%%\StandardLayout
+%%
+%% With the standard LaTeX classes (article.cls, report.cls, book.cls)
+%% you can change the separator used in figure and table captions in
+%% French with \CaptionSeparator, for instance (the default value of
+%% \CaptionSeparator in French is '\space\textendash\space'):
+%%
+%%\addto\captionsfrench{\def\CaptionSeparator{\space\textemdash\space}}
+%%
+%% You might want to change some of the translations of caption names,
+%% you can do it this way, for instance:
+%%
+%%\addto\captionsfrench{\def\figurename{{\scshape Figure}}}
+%%\addto\captionsfrench{\def\tablename{{\scshape Table}}}
+%%\addto\captionsfrench{\def\proofname{Preuve}}
+%%
+%% If French guillemets are available on your keyboard, you can use
+%% them instead of the commands \og and \fg: REPLACE << and >> in
+%% the following code by your ready-made guillemets (2 occurrences
+%% for each) AND uncomment the resulting code.
+%% WARNINGS:
+%% 1) This will reduce the portability of your source files!
+%% 2) This adds two active characters.
+%% 3) If you add this stuff to the preamble of a document, you'll
+%% need to wrap it in \makeatletter ... \makeatother.
+%%
+%% \ifx\mule@def\undefined
+%% \initiate@active@char{<<}
+%% \initiate@active@char{>>}
+%% \AtBeginDocument{%
+%% \def<<{\og\ignorespaces}%
+%% \def>>{{\fg}}%
+%% }%
+%% \else %%% For the CJK package, see MULEenc.sty.
+%% \mule@def{11}{\og\ignorespaces}
+%% \mule@def{27}{{\fg}}
+%% \fi
+%%
+%% The rest is for compatibility with Bernard Gaulle's french.sty:
+%% if you want to typeset with babel/frenchb files originally written
+%% for french.sty, you will probably want to uncomment these lines.
+%%
+%% Uncomment these lines if you want the aliases \numero and \Numero
+%% (as in french.sty) for \no and \No.
+%%
+%%\let\numero=\no
+%%\let\Numero=\No
+%%
+%% Uncomment the following lines if you want to substitute `\bsc' to
+%% either (or both) of french.sty macros `\fsc' and `\lsc'.
+%%
+%%\let\fsc=\bsc
+%%\let\lsc=\bsc
+%%
+%% Uncomment the following line if you want to substitute `\up' to
+%% french.sty macro `\fup'.
+%%
+%%\let\fup=\up
+%%
+%% Uncomment the following lines if you intend to use commands \french
+%% and \english to switch between languages, as in french.sty.
+%%
+%%\def\french{\leavevmode\selectlanguage{french}}
+%%\def\english{\leavevmode\selectlanguage{english}}
+%%
+%% Uncomment the following lines if you intend to use the command
+%% \AllTeX to refer to all flavours of TeX, (this command has been
+%% made popular by french.sty).
+%%
+%%\newcommand*{\AllTeX}{%
+%% (L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em)%
+%% T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}
+%</cfg>
+% \end{macrocode}
+%
+% \section{\TeX{}nical details}
+%
+% \subsection{Initial setup}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+%
+% \changes{frenchb-1.1b}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+%
+% \changes{frenchb-1.5g}{2001/09/09}{Let \cs{LdfInit} check for
+% \cs{datefrench} instead of \cs{NoAutoSpaceBeforeFDP},
+% as the later is also defined by russianb.ldf!}
+%
+% \begin{macrocode}
+%<*code>
+%%
+\LdfInit\CurrentOption\datefrench
+% \end{macrocode}
+%
+% \begin{macro}{\ifLaTeX}
+% \begin{macro}{\ifLaTeXe}
+% \changes{frenchb-1.1}{1996/02/12}{Use \cs{fmtname} to check
+% the format instead of \cs{newcommand}; define \cs{PlainFmtName}
+% and \cs{LaTeXeFmtName}.}
+%
+% \changes{frenchb-1.3f}{1999/04/11}{Use \cs{magnification} to check
+% if the format is plain (i.e \emph{not} \LaTeX). Checking the
+% format's name was not reliable: plain-like formats may not be
+% called just `plain' but `babel-plain'.}
+%
+% To check the format in use (plain, \LaTeX{} or \LaTeXe),
+% we'll need two new `if'.
+% \begin{macrocode}
+\newif\ifLaTeX
+\ifx\magnification\@undefined\LaTeXtrue\fi
+\newif\ifLaTeXe
+\ifx\@compatibilitytrue\@undefined\else\LaTeXetrue\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\if@Two@E}
+% \changes{frenchb-1.1}{1996/03/01}{New test \cs{if@Two@E}.}
+%
+% We will need another `if' : |\if@Two@E| is true if and only if
+% \LaTeXe{} is running \emph{not} in compatibility mode. It is
+% used in the definitions of the command |\nombre| and |\up|.
+% The definition is somewhat complicated, due to the fact that
+% |\if@compatibility| is not recognized as a |\if| in
+% \LaTeX-2.09 based formats.
+% \begin{macrocode}
+\newif\if@Two@E \@Two@Etrue
+\def\@FI@{\fi}
+\ifx\@compatibilitytrue\@undefined
+ \@Two@Efalse \def\@FI@{\relax}
+\else
+ \if@compatibility \@Two@Efalse \fi
+\@FI@
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{frenchb-1.1b}{1996/11/07}{Removed test for \cs{l@english}}
+%
+% \changes{frenchb-1.2}{1997/01/05}{Check for hyphenation patterns}
+%
+% Check if hyphenation patterns for the French language have been
+% loaded in language.dat; we allow for the names `french',
+% `francais', `canadien' or `acadian'. The latter two are both
+% names used in Canada for variants of French that are in use in
+% that country.
+%
+% \changes{frenchb-1.5b}{2001/02/09}{Added support for canadien and
+% acadian}
+%
+% \begin{macrocode}
+\ifx\l@french\@undefined
+ \ifx\l@francais\@undefined
+ \ifx\l@canadien\@undefined
+ \ifx\l@acadian\@undefined
+ \@nopatterns{French}
+ \adddialect\l@french0
+ \else
+ \let\l@french\l@acadian
+ \fi
+ \else
+ \let\l@french\l@canadien
+ \fi
+ \else
+ \let\l@french\l@francais
+ \fi
+\fi
+% \end{macrocode}
+% After the statement above |\l@french| is sure to always be
+% defined.
+%
+% \changes{frenchb-1.2}{1997/01/05}{`french' `frenchb' and
+% `francais' are synonymous regardless of \cs{CurrentOption}.}
+% The internal name for the French language will be `french';
+% `francais' and `frenchb' will be synonymous for `french':
+% first let both names use the same hyphenation patterns.
+% Later we will have to set aliases for |\captionsfrench|,
+% |\datefrench|, |\extrasfrench| and |\noextrasfrench|.
+% As French uses the standard values of |\lefthyphenmin| (2)
+% and |\righthyphenmin| (3), no special setting is required here.
+%
+% \changes{frenchb-1.5d}{2001/02/16}{The internal name for the
+% French language is changed from `frenchb' to `french'.}
+%
+% \begin{macrocode}
+\def\CurrentOption{french}
+\ifx\l@francais\@undefined
+ \let\l@francais\l@french
+\fi
+\ifx\l@frenchb\@undefined
+ \let\l@frenchb\l@french
+\fi
+% \end{macrocode}
+% When this language definition file was loaded for one of the
+% Canadian versions of French we need to make sure that a suitable
+% hyphenation pattern register will be found by \TeX.
+%
+% \changes{babel-1.5b}{2001/02/09}{Added support for canadien and
+% acadian}
+%
+% \begin{macrocode}
+\ifx\l@canadien\@undefined
+ \let\l@canadien\l@french
+\fi
+\ifx\l@acadian\@undefined
+ \let\l@acadian\l@french
+\fi
+% \end{macrocode}
+%
+% \changes{frenchb-1.5g}{2001/09/09}{Instead of issuing a warning when
+% \cs{captionsfrancais} or \cs{captionsfrenchb} are customized in
+% the preamble, we merge the changes into \cs{captionsfrench}.}
+%
+% This language definition can be loaded for different variants of
+% the French language. The `key' \babel\ macros are only defined
+% once, using `french' as the language name, but |frenchb| and
+% |francais| are synonymous. As some users who choose |frenchb|
+% or |francais| as option of \babel, might customize
+% |\captionsfrenchb| or |\captionsfrancais| in the preamble,
+% we merge their changes at the |\begin{document}| when they do so
+% (only possible in \LaTeXe).
+% The other three commands for |\date|, |\extras|, and |\noextras|
+% are not likely to be modified by end-users.
+% The other variants of languages are defined by checking if the
+% relevant option was used and then adding one extra level of
+% expansion.
+%
+% \changes{frenchb-1.6c}{2003/06/30}{Bug correction: it is necessary
+% to re-execute \cs{captionsfrench} after merging
+% \cs{captionsfrenchb} and \cs{captionsfrancais}.}
+%
+% \begin{macrocode}
+\def\datefrancais{\datefrench}
+\def\extrasfrancais{\extrasfrench}
+\def\noextrasfrancais{\noextrasfrench}
+\def\datefrenchb{\datefrench}
+\def\extrasfrenchb{\extrasfrench}
+\def\noextrasfrenchb{\noextrasfrench}
+\ifLaTeXe
+ \AtBeginDocument{\let\captions@French\captionsfrench
+ \ifx\captionsfrenchb\@undefined
+ \let\captions@Frenchb\relax
+ \else
+ \let\captions@Frenchb\captionsfrenchb
+ \fi
+ \ifx\captionsfrancais\@undefined
+ \let\captions@Francais\relax
+ \else
+ \let\captions@Francais\captionsfrancais
+ \fi
+ \def\captionsfrench{\captions@French
+ \captions@Francais\captions@Frenchb}%
+ \def\captionsfrancais{\captionsfrench}%
+ \def\captionsfrenchb{\captionsfrench}%
+ \iflanguage{french}{\captionsfrench}{}%
+ }
+\else
+ \def\captionsfrancais{\captionsfrench}
+ \def\captionsfrenchb{\captionsfrench}
+\fi
+\@ifpackagewith{babel}{canadien}{%
+ \def\captionscanadien{\captionsfrench}%
+ \def\datecanadien{\datefrench}%
+ \def\extrascanadien{\extrasfrench}%
+ \def\noextrascanadien{\noextrasfrench}%
+ }{}
+\@ifpackagewith{babel}{acadian}{%
+ \def\captionsacadian{\captionsfrench}%
+ \def\dateacadian{\datefrench}%
+ \def\extrasacadian{\extrasfrench}%
+ \def\noextrasacadian{\noextrasfrench}%
+ }{}
+% \end{macrocode}
+%
+% \begin{macro}{\extrasfrench}
+% \begin{macro}{\noextrasfrench}
+% The macro |\extrasfrench| will perform all the extra
+% definitions needed for the French language.
+% The macro |\noextrasfrench| is used to cancel the actions of
+% |\extrasfrench|.\\
+% In French ``apostrophe'' is used in hyphenation in expressions
+% like |l'ambulance| (French patterns provide entries for this kind
+% of words). This means that the |\lccode| of ``apostrophe'' has
+% to be non null in French for proper hyphenation of those
+% expressions, and to be reset to null when exiting French.
+%
+% \changes{frenchb-1.2}{1997/01/05}{`french' `frenchb' and
+% `francais' are synonymous regardless of \cs{CurrentOption}.}
+%
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{\lccode`\'=`\'}
+\@namedef{noextras\CurrentOption}{\lccode`\'=0}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{frenchb-1.1}{1996/01/29}{Add some font changing
+% definitions.}
+%
+% It is best to use \LaTeXe{}'s font changing commands, and to
+% emulated those we need when they are not available, as in
+% Plain\TeX{} or \LaTeX-2.09. Be aware that old commands |\sc|,
+% |\it|, \textit{etc.} exist in \LaTeXe{}, but they behave like
+% they did in \LaTeX-2.09 (i.\,e., they switch back to
+% |\normalfont| instead of keeping the other font attributes
+% unchanged).
+% \begin{macrocode}
+\ifx\scshape\@undefined
+ \ifx\sc\@undefined
+ \let\scshape\relax
+ \else
+ \let\scshape\sc
+ \fi
+\fi
+\ifx\emph\@undefined
+ \ifx\em\@undefined
+ \let\emph\relax
+ \else
+ \def\emph#1{\em #1}
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsection{Caption names}
+%
+% The next step consists of defining the French equivalents for
+% the \LaTeX{} caption names.
+%
+% \changes{frenchb-1.3c}{1997/10/08}{changed \cs{@makecaption}
+% definition to add a hook \cs{CaptionSeparator}.}
+%
+% In French, captions in figures and tables should be printed with
+% endash (`--') instead of the standard `:'. If another separator
+% is preferred, see in the example configuration file above
+% (section~\ref{sec-cfg}) how to change the default value of
+% |\CaptionSeparator|.
+%
+% \changes{frenchb-1.4a}{1999/10/23}{frenchb-1.3 silently redefined
+% \cs{@makecaption}, overwriting changes made by some classes
+% like koma-script, ua-thesis\dots (pointed out by Werner~Lemberg).
+% New implementation suggested by Vincent~Jalby.}
+%
+% \changes{frenchb-1.4e}{2000/03/12}{Captions print twice with AMS
+% classes (amsart, amsbook). Bug reported by Jean-Fran\c cois
+% Mertens. Revert to implementation of version 1.4, which is
+% safer as \@makecaption can be changed unpredictably.}
+%
+% We first store the standard definition of |\@makecaption|
+% (e.g., the one provided in article.cls, report.cls, book.cls
+% which is frozen for \LaTeXe{} according to Frank Mittelbach),
+% in |\STD@makecaption|. `ATBeginDocument' we compare it to its
+% current definition (some classes like koma-script classes,
+% AMS classes, ua-thesis.cls\dots change it).
+% If they are identical, frenchb just adds a hook called
+% |\CaptionSeparator| to |\@makecaption|, |\CaptionSeparator|
+% defaults to ': ' as in the standard |\@makecaption|, and will be
+% changed to ' -- ' in French.
+% If the definitions differ, frenchb doesn't overwrite the changes,
+% but prints a message in the .log file.
+%
+% \changes{frenchb-1.4f}{2000/04/07}{Only issue a warning if
+% \cs{@makecaption} exists}
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \long\def\STD@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+ \def\CaptionSeparator{\string:\space}
+ \long\def\FB@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1\CaptionSeparator #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1\CaptionSeparator #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+ \AtBeginDocument{%
+ \ifx\@makecaption\STD@makecaption
+ \let\@makecaption\FB@makecaption
+ \else
+ \ifx\@makecaption\@undefined\else
+ \PackageWarning{frenchb.ldf}%
+ {The definition of \protect\@makecaption\space
+ has been changed,\MessageBreak
+ frenchb will NOT customize it;\MessageBreak reported}%
+ \fi
+ \fi
+ \let\FB@makecaption\relax
+ \let\STD@makecaption\relax}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \def\CaptionSeparator{\string:\space}}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\captionsfrench}
+% The macro |\captionsfrench| defines all strings used in the four
+% standard document classes provided with \LaTeX. Some authors do
+% not like some of these names; it is easy to change them in the
+% preamble \emph{after} loading |frenchb| (or in your file
+% |frenchb.cfg|), e.g
+% |\addto\captionsfrench{\def\figurename{Figure}}| will print
+% `Figure' in Roman instead of `\textsc{Fig.}'.
+%
+% \changes{frenchb-1.1}{1996/01/30}{This code is useless in Plain\TeX,
+% check the format before loading it.}
+%
+% \changes{frenchb-1.2}{1997/01/05}{Added aliases \cs{captionsfrenchb}
+% and \cs{captionsfrancais}.}
+%
+% \changes{frenchb-1.3c}{1997/10/08}{Added \cs{CaptionSeparator}.}
+%
+% \changes{frenchb-1.4a}{1999/10/23}{Changed `--' to
+% \cs{textendash} in \cs{CaptionSeparator} in case the ligature
+% doesn't exist (tt-fonts).}
+%
+% \changes{frenchb-1.4f}{2000/04/06}{Added \cs{glossaryname}}
+%
+% \begin{macrocode}
+\ifLaTeX
+\@namedef{captions\CurrentOption}{%
+ \def\refname{R\'ef\'erences}%
+ \def\abstractname{R\'esum\'e}%
+ \def\bibname{Bibliographie}%
+ \def\prefacename{Pr\'eface}%
+ \def\chaptername{Chapitre}%
+ \def\appendixname{Annexe}%
+ \def\contentsname{Table des mati\`eres}%
+ \def\listfigurename{Table des figures}%
+ \def\listtablename{Liste des tableaux}%
+ \def\indexname{Index}%
+ \def\figurename{{\scshape Fig.}}%
+ \def\tablename{{\scshape Tab.}}%
+ \def\CaptionSeparator{\space\textendash\space}%
+% \end{macrocode}
+% ``Premi\`ere partie'' instead of ``Part I''
+% \begin{macrocode}
+ \def\partname{\protect\@Fpt partie}%
+ \def\@Fpt{{\ifcase\value{part}\or Premi\`ere\or Deuxi\`eme\or
+ Troisi\`eme\or Quatri\`eme\or Cinqui\`eme\or Sixi\`eme\or
+ Septi\`eme\or Huiti\`eme\or Neuvi\`eme\or Dixi\`eme\or Onzi\`eme\or
+ Douzi\`eme\or Treizi\`eme\or Quatorzi\`eme\or Quinzi\`eme\or
+ Seizi\`eme\or Dix-septi\`eme\or Dix-huiti\`eme\or Dix-neuvi\`eme\or
+ Vingti\`eme\fi}\space\def\thepart{}}%
+ \def\pagename{page}%
+ \def\seename{{\emph{voir}}}%
+ \def\alsoname{{\emph{voir aussi}}}%
+ \def\enclname{P.~J. }%
+ \def\ccname{Copie \`a }%
+ \def\headtoname{}%
+ \def\proofname{D\'emonstration}% for AMS-\LaTeX
+ \def\glossaryname{Glossaire}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Punctuation}
+%
+% The `double punctuation' characters (|;| |!| |?| and |:|) have to
+% be made |\active| for an automatic control of the amount of space
+% to insert before them.
+% \begin{macrocode}
+\initiate@active@char{:}
+\initiate@active@char{;}
+\initiate@active@char{!}
+\initiate@active@char{?}
+% \end{macrocode}
+% We specify that the French group of shorthands should be used.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \languageshorthands{french}}
+% \end{macrocode}
+% These characters are `turned on' once, later their definition may
+% vary.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{:}\bbl@activate{;}%
+ \bbl@activate{!}\bbl@activate{?}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{:}\bbl@deactivate{;}%
+ \bbl@deactivate{!}\bbl@deactivate{?}}
+% \end{macrocode}
+%
+% One more thing |\extrasfrench| needs to do is to make sure that
+% |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasfrench| will switch it off again.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchspacing}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% \begin{macro}{\french@sh@;@}
+% We have to tune the amount of white space before \texttt{;}
+% \texttt{!} \texttt{?} and \texttt{:}. This should only happen
+% in horizontal mode, hence the test |\ifhmode|.
+%
+% \changes{frenchb-1.1}{1995/12/23}{Added a hook to insert space
+% or not before `double punctuation'.}
+%
+% In horizontal mode, if a space has been typed before `;' we
+% remove it and put an unbreakable |\thinspace| instead. If no
+% space has been typed, we add |\FDP@thinspace| which will be
+% defined, up to the user's wishes, as an automatic added
+% thin space, or as |\@empty|.
+%
+% \begin{macrocode}
+\declare@shorthand{french}{;}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+% \end{macrocode}
+% Now we can insert a |;| character.
+% \begin{macrocode}
+ \string;}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\french@sh@!@}
+% \begin{macro}{\french@sh@?@}
+%
+% Because these definitions are very similar only one is displayed
+% in a way that the definition can be easily checked.
+%
+% \begin{macrocode}
+\declare@shorthand{french}{!}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string!}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\declare@shorthand{french}{?}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string?}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\french@sh@:@}
+%
+% The `:' requires a normal space before it, instead of
+% a |\thinspace|.
+%
+% \begin{macrocode}
+\declare@shorthand{french}{:}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\Fcolonspace
+ \else
+ \FDP@colonspace
+ \fi
+ \fi
+ \string:}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{frenchb-1.1}{1995/12/23}{Added a hook to insert space
+% or not before `double punctuation'.}
+%
+% \changes{frenchb-1.5f}{2001/06/02}{Added a hook to customize
+% the space before the colon in French (thin or normal).}
+%
+% \begin{macro}{\Fcolonspace}
+% \begin{macro}{\AutoSpaceBeforeFDP}
+% \begin{macro}{\NoAutoSpaceBeforeFDP}
+% |\FDP@thinspace| and |\FDP@space| are defined as unbreakable
+% spaces by\\ |\AutoSpaceBeforeFDP| or as |\@empty| by
+% |\NoAutoSpaceBeforeFDP|.\\
+% Default is |\AutoSpaceBeforeFDP|.
+% \begin{macrocode}
+\newcommand{\Fcolonspace}{\space}
+\def\AutoSpaceBeforeFDP{%
+ \def\FDP@thinspace{\penalty\@M\thinspace}%
+ \def\FDP@colonspace{\penalty\@M\Fcolonspace}}
+\def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty
+ \let\FDP@colonspace\@empty}
+\AutoSpaceBeforeFDP
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\system@sh@:@}
+% \begin{macro}{\system@sh@!@}
+% \begin{macro}{\system@sh@?@}
+% \begin{macro}{\system@sh@;@}
+%
+% When the active characters appear in an environment where their
+% French behaviour is not wanted they should give an `expected'
+% result. Therefore we define shorthands at system level as well.
+%
+% \begin{macrocode}
+\declare@shorthand{system}{:}{\string:}
+\declare@shorthand{system}{!}{\string!}
+\declare@shorthand{system}{?}{\string?}
+\declare@shorthand{system}{;}{\string;}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{French quotation marks}
+%
+% \changes{frenchb-1.3}{1997/04/24}{New implementation of guillemets.}
+%
+% \changes{frenchb-1.4}{1999/07/08}{Add a hook to pick French
+% guillemets from any font (suggested by Michel Bovani).}
+%
+% \changes{frenchb-1.3e}{1999/01/02}{Try to use AMS Cyrillic fonts
+% to provide better looking guillemets in OT1 encoding.}
+%
+% \changes{frenchb-1.6b}{2003/04/05}{Default OT1 guillemets are
+% now borrowed from Polish fonts, rather than from wncyr.}
+%
+% \changes{frenchb-1.6c}{2003/06/30}{OT1 `Polish' guillemets are
+% now taken from the LM fonts which will be part of TL8.}
+%
+% EC/LM fonts and standard PostScript fonts have built-in
+% guillemets, we of course use them. CM fonts have no French
+% guillemets built-in, so we have to emulate them:
+% \begin{itemize}
+% \item if a file `t1lmr.fd' is found, we expect the LM fonts
+% to be present on the system, so we pick up French guillemets
+% from them; before version 1.6b, French guillemets were
+% borrowed from the `wncyr' fonts, this has been changed because
+% it resulted in a conflict with the russian option of \babel.
+% Former Cyrillic guillemets are still available through the
+% command |\CyrillicGuillemets| (for backward compatibility).
+% \item otherwise we use math symbols, either \LaTeX's `lasy' font
+% if available, or \TeX{}~symbols |\ll| and |\gg| otherwise;
+% \end{itemize}
+%
+% The standard names for French quotation marks are |\guillemotleft|
+% and |\guillemotright|, these commands are defined in |t1enc.def|
+% for T1-encoding.
+% In \LaTeXe{} formats, we first define these commands for
+% OT1-encoding (for CM fonts), using either the Polish `pl*' fonts
+% or \LaTeX{}'s `lasy' fonts.
+% Other local text encodings \emph{should} define them too,
+% but if they don't, the OT1 definitions will be used.
+% The standard PostScript fonts should \emph{always} be used together
+% with T1-encoding (\emph{not} OT1), for proper hyphenation and
+% built-in (better looking) French quotation marks.
+%
+% \changes{frenchb-1.2b}{1997/04/24}{Spacing after opening and before
+% closing guillemets slightly enlarged and some glue added,
+% as suggested by Th.~Bouche. Unlike \cs{kern}, \cs{hskip} doesn't
+% inhibit hyphenation, nothing like \cs{allowhyphens} is required.}
+%
+% The next step is to provide correct spacing after |\guillemotleft|
+% and before |\guillemotright| : a space precedes and follows
+% quotation marks but no line break is allowed neither \emph{after}
+% the opening one, nor \emph{before} the closing one.
+% |\guill@spacing| which does the spacing, has been fine tuned by
+% Thierry Bouche.
+%
+% \changes{frenchb-1.3d}{1998/04/20}{Spacing after opening and before
+% closing guillemets changed again: normal space with little glue
+% (suggested by Th. Bouche).}
+%
+% The top macros for quotation marks will be called |\og|
+% (``\underline{o}uvrez \underline{g}uillemets'') and |\fg|
+% (``\underline{f}ermez \underline{g}uillemets'').\\
+% The top level definitions for French quotation marks are switched
+% on and off through the |\extrasfrench| |\noextrasfrench|
+% mechanism. Outside French, |\og| and |\fg| will typeset standard
+% English opening and closing double quotes.\\
+% As |\DeclareTextCommand| cannot be used after the
+% |\begin{document}| we introduce internal definitions
+% |\begin@guill| and |\end@guill|.\\
+% We'll try to be smart to users of D.~\textsc{Carlisle}'s |xspace|
+% package: if this package is loaded there will be no need for |{}|
+% or |\ | to get a space after |\fg|.
+%
+% \begin{macro}{\guillemotleft}
+% \begin{macro}{\guillemotright}
+% \begin{macro}{\og}
+% \begin{macro}{\fg}
+% \changes{frenchb-1.1}{1996/01/20}{A warning is now issued if \cs{og}
+% or \cs{fg} have been defined elsewhere in a \LaTeXe{} document
+% (suggested by Vincent Jalby).}
+% In \LaTeXe{} we provide a dummy definition for |\og| and |\fg|,
+% just to display an error message in case |\og| or |\fg| have been
+% defined elsewhere.
+%
+% \changes{frenchb-1.2b}{1997/04/24}{Define \cs{xspace} as \relax if
+% it is not defined by D. Carlisle `xspace.sty'. Will be used in
+% \cs{fg}, and \cs{ieme} ... \cs{ieres} (new for this release).}
+%
+% \changes{frenchb-1.5f}{2001/04/21}{\cs{og} and \cs{fg} should not
+% be expanded when written to a file; use \cs{renewcommand} (in
+% \cs{LaTeX}) to redefine them instead of \cs{let} or \cs{def}.}
+%
+% \begin{macrocode}
+\newcommand{\og}{\@empty}
+\newcommand{\fg}{\@empty}
+% \end{macrocode}
+% \begin{macro}{\FrenchGuillemetsFrom}
+% \begin{macrocode}
+\ifLaTeXe
+ \def\FrenchGuillemetsFrom#1#2#3#4{%
+ \DeclareFontEncoding{#1}{}{}%
+ \DeclareFontSubstitution{#1}{#2}{m}{n}%
+ \DeclareTextCommand{\guillemotleft}{OT1}{%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3}}%
+ \DeclareTextCommand{\guillemotright}{OT1}{%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}}
+% \end{macrocode}
+% \begin{macro}{\CyrillicGuillemets}
+% \begin{macro}{\PolishGuillemets}
+% \begin{macro}{\LasyGuillemets}
+% \begin{macro}{\bbl@frenchguillemets}
+% \begin{macro}{\bbl@nonfrenchguillemets}
+% \begin{macrocode}
+ \def\CyrillicGuillemets{\FrenchGuillemetsFrom{OT2}{wncyr}{60}{62}}
+ \def\PolishGuillemets{\FrenchGuillemetsFrom{T1}{lmr}{19}{20}}
+ \def\LasyGuillemets{%
+ \DeclareTextCommand{\guillemotleft}{OT1}{\hbox{%
+ \fontencoding{U}\fontfamily{lasy}\selectfont(\kern-0.20em(}}%
+ \DeclareTextCommand{\guillemotright}{OT1}{\hbox{%
+ \fontencoding{U}\fontfamily{lasy}\selectfont)\kern-0.20em)}}}
+ \IfFileExists{t1lmr.fd}{\PolishGuillemets}{\LasyGuillemets}
+ \DeclareTextSymbolDefault{\guillemotleft}{OT1}
+ \DeclareTextSymbolDefault{\guillemotright}{OT1}
+ \def\guill@spacing{\penalty\@M\hskip.8\fontdimen2\font
+ plus.3\fontdimen3\font
+ minus.8\fontdimen4\font}
+ \DeclareRobustCommand*{\begin@guill}{\leavevmode
+ \guillemotleft\penalty\@M\guill@spacing}
+ \DeclareRobustCommand*{\end@guill}{\ifdim\lastskip>\z@\unskip\fi
+ \penalty\@M\guill@spacing\guillemotright\xspace}
+ \AtBeginDocument{\ifx\xspace\@undefined\let\xspace\relax\fi}
+ \def\bbl@frenchguillemets{\renewcommand{\og}{\begin@guill}%
+ \renewcommand{\fg}{\end@guill}}
+ \def\bbl@nonfrenchguillemets{\renewcommand{\og}{``}%
+ \renewcommand{\fg}{\ifdim\lastskip>\z@\unskip\fi ''}}
+% \end{macrocode}
+% For \emph{Plain}\TeX, and \LaTeX-2.09 we define |\begin@guill|
+% and |\end@guill| using math symbols |\ll| and |\gg|.
+% \begin{macrocode}
+\else
+ \def\begin@guill{\leavevmode\raise0.25ex
+ \hbox{$\scriptscriptstyle\ll$}%
+ \penalty\@M\hskip.8\fontdimen2\font
+ plus.3\fontdimen3\font
+ minus.3\fontdimen4\font}
+ \def\end@guill{\ifdim\lastskip>\z@\unskip\penalty\@M\fi
+ \penalty\@M\hskip.8\fontdimen2\font
+ plus.3\fontdimen3\font minus.3\fontdimen4\font
+ \raise0.25ex\hbox{$\scriptscriptstyle\gg$}}
+ \let\xspace\relax
+ \def\bbl@frenchguillemets{\let\og\begin@guill
+ \let\fg\end@guill}
+ \def\bbl@nonfrenchguillemets{\def\og{``}%
+ \def\fg{\ifdim\lastskip>\z@\unskip\fi ''}}
+\fi
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchguillemets}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchguillemets}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{French lists}
+% \label{sec-lists}
+%
+% \begin{macro}{\bbl@frenchlistspacing}
+% \begin{macro}{\bbl@nonfrenchlistspacing}
+% Vertical spacing in general lists should be shorter in French
+% texts than the defaults provided by \LaTeX.
+% Note that the easy way, just changing values of vertical spacing
+% parameters when entering French and restoring them to their
+% defaults on exit would not work; as most lists are based on
+% |\list| we will redefine |\list| (up to version~1.4, the more
+% internal command |\@trivlist| was redefined, this ensured that
+% all lists would have common settings, but didn't allow the users
+% to provide their own settings, as pointed out by P.~Pichaureau).
+% If standard LaTeX{} settings are preferred, it is easy to issue
+% the command |\FrenchListSpacingfalse| in the preamble or in
+% |frenchb.cfg|. Please note that changing the flag
+% |\FrenchListSpacing| will \emph{not} take effect immediately,
+% but next time language French is switched on.
+%
+% The amount of vertical space before and after a list is given by
+% |\topsep| + |\parskip| (+ |\partopsep| if the list starts a new
+% paragraph). IMHO, |\parskip| should be added \emph{only} when
+% the list starts a new paragraph, so I subtract |\parskip| from
+% |\topsep| and add it back to |\partopsep|; this will normally
+% make no difference because |\parskip|'s default value is 0pt, but
+% will be noticeable when |\parskip| is \emph{not} null.\\
+% Of course, this code is only for \LaTeX.
+%
+% \changes{frenchb-1.3}{1997/05/30}{Add a switch to allow \cs{LaTeXe}
+% standard settings.}
+%
+% \changes{frenchb-1.5a}{2001/01/02}{Redefine \cs{list} instead of
+% \cs{@trivlist} to provide more freedom to the user, but still
+% allow the former way with \cs{ifFrenchOldTrivlist}.}
+%
+% \changes{frenchb-1.5g}{2001/09/09}{\cs{parskip} is of type `skip',
+% its mean value only (not the glue) should be moved from
+% \cs{topsep} to \cs{partopsep}: substracting glue can lead to
+% weird results. Bug pointed out by Michel Bovani.}
+%
+% \begin{macrocode}
+\newif\ifFrenchListSpacing \FrenchListSpacingtrue
+\newif\ifFrenchOldTrivlist
+\ifLaTeX
+ \let\listORI\list
+% \end{macrocode}
+% |\endlist| is not redefined, but |\endlistORI| is provided for
+% the users who prefer to define their own lists from the original
+% command, they can code: |\begin{listORI}{}{} \end{listORI}|.
+% \begin{macrocode}
+ \let\endlistORI\endlist
+ \def\FR@listsettings{%
+ \setlength{\itemsep}{0.4ex plus 0.2ex minus 0.2ex}%
+ \setlength{\parsep}{0.4ex plus 0.2ex minus 0.2ex}%
+ \setlength{\topsep}{0.8ex plus 0.4ex minus 0.4ex}%
+ \setlength{\partopsep}{0.4ex plus 0.2ex minus 0.2ex}%
+% \end{macrocode}
+% |\parskip| is of type `skip', its mean value only (\emph{not
+% the glue}) should be substracted from |\topsep| and added to
+% |\partopsep|, so convert |\parskip| to a `dimen' using
+% |\@tempdima|.
+% \begin{macrocode}
+ \@tempdima=\parskip
+ \addtolength{\topsep}{-\@tempdima}%
+ \addtolength{\partopsep}{\@tempdima}}%
+ \def\listFR#1#2{\listORI{#1}{\FR@listsettings #2}}%
+% \end{macrocode}
+% Keep the |\@trivlist| redefinition from version 1.4 (only
+% for compatibility reasons). The flag |\ifFrenchOldTrivlist|
+% could happen to be useful to process older documents.
+% \begin{macrocode}
+ \let\@trivlistORI\@trivlist
+ \def\@trivlistFR{\FR@listsettings\@trivlistORI}
+ \def\bbl@frenchlistspacing{\ifFrenchListSpacing\let\list\listFR\fi
+ \ifFrenchOldTrivlist\let\@trivlist\@trivlistFR
+ \let\list\listORI\fi}
+ \def\bbl@nonfrenchlistspacing{\let\list\listORI
+ \let\@trivlist\@trivlistORI}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchlistspacing}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchlistspacing}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bbl@frenchitemize}
+% \begin{macro}{\bbl@nonfrenchitemize}
+% The layout of French itemize-lists has changed between version~1.2
+% and~1.3. Jacques Andr\'e and Thierry Bouche pointed out to me
+% that vertical spacing between items, before and after the list,
+% should \emph{null} with \emph{no glue} added. Moreover
+% horizontal spacing was not correct either: the item labels of a
+% first level list should be vertically aligned on the paragraph's
+% first character (at |\parindent| from the left margin).
+% Checking the book ``Lexique des r\`egles typographiques en usage
+% \`a l'Imprimerie nationale'' confirmed their points, so the itemize
+% environment has been totally redefined for French in version~1.3.
+%
+% Several people pointed out to me that the layout of lists can
+% either be set by the current language or be tuned independently of
+% the language as part of the layout of the document. So hooks should
+% be provided to switch off the special settings made in |frenchb|.
+% Setting |\FrenchItemizeSpacingfalse| \emph{after} loading |frenchb|
+% in the preamble switches back to settings of version~1.2 (this can
+% be useful to process old documents). If you want all list spacings
+% to be exactly what they are in standard \LaTeXe{}, then add also
+% |\FrenchListSpacingfalse| in the preamble \emph{after} loading
+% |frenchb|. Both switches can also be set in |frenchb.cfg|.
+% Please note that changing the flags |\FrenchItemizeSpacing| and
+% |\FrenchListSpacing| will \emph{not} take effect immediately,
+% but next time language French is switched on.
+%
+% The \textbullet{} is never used in French itemize-lists,
+% a long dash `--' is preferred for all levels. The item label used
+% in French is stored in |\FrenchLabelItem}|, it defaults to '--' and
+% can be changed using |\renewcommand| (see the example
+% configuration file above).
+%
+% \changes{frenchb-1.1}{1996/01/25}{Save original definitions of label
+% items, instead of hard coding them in \cs{bbl@nonfrenchitems}
+% (suggested by Vincent Jalby).}
+%
+% \changes{frenchb-1.1}{1996/01/26}{Tune vertical spacing in
+% French lists.}
+%
+% \changes{frenchb-1.3}{1997/05/30}{Change -{}- to \cs{textendash},
+% completely redesign the itemize environment in French and add
+% a hook to switch back to \cs{LaTeXe} standard itemize lists.}
+%
+% \changes{frenchb-1.4}{1999/07/08}{\cs{newif} only in LaTeX.}
+%
+% \changes{frenchb-1.4}{1999/07/08}{Add a hook \cs{FrenchLabelItem}
+% which defaults to \cs{textendash}, this was suggested by
+% Michel Bovani to allow some customization of label items.}
+%
+% \changes{frenchb-1.5a}{2001/01/02}{Redesign \cs{itemize} to allow
+% users to change the markers of any level in itemize lists.}
+%
+% \changes{frenchb-1.5g}{2001/09/09}{\cs{parskip} is of type `skip',
+% its mean value only (not the glue) should be moved from
+% \cs{topsep} to \cs{partopsep}: substracting glue can lead to
+% weird results. Bug pointed out by Michel Bovani.}
+%
+% \begin{macrocode}
+\newif\ifFrenchItemizeSpacing \FrenchItemizeSpacingtrue
+\ifLaTeX
+ \newcommand{\FrenchLabelItem}{\textendash}
+ \newcommand{\Frlabelitemi}{\FrenchLabelItem}
+ \newcommand{\Frlabelitemii}{\FrenchLabelItem}
+ \newcommand{\Frlabelitemiii}{\FrenchLabelItem}
+ \newcommand{\Frlabelitemiv}{\FrenchLabelItem}
+ \def\bbl@frenchitemize{%
+ \let\@ltiORI\labelitemi
+ \let\@ltiiORI\labelitemii
+ \let\@ltiiiORI\labelitemiii
+ \let\@ltivORI\labelitemiv
+ \let\itemizeORI\itemize
+ \let\labelitemi\Frlabelitemi
+ \let\labelitemii\Frlabelitemii
+ \let\labelitemiii\Frlabelitemiii
+ \let\labelitemiv\Frlabelitemiv
+ \ifFrenchItemizeSpacing
+% \end{macrocode}
+% Make sure |\itemize| uses |\@trivlistORI| even with
+% |\FrenchOldTrivlisttrue|.
+% \begin{macrocode}
+ \def\itemize{\let\@trivlist\@trivlistORI
+ \ifnum \@itemdepth >\thr@@\@toodeep\else
+ \advance\@itemdepth\@ne
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+ \expandafter
+ \listORI
+ \csname\@itemitem\endcsname
+ {\settowidth{\labelwidth}{\csname\@itemitem\endcsname}%
+ \setlength{\leftmargin}{\labelwidth}%
+ \addtolength{\leftmargin}{\labelsep}%
+ \ifnum\@listdepth=0
+ \setlength{\itemindent}{\parindent}%
+ \else
+ \addtolength{\leftmargin}{\parindent}%
+ \fi
+ \setlength{\itemsep}{\z@}%
+ \setlength{\parsep}{\z@}%
+ \setlength{\topsep}{\z@}%
+ \setlength{\partopsep}{\z@}%
+% \end{macrocode}
+% |\parskip| is of type `skip', its mean value only (\emph{not
+% the glue}) should be substracted from |\topsep| and added to
+% |\partopsep|, so convert |\parskip| to a `dimen' using
+% |\@tempdima|.
+% \begin{macrocode}
+ \@tempdima=\parskip
+ \addtolength{\topsep}{-\@tempdima}%
+ \addtolength{\partopsep}{\@tempdima}}%
+ \fi}%
+ \fi}
+% \end{macrocode}
+% The user's changes in labelitems are saved when leaving French
+% for further use when switching back to French.
+% \begin{macrocode}
+ \def\bbl@nonfrenchitemize{\let\Frlabelitemi\labelitemi
+ \let\Frlabelitemii\labelitemii
+ \let\Frlabelitemiii\labelitemiii
+ \let\Frlabelitemiv\labelitemiv
+ \let\labelitemi\@ltiORI
+ \let\labelitemii\@ltiiORI
+ \let\labelitemiii\@ltiiiORI
+ \let\labelitemiv\@ltivORI
+ \let\itemize\itemizeORI}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchitemize}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchitemize}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{French indentation of sections}
+% \label{sec-indent}
+%
+% \begin{macro}{\bbl@frenchindent}
+% \begin{macro}{\bbl@nonfrenchindent}
+% In French the first paragraph of each section should be indented,
+% this is another difference with US-English.
+% Add this code only in \LaTeX.
+%
+% \changes{frenchb-1.2}{1996/12/27}{Corrected typo
+% \cs{bbl@nonfrenchident}.}
+%
+% \begin{macrocode}
+\ifLaTeX
+ \let\@aifORI\@afterindentfalse
+ \def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue}
+ \def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
+ \@afterindentfalse}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchindent}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchindent}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Formatting footnotes}
+%
+% \changes{frenchb-1.6a}{2003/02/02}{Add two hooks to customize
+% footnotes: \cs{AddThinSpaceBeforeFootnotes} and
+% \cs{FrenchFootnotes} (suggested by Jacques Andr\'e).}
+%
+% \begin{macro}{\AddThinSpaceBeforeFootnotes}
+% \begin{macro}{\FrenchFootnotes}
+% \begin{macro}{\StandardFootnotes}
+% |\AddThinSpaceBeforeFootnotes| redefines |\@footnotemark| (whose
+% definition is saved at the |\begin{document}| in order to include
+% any customization that packages might have done) to add a thinspace
+% before the number or symbol calling a footnote (any space typed
+% in is removed first). |\AddThinSpaceBeforeFootnotes| has no effect
+% on the layout of the footnote itself. Note that |\thanks| in
+% |\maketitle| also relies on |\@footnotemark|, so the thinspace
+% is added there too.
+%
+% \changes{frenchb-1.6f}{2003/04/02}{Move \cs{newif} and
+% \cs{newdimen} commands outside \cs{ifLaTeXe} ... \cs{fi}
+% for compatibility with the plain format.}
+%
+% \begin{macrocode}
+\newif\ifthinspace@FN
+\newif\ifFR@fntlayout
+\newdimen\parindentFFN
+\ifLaTeXe
+ \newcommand{\AddThinSpaceBeforeFootnotes}{\thinspace@FNtrue}
+ \AtBeginDocument{\let\@footnotemarkORI\@footnotemark
+ \def\@footnotemarkFR{\leavevmode\unskip\unkern
+ \,\@footnotemarkORI}%
+ \ifthinspace@FN
+ \let\@footnotemark\@footnotemarkFR
+ \fi}
+% \end{macrocode}
+%
+% We then define |\@makefntextFR|, a variant of |\@makefntext|
+% which is responsible for the layout of footnotes, to match the
+% specifications of the French `Imprimerie Nationale': Footnotes
+% will be indented by |\parindentFFN|, numbers (if any) typeset on
+% the baseline (instead of textsuperscripts) and followed by a dot
+% and an half quad space. Whenever symbols are used to number
+% footnotes (as in |\thanks| for instance), we switch back to the
+% standard layout (the French layout of footnotes is meant for
+% footnotes numbered by arabic or roman digits).
+% The value of |\parindentFFN| will be defined at the
+% |\begin{document}|, as the maximum of |\parindent| and 1.5em.
+%
+% \begin{macrocode}
+ \def\ftnISsymbol{\@fnsymbol\c@footnote}
+ \long\def\@makefntextFR#1{\ifx\thefootnote\ftnISsymbol
+ \@makefntextORI{#1}%
+ \else
+ \parindent=\parindentFFN
+ \rule\z@\footnotesep
+ \setbox\@tempboxa\hbox{\@thefnmark}%
+ \ifdim\wd\@tempboxa>\z@
+ \llap{\@thefnmark}.\kern.5em
+ \fi #1
+ \fi}%
+% \end{macrocode}
+% We now define two commands |\FrenchFootnotes| and
+% |\StandardFootnotes| which select French or Standard layout
+% for footnotes; we have to save the standard definition of
+% |\@makefntext| at the |\begin{document}|, and then redefine
+% |\@makefntext| according to the value of an internal flag set
+% by |\FrenchFootnotes| and reset by |\StandardFootnotes|.
+% \begin{macrocode}
+ \AtBeginDocument{\parindentFFN=\parindent
+ \ifdim\parindentFFN<1.5em\parindentFFN=1.5em\fi
+ \let\@makefntextORI\@makefntext
+ \long\def\@makefntext#1{%
+ \ifFR@fntlayout
+ \@makefntextFR{#1}%
+ \else
+ \@makefntextORI{#1}%
+ \fi
+ }%
+ }
+ \newcommand{\FrenchFootnotes}{\FR@fntlayouttrue}
+ \newcommand{\StandardFootnotes}{\FR@fntlayoutfalse}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Formatting numbers}
+% \label{sec-numbers}
+%
+% \changes{frenchb-1.4}{1999/10/02}{Add a hook to let the comma
+% be in math mode of type \cs{mathord} in French, as a decimal
+% separator should be.}
+%
+% \changes{frenchb-1.6e}{2003/11/09}{The change from \cs{mathpunct}
+% to \cs{mathord} should be encoding independent (suggested by
+% Michel Bovani): just strip the highest hexadecimal digit to
+% switch from type \cs{mathpunct} to type \cs{mathord}.}
+%
+% \begin{macro}{\DecimalMathComma}
+% \begin{macro}{\StandardMathComma}
+% As mentioned in the \TeX{}book p.~134, the comma is of type
+% |\mathpunct| in math mode: it is automatically followed by a
+% space. This is convenient in lists and intervals but
+% unpleasant when the comma is used as a decimal separator
+% in French: it has to be entered as |{,}|.
+% |\DecimalMathComma| makes the comma be an ordinary character
+% (of type |\mathord|) in French \emph{only} (no space added);
+% |\StandardMathComma| switches back to the standard behaviour
+% of the comma.
+% \begin{macrocode}
+\newcount\std@mcc
+\newcount\dec@mcc
+\std@mcc=\mathcode`\,
+\dec@mcc=\std@mcc
+\@tempcnta=\std@mcc
+\divide\@tempcnta by "1000
+\multiply\@tempcnta by "1000
+\advance\dec@mcc by -\@tempcnta
+\newcommand{\DecimalMathComma}{\iflanguage{french}%
+ {\mathcode`\,=\dec@mcc}{}%
+ \addto\extrasfrench{\mathcode`\,=\dec@mcc}}
+\newcommand{\StandardMathComma}{\mathcode`\,=\std@mcc
+ \addto\extrasfrench{\mathcode`\,=\std@mcc}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \mathcode`\,=\std@mcc}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{frenchb-1.2}{1996/12/27}{New macros \cs{nombre}
+% \cs{decimalsep} and \cs{thousandsep} added to format numbers.}
+%
+% In English the decimal part starts with a point and thousands
+% should be separated by a comma: an approximation of $1000\pi$
+% should be inputed as |$3{,}141.592{,}653$| in math mode and
+% as |3,141.592,653| in text.\\
+% In French the decimal part starts with a comma and thousands
+% should be separated by a space; the same approximation of
+% $1000\pi$ should be inputed as |$3\;141{,}592\;653$| in math mode
+% and as something like |3~141,592~653| in text: in math mode, the
+% comma is of type |\mathpunct| (thus normally followed by a space)
+% while the point is of type |\mathord| (no space added).
+%
+% Thierry Bouche suggested that a second type of comma, of type
+% |\mathord| would be useful in math mode, and proposed to
+% introduce a command (named |\decimalsep| in this package),
+% the expansion of which would depend on the current language.
+%
+% Vincent Jalby suggested a command |\nombre| to conveniently
+% typeset numbers: inputting |\nombre{3141,592653}| either in
+% text or in math mode will format this number properly according
+% to the current language (French or non-French).
+%
+% |\nombre| accepts an optional argument which happens to be
+% useful with the package `dcolumn', it specifies the decimal
+% separator used in the \emph{source code}:
+% |\newcolumntype{d}{D{,}{\decimalsep}{-1}}| \\
+% |\begin{tabular}{|d|}\hline | \\
+% | 3,14 \\ | \\
+% | \nombre[,]{123,4567} \\ | \\
+% | \nombre[,]{9876,543}\\\hline| \\
+% |\end{tabular} | \\
+% will print a column of numbers aligned on the decimal point
+% (comma or point depending on the current language), each slice
+% of 3 digits being separated by a space or a comma according to
+% the current language.
+%
+% \begin{macro}{\decimalsep}
+% \begin{macro}{\thousandsep}
+% We need a internal definition, valid in both text and math mode,
+% for the comma (|\@comma@|) and another one for the unbreakable
+% fixed length space (no glue) used in French (|\f@thousandsep|).
+%
+% The commands |\decimalsep| and |\thousandsep| get default
+% definitions (for the English language) when |frenchb| is loaded;
+% these definitions will be updated when the current language is
+% switched to or from French.
+%
+% \changes{frenchb-1.2b}{1997/04/24}{Extra care taken to handle
+% signs properly inside \cs{nombre} in \LaTeXe.}
+%
+% \changes{frenchb-1.2b}{1997/04/24}{Definition of \cs{nombre} changed
+% to correct a bug with moving arguments in \LaTeX-2.09.}
+%
+% \changes{frenchb-1.4g}{2000/10/07}{Added a new hook
+% \cs{ThinSpaceInFrenchNumbers} to have thin spaces instead of
+% normal spaces (the default) when formatting French numbers.}
+%
+% \begin{macrocode}
+\mathchardef\m@comma=\dec@mcc
+\def\@comma@{\ifmmode\m@comma\else,\fi}
+\def\f@thousandsep{\ifmmode\mskip5.5mu\else\penalty\@M\kern.3em\fi}
+\def\ThinSpaceInFrenchNumbers{\def\f@thousandsep{%
+ \ifmmode\mskip3mu\else\penalty\@M\kern.16667em\fi}}
+\newcommand{\decimalsep}{.}
+\newcommand{\thousandsep}{\@comma@}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\decimalsep{\@comma@}%
+ \def\thousandsep{\f@thousandsep}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \def\decimalsep{.}%
+ \def\thousandsep{\@comma@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{frenchb-1.3}{1997/05/24}{Avoid mixing text and math mode
+% whenever possible: check if \cs{textminus} and co. are available.}
+% Signs can now be entered inside |\nombre|. When |\nombre| is
+% used in text-mode, signs should be text symbols to get the
+% series, shape... from the current text-font. When signs are not
+% available in text-mode, we provide some defaults.
+%
+% \begin{macrocode}
+\providecommand{\textminus}{\textendash}
+\providecommand{\textplusminus}{\ensuremath{\pm}}
+\providecommand{\textminusplus}{\ensuremath{\mp}}
+\def\fb@minus{\ifmmode-\else\textminus\fi}
+\def\fb@plusminus{\ifmmode\pm\else\textplusminus\fi}
+\def\fb@minusplus{\ifmmode\mp\else\textminusplus\fi}
+% \end{macrocode}
+%
+% \begin{macro}{\nombre}
+% The decimal separator used when \emph{inputing} a number
+% with |\nombre| \emph{has to be a comma}.
+% |\nombre| splits the inputed number into two parts: what
+% comes before the first comma will be formatted by
+% \cs{@integerpart} while the rest (if not empty) will be
+% formatted by \cs{@decimalpart}. Both parts, once formatted
+% separately will be merged together with between them, either
+% the decimal separator \cs{decimalsep} or (in \LaTeXe{}
+% \emph{only}) the optional argument of |\nombre|.
+%
+% \changes{frenchb-1.3}{1997/05/24}{Added \cs{@empty} to the
+% definitions of \cs{nb@first} and \cs{nb@suite}, as suggested
+% by V. Jalby, to cope with possibly empty integer part as in
+% \cs{nombre{,123}}.}
+%
+% \begin{macrocode}
+\if@Two@E
+ \newcommand{\nombre}[2][\decimalsep]{\def\@decimalsep{#1}%
+ \@@nombre#2\@empty,\@empty,\@nil}
+\else
+ \def\@decimalsep{\decimalsep}
+ \newcommand{\nombre}[1]{\@nombre#1\@empty,\@empty,\@nil}
+\fi
+\def\@firstofmany#1#2,{#1}
+\def\@@nombre#1,#2,#3\@nil{%
+ \def\nb@sign{}%
+ \edef\nb@first{\@firstofmany #1\@empty,}%
+ \edef\nb@suite{\@secondoftwo #1\@empty,}%
+ \if+\nb@first \def\nb@sign{+}\fi
+ \if-\nb@first \def\nb@sign{\fb@minus}\fi
+ \expandafter\ifx\nb@first\pm \def\nb@sign{\fb@plusminus}\fi
+ \expandafter\ifx\nb@first\mp \def\nb@sign{\fb@minusplus}\fi
+ \ifx\@empty\nb@sign
+ \let\@tmp\nb@suite\edef\nb@suite{\nb@first\@tmp}%
+ \fi
+ \nb@sign\expandafter\@nombre\nb@suite#2,#3\@nil}
+\def\@nombre#1,#2,#3\@nil{%
+ \ifx\@empty#2%
+ \@integerpart{#1}%
+ \else
+ \@integerpart{#1}\@decimalsep\@decimalpart{#2}%
+ \fi}
+% \end{macrocode}
+% The easiest bit is the decimal part:
+% We attempt to read the first four digits of the decimal part, if
+% it has less than 4 digits, we just have to print them, otherwise
+% |\thousandsep| has to be appended after the third digit, and the
+% algorithm is applied recursively to the rest of the decimal part.
+% \begin{macrocode}
+\def\@decimalpart#1{\@@decimalpart#1\@empty\@empty\@empty}
+\def\@@decimalpart#1#2#3#4{#1#2#3%
+ \ifx\@empty#4%
+ \else
+ \thousandsep\expandafter\@@decimalpart\expandafter#4%
+ \fi}
+% \end{macrocode}
+% Formatting the integer part is more difficult because the slices
+% of 3 digits start from the \emph{bottom} while the number is
+% read from the top!
+% This (tricky) code is borrowed from David Carlisle's comma.sty.
+% \begin{macrocode}
+\def\@integerpart#1{\@@integerpart{}#1\@empty\@empty\@empty}
+\def\@@integerpart#1#2#3#4{%
+ \ifx\@empty#2%
+ \@addthousandsep#1\relax
+ \else
+ \ifx\@empty#3%
+ \@addthousandsep\@empty\@empty#1#2\relax
+ \else
+ \ifx\@empty#4%
+ \@addthousandsep\@empty#1#2#3\relax
+ \else
+ \@@integerpartafterfi{#1#2#3#4}%
+ \fi
+ \fi
+ \fi}
+\def\@@integerpartafterfi#1\fi\fi\fi{\fi\fi\fi\@@integerpart{#1}}
+\def\@addthousandsep#1#2#3#4{#1#2#3%
+ \if#4\relax
+ \else
+ \thousandsep\expandafter\@addthousandsep\expandafter#4%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Dots\dots}
+% \label{sec-dots}
+%
+% \changes{frenchb-1.3}{1997/06/03}{Added this section.}
+% \LaTeXe's standard definition of |\dots| in text-mode is
+% |\textellipsis| which includes a |\kern| at the end;
+% this space is not wanted in some cases (before a closing brace
+% for instance) and |\kern| breaks hyphenation of the next word.
+% We define |\Frtextellipsis| for French (in \LaTeXe{} only).
+%
+% \changes{frenchb-1.4c}{1999/11/17}{Bug correction: \cs{xspace}
+% didn't work in \cs{dots} without amsmath.sty.}
+% The |\if| construction in the \LaTeXe{} definition of |\dots|
+% doesn't allow the use of |xspace| (|xspace| is always followed
+% by a |\fi|), so we use the AMS-\LaTeX{} construction of |\dots|;
+% this has to be done `AtBeginDocument' not to be overwritten
+% when \file{amsmath.sty} is loaded after \babel.
+%
+% \changes{frenchb-1.4d}{2000/02/01}{AMS-LaTeX 2.0 provides a much
+% better spacing for \cs{dots} than 1.2, so let's take advantage
+% of it when amsmath (up to 1.2 or newer) is loaded.}
+%
+% \begin{macro}{\Frtextellipsis}
+% \begin{macrocode}
+\ifLaTeXe
+ \DeclareTextCommandDefault{\Frtextellipsis}{%
+ .\kern\fontdimen3\font.\kern\fontdimen3\font.\xspace}
+% \end{macrocode}
+% |\Mdots@| and |\Tdots@ORI| hold the definitions of |\dots| in
+% Math and Text mode. They default to those of amsmath-2.0, and
+% will revert to standard \LaTeX{} definitions `AtBeginDocument',
+% if amsmath has not been loaded. |\Mdots@| doesn't change when
+% switching from/to French, while |\Tdots@| is |\Frtextellipsis|
+% in French and |\Tdots@ORI| otherwise.
+% \begin{macrocode}
+ \newcommand{\Tdots@ORI}{\@xp\textellipsis}
+ \newcommand{\Tdots@}{\Tdots@ORI}
+ \newcommand{\Mdots@}{\@xp\mdots@}
+ \AtBeginDocument{\DeclareRobustCommand{\dots}{\relax
+ \csname\ifmmode M\else T\fi dots@\endcsname}%
+ \ifx\@xp\@undefined\let\@xp\relax\fi
+ \ifx\mdots@\@undefined\let\Tdots@ORI\textellipsis
+ \let\Mdots@\mathellipsis\fi}
+ \def\bbl@frenchdots{\let\Tdots@\Frtextellipsis}
+ \def\bbl@nonfrenchdots{\let\Tdots@\Tdots@ORI}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchdots}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchdots}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Global layout}
+% \label{sec-global}
+%
+% \changes{frenchb-1.4}{1999/10/03}{Added this section.}
+%
+% In multilingual documents, some typographic rules must depend
+% on the current language (e.g., hyphenation, typesetting of
+% numbers, spacing before double punctuation\dots),
+% others should, IMHO, be kept global to the document:
+% especially the layout of lists (see~\ref{sec-lists})
+% and the indentation of the first paragraph of sections
+% (see~\ref{sec-indent}).
+%
+% \begin{macro}{\FrenchLayout}
+% \begin{macro}{\StandardLayout}
+% In a multilingual document, a unified look, either the French
+% one or the standard one, can be assigned to the whole document:
+% adding |\FrenchLayout| will give a global ``French look'' to
+% the document (e.g., lists, regardless the current language, will
+% be typeset as in French) and |\StandardLayout| forces a global
+% ``US-English'' look.
+% Both of these commands can only be used \emph{before} the
+% |\begin{document}|.
+% |\StandardLayout| can also be of interest for class designers
+% who do not want |frenchb| to interfere with their global layout
+% choices.
+%
+% As of version~1.4, |\FrenchLayout| and |\StandardLayout| only
+% affect:
+% \begin{itemize}
+% \item the layout of lists (see~\ref{sec-lists}),
+% \item the indentation of the first paragraph of sections
+% (see~\ref{sec-indent}).
+% \end{itemize}
+%
+% \changes{frenchb-1.6c}{2003/06/30}{Bug correction: the definitions
+% of \cs{labelitemi} ... \cs{itemize} need to be saved in
+% \cs{StandardLayout}.}
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \newcommand{\FrenchLayout}{%
+ \renewcommand{\StandardLayout}{%
+ \PackageWarning{frenchb.ldf}%
+ {\protect\StandardLayout\space makes no change\MessageBreak
+ (\protect\FrenchLayout\space has been selected before
+ \MessageBreak for the whole document)}%
+ }%
+ \AtBeginDocument{\bbl@frenchitemize\bbl@frenchlistspacing
+ \bbl@frenchindent}%
+ \let\bbl@nonfrenchitemize\relax
+ \let\bbl@nonfrenchlistspacing\relax
+ \let\bbl@nonfrenchindent\relax}
+ \newcommand{\StandardLayout}{%
+ \renewcommand{\FrenchLayout}{%
+ \PackageWarning{frenchb.ldf}%
+ {\protect\FrenchLayout\space makes no change\MessageBreak
+ (\protect\StandardLayout\space has been selected before
+ \MessageBreak for the whole document)}%
+ }%
+ \let\@ltiORI\labelitemi
+ \let\@ltiiORI\labelitemii
+ \let\@ltiiiORI\labelitemiii
+ \let\@ltivORI\labelitemiv
+ \let\itemizeORI\itemize
+ \let\bbl@frenchitemize\relax
+ \let\bbl@frenchlistspacing\relax
+ \let\bbl@frenchindent\relax}
+ \@onlypreamble\FrenchLayout
+ \@onlypreamble\StandardLayout
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Extra utilities}
+%
+% All that is left to do now is to provide the French user
+% with some extra utilities.
+%
+% \begin{macro}{\up}
+% \begin{macro}{\ieme}
+% |\up| eases the typesetting of superscripts like
+% `1\raise0.55ex\hbox{\small er}'. |\up| relies on
+% |\textsuperscript| when available (i.\,e., in \LaTeXe).
+%
+% \changes{frenchb-1.1}{1996/01/20}{Use \cs{textsuperscript} in \LaTeXe,
+% as suggested by Vincent Jalby.}
+%
+% \changes{frenchb-1.1}{1996/01/26}{Internal macro \cs{up@size}
+% introduced by Johannes Braams to replace \cs{small},
+% too fragile in 2.09).}
+%
+% \changes{frenchb-1.1}{1996/05/03}{\cs{@ptsize} may not be undefined,
+% i.\,e. in slides.cls.}
+%
+% \begin{macro}{\up@size}
+% The internal macro |\up@size| holds the size at which the
+% superscript will be typeset. The reason for this is that we have
+% to specify it differently for different formats.
+% \begin{macrocode}
+\ifx\sevenrm\@undefined
+ \ifx\@ptsize\@undefined
+ \let\up@size\small
+ \else
+ \ifx\selectfont\@undefined
+% \end{macrocode}
+% In this case the format is the original \LaTeX-2.09:
+% \begin{macrocode}
+ \ifcase\@ptsize
+ \let\up@size\ixpt\or
+ \let\up@size\xpt\or
+ \let\up@size\xipt
+ \fi
+% \end{macrocode}
+% When |\selectfont| is defined we probably have NFSS available:
+% \begin{macrocode}
+ \else
+ \ifcase\@ptsize
+ \def\up@size{\fontsize\@ixpt{10pt}\selectfont}\or
+ \def\up@size{\fontsize\@xpt{11pt}\selectfont}\or
+ \def\up@size{\fontsize\@xipt{12pt}\selectfont}
+ \fi
+ \fi
+ \fi
+\else
+% \end{macrocode}
+% If we end up here it must be a plain based \TeX{} format, so:
+% \begin{macrocode}
+ \let\up@size\sevenrm
+\fi
+% \end{macrocode}
+% \end{macro}
+% Now we can define |\up|. When \LaTeXe{} runs in
+% compatibility mode (\LaTeX-2.09 emulation), |\textsuperscript| is
+% also defined, but does no good job, so we give two different
+% definitions for |\up| using |\if@Two@E|.
+% \begin{macrocode}
+\if@Two@E
+ \DeclareRobustCommand*{\up}[1]{\textsuperscript{#1}}
+\else
+ \DeclareRobustCommand*{\up}[1]{\leavevmode\raise1ex\hbox{\up@size#1}}
+\fi
+% \end{macrocode}
+%
+% \changes{frenchb-1.1}{1996/05/31}{Added 5 macros from french.sty and
+% missing \cs{lowercase}.}
+%
+% \changes{frenchb-1.2b}{1997/04/24}{Use \cs{xspace} to control spacing
+% after \cs{ieme} ... \cs{ieres}.}
+%
+% |\ieme| is provided for compatibility with |francais.sty|,
+% the other 5 for compatibility with |french.sty|:
+% \begin{macrocode}
+\def\ieme{\up{\lowercase{e}}\xspace}
+\def\iemes{\up{\lowercase{es}}\xspace}
+\def\ier{\up{\lowercase{er}}\xspace}
+\def\iers{\up{\lowercase{ers}}\xspace}
+\def\iere{\up{\lowercase{re}}\xspace}
+\def\ieres{\up{\lowercase{res}}\xspace}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\No}
+% \begin{macro}{\no}
+% \begin{macro}{\primo}
+% \begin{macro}{\fprimo)}
+% And some more macros for numbering, first two support macros.
+%
+% \changes{frenchb-1.1}{1996/01/25}{Avoid using math superscripts
+% in text mode (suggested by V.~Jalby), use \cs{up} instead.
+% The symbol `degree' has nothing to do in
+% \cs{FrenchPopularEnumerate}, replace it by a small `o'.}
+%
+% \begin{macrocode}
+\DeclareRobustCommand*{\FrenchEnumerate}[1]{%
+ #1\up{\lowercase{o}}\kern+.3em}
+\DeclareRobustCommand*{\FrenchPopularEnumerate}[1]{%
+ #1\up{\lowercase{o}})\kern+.3em}
+% \end{macrocode}
+%
+% \changes{frenchb-1.3c}{1997/10/08}{Typos corrected: quatro, fquatro}
+%
+% Typing |\primo| should result in `$1^{\rm o}$\kern+.3em',
+% \begin{macrocode}
+\def\primo{\FrenchEnumerate1}
+\def\secundo{\FrenchEnumerate2}
+\def\tertio{\FrenchEnumerate3}
+\def\quarto{\FrenchEnumerate4}
+% \end{macrocode}
+% while typing |\fprimo)| gives `1$^{\rm o}$)\kern+.3em.
+% \begin{macrocode}
+\def\fprimo){\FrenchPopularEnumerate1}
+\def\fsecundo){\FrenchPopularEnumerate2}
+\def\ftertio){\FrenchPopularEnumerate3}
+\def\fquarto){\FrenchPopularEnumerate4}
+% \end{macrocode}
+%
+% Let's provide two macros for the common abbreviations
+% of ``Num\'ero''.
+% \begin{macrocode}
+\DeclareRobustCommand*{\No}{N\up{\lowercase{o}}\kern+.2em}
+\DeclareRobustCommand*{\no}{n\up{\lowercase{o}}\kern+.2em}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{frenchb-1.1}{1996/01/29}{Added command \cs{bsc}.}
+%
+% \changes{frenchb-1.1}{1996/05/31}{Added \cs{leavevmode} in \cs{bsc}}
+%
+% \begin{macro}{\bsc}
+% As family names should be written in small capitals and never be
+% hyphenated, we provide a command (its name comes from Boxed Small
+% Caps) to input them easily; this is a simpler implementation of
+% commands |\fsc| and |\lsc| from |french.sty| : no automatic
+% uppercase/lowercase conversion is performed.
+% Usage: |Jean~\bsc{Duchemin}|.
+% \begin{macrocode}
+\DeclareRobustCommand*{\bsc}[1]{\leavevmode\hbox{\scshape #1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{frenchb-1.1}{1996/05/31}{Added \cs{AllTeX}.}
+%
+% \changes{frenchb-1.2}{1997/01/08}{Removed \cs{AllTeX}.}
+%
+% \changes{frenchb-1.1}{1996/02/12}{Added T1-encodings for \oe, \OE,
+% \ae, \AE. \emph{Do not} re-define these symbols outside \LaTeXe.}
+%
+% \changes{frenchb-1.1}{1996/02/14}{Corrected definitions of
+% \cs{boi}.}
+%
+% \changes{frenchb-1.3}{1997/05/24}{Use \cs{textbackslash} to define
+% \cs{boi}.}
+%
+% Some definitions for special characters. The first eight are
+% mandatory for |\oe| etc. to work properly in moving arguments,
+% the others just for convenience. We won't define |\tilde| as a
+% Text Symbol not to conflict with the macro |\tilde| for math mode
+% and use the name |\tild| instead. Note that |\boi| may \emph{not}
+% be used in math mode, its name in math mode is |\backslash|.
+%
+% \changes{frenchb-1.3}{1997/05/24}{Use \cs{r{}} to access the
+% character `degree', as suggested by V. Jalby.}
+%
+% |\degre| needs a special treatment: it is |\char6|
+% in T1-encoding and |\char23| in OT1-encoding, both can be
+% accessed by the command |\r{}| for ring accent.
+%
+% \changes{frenchb-1.1}{1996/03/03}{Do not use commands related to
+% encodings outside \LaTeXe.}
+%
+% \changes{frenchb-1.4}{1999/10/03}{Add definitions for \cs{at},
+% \cs{circonflexe} and \cs{tild} in other encodings (mlTeX's LO1).}
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \DeclareTextSymbol{\ae}{T1}{230}
+ \DeclareTextSymbol{\ae}{OT1}{26}
+ \DeclareTextSymbol{\oe}{T1}{247}
+ \DeclareTextSymbol{\oe}{OT1}{27}
+ \DeclareTextSymbol{\AE}{T1}{198}
+ \DeclareTextSymbol{\AE}{OT1}{29}
+ \DeclareTextSymbol{\OE}{T1}{215}
+ \DeclareTextSymbol{\OE}{OT1}{30}
+ \DeclareTextSymbol{\at}{T1}{64}
+ \DeclareTextSymbol{\at}{OT1}{64}
+ \DeclareTextSymbol{\circonflexe}{T1}{94}
+ \DeclareTextSymbol{\circonflexe}{OT1}{94}
+ \DeclareTextSymbol{\tild}{T1}{126}
+ \DeclareTextSymbol{\tild}{OT1}{126}
+ \DeclareTextSymbolDefault{\at}{OT1}
+ \DeclareTextSymbolDefault{\circonflexe}{OT1}
+ \DeclareTextSymbolDefault{\tild}{OT1}
+ \DeclareRobustCommand*{\boi}{\textbackslash}
+ \DeclareRobustCommand*{\degre}{\r{}}
+\else
+ \def\T@one{T1}
+ \ifx\f@encoding\T@one
+ \newcommand{\degre}{\char6}
+ \else
+ \newcommand{\degre}{\char23}
+ \fi
+ \newcommand{\at}{\char64}
+ \newcommand{\circonflexe}{\char94}
+ \newcommand{\tild}{\char126}
+ \newcommand{\boi}{{$\backslash$}}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\degres}
+% We now define a macro |\degres| for typesetting the abbreviation
+% for `degrees' (as in `degrees Celsius'). As the bounding box of
+% the character `degree' has \emph{very} different widths in CM/EC
+% and PostScript fonts, we fix the width of the bounding box of
+% |\degres| to 0.3\,em, this lets the symbol `degree' stick to the
+% preceding (e.g., |45\degres|) or following character
+% (e.g., |20~\degres C|).
+%
+% If the \TeX{} Companion fonts are available (\file{textcomp.sty}),
+% we pick up |\textdegree| from them instead of using emulating
+% `degrees' from the |\r{}| accent. Otherwise we overwrite the
+% (poor) definition of |\textdegree| given in \file{latin1.def},
+% \file{applemac.def} etc. (called by \file{inputenc.sty}) by
+% our definition of |\degres|. We also advice the user (once only)
+% to use TS1-encoding.
+%
+% \changes{frenchb-1.1}{1996/01/25}{Fixed width bounding box for
+% correct spacing with both CM, EC and PostScript fonts}
+%
+% \changes{frenchb-1.1}{1996/05/31}{Added \cs{leavevmode} in the
+% \cs{degres}'s definition}
+%
+% \changes{frenchb-1.6a}{2003/02/02}{Replace \cs{degres} by
+% \cs{textdegree} from textcomp.sty when possible (suggested
+% by Michel Bovani).}
+%
+% \changes{frenchb-1.6g}{2005/02/06}{Add \cs{hbox} in the definition
+% of \cs{degres} when textcomp.sty is loaded, so that \cs{degres}
+% can be used in math mode.}
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \def\Warning@degree@TSone{%
+ \PackageWarning{frenchb.ldf}{%
+ Degrees would look better in TS1-encoding:
+ \MessageBreak add \protect
+ \usepackage{textcomp} to the preamble.
+ \MessageBreak Degrees used}}
+ \AtBeginDocument{\expandafter\ifx\csname M@TS1\endcsname\relax
+ \DeclareRobustCommand*{\degres}{%
+ \leavevmode\hbox to 0.3em{\hss\degre\hss}%
+ \Warning@degree@TSone
+ \global\let\Warning@degree@TSone\relax}%
+ \let\textdegree\degres
+ \else
+ \DeclareRobustCommand*{\degres}{%
+ \hbox{\UseTextSymbol{TS1}{\textdegree}}}%
+ \fi}
+\else
+ \DeclareRobustCommand*{\degres}{%
+ \leavevmode\hbox to 0.3em{\hss\degre\hss}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{frenchb-1.1}{1996/01/16}{Special care has to be taken
+% with Ml\TeX.}
+%
+% The following macros are used in the redefinition of |\^| and
+% |\"| to handle the letter~i: they allow users to type simply
+% |\^i| and |\"i| instead of |\^{\i}| and |\"{\i}|.\\
+% Ml\TeX{}'s macros dealing with accents conflict with those of
+% \LaTeXe{}, so we check whether |\csubinverse| is defined or not.
+% If |\csubinverse| is \emph{defined}, we are in Ml\TeX.
+%
+% \changes{frenchb-1.1}{1996/03/02}{Do this only in \LaTeXe.}
+%
+% \changes{frenchb-1.1}{1996/03/12}{Do not redefine \cs{\char94} and
+% \cs{"} in Ml\TeX, because it would break hyphenation. The correct
+% place to redefine \cs{\char94i} and \cs{"i} is in the format
+% itself, see MLTeX.cfg.}
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \AtBeginDocument{%
+ \ifx\csubinverse\@undefined
+ \DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i}%
+ \DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i}%
+ \fi}
+\fi
+% \end{macrocode}
+%
+% \subsection{Date and clean up}
+%
+% \begin{macro}{\datefrench}
+% The macro |\datefrench| redefines the command |\today| to
+% produce French dates.
+%
+% \changes{frenchb-1.2}{1997/01/05}{Added aliases \cs{datefrenchb}
+% and \cs{datefrancais}. Use \cs{ier} instead of \cs{up}.}
+%
+% \changes{frenchb-1.3b}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+%
+% \changes{frenchb-1.3d}{1998/07/04}{Move this code to the end
+% of file, until \cs{ier} is defined (due to use of \cs{edef});
+% expansion of \cs{ier} has to be stopped anyway.}
+%
+% \changes{frenchb-1.3g}{1999/08/18}{Replaced \cs{edef} with \cs{def}
+% to prevent problems with unexpandable accent commands}
+%
+% \changes{frenchb-1.4d}{2000/02/01}{Changed \cs{noexpand}\cs{ier}
+% to \cs{ier}, as a result of the replacement of \cs{edef} by
+% \cs{def}, see previous change. Also add braces around \cs{ier}
+% for xspace.sty.}
+%
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day
+ \ifnum1=\day {\ier}\fi
+ \space \ifcase\month
+ \or janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
+ juillet\or ao\^ut\or septembre\or octobre\or novembre\or
+ d\'ecembre\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@quit| takes care for setting the main language
+% to be switched on at |\begin{document}| and resetting the
+% category code of \texttt{@} to its original value.
+% The config file searched for has to be `frenchb.cfg', and
+% |\CurrentOption| has been set to `french', so
+% |\ldf@finish\CurrentOption| cannot be used: we first load
+% `frenchb.cfg' (in LaTeX2e only), then call
+% |\ldf@quit\CurrentOption|.
+% The macro-space used by some control sequences we do not
+% need any longer, is freed.
+%
+% \changes{frenchb-1.1b}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up.}
+%
+% \changes{frenchb-1.2}{1997/01/05}{The config file searched for is
+% `frenchb.cfg' regardless \cs{CurrentOption}.}
+%
+% \changes{frenchb-1.5d}{2001/02/16}{Load frenchb.cfg first and
+% change \cs{ldf@finish} to \cs{ldf@quit}.}
+%
+% \changes{frenchb-1.6g}{2005/02/06}{frenchb.cfg is now loaded only
+% with LaTeX2e, as the customization makes sense only in LaTeX2e.
+% Suggested by J.F. Burnol.}
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \loadlocalcfg{frenchb}
+\fi
+\let\T@one\relax
+\let\@FI@\relax
+\let\ifLaTeX\@undefined
+\let\LaTeXtrue\@undefined
+\let\LaTeXfalse\@undefined
+\let\ifLaTeXe\@undefined
+\let\LaTeXetrue\@undefined
+\let\LaTeXefalse\@undefined
+\ldf@quit\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/frenchb.ins b/Master/texmf-dist/source/generic/babel/frenchb.ins
new file mode 100644
index 00000000000..8e5f7507769
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/frenchb.ins
@@ -0,0 +1,155 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/10/30}
+\def\batchfile{frenchb.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{frenchb.ldf}{\from{frenchb.dtx}{code}}
+ }
+\nopreamble
+\nopostamble
+\generate{\file{frenchb.cfg}{\from{frenchb.dtx}{cfg}}
+ }
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
+
+
+
+
diff --git a/Master/texmf-dist/source/generic/babel/galician.dtx b/Master/texmf-dist/source/generic/babel/galician.dtx
new file mode 100644
index 00000000000..89b8c59e296
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/galician.dtx
@@ -0,0 +1,476 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{263}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{galician.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{galician}
+%\fi
+%\ProvidesFile{galician.dtx}
+ [2005/03/30 v1.2l Galician support from the babel system]
+%\iffalse
+%% File `galician.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Galician Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Manuel Carriba mcarriba at eunetcom.net
+%% Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Galician language definition file.
+%
+% The 'galician' style was originally adopted from the 'spanish'
+% style.
+%
+% All the macrocodes have been translated from the spanish language
+% into the galician language, using the spanish-galician
+% dictionary:
+%
+% X.L. Franco Grande
+% Diccionario Galego-Castelan e Vocabulario Castelan-Galego
+% Editorial Galaixa, Vigo 1968
+%
+% The hyphenation patterns for the galician language should be the
+% same as the spanish language. I've inspected some galician essays
+% and nothing strange seems to point out that both languages might
+% use different hyphenation patterns. This still has to been
+% proved. I will check it anyway, and hope to report more as soon
+% as possible.
+%
+% A small note to the months in the galician language:
+%
+% 'outono' will be used sometimes instead of 'outubro', but this
+% word will be used more to assign the season.
+%
+% 'nadal' will be used sometimes instead of 'decembro', but this
+% word will be used more for the event on Christmas.
+%
+% Manuel Carriba (mcarriba at eunetcom.net)
+%
+% The file spanish.sty was written by Julio Sanchez,
+% (jsanchez at gmv.es)
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{galician.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{galician.dtx}
+%
+% \changes{galician-1.1}{1994/02/27}{Update for \LaTeXe}
+% \changes{galician-1.1c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{galician-1.2e}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Galician language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Galician language.
+%
+% For this language the characters |'| |~| and |"| are made
+% active. In table~\ref{tab:galician-quote} an overview is given of
+% their purpose.
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% |'a| & an accent that allows hyphenation. Valid for all
+% vowels uppercase and lowercase.\\
+% |'n| & a n with a tilde. This is included to
+% improve compatibility with FTC. Works for uppercase too.\\
+% |"u| & a u with dieresis allowing hyphenation.\\
+% |"a| & feminine ordinal as in
+% 1{\raise1ex\hbox{\underbar{\scriptsize a}}}.\\
+% |"o| & masculine ordinal as in
+% 1{\raise1ex\hbox{\underbar{\scriptsize o}}}.\\
+% |~n| & a n with tilde. Works for uppercase too.
+% \end{tabular}
+% \caption{The extra definitions made by \texttt{galician.ldf}}
+% \label{tab:galician-quote}
+% \end{table}
+% These active accents character behave according to their original
+% definitions if not followed by one of the characters indicated in
+% that table.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{galician-1.2e}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{galician}\captionsgalician
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{galician} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@galician| to see whether we have to do something here.
+%
+% \changes{galician-1.1c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@galician\@undefined
+ \@nopatterns{Galician}
+ \adddialect\l@galician0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Galician language.
+%
+% \begin{macro}{\captionsgalician}
+% The macro |\captionsgalician| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{galician-1.1d}{1994/11/09}{Added a few missing
+% translations}
+% \changes{galician-1.2b}{1995/07/02}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{galician-1.2j}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{galician-1.2k}{2001/02/20}{Translated Proof}
+% \changes{galician-1.2l}{2003/05/23}{Translated Gloassary}
+% \begin{macrocode}
+\addto\captionsgalician{%
+ \def\prefacename{Prefacio}%
+ \def\refname{Referencias}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Bibliograf\'{\i}a}%
+ \def\chaptername{Cap\'{\i}tulo}%
+ \def\appendixname{Ap\'endice}%
+ \def\contentsname{\'Indice Xeral}%
+ \def\listfigurename{\'Indice de Figuras}%
+ \def\listtablename{\'Indice de T\'aboas}%
+ \def\indexname{\'Indice de Materias}%
+ \def\figurename{Figura}%
+ \def\tablename{T\'aboa}%
+ \def\partname{Parte}%
+ \def\enclname{Adxunto}%
+ \def\ccname{Copia a}%
+ \def\headtoname{A}%
+ \def\pagename{P\'axina}%
+ \def\seename{v\'exase}%
+ \def\alsoname{v\'exase tam\'en}%
+ \def\proofname{Demostraci\'on}%
+ \def\glossaryname{Glosario}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dategalician}
+% The macro |\dategalician| redefines the command |\today| to
+% produce Galician dates.
+% \changes{galician-1.1d}{1994/11/09}{Corrected the name of the month
+% marzo from marzal}
+% \changes{galician-1.2h}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{galician-1.2h}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\dategalician{%
+ \def\today{\number\day~de\space\ifcase\month\or
+ xaneiro\or febreiro\or marzo\or abril\or maio\or xu\~no\or
+ xullo\or agosto\or setembro\or outubro\or novembro\or decembro\fi
+ \space de~\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasgalician}
+% \changes{galician-1.2a}{1995/03/14}{Handling of active characters
+% completely rewritten}
+% \begin{macro}{\noextrasgalician}
+%
+% The macro |\extrasgalician| will perform all the extra
+% definitions needed for the Galician language. The macro
+% |\noextrasgalician| is used to cancel the actions of
+% |\extrasgalician|.
+%
+% For Galician, some characters are made active or are
+% redefined. In particular, the \texttt{"} character and the |~|
+% character receive new meanings this can also happen for the
+% \texttt{'} character when the option \Lopt{activeacute} is
+% specified.
+%
+% \changes{galician-1.2c}{1995/07/08}{Make active accent optional}
+% \changes{galician-1.2d}{1995/08/17}{Need to split up the
+% \cs{@ifpackagewith} statement}
+% \begin{macrocode}
+\addto\extrasgalician{\languageshorthands{galician}}
+\initiate@active@char{"}
+\initiate@active@char{~}
+\addto\extrasgalician{%
+ \bbl@activate{"}\bbl@activate{~}}
+\@ifpackagewith{babel}{activeacute}{%
+ \initiate@active@char{'}}{}
+\@ifpackagewith{babel}{activeacute}{%
+ \addto\extrasgalician{\bbl@activate{'}}}{}
+% \end{macrocode}
+% Now make sure that the characters that have been turned into
+% shorthanfd characters expand to `normal' characters outside the
+% catalan environment.
+% \changes{galician-1.2i}{1999/12/16}{Don't forget do deactivate the
+% shorthands}
+% \begin{macrocode}
+\addto\noextrasgalician{%
+ \bbl@deactivate{"}\bbl@deactivate{~}}
+\@ifpackagewith{babel}{activeacute}{%
+ \addto\noextrascatalan{\bbl@deactivate{'}}}{}
+% \end{macrocode}
+%
+% \changes{galician-1.2a}{1995/03/14}{All the code for handling active
+% characters is now moved to \file{babel.def}}
+%
+% Apart from the active characters some other macros get a new
+% definition. Therefore we store the current one to be able to
+% restore them later.
+%
+% \changes{galician-1.2f}{1997/01/08}{Added some comment signs to
+% prevent unwanted spaces in the output}
+% \begin{macrocode}
+\addto\extrasgalician{%
+ \babel@save\"\babel@save\~%
+ \def\"{\protect\@umlaut}%
+ \def\~{\protect\@tilde}}
+\@ifpackagewith{babel}{activeacute}{%
+ \babel@save\'%
+ \addto\extrasgalician{\def\'{\protect\@acute}}
+ }{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% All the code above is necessary because we need a few extra
+% active characters. These characters are then used as indicated in
+% table~\ref{tab:galician-quote}.
+%
+% This option includes some support for working with extended,
+% 8-bit fonts, if available. This assumes that the user has some
+% macros predefined. For instance, if the user has a |\@ac@a| macro
+% defined, the sequence |\'a| or |'a| will both expand to whatever
+% |\@ac@a| is defined to expand, presumably \texttt{\'a}. The
+% names of these macros are the same as those in Ferguson's
+% ML-\TeX{} compatibility package on purpose. Using this method,
+% and provided that adequate hyphenation patterns exist, it is
+% possible to get better hyphenation for Galician than before. If
+% the user has a terminal able to produce these codes directly, it
+% is possible to do so. If the need arises to send the document to
+% someone who does not have such support, it is possible to
+% mechanically translate the document so that the receiver can make
+% use of it.
+%
+% To be able to define the function of the new accents, we first
+% define a couple of `support' macros.
+%
+% \begin{macro}{\dieresis}
+% \begin{macro}{\textacute}
+% \changes{galician-1.1c}{1994/06/26}{Renamed from \cs{acute} as that
+% is a \cs{mathaccent}}
+% \begin{macro}{\texttilde}
+% \changes{galician-1.1c}{1994/06/26}{Renamed from \cs{tilde} as that
+% is a \cs{mathaccent}}
+%
+% The original definition of |\"| is stored as |\dieresis|, because
+% the definition of |\"| might not be the default plain \TeX\
+% one. If the user uses \textsc{PostScript} fonts with the Adobe
+% font encoding the \texttt{"} character is not in the same
+% position as in Knuth's font encoding. In this case |\"| will not
+% be defined as |\accent"7F #1|, but as |\accent'310 #1|. Something
+% similar happens when using fonts that follow the Cork
+% encoding. For this reason we save the definition of |\"| and use
+% that in the definition of other macros. We do likewise for |\'|
+% and |\~|.
+% \begin{macrocode}
+\let\dieresis\"
+\let\texttilde\~
+\@ifpackagewith{babel}{activeacute}{\let\textacute\'}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@umlaut}
+% \begin{macro}{\@acute}
+% \begin{macro}{\@tilde}
+% If the user setup has extended fonts, the Ferguson macros are
+% required to be defined. We check for their existance and, if
+% defined, expand to whatever they are defined to. For instance,
+% |\'a| would check for the existance of a |\@ac@a| macro. It is
+% assumed to expand to the code of the accented letter. If it is
+% not defined, we assume that no extended codes are available and
+% expand to the original definition but enabling hyphenation beyond
+% the accent. This is as best as we can do. It is better if you
+% have extended fonts or ML-\TeX{} because the hyphenation
+% algorithm can work on the whole word. The following macros are
+% directly derived from ML-\TeX{}.\footnote{A problem is perceived
+% here with these macros when used in a multilingual environment
+% where extended hyphenation patterns are available for some but
+% not all languages. Assume that no extended patterns exist at some
+% site for French and that \file{french.sty} would adopt this
+% scheme too. In that case, \texttt{'e} in French would
+% produce the combined accented letter, but hyphenation around it
+% would be suppressed. Both language options would need an
+% independent method to know whether they have extended patterns
+% available. The precise impact of this problem and the possible
+% solutions are under study.}
+%
+% \begin{macrocode}
+\def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
+\def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}
+\@ifpackagewith{babel}{activeacute}{%
+ \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Now we can define our shorthands: the umlauts,
+% \begin{macrocode}
+\declare@shorthand{galician}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{galician}{"|}{\discretionary{-}{}{\kern.03em}}
+\declare@shorthand{galician}{"u}{\@umlaut{u}}
+\declare@shorthand{galician}{"U}{\@umlaut{U}}
+% \end{macrocode}
+% ordinals\footnote{The code for the ordinals was taken from the
+% answer provided by Raymond Chen
+% {\texttt(raymond@math.berkeley.edu}) to a question by Joseph Gil
+% (\texttt{yogi@cs.ubc.ca}) in \texttt{comp.text.tex}.},
+% \changes{galician-1.2f}{1997/01/08}{Added \cs{leavevmode} to
+% definitions of \texttt{"a} and \texttt{"o}}
+% \begin{macrocode}
+\declare@shorthand{galician}{"o}{%
+ \leavevmode\raise1ex\hbox{\underbar{\scriptsize o}}}
+\declare@shorthand{galician}{"a}{%
+ \leavevmode\raise1ex\hbox{\underbar{\scriptsize a}}}
+% \end{macrocode}
+% acute accents,
+% \changes{galician-1.2b}{1995/07/03}{Changed mathmode definition of
+% acute shorthands to expand to a single prime followed by the next
+% character in the input}
+% \begin{macrocode}
+\@ifpackagewith{babel}{activeacute}{%
+ \declare@shorthand{galician}{'a}{\textormath{\@acute a}{^{\prime} a}}
+ \declare@shorthand{galician}{'e}{\textormath{\@acute e}{^{\prime} e}}
+ \declare@shorthand{galician}{'i}{\textormath{\@acute\i{}}{^{\prime}i}}
+ \declare@shorthand{galician}{'o}{\textormath{\@acute o}{^{\prime} o}}
+ \declare@shorthand{galician}{'u}{\textormath{\@acute u}{^{\prime} u}}
+ \declare@shorthand{galician}{'A}{\textormath{\@acute A}{^{\prime} A}}
+ \declare@shorthand{galician}{'E}{\textormath{\@acute E}{^{\prime} E}}
+ \declare@shorthand{galician}{'I}{\textormath{\@acute I}{^{\prime} I}}
+ \declare@shorthand{galician}{'O}{\textormath{\@acute O}{^{\prime} O}}
+ \declare@shorthand{galician}{'U}{\textormath{\@acute U}{^{\prime} U}}
+% \end{macrocode}
+% tildes,
+% \begin{macrocode}
+ \declare@shorthand{galician}{'n}{\textormath{\~n}{^{\prime} n}}
+ \declare@shorthand{galician}{'N}{\textormath{\~N}{^{\prime} N}}
+% \end{macrocode}
+% the acute accent,
+% \changes{galician-1.2d}{1995/11/11}{Added '{}' as an axtra shorthand}
+% \begin{macrocode}
+ \declare@shorthand{galician}{''}{%
+ \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
+ }{}
+\declare@shorthand{galician}{~n}{\textormath{\~n}{\@tilde n}}
+\declare@shorthand{galician}{~N}{\textormath{\~N}{\@tilde N}}
+% \end{macrocode}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% unfortunate for Galician but not as much as for Dutch or German,
+% where long compound words are quite normal and all one needs is a
+% means to indicate an extra hyphenation position on top of the
+% ones that \TeX\ can generate from the hyphenation
+% patterns. However, the average length of words in Galician makes
+% this desirable and so it is kept here.
+%
+% \begin{macrocode}
+\addto\extrasgalician{%
+ \babel@save{\-}%
+ \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{galician-1.2e}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{galician}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/galician.ins b/Master/texmf-dist/source/generic/babel/galician.ins
new file mode 100644
index 00000000000..a50810d8f2c
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/galician.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{galician.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{galician.ldf}{\from{galician.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/german.ins b/Master/texmf-dist/source/generic/babel/german.ins
new file mode 100644
index 00000000000..987f600bf78
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/german.ins
@@ -0,0 +1,149 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{german.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{germanb.ldf}{\from{germanb.dtx}{code}}
+ \file{ngermanb.ldf}{\from{ngermanb.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/germanb.dtx b/Master/texmf-dist/source/generic/babel/germanb.dtx
new file mode 100644
index 00000000000..4e2491b2ecd
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/germanb.dtx
@@ -0,0 +1,543 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{343}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{germanb.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{germanb}
+%\fi
+%\ProvidesFile{germanb.dtx}
+ [2004/02/19 v2.6k German support from the babel system]
+%\iffalse
+%% File `germanb.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2004
+%% by Johannes Braams, TeXniek
+%
+%% Germanb Language Definition File
+%% Copyright (C) 1989 - 2004
+%% by Bernd Raichle raichle at azu.Informatik.Uni-Stuttgart.de
+%% Johannes Braams, TeXniek
+% This file is based on german.tex version 2.5d,
+% by Bernd Raichle, Hubert Partl et.al.
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{germanb.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{germanb.dtx}
+%
+% \changes{germanb-1.0a}{1990/05/14}{Incorporated Nico's comments}
+% \changes{germanb-1.0b}{1990/05/22}{fixed typo in definition for
+% austrian language found by Werenfried Spit
+% \texttt{nspit@fys.ruu.nl}}
+% \changes{germanb-1.0c}{1990/07/16}{Fixed some typos}
+% \changes{germanb-1.1}{1990/07/30}{When using PostScript fonts with
+% the Adobe fontencoding, the dieresis-accent is located elsewhere,
+% modified code}
+% \changes{germanb-1.1a}{1990/08/27}{Modified the documentation
+% somewhat}
+% \changes{germanb-2.0}{1991/04/23}{Modified for babel 3.0}
+% \changes{germanb-2.0a}{1991/05/25}{Removed some problems in change
+% log}
+% \changes{germanb-2.1}{1991/05/29}{Removed bug found by van der Meer}
+% \changes{germanb-2.2}{1991/06/11}{Removed global assignments,
+% brought uptodate with \file{german.tex} v2.3d}
+% \changes{germanb-2.2a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{germanb-2.3}{1991/11/05}{Rewritten parts of the code to use
+% the new features of babel version 3.1}
+% \changes{germanb-2.3e}{1991/11/10}{Brought up-to-date with
+% \file{german.tex} v2.3e (plus some bug fixes) [br]}
+% \changes{germanb-2.5}{1994/02/08}{Update or \LaTeXe}
+% \changes{germanb-2.5c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved the identification after the loading of
+% \file{babel.def}}
+% \changes{germanb-2.6a}{1995/02/15}{Moved the identification to the
+% top of the file}
+% \changes{germanb-2.6a}{1995/02/15}{Rewrote the code that handles the
+% active double quote character}
+% \changes{germanb-2.6d}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{germanb-2.6d}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The German language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% German language as well as for the Austrian dialect of this
+% language\footnote{This file is a re-implementation of Hubert
+% Partl's \file{german.sty} version 2.5b, see~\cite{HP}.}.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:german-quote} an overview is given of its
+% purpose. One of the reasons for this is that in the German
+% language some character combinations change when a word is broken
+% between the combination. Also the vertical placement of the
+% umlaut can be controlled this way.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"a| & |\"a|, also implemented for the other
+% lowercase and uppercase vowels. \\
+% |"s| & to produce the German \ss{} (like |\ss{}|). \\
+% |"z| & to produce the German \ss{} (like |\ss{}|). \\
+% |"ck|& for |ck| to be hyphenated as |k-k|. \\
+% |"ff|& for |ff| to be hyphenated as |ff-f|,
+% this is also implemented for l, m, n, p, r and t\\
+% |"S| & for |SS| to be |\uppercase{"s}|. \\
+% |"Z| & for |SZ| to be |\uppercase{"z}|. \\
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"~| & for a compound word mark without a breakpoint. \\
+% |"=| & for a compound word mark with a breakpoint, allowing
+% hyphenation in the composing words. \\
+% |"`| & for German left double quotes (looks like ,,). \\
+% |"'| & for German right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{german.ldf}}\label{tab:german-quote}
+% \end{center}
+% \end{table}
+% The quotes in table~\ref{tab:german-quote} can also be typeset by
+% using the commands in table~\ref{tab:more-quote}.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |\glqq| & for German left double quotes (looks like ,,). \\
+% |\grqq| & for German right double quotes (looks like ``). \\
+% |\glq| & for German left single quotes (looks like ,). \\
+% |\grq| & for German right single quotes (looks like `). \\
+% |\flqq| & for French left double quotes (similar to $<<$). \\
+% |\frqq| & for French right double quotes (similar to $>>$).\\
+% |\flq| & for (French) left single quotes (similar to $<$). \\
+% |\frq| & for (French) right single quotes (similar to $>$). \\
+% |\dq| & the original quotes character (|"|). \\
+% \end{tabular}
+% \caption{More commands which produce quotes, defined
+% by \file{german.ldf}}\label{tab:more-quote}
+% \end{center}
+% \end{table}
+%
+% \StopEventually{}
+%
+% When this file was read through the option \Lopt{germanb} we make
+% it behave as if \Lopt{german} was specified.
+% \begin{macrocode}
+\def\bbl@tempa{germanb}
+\ifx\CurrentOption\bbl@tempa
+ \def\CurrentOption{german}
+\fi
+% \end{macrocode}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{germanb-2.6d}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{german} will be an `unknown' language, so we
+% have to make it known. So we check for the existence of
+% |\l@german| to see whether we have to do something here.
+%
+% \changes{germanb-2.0}{1991/04/23}{Now use \cs{adddialect} if
+% language undefined}
+% \changes{germanb-2.2d}{1991/10/27}{Removed use of \cs{@ifundefined}}
+% \changes{germanb-2.3e}{1991/11/10}{Added warning, if no german
+% patterns loaded}
+% \changes{germanb-2.5c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@german\@undefined
+ \@nopatterns{German}
+ \adddialect\l@german0
+\fi
+% \end{macrocode}
+%
+% For the Austrian version of these definitions we just add another
+% language.
+% \changes{germanb-2.0}{1991/04/23}{Now use \cs{adddialect} for
+% austrian}
+% \begin{macrocode}
+\adddialect\l@austrian\l@german
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the German language.
+%
+% \begin{macro}{\captionsgerman}
+% \begin{macro}{\captionsaustrian}
+% Either the macro |\captionsgerman| or the macro
+% |\captionsaustrian| will define all strings used in the four
+% standard document classes provided with \LaTeX.
+%
+% \changes{germanb-2.2}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{germanb-2.2}{1991/06/06}{\cs{pagename} should be
+% \cs{headpagename}}
+% \changes{germanb-2.3e}{1991/11/10}{Added \cs{prefacename},
+% \cs{seename} and \cs{alsoname}}
+% \changes{germanb-2.4}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{germanb-2.6b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{germanb-2.6d}{1996/07/10}{Construct control sequence on the
+% fly}
+% \changes{germanb-2.6j}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Vorwort}%
+ \def\refname{Literatur}%
+ \def\abstractname{Zusammenfassung}%
+ \def\bibname{Literaturverzeichnis}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Anhang}%
+ \def\contentsname{Inhaltsverzeichnis}% % oder nur: Inhalt
+ \def\listfigurename{Abbildungsverzeichnis}%
+ \def\listtablename{Tabellenverzeichnis}%
+ \def\indexname{Index}%
+ \def\figurename{Abbildung}%
+ \def\tablename{Tabelle}% % oder: Tafel
+ \def\partname{Teil}%
+ \def\enclname{Anlage(n)}% % oder: Beilage(n)
+ \def\ccname{Verteiler}% % oder: Kopien an
+ \def\headtoname{An}%
+ \def\pagename{Seite}%
+ \def\seename{siehe}%
+ \def\alsoname{siehe auch}%
+ \def\proofname{Beweis}%
+ \def\glossaryname{Glossar}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\dategerman}
+% The macro |\dategerman| redefines the command
+% |\today| to produce German dates.
+% \changes{germanb-2.3e}{1991/11/10}{Added \cs{month@german}}
+% \changes{germanb-2.6f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{germanb-2.6f}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\month@german{\ifcase\month\or
+ Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
+ Juli\or August\or September\or Oktober\or November\or Dezember\fi}
+\def\dategerman{\def\today{\number\day.~\month@german
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateaustrian}
+% The macro |\dateaustrian| redefines the command
+% |\today| to produce Austrian version of the German dates.
+% \changes{germanb-2.6f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{germanb-2.6f}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\dateaustrian{\def\today{\number\day.~\ifnum1=\month
+ J\"anner\else \month@german\fi \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasgerman}
+% \begin{macro}{\extrasaustrian}
+% \changes{germanb-2.0b}{1991/05/29}{added some comment chars to
+% prevent white space}
+% \changes{germanb-2.2}{1991/06/11}{Save all redefined macros}
+% \begin{macro}{\noextrasgerman}
+% \begin{macro}{\noextrasaustrian}
+% \changes{germanb-1.1}{1990/07/30}{Added \cs{dieresis}}
+% \changes{germanb-2.0b}{1991/05/29}{added some comment chars to
+% prevent white space}
+% \changes{germanb-2.2}{1991/06/11}{Try to restore everything to its
+% former state}
+% \changes{germanb-2.6d}{1996/07/10}{Construct control sequence
+% \cs{extrasgerman} or \cs{extrasaustrian} on the fly}
+%
+% Either the macro |\extrasgerman| or the macros |\extrasaustrian|
+% will perform all the extra definitions needed for the German
+% language. The macro |\noextrasgerman| is used to cancel the
+% actions of |\extrasgerman|.
+%
+% For German (as well as for Dutch) the \texttt{"} character is
+% made active. This is done once, later on its definition may vary.
+% \begin{macrocode}
+\initiate@active@char{"}
+\@namedef{extras\CurrentOption}{%
+ \languageshorthands{german}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{germanb-2.6i}{1999/12/16}{Deactivate shorthands ouside of
+% German}
+% \begin{macrocode}
+\addto\noextrasgerman{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% \changes{germanb-2.6a}{1995/02/15}{All the code to handle the active
+% double quote has been moved to \file{babel.def}}
+%
+% In order for \TeX\ to be able to hyphenate German words which
+% contain `\ss' (in the \texttt{OT1} position |^^Y|) we have to
+% give the character a nonzero |\lccode| (see Appendix H, the \TeX
+% book).
+% \changes{germanb-2.6c}{1996/04/08}{Use decimal number instead of
+% hat-notation as the hat may be activated}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable{\lccode25}%
+ \lccode25=25}
+% \end{macrocode}
+% \changes{germanb-2.6a}{1995/02/15}{Removeed \cs{3} as it is no
+% longer in \file{german.ldf}}
+%
+% The umlaut accent macro |\"| is changed to lower the umlaut dots.
+% The redefinition is done with the help of |\umlautlow|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\"\umlautlow}
+\@namedef{noextras\CurrentOption}{\umlauthigh}
+% \end{macrocode}
+% The german hyphenation patterns can be used with |\lefthyphenmin|
+% and |\righthyphenmin| set to~2.
+% \changes{germanb-2.6a}{1995/05/13}{use \cs{germanhyphenmins} to store
+% the correct values}
+% \changes{germanb-2.6j}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% For German texts we need to make sure that |\frenchspacing| is
+% turned on.
+% \changes{germanb-2.6k}{2001/01/26}{Turn frenchspacing on, as in
+% \texttt{german.sty}}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchspacing}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{germanb-2.6a}{1995/02/15}{\cs{umlautlow} and
+% \cs{umlauthigh} moved to \file{glyphs.dtx}, as well as
+% \cs{newumlaut} (now \cs{lower@umlaut}}
+%
+% The code above is necessary because we need an extra active
+% character. This character is then used as indicated in
+% table~\ref{tab:german-quote}.
+%
+% To be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+% \changes{germanb-2.3e}{1991/11/10}{Added \cs{save@sf@q} macro and
+% rewrote all quote macros to use it}
+% \changes{germanb-2.3h}{1991/02/16}{moved definition of
+% \cs{allowhyphens}, \cs{set@low@box} and \cs{save@sf@q} to
+% \file{babel.com}}
+% \changes{germanb-2.6a}{1995/02/15}{Moved all quotation characters to
+% \file{glyphs.dtx}}
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+% \changes{germanb-2.6c}{1996/01/24}{Moved \cs{german@dq@disc} to
+% babel.def, calling it \cs{bbl@disc}}
+%
+% \changes{germanb-2.6a}{1995/02/15}{Use \cs{ddot} instead of
+% \cs{@MATHUMLAUT}}
+%
+% Now we can define the doublequote macros: the umlauts,
+% \changes{germanb-2.6c}{1996/05/30}{added the \cs{allowhyphens}}
+% \begin{macrocode}
+\declare@shorthand{german}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
+\declare@shorthand{german}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
+\declare@shorthand{german}{"u}{\textormath{\"{u}\allowhyphens}{\ddot u}}
+\declare@shorthand{german}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
+\declare@shorthand{german}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
+\declare@shorthand{german}{"U}{\textormath{\"{U}\allowhyphens}{\ddot U}}
+% \end{macrocode}
+% tremas,
+% \begin{macrocode}
+\declare@shorthand{german}{"e}{\textormath{\"{e}}{\ddot e}}
+\declare@shorthand{german}{"E}{\textormath{\"{E}}{\ddot E}}
+\declare@shorthand{german}{"i}{\textormath{\"{\i}}%
+ {\ddot\imath}}
+\declare@shorthand{german}{"I}{\textormath{\"{I}}{\ddot I}}
+% \end{macrocode}
+% german es-zet (sharp s),
+% \changes{germanb-2.6f}{1997/05/08}{use \cs{SS} instead of
+% \texttt{SS}, removed braces after \cs{ss}}
+% \begin{macrocode}
+\declare@shorthand{german}{"s}{\textormath{\ss}{\@SS{}}}
+\declare@shorthand{german}{"S}{\SS}
+\declare@shorthand{german}{"z}{\textormath{\ss}{\@SS{}}}
+\declare@shorthand{german}{"Z}{SZ}
+% \end{macrocode}
+% german and french quotes,
+% \begin{macrocode}
+\declare@shorthand{german}{"`}{\glqq}
+\declare@shorthand{german}{"'}{\grqq}
+\declare@shorthand{german}{"<}{\flqq}
+\declare@shorthand{german}{">}{\frqq}
+% \end{macrocode}
+% discretionary commands
+% \begin{macrocode}
+\declare@shorthand{german}{"c}{\textormath{\bbl@disc ck}{c}}
+\declare@shorthand{german}{"C}{\textormath{\bbl@disc CK}{C}}
+\declare@shorthand{german}{"F}{\textormath{\bbl@disc F{FF}}{F}}
+\declare@shorthand{german}{"l}{\textormath{\bbl@disc l{ll}}{l}}
+\declare@shorthand{german}{"L}{\textormath{\bbl@disc L{LL}}{L}}
+\declare@shorthand{german}{"m}{\textormath{\bbl@disc m{mm}}{m}}
+\declare@shorthand{german}{"M}{\textormath{\bbl@disc M{MM}}{M}}
+\declare@shorthand{german}{"n}{\textormath{\bbl@disc n{nn}}{n}}
+\declare@shorthand{german}{"N}{\textormath{\bbl@disc N{NN}}{N}}
+\declare@shorthand{german}{"p}{\textormath{\bbl@disc p{pp}}{p}}
+\declare@shorthand{german}{"P}{\textormath{\bbl@disc P{PP}}{P}}
+\declare@shorthand{german}{"r}{\textormath{\bbl@disc r{rr}}{r}}
+\declare@shorthand{german}{"R}{\textormath{\bbl@disc R{RR}}{R}}
+\declare@shorthand{german}{"t}{\textormath{\bbl@disc t{tt}}{t}}
+\declare@shorthand{german}{"T}{\textormath{\bbl@disc T{TT}}{T}}
+% \end{macrocode}
+% We need to treat |"f| a bit differently in order to preserve the
+% ff-ligature.
+% \changes{germanb-2.6f}{1998/06/15}{Copied the coding for \texttt{"f}
+% from german.dtx version 2.5d}
+% \begin{macrocode}
+\declare@shorthand{german}{"f}{\textormath{\bbl@discff}{f}}
+\def\bbl@discff{\penalty\@M
+ \afterassignment\bbl@insertff \let\bbl@nextff= }
+\def\bbl@insertff{%
+ \if f\bbl@nextff
+ \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+ {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}
+\let\bbl@nextff=f
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{german}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{german}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{german}{""}{\hskip\z@skip}
+\declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{german}{"=}{\penalty\@M-\hskip\z@skip}
+% \end{macrocode}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% \begin{macro}{\ck}
+% All that's left to do now is to define a couple of commands
+% for reasons of compatibility with \file{german.sty}.
+% \changes{germanb-2.6f}{1998/06/07}{Now use \cs{shorthandon} and
+% \cs{shorthandoff}}
+% \begin{macrocode}
+\def\mdqon{\shorthandon{"}}
+\def\mdqoff{\shorthandoff{"}}
+\def\ck{\allowhyphens\discretionary{k-}{k}{ck}\allowhyphens}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{germanb-2.6d}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/greek.dtx b/Master/texmf-dist/source/generic/babel/greek.dtx
new file mode 100644
index 00000000000..4f198cdee56
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/greek.dtx
@@ -0,0 +1,864 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{636}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{greek.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{greek}
+%\fi
+%\ProvidesFile{greek.dtx}
+ [2005/03/30 v1.3l Greek support from the babel system]
+%\iffalse
+%% File `greek.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Greek language Definition File
+%% Copyright (C) 1997, 2005
+%% by Apostolos Syropoulos
+%% Johannes Braams, TeXniek
+%
+%% Please report errors to: Apostolos Syropoulos
+%% apostolo at platon.ee.duth.gr or
+%% apostolo at obelix.ee.duth.gr
+%% (or J.L. Braams <babel at braams.cistron.nl)
+%
+% This file is part of the babel system, it provides the source
+% code for the greek language definition file. The original
+% version of this file was written by Apostolos Syropoulos.
+% It was then enhanced by adding code from kdgreek.sty from David
+% Kastrup <dak@neuroinformatik.ruhr-uni-bochum.de> with his
+% consent.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\newcommand*{\pkg}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{greek.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{greek.dtx}
+%
+% \changes{greek-1.0b}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{greek-1.0b}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning}
+% \changes{greek-1.2}{1997/10/28}{Classical Greek is now a dialect}
+% \changes{greek-1.2b}{1997/11/01}{Classical Greek is now called
+% ``Polutoniko'' Greek. The previous name was at least misleading}
+% \changes{greek-1.2c}{1998/06/26}{This version conforms to version
+% 2.0 of the CB fonts and consequently we added a few new
+% symbol-producing commands}
+% \changes{greek-1.3a}{1998/07/04}{polutoniko is now an attribute to
+% Greek, no longer a `dialect'}
+%
+% \section{The Greek language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author is Apostolos Syropoulos
+% (\texttt{apostolo@platon.ee.duth.gr}), code from
+% \file{kdgreek.sty} by David Kastrup
+% \texttt{dak@neuroinformatik.ruhr-uni-bochum.de} was used to
+% enhance the support for typesetting greek texts.} defines all the
+% language definition macros for the Greek language, i.e.,
+% as it used today with only one accent, and the attribute
+% $\pi o\lambda\upsilon\tau o\nu\kappa\acute{o}$ (``Polutoniko'')
+% for typesetting greek text with all accents. This separation
+% arose out of the need to simplify things, for only very few
+% people will be really interested to typeset polytonic Greek
+% text.
+%
+% \DescribeMacro\greektext
+% \DescribeMacro\latintext
+% The commands |\greektext| and |\latintext| can be used to switch
+% to greek or latin fonts. These are declarations.
+%
+% \DescribeMacro\textgreek
+% \DescribeMacro\textlatin
+% The commands |\textgreek| and |\textlatin| both take one argument
+% which is then typeset using the requested font encoding.
+% \DescribeMacro\textol
+% The command |\greekol| switches to the greek outline font family,
+% while the command |\textol| typests a short text in outline font.
+% A number of extra greek characters are made available through the
+% added text commands |\stigma|, |\qoppa|, |\sampi|, |\ddigamma|,
+% |\Digamma|, |\euro|, |\permill|, and |\vardigamma|.
+%
+% \subsection{Typing conventions}
+%
+% Entering greek text can be quite difficult because of the many
+% diacritical signs that need to be added for various purposes.
+% The fonts that are used to typeset Greek make this a lot
+% easier by offering a lot of ligatures. But in order for this to
+% work, some characters need to be considered as letters. These
+% characters are |<|, |>|, |~|, |`|, |'|, |"| and
+% \verb=|=. Therefore their |\lccode| is changed when Greek is in
+% effect. In order to let |\uppercase| give correct results, the
+% |\uccode| of these characters is set to a non-existing character
+% to make them disappear. Of course not all characters are needed
+% when typesetting ``modern'' $\mu o\nu o\tau o\nu
+% \iota\kappa\acute{o}$. In that case we only need the |'| and |"|
+% symbols which are treated in the proper way.
+%
+% \subsection{Greek numbering}
+%
+% The Greek alphabetical numbering system, like the Roman one, is
+% still used in everyday life for short enumerations. Unfortunately
+% most Greeks don't know how to write Greek numbers bigger than 20 or
+% 30. Nevertheless, in official editions of the last century and
+% beginning of this century this numbering system was also used for
+% dates and numbers in the range of several thousands. Nowadays
+% this numbering system is primary used by the Eastern Orthodox
+% Church and by certain scholars. It is hence necessary to be able
+% to typeset any Greek numeral up to \hbox{999\,999}. Here are the
+% conventions:
+% \begin{itemize}
+% \item There is no Greek numeral for any number less than or equal
+% to $0$.
+% \item Numbers from $1$ to $9$ are denoted by letters alpha, beta,
+% gamma, delta, epsilon, stigma, zeta, eta, theta, followed by a
+% mark similar to the mathematical symbol ``prime''. (Nowadays
+% instead of letter stigma the digraph sigma tau is used for number
+% $6$. Mainly because the letter stigma is not always available, so
+% people opt to write down the first two letters of its name as an
+% alternative. In our implementation we produce the letter stigma,
+% not the digraph sigma tau.)
+% \item Decades from $10$ to $90$ are denoted by letters iota,
+% kappa, lambda, mu, nu, xi, omikron, pi, qoppa, again followed by
+% the numeric mark. The qoppa used for this purpose has a special
+% zig-zag form, which doesn't resemble at all the original
+% `q'-like qoppa.
+% \item Hundreds from $100$ to $900$ are denoted by letters rho,
+% sigma, tau, upsilon, phi, chi, psi, omega, sampi, followed by the
+% numeric mark.
+% \item Any number between $1$ and $999$ is obtained by a group of
+% letters denoting the hundreds decades and units, followed by a
+% numeric mark.
+% \item To denote thousands one uses the same method, but this time
+% the mark is placed in front of the letter, and under the baseline
+% (it is inverted by 180 degrees). When a group of letters denoting
+% thousands is followed by a group of letters denoting a number
+% under $1000$, then both marks are used.
+% \end{itemize}
+%
+% Using these conventions one obtains numbers up to \hbox{999\,999}.
+% \DescribeMacro{\greeknumeral}
+% The command |\greeknumeral| makes it possible to typeset Greek
+% numerals. There is also an
+% \DescribeMacro{\Greeknumeral}
+% ``uppercase'' version of this macro: |\Greeknumeral|.
+%
+% Another system which was in wide use only in Athens, could
+% express any positive number. This system is implemented in
+% package |athnum|.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{greek-1.0b}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+% When the option \Lopt{polutonikogreek} was used, redefine
+% |\CurrentOption| to prevent problems later on.
+% \begin{macrocode}
+\gdef\CurrentOption{greek}%
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{greek} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@greek| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\l@greek\@undefined
+ \@nopatterns{greek}
+ \adddialect\l@greek0\fi
+% \end{macrocode}
+%
+% Now we declare the |polutoniko| language attribute.
+% \begin{macrocode}
+\bbl@declare@ttribute{greek}{polutoniko}{%
+% \end{macrocode}
+% This code adds the expansion of |\extraspolutonikogreek| to
+% |\extrasgreek| and changes the definition of |\today| for Greek
+% to produce polytonic month names.
+% \begin{macrocode}
+ \expandafter\addto\expandafter\extrasgreek
+ \expandafter{\extraspolutonikogreek}%
+ \let\captionsgreek\captionspolutonikogreek
+ \let\gr@month\gr@c@month
+% \end{macrocode}
+% We need to take some extra precautions in order not to break
+% older documents which still use the old \Lopt{polutonikogreek}
+% option.
+% \changes{greek-1.3f}{1999/09/29}{Added some code to make older
+% documents work}
+% \changes{greek-1.3g}{2000/02/04}{\cs{noextraspolutonikogreek} was
+% missing}
+% \begin{macrocode}
+ \let\l@polutonikogreek\l@greek
+ \let\datepolutonikogreek\dategreek
+ \let\extraspolutonikogreek\extrasgreek
+ \let\noextraspolutonikogreek\noextrasgreek
+ }
+% \end{macrocode}
+%
+% Typesetting Greek texts implies that a special set of fonts needs
+% to be used. The current support for greek uses the |cb| fonts
+% created by Claudio Beccari\footnote{Apostolos Syropoulos wishes
+% to thank him for his patience, collaboration, cooments and
+% suggestions.}. The |cb| fonts provide all sorts of \textit{font
+% combinations}. In order to use these fonts we define the Local
+% GReek encoding (LGR, see the file \file{greek.fdd}). We make sure
+% that this encoding is known to \LaTeX, and if it isn't we abort.
+% \changes{greek-1.2a}{1997/10/31}{filename \file{lgrenc.def} now
+% lowercase}
+% \begin{macrocode}
+\InputIfFileExists{lgrenc.def}{%
+ \message{Loading the definitions for the Greek font encoding}}{%
+ \errhelp{I can't find the lgrenc.def file for the Greek fonts}%
+ \errmessage{Since I do not know what the LGR encoding means^^J
+ I can't typeset Greek.^^J
+ I stop here, while you get a suitable lgrenc.def file}\@@end
+ }
+% \end{macrocode}
+%
+% Now we define two commands that offer the possibility to switch
+% between Greek and Roman encodings.
+%
+% \begin{macro}{\greektext}
+% The command |\greektext| will switch from Latin font encoding to
+% the Greek font encoding. This assumes that the `normal' font
+% encoding is a Latin one. This command is a \emph{declaration},
+% for shorter pieces of text the command |\textgreek| should be
+% used.
+% \begin{macrocode}
+\DeclareRobustCommand{\greektext}{%
+ \fontencoding{LGR}\selectfont
+ \def\encodingdefault{LGR}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textgreek}
+% This command takes an argument which is then typeset using the
+% requested font encoding. In order to avoid many encoding switches
+% it operates in a local scope.
+% \changes{greek-1.0b}{1996/09/23}{Added a level of braces to keep
+% encoding change local}
+% \changes{greek-1.3k}{2003/03/19}{Added \cs{leavevmode} as was done
+% with \cs{latintext}}
+% \begin{macrocode}
+\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textol}
+% A last aspect of the set of fonts provided with this version of
+% support for typesetting Greek texts is that it contains an
+% outline family. In order to make it available we define the command
+% |\textol|.
+% \begin{macrocode}
+\def\outlfamily{\usefont{LGR}{cmro}{m}{n}}
+\DeclareTextFontCommand{\textol}{\outlfamily}
+% \end{macrocode}
+% \end{macro}
+%
+% The next step consists in defining commands to switch to (and
+% from) the Greek language.
+%
+% \begin{macro}{\greekhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{greek-1.3h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+% Yannis Haralambous has suggested this value
+\providehyphenmins{\CurrentOption}{\@ne\@ne}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{greek-1.1e}{1997/10/12}{Added caption name for proof}
+% \changes{greek-1.3d}{1999/08/28}{Fixed typo, \texttt{bl'epe ep'ishc}
+% instead of \texttt{bl'pe ep'ishc}}
+%
+% \begin{macro}{\captionsgreek}
+% The macro |\captionsgreek| defines all strings used in the
+% four standard document classes provided with \LaTeX.
+% \changes{greek-1.3h}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{greek-1.3i}{2000/10/02}{The final sigma in all names appears
+% as `s' instead of `c'.}
+% \begin{macrocode}
+\addto\captionsgreek{%
+ \def\prefacename{Pr'ologos}%
+ \def\refname{Anafor'es}%
+ \def\abstractname{Per'ilhyh}%
+ \def\bibname{Bibliograf'ia}%
+ \def\chaptername{Kef'alaio}%
+ \def\appendixname{Par'arthma}%
+ \def\contentsname{Perieq'omena}%
+ \def\listfigurename{Kat'alogos Sqhm'atwn}%
+ \def\listtablename{Kat'alogos Pin'akwn}%
+ \def\indexname{Euret'hrio}%
+ \def\figurename{Sq'hma}%
+ \def\tablename{P'inakas}%
+ \def\partname{M'eros}%
+ \def\enclname{Sunhmm'ena}%
+ \def\ccname{Koinopo'ihsh}%
+ \def\headtoname{Pros}%
+ \def\pagename{Sel'ida}%
+ \def\seename{bl'epe}%
+ \def\alsoname{bl'epe ep'ishs}%
+ \def\proofname{Ap'odeixh}%
+ \def\glossaryname{Glwss'ari}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \changes{greek-1.2}{1997/10/28}{Added caption names for
+% \cs{polutonikogreek}}
+% \changes{greek-1.3d}{1999/08/28}{Fixed typo, \texttt{bl'epe >ep'ishc}
+% instead of \texttt{bl'pe >ep'ishc}}
+%
+% \begin{macro}{\captionspolutonikogreek}
+% For texts written in the $\pi o\lambda\upsilon\tau
+% o\nu\kappa\acute{o}$ (polytonic greek) the translations are
+% the same as above, but some words are spelled differently. For
+% now we just add extra definitions to |\captionsgreek| in order to
+% override the earlier definitions.
+% \begin{macrocode}
+\let\captionspolutonikogreek\captionsgreek
+\addto\captionspolutonikogreek{%
+ \def\refname{>Anafor`es}%
+ \def\indexname{E<uret'hrio}%
+ \def\figurename{Sq~hma}%
+ \def\headtoname{Pr`os}%
+ \def\alsoname{bl'epe >ep'ishs}%
+ \def\proofname{>Ap'odeixh}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gr@month}
+% \changes{greek-1.1e}{1997/10/12}{Macro added}
+% \begin{macro}{\dategreek}
+% The macro |\dategreek| redefines the command |\today| to
+% produce greek dates. The name of the month is now produced
+% by the macro |\gr@month| since it is needed in the definition
+% of the macro |\Grtoday|.
+% \changes{greek-1.1a}{1997/03/03}{Fixed typo, \texttt{Oktwbr'iou}
+% instead of \texttt{Oktobr'iou}}
+% \changes{greek-1.1d}{1997/10/12}{Macro \cs{gr@month} now produces
+% the name of the month}
+% \changes{greek-1.2a}{1997/10/31}{Use \cs{edef} to define \cs{today}}
+% \changes{greek-1.2b}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\gr@month{%
+ \ifcase\month\or
+ Ianouar'iou\or Febrouar'iou\or Mart'iou\or April'iou\or
+ Ma'"iou\or Ioun'iou\or Ioul'iou\or Augo'ustou\or
+ Septembr'iou\or Oktwbr'iou\or Noembr'iou\or Dekembr'iou\fi}
+\def\dategreek{%
+ \def\today{\number\day \space \gr@month\space \number\year}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\gr@c@greek}
+% \changes{greek-1.2}{1997/10/28}{Added macro \cs{gr@cl@month}}
+% \changes{greek-1.2}{1997/10/28}{Added macro
+% \cs{datepolutonikogreek}}
+% \changes{greek-1.3a}{1997/10/28}{removed macro
+% \cs{datepolutonikogreek}}
+% \begin{macrocode}
+\def\gr@c@month{%
+ \ifcase\month\or >Ianouar'iou\or
+ Febrouar'iou\or Mart'iou\or >April'iou\or Ma"'iou\or
+ >Ioun'iou\or >Ioul'iou\or A>ugo'ustou\or Septembr'iou\or
+ >Oktwbr'iou\or Noembr'iou\or Dekembr'iou\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Grtoday}
+% \changes{greek-1.1}{1996/10/28}{Added macro \cs{Grtoday}}
+% The macro |\Grtoday| produces the current date, only that the
+% month and the day are shown as greek numerals instead of arabic
+% as it is usually the case.
+% \begin{macrocode}
+\def\Grtoday{%
+ \expandafter\Greeknumeral\expandafter{\the\day}\space
+ \gr@c@month \space
+ \expandafter\Greeknumeral\expandafter{\the\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasgreek}
+% \begin{macro}{\noextrasgreek}
+% The macro |\extrasgreek| will perform all the extra definitions
+% needed for the Greek language. The macro |\noextrasgreek| is used
+% to cancel the actions of |\extrasgreek|. For the moment these
+% macros switch the fontencoding used and the definition of the
+% internal macros |\@alph| and |\@Alph| because in Greek we do use
+% the Greek numerals.
+%
+% \begin{macrocode}
+\addto\extrasgreek{\greektext}
+\addto\noextrasgreek{\latintext}
+% \end{macrocode}
+%
+% \begin{macro}{\gr@ill@value}
+% When the argument of |\greeknumeral| has a value outside of the
+% acceptable bounds ($0 < x < 999999$) a warning will be issued
+% (and nothing will be printed).
+% \begin{macrocode}
+\def\gr@ill@value#1{%
+ \PackageWarning{babel}{Illegal value (#1) for greeknumeral}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\anw@true}
+% \begin{macro}{\anw@false}
+% \begin{macro}{\anw@print}
+% When a a large number with three \emph{trailing} zero's is to be
+% printed those zeros \emph{and} the numeric mark need to be
+% discarded. As each `digit' is processed by a separate macro
+% \emph{and} because the processing needs to be expandable we need
+% some helper macros that help remember to \emph{not} print the
+% numeric mark (|\anwtonos|).
+%
+% The command |\anw@false| switches the printing of the numeric
+% mark off by making |\anw@print| expand to nothing. The command
+% |\anw@true| (re)enables the printing of the numeric marc. These
+% macro's need to be robust in order to prevent improper expansion
+% during writing to files or during |\uppercase|.
+% \begin{macrocode}
+\DeclareRobustCommand\anw@false{%
+ \DeclareRobustCommand\anw@print{}}
+\DeclareRobustCommand\anw@true{%
+ \DeclareRobustCommand\anw@print{\anwtonos}}
+\anw@true
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\greeknumeral}
+% The command |\greeknumeral| needs to be \emph{fully} expandable
+% in order to get the right information in auxiliary
+% files. Therefore we use a big |\if|-construction to check the
+% value of the argument and start the parsing at the right level.
+% \begin{macrocode}
+\def\greeknumeral#1{%
+% \end{macrocode}
+% If the value is negative or zero nothing is printed and a warning
+% is issued.
+% \changes{greek-1.3b}{1999/04/03}{Added \cs{expandafter} and
+% \cs{number} (PR3000) in order to make a counter an acceptable
+% argument}
+% \begin{macrocode}
+ \ifnum#1<\@ne\space\gr@ill@value{#1}%
+ \else
+ \ifnum#1<10\expandafter\gr@num@i\number#1%
+ \else
+ \ifnum#1<100\expandafter\gr@num@ii\number#1%
+ \else
+% \end{macrocode}
+% We use the available shorthands for 1.000 (|\@m|) and 10.000
+% (|\@M|) to save a few tokens.
+% \begin{macrocode}
+ \ifnum#1<\@m\expandafter\gr@num@iii\number#1%
+ \else
+ \ifnum#1<\@M\expandafter\gr@num@iv\number#1%
+ \else
+ \ifnum#1<100000\expandafter\gr@num@v\number#1%
+ \else
+ \ifnum#1<1000000\expandafter\gr@num@vi\number#1%
+ \else
+% \end{macrocode}
+% If the value is too large, nothing is printed and a warning
+% is issued.
+% \begin{macrocode}
+ \space\gr@ill@value{#1}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Greeknumeral}
+% The command |\Greeknumeral| prints uppercase greek numerals.
+% The parsing is performed by the macro |\greeknumeral|.
+% \begin{macrocode}
+\def\Greeknumeral#1{%
+ \expandafter\MakeUppercase\expandafter{\greeknumeral{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\greek@alph}
+% \begin{macro}{\greek@Alph}
+% In the previous release of this language definition the
+% commands |\greek@aplh| and |\greek@Alph| were kept just for
+% reasons of compatibility. Here again they become meaningful macros.
+% They are definited in a way that even page numbering with greek
+% numerals is possible. Since the macros |\@alph| and |\@Alph| will
+% lose their original meaning while the Greek option is active, we
+% must save their original value.
+% macros |\@alph|
+% \begin{macrocode}
+\let\latin@alph\@alph
+\let\latin@Alph\@Alph
+% \end{macrocode}
+% Then we define the Greek versions; the additional |\expandafter|s
+% are needed in order to make sure the table of contents will be
+% correct, e.g., when we have appendixes.
+% \begin{macrocode}
+\def\greek@alph#1{\expandafter\greeknumeral\expandafter{\the#1}}
+\def\greek@Alph#1{\expandafter\Greeknumeral\expandafter{\the#1}}
+% \end{macrocode}
+%
+% Now we can set up the switching.
+% \changes{greek-1.1a}{1997/03/03}{removed two superfluous @'s which
+% made \cs{@alph} undefined}
+% \begin{macrocode}
+\addto\extrasgreek{%
+ \let\@alph\greek@alph
+ \let\@Alph\greek@Alph}
+\addto\noextrasgreek{%
+ \let\@alph\latin@alph
+ \let\@Alph\latin@Alph}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\greek@roman}
+% \begin{macro}{\greek@Roman}
+% \changes{greek-1.2e}{1999/04/16}{Moved redefinition of \cs{@roman}
+% back to the language specific file}
+% \changes{greek-1.3d}{1999/08/27}{\cs{@roman} and \cs{@Roman} need to
+% be added to \cs{extraspolutonikogreek}}
+% \changes{greek-1.3e}{1999/09/24}{\cs{@roman} and \cs{@Roman} need
+% \emph{not} be in \cs{extraspolutonikogreek} when they are already
+% in \cs{extrasgreek}}
+%
+% To prevent roman numerals being typeset in greek letters we need
+% to adopt the internal \LaTeX\ commands |\@roman| and
+% |\@Roman|. \textbf{Note that this may cause errors where
+% |\@roman| ends up in a situation where it needs to be expanded;
+% problems are known to exist with the AMS document classes.}
+% \begin{macrocode}
+\let\latin@roman\@roman
+\let\latin@Roman\@Roman
+\def\greek@roman#1{\textlatin{\latin@roman{#1}}}
+\def\greek@Roman#1{\textlatin{\latin@Roman{#1}}}
+\addto\extrasgreek{%
+ \let\@roman\greek@roman
+ \let\@Roman\greek@Roman}
+\addto\noextrasgreek{%
+ \let\@roman\latin@roman
+ \let\@Roman\latin@Roman}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\greek@amp}
+% \begin{macro}{\ltx@amp}
+% The greek fonts do not contain an ampersand, so the \LaTeX\
+% command |\&| dosn't give the expected result if we do not do
+% something about it.
+% \changes{greek-1.2f}{1999/04/25}{Now switch the definition of
+% \cs{\&} from \cs{extrasgreek}}
+% \changes{greek-1.3c}{1999/05/17}{Added a missing opening brace}
+% \begin{macrocode}
+\let\ltx@amp\&
+\def\greek@amp{\textlatin{\ltx@amp}}
+\addto\extrasgreek{\let\&\greek@amp}
+\addto\noextrasgreek{\let\&\ltx@amp}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% What is left now is the definition of a set of macros to produce
+% the various digits.
+% \begin{macro}{\gr@num@i}
+% \begin{macro}{\gr@num@ii}
+% \begin{macro}{\gr@num@iii}
+% \changes{greek-1.2b}{1997/11/13}{No longer use \cs{\let} in the
+% expansion of the \cs{gr@num@x} macros as they ned to be
+% expandable}
+% As there is no representation for $0$ in this system the zeros
+% are simply discarded. When we have a large number with three
+% \emph{trailing} zero's also the numeric mark is discarded.
+% Therefore these macros need to pass the information to each other
+% about the (non-)translation of a zero.
+% \begin{macrocode}
+\def\gr@num@i#1{%
+ \ifcase#1\or a\or b\or g\or d\or e\or \stigma\or z\or h\or j\fi
+ \ifnum#1=\z@\else\anw@true\fi\anw@print}
+\def\gr@num@ii#1{%
+ \ifcase#1\or i\or k\or l\or m\or n\or x\or o\or p\or \qoppa\fi
+ \ifnum#1=\z@\else\anw@true\fi\gr@num@i}
+\def\gr@num@iii#1{%
+ \ifcase#1\or r\or sv\or t\or u\or f\or q\or y\or w\or \sampi\fi
+ \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@num@ii}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\gr@num@iv}
+% \begin{macro}{\gr@num@v}
+% \begin{macro}{\gr@num@vi}
+% The first three `digits' always have the numeric mark, except
+% when one is discarded because it's value is zero.
+% \begin{macrocode}
+\def\gr@num@iv#1{%
+ \ifnum#1=\z@\else\katwtonos\fi
+ \ifcase#1\or a\or b\or g\or d\or e\or \stigma\or z\or h\or j\fi
+ \gr@num@iii}
+\def\gr@num@v#1{%
+ \ifnum#1=\z@\else\katwtonos\fi
+ \ifcase#1\or i\or k\or l\or m\or n\or x\or o\or p\or \qoppa\fi
+ \gr@num@iv}
+\def\gr@num@vi#1{%
+ \katwtonos
+ \ifcase#1\or r\or sv\or t\or u\or f\or q\or y\or w\or \sampi\fi
+ \gr@num@v}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\greek@tilde}
+% \changes{greek-1.0c}{1997/02/19}{Added command}
+% In greek typesetting we need a number of characters with more
+% than one accent. In the underlying family of fonts (the
+% |cb| fonts) this is solved using Knuth's ligature
+% mechanism.
+% Characters we need to have ligatures with are the tilde, the
+% acute and grave accent characters, the rough and smooth breathings,
+% the subscript, and the double quote character.
+% In text input the |~| is normaly used to produce an
+% unbreakable space. The command |\~| normally produces a tilde
+% accent. For polytonic Greek we change the definition of |\~|
+% to produce the tilde character itself, making sure it has category
+% code 12.
+% \changes{greek-1.3k}{2003/04/10}{Make sure the character `!' is not
+% active during the definition of \cs{greek@tilde}}
+% \begin{macrocode}
+\begingroup
+ \@ifundefined{active@char\string!}{}{\catcode`!=12\relax}
+ \catcode`\~=12
+ \lccode`\!=`\~
+ \lowercase{\def\x{\endgroup
+ \def\greek@tilde{!}}\x}
+\addto\extraspolutonikogreek{%
+ \babel@save\~\let\~\greek@tilde}
+% \end{macrocode}
+% \end{macro}
+% In order to get correct hyphenation we need to set the lower case
+% code of a number of characters. The `v' character has a special
+% usage for the |cb| fonts: in fact this ligature mechanism detects
+% the end of a word and assures that a final sigma is typeset with
+% the proper sign wich is different from that of an initial or
+% medial sigma; the `v 'after an \textit{isolated} sigma fools
+% the ligature mechanism in order to typeset $\sigma$ in place of
+% $\varsigma$. Because of this we make sure its lowercase code is
+% not changed. For ``modern'' greek we have to deal only with |'|
+% and |"| and so things are easy.
+% \changes{greek-1.1c}{1997/04/30}{fixed two typos}
+% \changes{greek-1.1e}{1997/10/12}{Added lowercase code for v}
+% \changes{greek-1.2}{1997/10/28}{Definitions for ``modern'' Greek are
+% now the definitions of ``Polutoniko'' Greek}
+% \changes{greek-1.2}{1997/10/28}{Added lowercase codes for ``modern''
+% greek}
+% \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and
+% \cs{extraspolutonikogreek} should be complementary}
+% \begin{macrocode}
+\addto\extrasgreek{%
+ \babel@savevariable{\lccode`v}\lccode`v=`v%
+ \babel@savevariable{\lccode`\'}\lccode`\'=`\'%
+ \babel@savevariable{\lccode`\"}\lccode`\"=`\"}
+\addto\extraspolutonikogreek{%
+ \babel@savevariable{\lccode`\<}\lccode`\<=`\<%
+ \babel@savevariable{\lccode`\>}\lccode`\>=`\>%
+ \babel@savevariable{\lccode`\~}\lccode`\~=`\~%
+ \babel@savevariable{\lccode`\|}\lccode`\|=`\|%
+ \babel@savevariable{\lccode`\`}\lccode`\`=`\`}
+% \end{macrocode}
+% And in order to get rid of all accents and breathings when a
+% string is |\uppercase|d we also change a number of uppercase
+% codes.
+% \changes{greek-1.1b}{1997/03/06}{Added setting of \cs{uccode}s
+% (after \file{kdgreek.sty})}
+% \changes{greek-1.1e}{1997/10/12}{Added uppercase code for special
+% letter ``v''. Uppercase code for accents is now \texttt{9f},
+% instead of \texttt{ff}}
+% \changes{greek-1.2}{1997/10/28}{Added uppercase codes for ``modern''
+% Greek. The old codes are now for ``Polutoniko'' Greek}
+% \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and
+% \cs{extraspolutonikogreek} should be complementary}
+% {\catcode`|=12\relax\gdef\indexbar{\cs{|}}}
+% \changes{greek-1.3g}{1999/11/17}{uc code of \indexbar{} is now just
+% \indexbar{} to reflect recent changes in the cb fonts}
+% \changes{greek-1.3i}{2000/10/02}{uc code of `v' is switched to V
+% so that mixed text appears correctly in headers.}
+% \changes{greek-1.3j}{2001/02/03}{Because other languages might
+% make the caret active, we can't use the double caret notation
+% here}
+% \begin{macrocode}
+\addto\extrasgreek{%
+ \babel@savevariable{\uccode`\"}\uccode`\"=`\"%
+ \babel@savevariable{\uccode`\'}\uccode`\'=159} %% 159 == ^^9f
+\addto\extraspolutonikogreek{%
+ \babel@savevariable{\uccode`\~}\uccode`\~=159%
+ \babel@savevariable{\uccode`\>}\uccode`\>=159%
+ \babel@savevariable{\uccode`\<}\uccode`\<=159%
+ \babel@savevariable{\uccode`\|}\uccode`\|=`\|%
+ \babel@savevariable{\uccode`\`}\uccode`\`=159}
+% \end{macrocode}
+% For this to work we make the character |^^9f| a shorthand that
+% expands to nothing. In order for this to work we need to make a
+% character look like |^^9f| in \TeX's eyes. The trick is to have
+% another character and assign it a different lowercase code. The
+% execute the macros needed in a |\lowercase| environment. Usually
+% the tile |~| character is used for such purposes. Before we do
+% this we save it's original lowercase code to restore it once
+% we're done.
+% \changes{greek-1.1b}{1997/03/06}{Added shorthand for \cs{char255}}
+% \changes{greek-1.1e}{1997/10/12}{Shorthand is changed. Active
+% character is now \cs{char159}}
+% \changes{greek-1.2a}{1997/10/31}{Need shorthand to exist for
+% ``monotoniko'' Greek, not ``polutoniko'' Greek}
+% \changes{greek-1.3j}{2001/02/03}{Ues the tilde as an alias for
+% character 159}
+% \begin{macrocode}
+\@tempcnta=\lccode`\~
+\lccode`\~=159
+\lowercase{%
+ \initiate@active@char{~}%
+ \declare@shorthand{greek}{~}{}}
+\lccode`\~=\@tempcnta
+% \end{macrocode}
+% We can also make the tilde character itself expand to a tilde with
+% category code 12 to make the typing of texts easier.
+% \changes{greek-1.1b}{1997/03/06}{Made tilde expand to a tilde with
+% \cs{catcode 12}}
+% \begin{macrocode}
+\addto\extraspolutonikogreek{\languageshorthands{greek}}%
+\declare@shorthand{greek}{~}{\greek@tilde}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+% \changes{greek-1.1c}{1997/03/10}{Added a couple of symbols, needed
+% for \cs{greeknumeral}}
+% \changes{greek-1.1e}{1997/10/12}{Most symbols are removed and are
+% now defined in package grsymb}
+% \changes{greek-1.2c}{1998/06/26}{Package grsymb has been eliminated
+% because the CB fonts v2.0 do not inlcude certain symbols and so
+% the remaining symbol definitions have been moved here}
+% We now define a few symbols which are used in the typesetting of
+% greek numerals, as well as some other symbols which are usefull,
+% such as the $\epsilon\upsilon\rho\omega$ symbol, etc.
+% \begin{macrocode}
+\DeclareTextCommand{\anwtonos}{LGR}{\char"FE\relax}
+\DeclareTextCommand{\katwtonos}{LGR}{\char"FF\relax}
+\DeclareTextCommand{\qoppa}{LGR}{\char"12\relax}
+\DeclareTextCommand{\stigma}{LGR}{\char"06\relax}
+\DeclareTextCommand{\sampi}{LGR}{\char"1B\relax}
+\DeclareTextCommand{\Digamma}{LGR}{\char"C3\relax}
+\DeclareTextCommand{\ddigamma}{LGR}{\char"93\relax}
+\DeclareTextCommand{\vardigamma}{LGR}{\char"07\relax}
+\DeclareTextCommand{\euro}{LGR}{\char"18\relax}
+\DeclareTextCommand{\permill}{LGR}{\char"19\relax}
+% \end{macrocode}
+%
+% Since the |~| cannot be used to produce an unbreakable white
+% space we must redefine at least the commands |\fnum@figure| and
+% |\fnum@table| so they do not produce a |~| instead of white
+% space.
+% \changes{greek-1.3l}{2004/02/19}{Commented these lines out as this
+% change has made it into \LaTeX{} itself.}
+% \begin{macrocode}
+%\def\fnum@figure{\figurename\nobreakspace\thefigure}
+%\def\fnum@table{\tablename\nobreakspace\thetable}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{greek-1.0b}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{\CurrentOption}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/Master/texmf-dist/source/generic/babel/greek.fdd b/Master/texmf-dist/source/generic/babel/greek.fdd
new file mode 100644
index 00000000000..c567aa5d52c
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/greek.fdd
@@ -0,0 +1,349 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{105}
+%
+% \iffalse This is a META comment
+%
+%<*fdd>
+\ProvidesFile{greek.fdd}
+%</fdd>
+%
+%<LGRenc, >\ProvidesFile{lgrenc.def}
+%<LGRcmr, >\ProvidesFile{lgrcmr.fd}
+%<LGRcmro, >\ProvidesFile{lgrcmro.fd}
+%<LGRcmtt, >\ProvidesFile{lgrcmtt.fd}
+%<LGRcmss, >\ProvidesFile{lgrcmss.fd}
+%<LGRlcmss, >\ProvidesFile{lgrlcmss.fd}
+%<LGRlcmtt, >\ProvidesFile{lgrlcmtt.fd}
+ [2001/01/30 v2.2e %
+%<LGRenc, > Greek Encoding]
+%<LGRcmr, > Greek Computer Modern]
+%<LGRcmro, > Greek Computer Modern Outline]
+%<LGRcmtt, > Greek Computer Modern Typewriter]
+%<LGRcmss, > Greek Computer Modern Sans Serif]
+%<LGRlcmss, > Greek Computer Modern Sans Serif slide sizes]
+%<LGRlcmtt, > Greek Computer Modern Typewriter slide sizes]
+%<*fdd>
+]
+%</fdd>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{greek.fdd}
+\providecommand\dsc{\expandafter{\normalfont\scshape docstrip}}
+\title{The file \texttt{greek.fdd} for use with
+ \LaTeXe.\thanks{This file has version
+ number \fileversion, dated \filedate.}}
+\date{\filedate}
+\author{Claudio Beccari, Apostolos Syropoulos and Johannes Braams}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\begin{document}
+\maketitle
+\DocInput{greek.fdd}
+\end{document}
+%</driver>
+%
+%\fi
+%
+% \changes{greekfdd-2.0}{1997/10/12}{Changed to use Claudio Beccari's
+% fonts}
+% \changes{greekfdd-2.1}{1997/10/31}{Produce files with lowercase
+% names}
+% \changes{greekfdd-2.2}{1998/05/16}{Added support for CB fonts v2.xx}
+%
+% \section{Introduction}
+%
+% The file `greek.fdd' provides font definitions for typesetting
+% greek texts. This version of the file has been updated, since
+% now the official fonts for the \Lopt{greek} option of the
+% \textsf{babel} package are the |cb| fonts.
+%
+% \StopEventually{}
+%
+% \section{The \texttt{docstrip} modules}
+% The following modules are used to direct \texttt{docstrip} in
+% generating external files:
+% \begin{center}
+% \begin{tabular}{ll}
+% driver & produce a documentation driver file \\
+% LGRenc & The encoding definition file\\
+% LGRcmr & The Roman font shapes\\
+% LGRcmro & The Outline Roman font shapes\\
+% LGRcmss & The Sans Serif font shapes\\
+% LGRcmtt & The typewriter font shapes\\
+% LGRlcmss & The slide size Sans Serif font shapes\\
+% LGRlcmtt & The slide size typewriter fonts\\
+% \end{tabular}
+% \end{center}
+% A typical \dsc\ command file would then have entries like:
+%\begin{verbatim}
+%\generateFile{lgrcmr.fd}{t}{\from{greek.fdd}{fd,LGRcmr}}
+%\end{verbatim}
+%
+% \section{The encoding definition file}
+%
+% This file defines the fontencoding \texttt{LGR} for greek
+% text. Moreover, it provides the |\EC@family| macro, since the
+% Greek fonts have the same naming conventions as the Latin
+% ones produced by J\"{o}rg Knappen that are now the official
+% fonts of \LaTeXe. It also makes some definitions to ensure
+% that commands such as |\TeX|, |\copyright| give ``expected
+% results'' (\TeX, \copyright).
+%
+% \changes{greekfdd-2.1}{1997/10/31}{Removed some unwanted spaces}
+% \changes{greekfdd-2.2e}{2000/10/26}{Added more font sizes to make
+% the CB fonts compatible with the EC fonts}
+% \begin{macrocode}
+%<*fd>
+\providecommand{\EC@family}[5]{%
+ \DeclareFontShape{#1}{#2}{#3}{#4}
+ {<5><6><7><8><9><10><10.95><12><14.4>%
+ <17.28><20.74><24.88><29.86><35.83>genb*#5}{}}
+%</fd>
+%<*LGRenc>
+\DeclareFontEncoding{LGR}{}{}
+\DeclareFontSubstitution{LGR}{cmr}{m}{n}
+\DeclareErrorFont{LGR}{cmr}{m}{n}{10}
+% \end{macrocode}
+% First we define a few commands in the \texttt{LGR} encoding.
+% \changes{greekfdd-2.2c}{1999/04/05}{Fixed typos, \cs{textrademark}
+% misses a `t', \cs{copyright} should be \cs{textcopyright}}
+% \changes{greekfdd-2.2d}{1999/04/25}{removed redefinition of \cs{\&}}
+% \begin{macrocode}
+\ProvideTextCommand{\textcopyright}{LGR}{%
+ \textcircled{\textlatin{c}}}
+\ProvideTextCommand{\textregistered}{LGR}{%
+ \textcircled{\textlatin{\textsc r}}}
+\ProvideTextCommand{\texttrademark}{LGR}{%
+ \textsuperscript{\textlatin{TM}}}
+\ProvideTextCommand{\SS}{LGR}{%
+ \textlatin{SS}}
+%</LGRenc>
+% \end{macrocode}
+%
+% \section{The font definition files}
+%
+% In the previous release of the greek option we used
+% the \texttt{kd} family of fonts, which were made by
+% K.J.~Dryllerakis. Now, we have switched to the |cb| fonts by
+% Claudio Beccari, mainly because these fonts are complete, in any
+% sense of the word, and moreover fit nicely with the Computer
+% Modern font family.
+%
+% We begin with the definitions for the Greek Computer Modern fonts.
+%
+% \begin{macrocode}
+%<*LGRcmr>
+\DeclareFontFamily{LGR}{cmr}{}
+\EC@family{LGR}{cmr}{m}{n} {grmn}
+\EC@family{LGR}{cmr}{m}{sl} {grmo}
+\EC@family{LGR}{cmr}{m}{it} {grmi}
+\EC@family{LGR}{cmr}{m}{sc} {grmc}
+\EC@family{LGR}{cmr}{m}{ui} {grmu}
+\EC@family{LGR}{cmr}{bx}{sc} {grxc}
+\EC@family{LGR}{cmr}{bx}{n} {grxn}
+\EC@family{LGR}{cmr}{bx}{sl} {grxo}
+\EC@family{LGR}{cmr}{bx}{it} {grxi}
+\EC@family{LGR}{cmr}{bx}{ui} {grxu}
+\DeclareFontShape{LGR}{cmr}{b}{n}
+ {<->ssub*cmr/bx/n}{}
+\DeclareFontShape{LGR}{cmr}{b}{sc}
+ {<->ssub*cmr/bx/sc}{}
+%</LGRcmr>
+% \end{macrocode}
+%
+% The greek outline family is now complete with the same five
+% shapes and the two series as the roman family.
+% \changes{greekfdd-2.2b}{1999/04/03}{grmu should be gomu here...}
+% \begin{macrocode}
+%<*LGRcmro>
+\DeclareFontFamily{LGR}{cmro}{}
+\EC@family{LGR}{cmro}{m}{n} {gomn}
+\EC@family{LGR}{cmro}{m}{sl} {gomo}
+\EC@family{LGR}{cmro}{m}{it} {gomi}
+\EC@family{LGR}{cmro}{m}{sc} {gomc}
+\EC@family{LGR}{cmro}{m}{ui} {gomu}
+\EC@family{LGR}{cmro}{bx}{sc} {goxc}
+\EC@family{LGR}{cmro}{bx}{n} {goxn}
+\EC@family{LGR}{cmro}{bx}{sl} {goxo}
+\EC@family{LGR}{cmro}{bx}{it} {goxi}
+\EC@family{LGR}{cmro}{bx}{ui} {goxu}
+\DeclareFontShape{LGR}{cmro}{b}{n}
+ {<->ssub*cmro/bx/n}{}
+\DeclareFontShape{LGR}{cmro}{b}{sc}
+ {<->ssub*cmro/bx/sc}{}
+%</LGRcmro>
+% \end{macrocode}
+%
+% Then we have the \texttt{typewriter} fonts...
+%
+% \changes{greekfdd-2.1}{1997/10/31}{Set the \cs{hyphenchar} of the tt
+% font to $-1$}
+% \begin{macrocode}
+%<*LGRcmtt>
+\DeclareFontFamily{LGR}{cmtt}{\hyphenchar\font\m@ne}% \hyphenchar = -1
+\EC@family{LGR}{cmtt}{m}{n} {gttn}
+\EC@family{LGR}{cmtt}{m}{sl} {gtto}
+\EC@family{LGR}{cmtt}{m}{sc} {gttc}
+\EC@family{LGR}{cmtt}{m}{it} {gtti}
+\EC@family{LGR}{cmtt}{m}{ui} {gttu}
+\DeclareFontShape{LGR}{cmtt}{bx}{n}
+ {<->ssub*cmtt/m/n}{}
+\DeclareFontShape{LGR}{cmtt}{bx}{sl}
+ {<->ssub*cmtt/m/sl}{}
+\DeclareFontShape{LGR}{cmtt}{bx}{it}
+ {<->ssub*cmtt/m/it}{}
+\DeclareFontShape{LGR}{cmtt}{bx}{sc}
+ {<->ssub*cmtt/m/sc}{}
+\DeclareFontShape{LGR}{cmtt}{bx}{ui}
+ {<->ssub*cmtt/m/ui}{}
+%</LGRcmtt>
+% \end{macrocode}
+%
+% Now we come to the Sans Serif font to be used in greek
+% texts.
+% \changes{greekfdd-2.2b}{1999/04/03}{the last two lines had m instead
+% of x in the fontname}
+% \begin{macrocode}
+%<*LGRcmss>
+\DeclareFontFamily{LGR}{cmss}{}
+\EC@family{LGR}{cmss}{m}{n} {gsmn}
+\EC@family{LGR}{cmss}{m}{sl} {gsmo}
+\EC@family{LGR}{cmss}{m}{sc} {gsmc}
+\EC@family{LGR}{cmss}{m}{it} {gsmi}
+\EC@family{LGR}{cmss}{m}{ui} {gsmu}
+\EC@family{LGR}{cmss}{bx}{n} {gsxn}
+\EC@family{LGR}{cmss}{bx}{sl} {gsxo}
+\EC@family{LGR}{cmss}{bx}{sc} {gsxc}
+\EC@family{LGR}{cmss}{bx}{it} {gsmi}
+\EC@family{LGR}{cmss}{bx}{ui} {gsmu}
+%</LGRcmss>
+% \end{macrocode}
+%
+% We have finished with the ``regular'' fonts. We now provide the fonts
+% definition files for the fonts used only in slides. First comes the
+% typewriter font.
+% \begin{macrocode}
+%<*LGRlcmtt>
+\DeclareFontFamily{LGR}{lcmtt}{\hyphenchar\font\m@ne}
+\DeclareFontShape{LGR}{lcmtt}{m}{n}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * gltn}{}
+\DeclareFontShape{LGR}{lcmtt}{m}{In}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * gljn}{}
+\DeclareFontShape{LGR}{lcmtt}{m}{it}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glto}{}
+\DeclareFontShape{LGR}{lcmtt}{m}{Iit}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * gljo}{}
+\DeclareFontShape{LGR}{lcmtt}{m}{sl}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ ssub * lcmtt/m/it}{}
+\DeclareFontShape{LGR}{lcmtt}{m}{Isl}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ ssub * lcmtt/m/Iit}{}
+\DeclareFontShape{LGR}{lcmtt}{m}{sc}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * gltc}{}
+\DeclareFontShape{LGR}{lcmtt}{m}{Isc}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * gljc}{}
+%</LGRlcmtt>
+% \end{macrocode}
+%
+% And then the Sans Serif font.
+% \begin{macrocode}
+%<*LGRlcmss>
+\DeclareFontFamily{LGR}{lcmss}{}
+\DeclareFontShape{LGR}{lcmss}{m}{n}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glmn}{}
+\DeclareFontShape{LGR}{lcmss}{m}{In}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glin}{}
+\DeclareFontShape{LGR}{lcmss}{m}{sl}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glmo}{}
+\DeclareFontShape{LGR}{lcmss}{m}{Isl}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glio}{}
+\DeclareFontShape{LGR}{lcmss}{m}{it}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glmi}{}
+\DeclareFontShape{LGR}{lcmss}{m}{Iit}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glii}{}
+\DeclareFontShape{LGR}{lcmss}{m}{ui}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glmu}{}
+\DeclareFontShape{LGR}{lcmss}{bx}{n}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glxn}{}
+\DeclareFontShape{LGR}{lcmss}{bx}{In}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glwn}{}
+\DeclareFontShape{LGR}{lcmss}{bx}{sl}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glxo}{}
+\DeclareFontShape{LGR}{lcmss}{bx}{Isl}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glwo}{}
+\DeclareFontShape{LGR}{lcmss}{bx}{it}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glxi}{}
+\DeclareFontShape{LGR}{lcmss}{bx}{Iit}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glwi}{}
+\DeclareFontShape{LGR}{lcmss}{m}{sc}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glmc}{}
+\DeclareFontShape{LGR}{lcmss}{m}{Isc}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glic}{}
+\DeclareFontShape{LGR}{lcmss}{bx}{sc}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glxc}{}
+\DeclareFontShape{LGR}{lcmss}{bx}{Isc}{%
+ <7><8><10><12><13.82><16.59><19.91><23.89><28.66><34.4><41.28>
+ genb * glwc}{}
+%</LGRlcmss>
+% \end{macrocode}
+%
+% The next line goes into all files and in addition prevents \dsc{}
+% from adding any further code from the main source file (such as a
+% character table.
+% \begin{macrocode}
+\endinput
+% \end{macrocode}
+%
+% \Finale
+
+
diff --git a/Master/texmf-dist/source/generic/babel/greek.ins b/Master/texmf-dist/source/generic/babel/greek.ins
new file mode 100644
index 00000000000..a641719f93a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/greek.ins
@@ -0,0 +1,158 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/03/15}
+\def\batchfile{greek.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{greek.ldf}{\from{greek.dtx}{code}}
+ \file{athnum.sty}{\from{athnum.dtx}{package}}
+ \file{grmath.sty}{\from{grmath.dtx}{package}}
+ }
+\usepreamble\fdpreamble
+\generate{\file{lgrenc.def}{\from{greek.fdd}{LGRenc}}
+ \file{lgrcmr.fd}{\from{greek.fdd}{fd,LGRcmr}}
+ \file{lgrcmro.fd}{\from{greek.fdd}{fd,LGRcmro}}
+ \file{lgrcmtt.fd}{\from{greek.fdd}{fd,LGRcmtt}}
+ \file{lgrcmss.fd}{\from{greek.fdd}{fd,LGRcmss}}
+ \file{lgrlcmtt.fd}{\from{greek.fdd}{fd,LGRlcmtt}}
+ \file{lgrlcmss.fd}{\from{greek.fdd}{fd,LGRlcmss}}
+ }
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/grmath.dtx b/Master/texmf-dist/source/generic/babel/grmath.dtx
new file mode 100644
index 00000000000..be42c48545a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/grmath.dtx
@@ -0,0 +1,168 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%% \CheckSum{126}
+%
+%\iffalse
+%
+%% This is file `grmath.sty'
+%% (c) 1997-2005 Apostolos Syropoulos.
+%% All rights reserved.
+% You are allowed to modify this file as long the initial copyright notice
+% appears in the modified file.
+%
+% Please report errors or suggestions for improvement to
+%
+% Apostolos Syropoulos
+% 366, 28th October Str.
+% GR-671 00 Xanthi, GREECE
+%
+% apostolo at platon.ee.duth.gr or apostolo at obelix.ee.duth.gr
+%
+%\fi
+%\iffalse
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{grmath.drv}
+\begin{document}
+ \DocInput{grmath.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%\fi
+%
+% \changes{grmath-1.2}{2001/02/12}{Package provides options ``grlog''
+% (default) and ``enlog'' that create Greek and Latin names
+% log functions}
+%
+% \title{Greek log-like Operators}
+% \author{Apostolos Syropoulos\\
+% 366, 28th October Str.\\
+% GR-671 00 Xanthi, HELLAS\\
+% E-mail: \texttt{apostolo@platon.ee.duth.gr}}
+% \date{2001/02/12}
+% \maketitle
+%
+% \MakeShortVerb{|}
+% \section{What is this all about?}
+%
+% In Greece, until recently, it was common practice to write down most
+% log-like functions as abbreviations of their Greek names. Consequently,
+% high school students and even university freshmen were not familiar with
+% the Latin names employed in international literature. However, this practice
+% is fading away in universities but it is still in wide use in books for
+% high schools, mainly because the Latin names would produce nothing but
+% confusion. The package |grmath| redefines most log-like definitions
+% so that they produce the Greek name, instead of the Latin one. The package
+% can be used only in conjunction with the |greek| option of the |babel|
+% package. The new option |enlog| allows one to keep the Latin names for
+% the log functions.
+% \StopEventually
+%
+% \section{The Implementation}
+%
+% As usual we must first identify ourselves.
+%
+% \begin{macrocode}
+%<*package>
+\ProvidesPackage{grmath}[2001/02/12\space v1.2]
+\typeout{Package: `grmath' v1.2\space <2001/02/12> (A. Syropoulos)}
+% \end{macrocode}
+%
+% The next thing we do is to process the options. The default option
+% ``grlog'' generates Greek names for log functions and the ``enlog''
+% option generates Latin names for log functions.
+% \begin{macrocode}
+\DeclareOption{grlog}{%
+ \def\log{\mathop{\mathgroup\symgroperators log_{10}}\nolimits}
+ \def\ln{\mathop{\mathgroup\symgroperators log_%
+ {\mathgroup\symoperators e}}\nolimits}
+}
+\DeclareOption{enlog}{%
+ \def\log{\mathop{\operator@font log}\nolimits}
+ \def\ln{\mathop{\operator@font ln}\nolimits}
+}
+\ExecuteOptions{grlog}
+\ProcessOptions
+% \end{macrocode}
+%
+% Now we check to see if the |babel| package is loaded with at least
+% the |greek| option. In case it isn't, we opt to produce an error message.
+% \begin{macrocode}
+\@ifpackagewith{babel}{greek}{}{%
+ \@ifpackagewith{babel}{polutonikogreek}{}{%
+ \PackageError{grmath}{%
+ `greek' option of the `babel'\MessageBreak
+ package hasn't been loaded}{%
+ The commands provided by this package\MessageBreak
+ are specially designed for greek language\MessageBreak
+ typesetting with the `babel' package. Load\MessageBreak
+ it with at least the `greek' option.}\relax
+ }}
+% \end{macrocode}
+%
+% We define the mathematical font which will be used to typeset
+% the log-like functions.
+% \begin{macrocode}
+\DeclareSymbolFont{groperators}{LGR}{cmr}{m}{n}
+\SetSymbolFont{groperators}{bold}{LGR}{cmr}{bx}{n}
+% \end{macrocode}
+%
+% We are now ready to proceed with the redefinitions of the log-like
+% operator names.
+% \begin{macrocode}
+\def\sin{\mathop{\mathgroup\symgroperators hm}\nolimits}
+\def\cos{\mathop{\mathgroup\symgroperators sun}\nolimits}
+\def\tan{\mathop{\mathgroup\symgroperators ef}\nolimits}
+\def\arcsin{\mathop{\mathgroup\symgroperators toxhm}\nolimits}
+\def\arccos{\mathop{\mathgroup\symgroperators toxsun}\nolimits}
+\def\arctan{\mathop{\mathgroup\symgroperators toxef}\nolimits}
+\def\cot{\mathop{\mathgroup\symgroperators sf}\nolimits}
+\def\sec{\mathop{\mathgroup\symgroperators tem}\nolimits}
+\def\csc{\mathop{\mathgroup\symgroperators stem}\nolimits}
+\def\gcd{\mathop{\mathgroup\symgroperators MKD}\nolimits}
+% \end{macrocode}
+% In the standard \LaTeX\ distribution there is no provision for a
+% Least Common Multiple (lcm) log-like operator. Since, this operator
+% appears quite often in greek literature we opt to include it. Moreover,
+% we include three more log-like functions: |\arccot|, |\arcsec| and
+% |\arccsc|.
+% \begin{macrocode}
+\def\lcm{\mathop{\mathgroup\symgroperators EKP}\nolimits}
+\def\arccot{\mathop{\mathgroup\symgroperators toxsf}\nolimits}
+\def\arcsec{\mathop{\mathgroup\symgroperators toxtem}\nolimits}
+\def\arccsc{\mathop{\mathgroup\symgroperators toxstem}\nolimits}
+%</package>
+% \end{macrocode}
+%
+% \section*{Dedication}
+% I would like to dedicate this piece of work to my son
+% \begin{center}Demetrios-Georgios.\end{center}
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/grsymb.dtx b/Master/texmf-dist/source/generic/babel/grsymb.dtx
new file mode 100644
index 00000000000..ef783fbd48d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/grsymb.dtx
@@ -0,0 +1,131 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%% \CheckSum{55}
+%
+%\iffalse
+%
+%% This is file `grsymb.sty'
+%% (c) 1997-2005 Apostolos Syropoulos.
+%% All rights reserved.
+% You are allowed to modify this file as long the initial copyright notice
+% appears in the modified file.
+%
+% Please report errors or suggestions for improvement to
+%
+% Apostolos Syropoulos
+% 366, 28th October Str.
+% GR-671 00 Xanthi, GREECE
+%
+% apostolo at platon.ee.duth.gr or apostolo at obelix.ee.duth.gr
+%
+%\fi
+%\iffalse
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{grsymb.drv}
+\begin{document}
+ \DocInput{grsymb.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%\fi
+%
+% \title{Greek Symbols}
+% \author{Apostolos Syropoulos\\
+% 366, 28th October Str.\\
+% GR-671 00 Xanthi, HELLAS\\
+% E-mail: \texttt{apostolo@platon.ee.duth.gr}}
+% \date{1997/09/21}
+% \maketitle
+%
+% \MakeShortVerb{|}
+% \section{Introduction}
+%
+% There are certain symbols which were in use in ancient Greece and which
+% are of use to scholars even today. These symbols are various forms of
+% qoppa and stigma, and the letter digamma. These special symbols are
+% provided by the \texttt{cb} fonts which are now the official fonts for
+% the \texttt{greek} option of the \texttt{babel} package. Moreover, these
+% fonts provide a few more symbols such as a symbol for Euro, etc. The `tao'
+% symbol although is not a greek symbol, survives mainly for reasons of
+% compatibility. This little package provides access commands for these
+% symbols. The package can be used only in conjunction with the |greek|
+% option of the |babel| package.
+%
+% \StopEventually
+%
+% \section{The Implementation}
+%
+% First comes the identification part.
+%
+% \begin{macrocode}
+%<*package>
+\ProvidesPackage{grsymb}[1997/09/21\space v1.0]
+\typeout{Package: `grsymb' v1.0\space <1997/09/21> (A. Syropoulos)}
+% \end{macrocode}
+%
+% Next we check to see if the |babel| package is loaded with at least
+% the |greek| option. In case it isn't, we opt to produce an error message.
+% \begin{macrocode}
+\@ifpackagewith{babel}{greek}{}{%
+ \PackageError{grsymb}{%
+ `greek' option of the `babel'\MessageBreak
+ package hasn't been loaded}{%
+ The commands provided by this package\MessageBreak
+ are specially designed for greek language\MessageBreak
+ typesetting with the `babel' package. Load\MessageBreak
+ it with at least the `greek' option.}\relax
+ }
+% \end{macrocode}
+% Now, we proceed with the definitions of the various symbols. Please note
+% that |\ddigamma| is intensionally spelled erroneously, in order to avoid
+% conflicts with the command |\digamma| that is defined by the package
+% |amssymb|. Although the tao symbol is not a greek symbol, it is included
+% mainly for reasons of compatibility.
+% \begin{macrocode}
+\DeclareTextCommand{\Digamma}{LGR}{\char"C3\relax}
+\DeclareTextCommand{\ddigamma}{LGR}{\char"93\relax}
+\DeclareTextCommand{\tao}{LGR}{\char"01\relax}
+\DeclareTextCommand{\Qoppa}{LGR}{\char"14\relax}
+\DeclareTextCommand{\varqoppa}{LGR}{\char"13\relax}
+\DeclareTextCommand{\Sampi}{LGR}{\char"1A\relax}
+\DeclareTextCommand{\vardigamma}{LGR}{\char"07\relax}
+\DeclareTextCommand{\Stigma}{LGR}{\char"08\relax}
+\DeclareTextCommand{\VarQoppa}{LGR}{\char"15\relax}
+\DeclareTextCommand{\euro}{LGR}{\char"18\relax}
+\DeclareTextCommand{\permill}{LGR}{\char"19\relax}
+%</package>
+% \end{macrocode}
+%
+% \section*{Dedication}
+% I would like to dedicate this piece of work to my son
+% \begin{center}Demetrios-Georgios.\end{center}
+% \Finale
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/babel/heb209.dtx b/Master/texmf-dist/source/generic/babel/heb209.dtx
new file mode 100644
index 00000000000..69101ca7660
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/heb209.dtx
@@ -0,0 +1,165 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{8}
+%
+% \iffalse meta-comment
+%% File `heb209.dtx' - obsolete LaTeX 2.09 compatible style files.
+%% Copyright (C) 1997 -- 2004 Boris Lavva.
+%
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2004 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+%\fi
+% \providecommand\dst{\textsc{docstrip}}
+% \providecommand\babel{\textsf{babel}}
+% \GetFileInfo{heb209.dtx}
+%
+% \changes{heb209~1.0a}{1998/01/06}{%
+% Initial version. Provides hebrew\_newcode, hebrew\_oldcode and
+% hebrew\_p style files for \LaTeX~2.09 (by Boris Lavva)}
+%
+% \section{Hebrew in \LaTeX~2.09 compatibility mode}\label{sec:heb209}
+%
+% |\documentstyle| command in the preamble of \LaTeX\ document
+% indicates that it is a \LaTeX~2.09 document, and should be processed
+% in \emph{compatibility mode}. In such documents, one of the following
+% three Hebrew style options can be included:
+% \begin{enumerate}
+% \item \texttt{hebrew\_newcode} indicates that document will use UNIX
+% ISO 8859-8 or Windows cp1255 input encoding, i.e.\ \emph{Alef}
+% letter will be represented as 224.
+% \item \texttt{hebrew\_p} indicates that document is encoded with IBM
+% PC cp862 encoding, i.e.\ \emph{Alef} letter will be represented as
+% 128.
+% \item \texttt{hebrew\_oldcode} indicates that document uses old 7-bit
+% encoding, as defined in Israeli Standard 960, i.e.\ \emph{Alef} is
+% character number 96.
+% \end{enumerate}
+% Note, that other hebrew-related styles, such as \texttt{hebcal} can
+% be included \emph{after} the abovenamed Hebrew style option, for
+% example:
+% \begin{quote}
+% |\documentstyle[12pt,hebrew_p,hebcal]{report}|.
+% \end{quote}
+%
+% Any Hebrew document which compiled under \LaTeX~2.09 should compile
+% under compatibility mode, unless it uses low-level commands such as
+% |\tenrm|.
+%
+% \subsection{The {\normalfont\dst{}} modules}
+%
+% The following modules are used in the implementation to direct
+% \dst{} in generating the external files:
+% \begin{center}
+% \begin{tabular}{ll}
+% newcode & produce \texttt{hebrew\_newcode.sty} \\
+% pccode & produce \texttt{hebrew\_p.sty} \\
+% oldcode & produce \texttt{hebrew\_oldcode.sty}
+% \end{tabular}
+% \end{center}
+%
+% \StopEventually{}
+%
+% \iffalse
+% \subsection{A driver for this document}
+%
+% The next bit of code contains the documentation driver file for
+% \TeX{}, i.e., the file that will produce the documentation you
+% are currently reading. It will be extracted from this file by
+% the \dst{} program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\title{Hebrew \LaTeX~2.09 compatibility style files}
+\author{Boris Lavva}
+\date{Printed \today}
+\begin{document}
+ \maketitle
+ \DocInput{heb209.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \subsection{Obsolete style files}
+%
+% For each of the Hebrew \LaTeX~2.09 Hebrew styles, we produce a
+% file which uses correct input encoding and calls \babel\ with
+% Hebrew and English language options.
+% This means that any styles which say |\input hebrew_newcode.sty|
+% or |\documentstyle[|\ldots|hebrew_newcode|\ldots|]{|\ldots|}|
+% should still work.
+%
+% \begin{macrocode}
+%<*newcode|pccode|oldcode>
+\NeedsTeXFormat{LaTeX2e}
+%</newcode|pccode|oldcode>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*newcode>
+\@obsoletefile{hebrew.sty}{hebrew_newcode.sty}
+\RequirePackage[8859-8]{inputenc}
+%</newcode>
+%<*pccode>
+\@obsoletefile{hebrew.sty}{hebrew_p.sty}
+\RequirePackage[cp862]{inputenc}
+%</pccode>
+%<*oldcode>
+\@obsoletefile{hebrew.sty}{hebrew_oldcode.sty}
+\RequirePackage[si960]{inputenc}
+%</oldcode>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*newcode|pccode|oldcode>
+\RequirePackage[english,hebrew]{babel}
+%</newcode|pccode|oldcode>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/hebinp.dtx b/Master/texmf-dist/source/generic/babel/hebinp.dtx
new file mode 100644
index 00000000000..a6a9d60c394
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/hebinp.dtx
@@ -0,0 +1,550 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{446}
+%
+% \iffalse
+%<si960> \ProvidesFile{si960.def}
+%<8859-8> \ProvidesFile{8859-8.def}
+%<cp862> \ProvidesFile{cp862.def}
+%<cp1255> \ProvidesFile{cp1255.def}
+%<*driver>
+\ProvidesFile{hebinp.drv}
+%</driver>
+% \fi
+% \ProvidesFile{hebinp.dtx}
+ [2004/02/20 v1.1b Hebrew input encoding file]
+% \iffalse meta-comment
+%% File `hebinp.dtx' for installing the input hebrew encodings.
+%% Copyright (C) 1997 -- 2005 Boris Lavva.
+%
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+% \fi
+%
+% \providecommand\dst{\textsc{docstrip}}
+% \GetFileInfo{hebinp.dtx}
+%
+% \changes{hebinp~1.0a}{1997/12/07}{%
+% Initial version. Provides 8859-8, cp862, cp1255, and old 7-bit
+% input encodings (by Boris Lavva)}
+% \changes{hebinp~1.1}{2001/02/27}{%
+% Renamed hebrew letters: \cs{alef} to \cs{hebalef} etc.
+% (by Tzafrir Cohen)}
+% \changes{hebinp~1.1a}{2001/07/22}{%
+% Renamed CP1255 nikud \cs{patah} to \cs{hebpatah etc}.
+% Added the macro \cs{DisableNikud} - may not be a good idea
+% (by Tzafrir Cohen)}
+%
+% \section{Hebrew input encodings}\label{sec:hebinp}
+%
+% Hebrew input encodings defined in file |hebinp.dtx|\footnote{The
+% files described in this section have version number \fileversion\
+% and were last revised on \filedate.} should be used with |inputenc|
+% \LaTeXe{} package. This package allows the user
+% to specify an input encoding from this file (for example, ISO
+% Hebrew/Latin 8859-8, IBM Hebrew codepage 862 or MS Windows
+% Hebrew codepage 1255) by saying:
+% \begin{quote}
+% |\usepackage[|\emph{encoding name}|]{inputenc}|
+% \end{quote}
+% The encoding can also be selected in the document with:
+% \begin{quote}
+% |\inputencoding{|\emph{encoding name}|}|
+% \end{quote}
+% The only practical use of this command within a document is when
+% using text from several documents to build up a composite work such
+% as a volume of journal articles. Therefore this command will be
+% used only in vertical mode.
+%
+% The encodings provided by this package are:
+% \begin{itemize}
+% \item |si960| 7-bit Hebrew encoding for the range 32--127. This
+% encoding also known as ``old-code'' and defined by Israeli
+% Standard SI-960.
+% \item |8859-8| ISO 8859-8 Hebrew/Latin encoding commonly used in
+% UNIX systems. This encoding also known as ``new-code'' and
+% includes hebrew letters in positions starting from 224.
+% \item |cp862| IBM 862 code page commonly used by DOS on
+% IBM-compatible personal computers. This encoding also known as
+% ``pc-code'' and includes hebrew letters in positions starting
+% from 128.
+% \item |cp1255| MS Windows 1255 (hebrew) code page which is similar to
+% 8859-8. In addition to hebrew letters, this encoding contains
+% also hebrew vowels and dots (nikud).
+% \end{itemize}
+% Each encoding has an associated |.def| file, for example
+% |8859-8.def| which defines the behaviour of each input character,
+% using the commands:
+% \begin{quote}
+% |\DeclareInputText{|\emph{slot}|}{|\emph{text}|}| \\
+% |\DeclareInputMath{|\emph{slot}|}{|\emph{math}|}|
+% \end{quote}
+% This defines the input character \emph{slot} to be the
+% \emph{text} material or \emph{math} material respectively.
+% For example, |8859-8.def| defines slots |"EA| (letter hebalef)
+% and |"B5| ($\mu$) by saying:
+%\begin{verbatim}
+% \DeclareInputText{224}{\hebalef}
+% \DeclareInputMath{181}{\mu}
+%\end{verbatim}
+% Note that the \emph{commands} should be robust, and should not be
+% dependent on the output encoding. The same \emph{slot} should not
+% have both a text and a math declaration for it. (This restriction
+% may be removed in future releases of inputenc).
+%
+% The |.def| file may also define commands using the declarations:\\
+% |\providecommand| or |\ProvideTextCommandDefault|.
+% For example, |8859-8.def| defines:
+%\begin{verbatim}
+% \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
+% \DeclareInputText{188}{\textonequarter}
+%\end{verbatim}
+% The use of the `provide' forms here will ensure that a
+% better definition will not be over-written; their use is
+% recommended since, in general, the best defintion depends on the
+% fonts available.
+%
+% See the documentation in |inputenc.dtx| for details of how to
+% declare input definitions for various encodings.
+%
+% \StopEventually{}
+%
+% \iffalse
+% \subsection{A driver for this document}
+%
+% The next bit of code contains the documentation driver file for
+% \TeX{}, i.e., the file that will produce the documentation you
+% are currently reading. It will be extracted from this file by
+% the \dst{} program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\title{Hebrew input encodings for use with \LaTeXe}
+\author{Boris Lavva}
+\date{Printed \today}
+\begin{document}
+ \maketitle
+ \DocInput{hebinp.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \subsection{Default definitions for characters}
+%
+% First, we insert a |\makeatletter| at the beginning of all |.def|
+% files to use |@| symbol in the macros' names.
+% \begin{macrocode}
+%<-driver>\makeatletter
+% \end{macrocode}
+%
+% Some input characters map to internal functions which are not in
+% either the |T1| or |OT1| font encoding. For this reason default
+% definitions are provided in the encoding file: these will be
+% used unless some other output encoding is used which supports
+% those glyphs. In some cases this default defintion has to be
+% simply an error message.
+%
+% Note that this works reasonably well only because the encoding
+% files for both |OT1| and |T1| are loaded in the standard LaTeX
+% format.
+%
+% \begin{macrocode}
+%<*8859-8|cp862|cp1255>
+\ProvideTextCommandDefault{\textdegree}{\ensuremath{{^\circ}}}
+\ProvideTextCommandDefault{\textonehalf}{\ensuremath{\frac12}}
+\ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
+%</8859-8|cp862|cp1255>
+%<*8859-8|cp1255>
+\ProvideTextCommandDefault{\textthreequarters}{\ensuremath{\frac34}}
+%</8859-8|cp1255>
+%<*cp862|cp1255>
+\ProvideTextCommandDefault{\textflorin}{\textit{f}}
+%</cp862|cp1255>
+%<*cp862>
+\ProvideTextCommandDefault{\textpeseta}{Pt}
+%</cp862>
+% \end{macrocode}
+%
+% The name |\textblacksquare| is derived from the AMS symbol name
+% since Adobe seem not to want this symbol. The default
+% definition, as a rule, makes no claim to being a good design.
+% \begin{macrocode}
+%<*cp862>
+\ProvideTextCommandDefault{\textblacksquare}
+ {\vrule \@width .3em \@height .4em \@depth -.1em\relax}
+%</cp862>
+% \end{macrocode}
+%
+% Some commands can't be faked, so we have them generate an error
+% message.
+% \begin{macrocode}
+%<*8859-8|cp862|cp1255>
+\ProvideTextCommandDefault{\textcent}
+ {\TextSymbolUnavailable\textcent}
+\ProvideTextCommandDefault{\textyen}
+ {\TextSymbolUnavailable\textyen}
+%</8859-8|cp862|cp1255>
+%<*8859-8>
+\ProvideTextCommandDefault{\textcurrency}
+ {\TextSymbolUnavailable\textcurrency}
+%</8859-8>
+%<*cp1255>
+\ProvideTextCommandDefault{\newsheqel}
+ {\TextSymbolUnavailable\newsheqel}
+%</cp1255>
+%<*8859-8|cp1255>
+\ProvideTextCommandDefault{\textbrokenbar}
+ {\TextSymbolUnavailable\textbrokenbar}
+%</8859-8|cp1255>
+%<*cp1255>
+\ProvideTextCommandDefault{\textperthousand}
+ {\TextSymbolUnavailable\textperthousand}
+%</cp1255>
+% \end{macrocode}
+%
+% Characters that are supposed to be used only in math will be defined
+% by |\providecommand| because \LaTeXe{} assumes that the font
+% encoding for math fonts is static.
+% \begin{macrocode}
+%<*8859-8|cp1255>
+\providecommand{\mathonesuperior}{{^1}}
+\providecommand{\maththreesuperior}{{^3}}
+%</8859-8|cp1255>
+%<*8859-8|cp862|cp1255>
+\providecommand{\mathtwosuperior}{{^2}}
+%</8859-8|cp862|cp1255>
+%<*cp862>
+\providecommand{\mathordmasculine}{{^o}}
+\providecommand{\mathordfeminine}{{^a}}
+%</cp862>
+% \end{macrocode}
+%
+% \subsection{The SI-960 encoding}
+%
+%% The SI-960 or ``old-code'' encoding only allows characters in the
+%% range 32--127, so we only need to provide an empty |si960.def| file.
+%
+% \subsection{The ISO 8859-8 encoding and the MS Windows cp1255 encoding}
+%
+% The |8859-8.def| encoding file defines the characters in the ISO
+% 8859-8 encoding.
+%
+% The MS Windows Hebrew character set incorporates the Hebrew
+% letter repertoire of ISO 8859-8, and uses the same code points
+% (starting from 224). It has also some important additions in the
+% 128--159 and 190--224 ranges.
+%
+% \begin{macrocode}
+%<*cp1255>
+\DeclareInputText{130}{\quotesinglbase}
+\DeclareInputText{131}{\textflorin}
+\DeclareInputText{132}{\quotedblbase}
+\DeclareInputText{133}{\dots}
+\DeclareInputText{134}{\dag}
+\DeclareInputText{135}{\ddag}
+\DeclareInputText{136}{\^{}}
+\DeclareInputText{137}{\textperthousand}
+\DeclareInputText{139}{\guilsinglleft}
+\DeclareInputText{145}{\textquoteleft}
+\DeclareInputText{146}{\textquoteright}
+\DeclareInputText{147}{\textquotedblleft}
+\DeclareInputText{148}{\textquotedblright}
+\DeclareInputText{149}{\textbullet}
+\DeclareInputText{150}{\textendash}
+\DeclareInputText{151}{\textemdash}
+\DeclareInputText{152}{\~{}}
+\DeclareInputText{153}{\texttrademark}
+\DeclareInputText{155}{\guilsinglright}
+%</cp1255>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*8859-8|cp1255>
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\pounds}
+%<+8859-8>\DeclareInputText{164}{\textcurrency}
+%<+cp1255>\DeclareInputText{164}{\newsheqel}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\S}
+\DeclareInputText{168}{\"{}}
+\DeclareInputText{169}{\textcopyright}
+%<+8859-8>\DeclareInputMath{170}{\times}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputMath{172}{\lnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\@tabacckludge={}}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputMath{177}{\pm}
+\DeclareInputMath{178}{\mathtwosuperior}
+\DeclareInputMath{179}{\maththreesuperior}
+\DeclareInputText{180}{\@tabacckludge'{}}
+\DeclareInputMath{181}{\mu}
+\DeclareInputText{182}{\P}
+\DeclareInputText{183}{\textperiodcentered}
+%<+8859-8>\DeclareInputText{184}{\c\ }
+\DeclareInputMath{185}{\mathonesuperior}
+%<+8859-8>\DeclareInputMath{186}{\div}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+%</8859-8|cp1255>
+% \end{macrocode}
+%
+% Hebrew vowels and dots (nikud) are included only to MS Windows cp1255
+% page and start from the position 192.
+% \begin{macrocode}
+%<*cp1255>
+\DeclareInputText{192}{\hebsheva}
+\DeclareInputText{193}{\hebhatafsegol}
+\DeclareInputText{194}{\hebhatafpatah}
+\DeclareInputText{195}{\hebhatafqamats}
+\DeclareInputText{196}{\hebhiriq}
+\DeclareInputText{197}{\hebtsere}
+\DeclareInputText{198}{\hebsegol}
+\DeclareInputText{199}{\hebpatah}
+\DeclareInputText{200}{\hebqamats}
+\DeclareInputText{201}{\hebholam}
+\DeclareInputText{203}{\hebqubuts}
+\DeclareInputText{204}{\hebdagesh}
+\DeclareInputText{205}{\hebmeteg}
+\DeclareInputText{206}{\hebmaqaf}
+\DeclareInputText{207}{\hebrafe}
+\DeclareInputText{208}{\hebpaseq}
+\DeclareInputText{209}{\hebshindot}
+\DeclareInputText{210}{\hebsindot}
+\DeclareInputText{211}{\hebsofpasuq}
+\DeclareInputText{212}{\hebdoublevav}
+\DeclareInputText{213}{\hebvavyod}
+\DeclareInputText{214}{\hebdoubleyod}
+%</cp1255>
+% \end{macrocode}
+%
+% Hebrew letters start from the position 224 in both encodings.
+% \begin{macrocode}
+%<*8859-8|cp1255>
+\DeclareInputText{224}{\hebalef}
+\DeclareInputText{225}{\hebbet}
+\DeclareInputText{226}{\hebgimel}
+\DeclareInputText{227}{\hebdalet}
+\DeclareInputText{228}{\hebhe}
+\DeclareInputText{229}{\hebvav}
+\DeclareInputText{230}{\hebzayin}
+\DeclareInputText{231}{\hebhet}
+\DeclareInputText{232}{\hebtet}
+\DeclareInputText{233}{\hebyod}
+\DeclareInputText{234}{\hebfinalkaf}
+\DeclareInputText{235}{\hebkaf}
+\DeclareInputText{236}{\heblamed}
+\DeclareInputText{237}{\hebfinalmem}
+\DeclareInputText{238}{\hebmem}
+\DeclareInputText{239}{\hebfinalnun}
+\DeclareInputText{240}{\hebnun}
+\DeclareInputText{241}{\hebsamekh}
+\DeclareInputText{242}{\hebayin}
+\DeclareInputText{243}{\hebfinalpe}
+\DeclareInputText{244}{\hebpe}
+\DeclareInputText{245}{\hebfinaltsadi}
+\DeclareInputText{246}{\hebtsadi}
+\DeclareInputText{247}{\hebqof}
+\DeclareInputText{248}{\hebresh}
+\DeclareInputText{249}{\hebshin}
+\DeclareInputText{250}{\hebtav}
+%</8859-8|cp1255>
+% \end{macrocode}
+%
+% Special symbols which define the direction of symbols explicitly.
+% Currently, they are not used in \LaTeX.
+% \begin{macrocode}
+%<*cp1255>
+\DeclareInputText{253}{\lefttorightmark}
+\DeclareInputText{254}{\righttoleftmark}
+%</cp1255>
+% \end{macrocode}
+%
+% \subsection{The IBM code page 862}
+%
+% The |cp862.def| encoding file defines the characters in the IBM
+% codepage 862 encoding. The DOS graphics `letters' and a few
+% other positions are ignored (left undefined).
+%
+% Hebrew letters start from the position 128.
+% \begin{macrocode}
+%<*cp862>
+\DeclareInputText{128}{\hebalef}
+\DeclareInputText{129}{\hebbet}
+\DeclareInputText{130}{\hebgimel}
+\DeclareInputText{131}{\hebdalet}
+\DeclareInputText{132}{\hebhe}
+\DeclareInputText{133}{\hebvav}
+\DeclareInputText{134}{\hebzayin}
+\DeclareInputText{135}{\hebhet}
+\DeclareInputText{136}{\hebtet}
+\DeclareInputText{137}{\hebyod}
+\DeclareInputText{138}{\hebfinalkaf}
+\DeclareInputText{139}{\hebkaf}
+\DeclareInputText{140}{\heblamed}
+\DeclareInputText{141}{\hebfinalmem}
+\DeclareInputText{142}{\hebmem}
+\DeclareInputText{143}{\hebfinalnun}
+\DeclareInputText{144}{\hebnun}
+\DeclareInputText{145}{\hebsamekh}
+\DeclareInputText{146}{\hebayin}
+\DeclareInputText{147}{\hebfinalpe}
+\DeclareInputText{148}{\hebpe}
+\DeclareInputText{149}{\hebfinaltsadi}
+\DeclareInputText{150}{\hebtsadi}
+\DeclareInputText{151}{\hebqof}
+\DeclareInputText{152}{\hebresh}
+\DeclareInputText{153}{\hebshin}
+\DeclareInputText{154}{\hebtav}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareInputText{155}{\textcent}
+\DeclareInputText{156}{\pounds}
+\DeclareInputText{157}{\textyen}
+\DeclareInputText{158}{\textpeseta}
+\DeclareInputText{159}{\textflorin}
+\DeclareInputText{160}{\@tabacckludge'a}
+\DeclareInputText{161}{\@tabacckludge'\i}
+\DeclareInputText{162}{\@tabacckludge'o}
+\DeclareInputText{163}{\@tabacckludge'u}
+\DeclareInputText{164}{\~n}
+\DeclareInputText{165}{\~N}
+\DeclareInputMath{166}{\mathordfeminine}
+\DeclareInputMath{167}{\mathordmasculine}
+\DeclareInputText{168}{\textquestiondown}
+\DeclareInputMath{170}{\lnot}
+\DeclareInputText{171}{\textonehalf}
+\DeclareInputText{172}{\textonequarter}
+\DeclareInputText{173}{\textexclamdown}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\guillemotright}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareInputMath{224}{\alpha}
+\DeclareInputText{225}{\ss}
+\DeclareInputMath{226}{\Gamma}
+\DeclareInputMath{227}{\pi}
+\DeclareInputMath{228}{\Sigma}
+\DeclareInputMath{229}{\sigma}
+\DeclareInputMath{230}{\mu}
+\DeclareInputMath{231}{\tau}
+\DeclareInputMath{232}{\Phi}
+\DeclareInputMath{233}{\Theta}
+\DeclareInputMath{234}{\Omega}
+\DeclareInputMath{235}{\delta}
+\DeclareInputMath{236}{\infty}
+\DeclareInputMath{237}{\phi}
+\DeclareInputMath{238}{\varepsilon}
+\DeclareInputMath{239}{\cap}
+\DeclareInputMath{240}{\equiv}
+\DeclareInputMath{241}{\pm}
+\DeclareInputMath{242}{\ge}
+\DeclareInputMath{243}{\le}
+\DeclareInputMath{246}{\div}
+\DeclareInputMath{247}{\approx}
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textperiodcentered}
+\DeclareInputText{250}{\textbullet}
+\DeclareInputMath{251}{\surd}
+\DeclareInputMath{252}{\mathnsuperior}
+\DeclareInputMath{253}{\mathtwosuperior}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+%</cp862>
+% \end{macrocode}
+%
+% \begin{macro}{\DisableNikud}
+% A utility macro to ignore any nikud character that may appear in the
+% input. This allows you to ignore cp1255 nikud characters that happened to
+% appear in the input.
+% \end{macro}
+% \begin{macrocode}
+%<*8859-8>
+\newcommand{\DisableNikud}{%
+ \DeclareInputText{192}{}%
+ \DeclareInputText{193}{}%
+ \DeclareInputText{194}{}%
+ \DeclareInputText{195}{}%
+ \DeclareInputText{196}{}%
+ \DeclareInputText{197}{}%
+ \DeclareInputText{198}{}%
+ \DeclareInputText{199}{}%
+ \DeclareInputText{200}{}%
+ \DeclareInputText{201}{}%
+ \DeclareInputText{203}{}%
+ \DeclareInputText{204}{}%
+ \DeclareInputText{205}{}%
+ \DeclareInputText{206}{}%
+ \DeclareInputText{207}{}%
+ \DeclareInputText{208}{}%
+ \DeclareInputText{209}{}%
+ \DeclareInputText{210}{}%
+ \DeclareInputText{211}{}%
+ \DeclareInputText{212}{}%
+ \DeclareInputText{213}{}%
+ \DeclareInputText{214}{}%
+}
+%</8859-8>
+% \end{macrocode}
+%
+% Finally, we reset the category code of the |@| sign at the end of
+% all |.def| files.
+% \begin{macrocode}
+%<-driver>\makeatother
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/hebrew.dtx b/Master/texmf-dist/source/generic/babel/hebrew.dtx
new file mode 100644
index 00000000000..19f0fbf0fc8
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/hebrew.dtx
@@ -0,0 +1,3329 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{3345}
+%
+% \iffalse meta-comment
+%% Hebrew language definition and additional packages.
+%% Copyright (C) 1997 -- 2005 Boris Lavva.
+%
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+%<*calendar>
+%% TeX & LaTeX macros for computing Hebrew date from Gregorian one
+%% Copyright (C) 1991 by Michail Rozman, misha@iop.tartu.ew.su
+%%
+%</calendar>
+% \fi
+%
+%
+% \iffalse
+%<hebrew>\ProvidesFile{hebrew.ldf}
+%<rightleft>\ProvidesFile{rlbabel.def}
+%<calendar>\ProvidesPackage{hebcal}
+%<*driver>
+\ProvidesFile{hebrew.drv}
+%</driver>
+% \fi
+% \ProvidesFile{hebrew.dtx}
+ [2005/03/30 v2.3h %
+% \iffalse
+%<hebrew> Hebrew language definition from the babel system
+%<rightleft> Right-to-Left support from the babel system
+%<calendar> Hebrew calendar
+%<driver> Driver file for hebrew support
+% \fi
+ Hebrew language support from the babel system]
+%
+% \iffalse
+% \subsection{A driver for this document}
+%
+% The next bit of code contains the documentation driver file for
+% \TeX{}, i.e., the file that will produce the documentation you are
+% currently reading. It will be extracted from this file by the \dst{}
+% program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\providecommand\babel{\textsf{babel}}
+\providecommand\file[1]{\texttt{#1}}
+\makeatletter
+% \end{macrocode}
+%
+% The code lines are numbered within sections,
+% \begin{macrocode}
+\@addtoreset{CodelineNo}{section}
+\renewcommand\theCodelineNo{%
+ \reset@font\scriptsize\thesection.\arabic{CodelineNo}}
+% \end{macrocode}
+% which should also be visible in the index; hence this
+% redefinition of a macro from \file{doc.sty}.
+% \begin{macrocode}
+\renewcommand\codeline@wrindex[1]{\if@filesw
+ \immediate\write\@indexfile
+ {\string\indexentry{#1}%
+ {\number\c@section.\number\c@CodelineNo}}\fi}
+% \end{macrocode}
+%
+% The glossary environment is used or the change log, but its
+% definition needs changing for this document.
+% \begin{macrocode}
+\renewenvironment{theglossary}{%
+ \glossary@prologue%
+ \GlossaryParms \let\item\@idxitem \ignorespaces}%
+ {}
+\makeatother
+\DisableCrossrefs
+\CodelineIndex
+\RecordChanges
+\title{Hebrew language support from the \babel\ system}
+\author{Boris Lavva}
+\date{Printed \today}
+\begin{document}
+ \maketitle
+ \tableofcontents
+ \DocInput{hebrew.dtx}
+ \DocInput{hebinp.dtx}
+ \DocInput{hebrew.fdd}
+ \DocInput{heb209.dtx}
+ \clearpage
+ \def\filename{index}
+ \PrintIndex
+ \clearpage
+ \def\filename{changes}
+ \PrintChanges
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \providecommand\babel{\textsf{babel}}
+% \providecommand\dst{\textsc{docstrip}}
+% \providecommand\file[1]{\texttt{#1}}
+% \providecommand\pkg[1]{\texttt{#1}}
+% \providecommand\XeT{X\kern-.125em\lower.5ex\hbox{E}\kern-.1667emT\@}
+% \providecommand\scrunch{\setlength{\itemsep}{-.05in}}
+% \GetFileInfo{hebrew.dtx}
+%
+% \changes{hebrew~0.1}{??/??/??}{%
+% Preliminary \LaTeX\ Hebrew option (by Sergio Fogel)}
+% \changes{hebrew~0.2}{??/??/??}{%
+% Corrections and additions (by Rama Porrat)}
+% \changes{hebrew~0.6}{??/??/??}{Additions (by Yael Dubinsky)}
+% \changes{hebrew~1.2}{??/??/??}{%
+% Bilingual tables, penalties, documentation and more changes
+% (by Yaniv Bargury)}
+% \changes{hebrew~1.30}{1992/05/15}{%
+% Font selection, various (by Alon Ziv)}
+% \changes{hebrew~1.31}{1993/02/22}{Bug fixes (by Alon Ziv)}
+% \changes{hebrew~1.32}{1993/03/10}{Made font-change command
+% for numbers `\cs{protect}'ed (by Alon Ziv)}
+% \changes{hebrew~1.33}{1993/03/11}{%
+% Made \cs{refstepcounter} work using \cs{@ltor} (by Alon Ziv)}
+% \changes{hebrew~1.34}{1993/03/22}{%
+% Moved font loading to another file. Added \cs{mainsec}.
+% Made all text strings be produced by control codes (similar to
+% \LaTeX 2.09 Mar '92). Fixed \cs{noindent} (by Alon Ziv)}
+% \changes{hebrew~1.35}{1993/03/22}{%
+% Moved the texts to a file selected by the current encoding
+% (by Alon Ziv)}
+% \changes{hebrew~1.36}{1993/03/24}{Use \TeX\ tricks to redefine
+% \cs{theXXXX} without keeping old definitions.
+% Use only \cs{@eng} for direction/font change (removed \cs{@ltor}).
+% Switched from use of \cs{mainsec} to code taken from \babel\
+% system (by Alon Ziv)}
+% \changes{hebrew~1.37}{1993/03/28}{%
+% Use \cs{add@around} in defining font size commands. Small bug
+% fixes (by Alon Ziv)}
+% \changes{hebrew~1.38}{1993/04/20}{%
+% \cs{everypar} changed so that \cs{noindent} works unmodified
+% (by Alon Ziv, thanks to Chris Rowley)}
+% \changes{hebrew~1.39}{1993/08/10}{%
+% Redefined primitive sectioning commands. Changed \cs{include} so
+% it finds \texttt{.h}, \texttt{.xet}, and \texttt{.ltx} files (no
+% extension needed). Reinstated use of \cs{@ltor} (by Alon Ziv)}
+% \changes{hebrew~1.40}{1993/09/01}{Added the \cs{@brackets} hack
+% (by Alon Ziv)}
+% \changes{hebrew~1.41}{1993/09/09}{%
+% Reworked towards using NFSS2. Changed some macro names to be more
+% logical: renamed \cs{@ltor} to \cs{@number}, \cs{@eng} to
+% \cs{@latin}, and (in \texttt{hebrew.ldf}) \cs{@heb} to
+% \cs{@hebrew} (by Alon Ziv)}
+% \changes{hebrew~1.42}{1993/09/22}{%
+% Made list environments work better. Fixed thebibliography
+% environment (by Alon Ziv)}
+% \changes{hebrew~2.0a}{1998/01/01}{%
+% Completely rewritten for \LaTeXe\ and \babel\ support. Various
+% input and font encodings (with NFSS2) are supported too. The
+% original \pkg{hebrew.sty} is divided to a number of packages and
+% definition files for better readability and extensibility. Added
+% some user- and code-level documentation inside the \texttt{.dtx}
+% and \texttt{.fdd} files, and \LaTeX -driven installation with
+% \pkg{hebrew.ins} (by Boris Lavva)}
+% \changes{hebrew~2.1}{2000/11/23}{%
+% corrections from Sivan Toledo: sender name in letter, and section name in
+% headings. (by Tzafrir Cohen)}
+% \changes{hebrew~2.2}{2000/12/11}{%
+% renamed hebrew letters to heb* (e.g.: alef renamed to hebalef)
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3}{2001/02/27}{
+% added several \cs{@ifclassloaded}\{slides\} to allow the use of the
+% slides class. (by Tzafrir Cohen)}
+% \changes{hebrew~2.3a}{2001/07/09}{
+% The documentation should now be built fine (broken since at least
+% 2.1, and probably 2.0) (by Tzafrir Cohen)}
+% \changes{hebrew~2.3b}{2001/08/16}{
+% minor clean-ups. The documentation builds now with no warnings.
+% Also removed \cs{R} from the caption macro (added in 2.1)
+% Added internal \cs{@ensure@L} and \cs{@ensure@R}
+% (Is there a real need for them? Maybe should they be exposed?)
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3c}{2001/10/05}{
+% a temporary fix to the \cs{gim} macro. Should be replaced by stuff
+% from hebcal.
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3d}{2002/01/04}{
+% Initial support for the prosper class. Added \cs{arabicnorl} .
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3e}{2002/08/09}{
+% Removing hebtech from this distriution (not relevant to babel),
+% added \cs{HeblatexEncoding}. some docs cleanup
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3f}{2002/12/26}{
+% redefined \cs{list} instead of redefining every environment
+% that uses it. some pscolor handling, removed HeblatexEncoding
+% (don't use 2.3e) (by Tzafrir Cohen)}
+% \changes{hebrew~2.3g}{2003/06/05}{
+% Reimplemented the printing of Hebrew numerals and Hebrew
+% counters; modified \pkg{hebcal.sty} to use this implementation
+% when typesetting Hebrew dates; added option |full| to package
+% \pkg{hebcal}; also removed some gratuitous
+% spaces inserted by \pkg{hebcal.sty} by adding comment marks.
+% CAUTION: the changes to \pkg{hebcal.sty} make it dependent on
+% \pkg{babel} and not useable as a stand-alone package. Is this a
+% problem? (by Ron Artstein)}
+%
+% \section{The Hebrew language}\label{sec:hebrew}
+%
+% The file \file{\filename}\footnote{The Hebrew language support
+% files described in this section have version number \fileversion\
+% and were last revised on \filedate.} provides the following
+% packages and files for Hebrew language support:
+% \begin{description}
+% \item[\file{hebrew.ldf}] file defines all the language-specific
+% macros for the Hebrew language.
+% \item[\file{rlbabel.def}] file is used by |hebrew.ldf| for
+% bidirectional versions of the major \LaTeX{} commands and
+% environments. It is designed to be used with other right-to-left
+% languages, not only with Hebrew.
+% \item[\pkg{hebcal.sty}] package defines a set of macros for
+% computing Hebrew date from Gregorian one.
+% \end{description}
+%
+% Additional Hebrew input and font encoding definition files that
+% should be included and used with \file{hebrew.ldf} are:
+% \begin{description}
+% \item[\file{hebinp.dtx}] provides Hebrew input encodings, such as
+% ISO 8859-8, MS Windows codepage 1255 or IBM PC codepage 862
+% (see Section~\ref{sec:hebinp} on page~\pageref{sec:hebinp}).
+% \item[\file{hebrew.fdd}] contains Hebrew font encodings, related
+% font definition files and \pkg{hebfont} package that
+% provides Hebrew font switching commands (see
+% Section~\ref{sec:hebfdd} on page~\pageref{sec:hebfdd} for
+% further details).
+% \end{description}
+%
+% \LaTeX~2.09 compatibility files are included with
+% \file{heb209.dtx} and gives possibility to compile existing
+% \LaTeX~2.09 Hebrew documents with small (if any) changes (see
+% Section~\ref{sec:heb209} on page~\pageref{sec:heb209} for
+% details).
+%
+% Finally, optional document class \pkg{hebtech} may be useful for
+% writing theses and dissertations in both Hebrew and English (and
+% any other languages included with \babel). It designed to meet
+% requirements of the Graduate School of the Technion --- Israel
+% Institute of Technology.
+%
+% \emph{As of version 2.3e hebtech is no longer distributed together
+% with heblatex. It should be part of a new "hebclasses" package}
+%
+% \subsection{Acknowledgement}
+%
+% The following people have contributed to Hebrew package in one
+% way or another, knowingly or unknowingly. In alphabetical order:
+% Irina Abramovici, Yaniv Bargury, Yael Dubinsky, Sergio Fogel,
+% Dan Haran, Rama Porrat, Michail Rozman, Alon Ziv.
+%
+% Tatiana Samoilov and Vitaly Surazhsky found a number of serious
+% bugs in preliminary version of Hebrew package.
+%
+% A number of other people have contributed comments and
+% information. Specific contributions are acknowledged within the
+% document.
+%
+% I want to thank my wife, Vita, and son, Mishka, for their
+% infinite love and patience.
+%
+% If you made a contribution and I haven't mentioned it, don't
+% worry, it was an accident. I'm sorry. Just tell me and I will add
+% you to the next version.
+%
+% \StopEventually{}
+%
+% \subsection{The {\normalfont\dst{}} modules}
+%
+% The following modules are used in the implementation to direct
+% \dst{} in generating external files:
+% \begin{center}
+% \begin{tabular}{@{}ll}
+% driver & produce a documentation driver file \\[4pt]
+% hebrew & produce Hebrew language support file\\
+% rightleft & create right-to-left support file\\
+% calendar & create Hebrew calendar package
+% \end{tabular}
+% \end{center}
+% A typical \dst{} command file would then have entries like:
+% \begin{quote}
+% |\generateFile{hebrew.ldf}{t}{\from{hebrew.dtx}{hebrew}}|
+% \end{quote}
+%
+% \subsection{Hebrew language definitions}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the |@|
+% sign, etc.
+% \begin{macrocode}
+%<*hebrew>
+\LdfInit{hebrew}{captionshebrew}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, |hebrew| will be an `unknown' language, in which case we
+% have to make it known. So we check for the existence of
+% |\l@hebrew| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@hebrew\@undefined
+ \@nopatterns{Hebrew}%
+ \adddialect\l@hebrew0
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\hebrewencoding}
+% \emph{FIX DOCS REGARDING 8BIT}
+%
+% Typesetting Hebrew texts implies that a special input and output
+% encoding needs to be used. Generally, the user may choose
+% between different available Hebrew encodings provided. The
+% current support for Hebrew uses all available fonts from the
+% Hebrew University of Jerusalem encoded in `old-code' 7-bit
+% encoding also known as Israeli Standard SI-960. We define for
+% these fonts the Local Hebrew Encoding |LHE| (see the file
+% |hebrew.fdd| for more details), and the |LHE| encoding definition
+% file should be loaded by default.
+%
+% Other fonts are available in windows-cp1255 (a superset of ISO-8859-8
+% with nikud). For those, the encoding |HE8| should be used. Such fonts
+% are, e.g., windows' TrueType fonts (once cnverted to Type1 or MetaFont)
+% and IBM's Type1 fonts.
+%
+% However, if an user wants to use another font encoding, for
+% example, cyrillic encoding T2 and extended latin encoding T1, ---
+% he/she has to load the corresponding file \emph{before} the
+% \pkg{hebrew} package. This may be done in the following way:
+% \begin{quote}
+% |\usepackage[LHE,T2,T1]{fontenc}|\\
+% |\usepackage[hebrew,russian,english]{babel}|
+% \end{quote}
+% We make sure that the |LHE| encoding is known to \LaTeX{} at end
+% of this package.
+%
+% Also note that if you want to use the encoding |HE8| , you should define
+% the following in your document, \emph{before loading babel}:
+% \begin{quote}
+% |\def\HeblatexEncoding{HE8}|\\
+% |\def\HeblatexEncodingFile{he8enc}|
+% \end{quote}
+% \changes{hebrew-2.3h}{2004/02/20}{Make LHE the default encoding for
+% compatibility reasons}
+% \begin{macrocode}
+\providecommand{\HeblatexEncoding}{LHE}%
+\providecommand{\HeblatexEncodingFile}{lheenc}%
+\newcommand{\heblatex@set@encoding}[2]{
+}
+\AtEndOfPackage{%
+ \@ifpackageloaded{fontenc}{%
+ \@ifl@aded{def}{%
+ \HeblatexEncodingFile}{\def\hebrewencoding{\HeblatexEncoding}}{}%
+ }{%
+ \input{\HeblatexEncodingFile.def}%
+ \def\hebrewencoding{\HeblatexEncoding}%
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% We also need to load inputenc package with one of the Hebrew
+% input encodings. By default, we set up the |8859-8| codepage.
+% If an user wants to use many input encodings in the same
+% document, for example, the MS Windows Hebrew codepage |cp1255|
+% and the standard IBM PC Russian codepage |cp866|, he/she has to
+% load the corresponding file \emph{before} the hebrew package
+% too. This may be done in the following way:
+% \begin{quote}
+% |\usepackage[cp1255,cp866]{inputenc}|\\
+% |\usepackage[hebrew,russian,english]{babel}|
+% \end{quote}
+%
+% An user can switch input encodings in the document using the
+% command |\inputencoding|, for example, to use the |cp1255|:
+% \begin{quote}
+% |\inputencoding{cp1255}|
+% \end{quote}
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \@ifpackageloaded{inputenc}{}{\RequirePackage[8859-8]{inputenc}}}
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Hebrew language.
+%
+% \begin{macro}{\hebrewhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|. They are set
+% to~2.
+% \changes{hebrew~2.0b}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionshebrew}
+% The macro |\captionshebrew| replaces all captions used in the four
+% standard document classes provided with \LaTeXe with their Hebrew
+% equivalents.
+% \changes{hebrew-2.0b}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionshebrew{%
+ \def\prefacename{\@ensure@R{\hebmem\hebbet\hebvav\hebalef}}%
+ \def\refname{\@ensure@R{\hebresh\hebshin\hebyod\hebmem\hebtav\ %
+ \hebmem\hebqof\hebvav\hebresh\hebvav\hebtav}}%
+ \def\abstractname{\@ensure@R{\hebtav\hebqof\hebtsadi\hebyod\hebresh}}%
+ \def\bibname{\@ensure@R{\hebbet\hebyod\hebbet\heblamed\hebyod\hebvav%
+ \hebgimel\hebresh\hebpe\hebyod\hebhe}}%
+ \def\chaptername{\@ensure@R{\hebpe\hebresh\hebqof}}%
+ \def\appendixname{\@ensure@R{\hebnun\hebsamekh\hebpe\hebhet}}%
+ \def\contentsname{\@ensure@R{%
+ \hebtav\hebvav\hebkaf\hebfinalnun\ %
+ \hebayin\hebnun\hebyod\hebyod\hebnun\hebyod\hebfinalmem}}%
+ \def\listfigurename{\@ensure@R{%
+ \hebresh\hebshin\hebyod\hebmem\hebtav\ %
+ \hebalef\hebyod\hebvav\hebresh\hebyod\hebfinalmem}}%
+ \def\listtablename{\@ensure@R{%
+ \hebresh\hebshin\hebyod\hebmem\hebtav\
+ \hebtet\hebbet\heblamed\hebalef\hebvav\hebtav}}%
+ \def\indexname{\@ensure@R{\hebmem\hebpe\hebtav\hebhet}}%
+ \def\figurename{\@ensure@R{\hebalef\hebyod\hebvav\hebresh}}%
+ \def\tablename{\@ensure@R{\hebtet\hebbet\heblamed\hebhe}}%
+ \def\partname{\@ensure@R{\hebhet\heblamed\hebqof}}%
+ \def\enclname{\@ensure@R{\hebresh\hebtsadi"\hebbet}}%
+ \def\ccname{\@ensure@R{\hebhe\hebayin\hebtav\hebqof\hebyod%
+ \hebfinalmem}}%
+ \def\headtoname{\@ensure@R{\hebalef\heblamed}}%
+ \def\pagename{\@ensure@R{\hebayin\hebmem\hebvav\hebdalet}}%
+ \def\psname{\@ensure@R{\hebnun.\hebbet.}}%
+ \def\seename{\@ensure@R{\hebresh\hebalef\hebhe}}%
+ \def\alsoname{\@ensure@R{\hebresh\hebalef\hebhe \hebgimel%
+ \hebmemesof}}%
+ \def\proofname{\@ensure@R{\hebhe\hebvav\hebkaf\hebhet\hebhe}}
+ \def\glossaryname{\@ensure@L{Glossary}}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\slidelabel}
+% Here we fix the macro |slidelabel| of the seminar package. Note
+% that this still won't work well enough when overlays will be
+% involved
+% \begin{macrocode}
+\@ifclassloaded{seminar}{%
+ \def\slidelabel{\bf \if@rl\R{\hebshin\hebqof\hebfinalpe{} \theslide}%
+ \else\L{Slide \theslide}%
+ \fi}%
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% Here we provide an user with translation of Gregorian dates
+% to Hebrew. In addition, the \pkg{hebcal} package can be used
+% to create Hebrew calendar dates.
+%
+% \begin{macro}{\hebmonth}
+% The macro |\hebmonth{|\emph{month}|}| produces month names in
+% Hebrew.
+% \begin{macrocode}
+\def\hebmonth#1{%
+ \ifcase#1\or \hebyod\hebnun\hebvav\hebalef\hebresh\or %
+ \hebpe\hebbet\hebresh\hebvav\hebalef\hebresh\or %
+ \hebmem\hebresh\hebfinaltsadi\or %
+ \hebalef\hebpe\hebresh\hebyod\heblamed\or %
+ \hebmem\hebalef\hebyod\or \hebyod\hebvav\hebnun\hebyod\or %
+ \hebyod\hebvav\heblamed\hebyod\or %
+ \hebalef\hebvav\hebgimel\hebvav\hebsamekh\hebtet\or %
+ \hebsamekh\hebpe\hebtet\hebmem\hebbet\hebresh\or %
+ \hebalef\hebvav\hebqof\hebtet\hebvav\hebbet\hebresh\or %
+ \hebnun\hebvav\hebbet\hebmem\hebbet\hebresh\or %
+ \hebdalet\hebtsadi\hebmem\hebbet\hebresh\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hebdate}
+% The macro |\hebdate{|\emph{day}|}{|\emph{month}|}{|\emph{year}|}|
+% translates a given Gregorian date to Hebrew.
+% \begin{macrocode}
+\def\hebdate#1#2#3{%
+ \beginR\beginL\number#1\endL\ \hebbet\hebmonth{#2}
+ \beginL\number#3\endL\endR}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hebday}
+% The macro |\hebday| will replace |\today| command when in Hebrew
+% mode.
+% \begin{macrocode}
+\def\hebday{\hebdate{\day}{\month}{\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datehebrew}
+% The macro |\datehebrew| redefines the command |\today| to produce
+% Gregorian dates in Hebrew. It uses the macro |\hebday|.
+% \begin{macrocode}
+\def\datehebrew{\let\today=\hebday}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\extrashebrew| will perform all the extra definitions
+% needed for the Hebrew language. The macro |\noextrashebrew|
+% is used to cancel the actions of |\extrashebrew|.
+%
+% \begin{macro}{\extrashebrew}
+% We switch font encoding to Hebrew and direction to
+% right-to-left. We cannot use the regular language switching
+% commands (for example, |\sethebrew| and |\unsethebrew| or
+% |\selectlanguage{hebrew}|), when in restricted horizontal mode,
+% because it will result in \emph{unbalanced} |\beginR| or
+% |\beginL| primitives.
+% Instead, in \TeX 's restricted horizontal mode, the
+% |\L{|\emph{latin text}|}| and |\R{|\emph{hebrew text}|}|, or
+% |\embox{|\emph{latin text}|}| and |\hmbox{|\emph{hebrew text}|}|
+% should be used.
+%
+% Hence, we use |\beginR| and |\beginL| switching commands only
+% when not in restricted horizontal mode.
+% \begin{macrocode}
+\addto\extrashebrew{%
+ \tohebrew%
+ \ifhmode\ifinner\else\beginR\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\noextrashebrew}
+% The macro |\noextrashebrew| is used to cancel the actions of
+% |\extrashebrew|. We switch back to the previous font encoding and
+% restore left-to-right direction.
+% \begin{macrocode}
+\addto\noextrashebrew{%
+ \fromhebrew%
+ \ifhmode\ifinner\else\beginL\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% Generally, we can switch to- and from- Hebrew by means of
+% standard \babel -defined commands, for example,
+% \begin{quote}
+% |\selectlanguage{hebrew}|
+% \end{quote}
+% or
+% \begin{quote}
+% |\begin{otherlanguage}{hebrew}|\\
+% \hspace*{1.5em} some Hebrew text\\
+% |\end{otherlanguage}|
+% \end{quote}
+% Now we define two additional commands that offer the possibility
+% to switch to and from Hebrew language. These commands are
+% backward compatible with the previous versions of
+% \pkg{hebrew.sty}.
+%
+% \begin{macro}{\sethebrew}
+% \begin{macro}{\unsethebrew}
+% The command |\sethebrew| will switch from the current font encoding
+% to the hebrew font encoding, and from the current direction of
+% text to the right-to-left mode. The command |\unsethebrew| switches
+% back.
+%
+% Both commands use standard right-to-left switching macros
+% |\setrllanguage{|\emph{ r2l language name}|}| and
+% |\unsetrllanguage{|\emph{r2l language name}|}|, that
+% defined in the \file{rlbabel.def} file.
+% \begin{macrocode}
+\def\sethebrew{\setrllanguage{hebrew}}
+\def\unsethebrew{\unsetrllanguage{hebrew}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\hebrewtext}
+% \begin{macro}{\nohebrewtext}
+% The following two commands are \emph{obsolete} and work only
+% in \LaTeX 2.09 compatibility mode. They are synonyms of
+% |\sethebrew| and |\unsethebrew| defined above.
+% \begin{macrocode}
+\if@compatibility
+ \let\hebrewtext=\sethebrew
+ \let\nohebrewtext=\unsethebrew
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tohebrew}
+% \begin{macro}{\fromhebrew}
+% These two commands change only the current font encoding to- and
+% from- Hebrew encoding. Their implementation uses
+% |\@torl{|\emph{language name}|}| and |\@fromrl| macros defined in
+% \file{rlbabel.def} file. Both commands may be useful \emph{only}
+% for package and class writers, not for regular users.
+% \begin{macrocode}
+\def\tohebrew{\@torl{hebrew}}%
+\def\fromhebrew{\@fromrl}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@hebrew}
+% Sometimes we need to preserve Hebrew mode without knowing in
+% which environment we are located now. For these cases, the
+% |\@hebrew{|\emph{hebrew text}|}| macro will be useful. Not that
+% this macro is similar to the |\@number| and |\@latin| macros
+% defined in \file{rlbabel.def} file.
+% \begin{macrocode}
+\def\@@hebrew#1{\beginR{{\tohebrew#1}}\endR}
+\def\@hebrew{\protect\@@hebrew}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Hebrew numerals}
+%
+% We provide commands to print numbers in the traditional
+% notation using Hebrew letters. We need commands that print
+% a Hebrew number from a decimal input, as well as commands
+% to print the value of a counter as a Hebrew number.
+% \begin{macro}{\if@gim@apost}
+% \begin{macro}{\if@gim@final}
+% Hebrew numbers can be written in various styles: with or without
+% apostrophes, and with the letters kaf, mem, nun, pe, tsadi as either
+% final or initial forms when they are the last letters in the
+% sequence. We provide two flags to set the style options.
+% \begin{macrocode}
+\newif\if@gim@apost % whether we print apostrophes
+\newif\if@gim@final % whether we use final or initial letters
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\hebrewnumeral}
+% \begin{macro}{\Hebrewnumeral}
+% \begin{macro}{\Hebrewnumeralfinal}
+% The commands that print a Hebrew number
+% must specify the style locally: relying on a global style
+% option could cause a counter to
+% print in an inconsistent manner---for instance, page numbers
+% might appear in different styles if the global style option
+% changed mid-way through a document.
+% The commands only allow three of the four possible flag
+% combinations (I do not know of a use that requires the
+% combination of final letters and no apostrophes --RA).
+%
+% Each command sets the style flags and calls |\@hebrew@numeral|.
+% Double braces are used in order to protect the values of
+% |\@tempcnta| and |\@tempcntb|, which are changed by this call;
+% they also keep the flag assignments local (this is not important
+% because the global values are never used).
+% \begin{macrocode}
+\newcommand*{\hebrewnumeral}[1] % no apostrophe, no final letters
+ {{\@gim@finalfalse\@gim@apostfalse\@hebrew@numeral{#1}}}
+\newcommand*{\Hebrewnumeral}[1] % apostrophe, no final letters
+ {{\@gim@finalfalse\@gim@aposttrue\@hebrew@numeral{#1}}}
+\newcommand*{\Hebrewnumeralfinal}[1] % apostrophe, final letters
+ {{\@gim@finaltrue\@gim@aposttrue\@hebrew@numeral{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\alph}
+% \begin{macro}{\@alph}
+% \begin{macro}{\Alph}
+% \begin{macro}{\@Alph}
+% \begin{macro}{\Alphfinal}
+% \begin{macro}{\@Alphfinal}
+% Counter-printing commands are based on the above commands. The
+% natural name for the counter-printing commands is |\alph|, because
+% Hebrew numerals are the only way to represent numbers with
+% Hebrew letters (kaf always means~20, never~11). Hebrew has no
+% uppercase letters, hence no need for the familiar meaning of |\Alph|;
+% we therefore define |\alph| to print counters as Hebrew numerals
+% without apostrophes, and |\Alph| to print with apostrophes. A third
+% form, |\Alphfinal|, is provided to print with apostrophes and final
+% letters, as is required for Hebrew year designators. The commands
+% |\alph| and |\Alph| are defined in \pkg{latex.ltx}, and we only
+% need to redefine the internal commands |\@alph| and
+% |\@Alph|; for |\Alphfinal| we need to provide both a wrapper and
+% an internal command.
+% The counter printing commands are made semi-robust: without the
+% |\protect|, commands like |\theenumii| break (I'm not quite clear
+% on why this happens, --RA); at the same time, we cannot make the
+% commands too robust (e.g.~with |\DeclareRobustCommand|) because
+% this would enter the command name rather than its value into
+% files like |.aux|, |.toc| etc\@.
+% The old meanings of meaning of |\@alph| and |\@Alph| are saved
+% upon entering Hebrew mode and restored upon exiting it.
+% \begin{macrocode}
+\addto\extrashebrew{%
+ \let\saved@alph=\@alph%
+ \let\saved@Alph=\@Alph%
+ \renewcommand*{\@alph}[1]{\protect\hebrewnumeral{\number#1}}%
+ \renewcommand*{\@Alph}[1]{\protect\Hebrewnumeral{\number#1}}%
+ \def\Alphfinal#1{\expandafter\@Alphfinal\csname c@#1\endcsname}%
+ \providecommand*{\@Alphfinal}[1]{\protect\Hebrewnumeralfinal{\number#1}}}
+\addto\noextrashebrew{%
+ \let\@alph=\saved@alph%
+ \let\@Alph=\saved@Alph}
+% \end{macrocode}
+% Note that |\alph| (without apostrophes) is already the
+% appropriate choice for the second-level enumerate label, and
+% |\Alph| (with apostrophes) is an appropriate choice for appendix;
+% however, the default \LaTeX\ labels need to be redefined for
+% appropriate cross-referencing, see below.
+% \LaTeX\ default class files specify |\Alph| for
+% the fourth-level enumerate level, this should probably be changed.
+% Also, the way labels get flushed left by default looks inappropriate
+% for Hebrew numerals, so we should redefine |\labelenumii| as well
+% as |\labelenumiv| (presently not implemented).
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\theenumii}
+% \begin{macro}{\theenumiv}
+% \begin{macro}{\label}
+% Cross-references to counter labels need to be printed according
+% to the language environment in which a label was issued, not
+% the environment in which it is called: for example, a label~(1b)
+% issued in a Latin environment should be referred to as~(1b) in a
+% Hebrew text, and label~(2dalet) issued in a Hebrew environment
+% should be referred to as~(2dalet) in a Latin text. This was the
+% unanimous opinion in a poll sent to the Ivri\TeX\ list.
+% We therefore redefine |\theenumii| and |\theenumiv|, so that an
+% explicit language instruction gets written to the |.aux| file.
+% \begin{macrocode}
+\renewcommand{\theenumii}
+ {\if@rl\protect\hebrewnumeral{\number\c@enumii}%
+ \else\protect\L{\protect\@@alph{\number\c@enumii}}\fi}
+\renewcommand{\theenumiv}
+ {\if@rl\protect\Hebrewnumeral{\number\c@enumiv}%
+ \else\protect\L{\protect\@@Alph{\number\c@enumiv}}\fi}
+% \end{macrocode}
+% We also need to control for the font and direction in which a
+% counter label is printed. Direction is straightforward: a Latin
+% label like~(1b) should be written left-to-right when called in a
+% Hebrew text, and a Hebrew label like~(2dalet) should be written
+% right-to-left when called in a Latin text. The font question is
+% more delicate, because we should decide whether the numerals
+% should be typeset in the font of the language enviroment in which
+% the label was issued, or that of the environment in which it is
+% called.
+% \begin{itemize}
+% \item
+% A purely numeric label like~(23) looks best if it is set in the
+% font of the surrounding language.
+% \item
+% But a mixed alphanumeric label like~(1b) lookes weird if
+% the~`1' is taken from the Hebrew font; likewise, (2dalet) looks
+% weird if the~`2' is taken from a Latin font.
+% \item
+% Finally, mixing the two possibilities is worst, because a
+% single Hebrew sentence referring to examples~(1b) and~(2) would
+% take the~`1' from the Latin font and the~`2' from the Hebrew
+% font, and this looks really awful. (It is also very hard to
+% implement).
+% \end{itemize}
+% In light of the conflicting considerations it seems like there's
+% no perfect solution. I have chosen to implement the top option,
+% where numerals are taken from the font of the surrounding
+% language, because it seems to me that reference to purely numeric
+% labels is the most common, so this gives a good solution to the
+% majority of cases and a mediocre solution to the minority.
+%
+% We redefine the |\label| command which writes to the
+% |.aux| file. Depending on the language environment we issue
+% appropriate |\beginR/L|$\cdots$|\endR/L| commands to control the
+% direction without affecting the font. Since these commands do not
+% affect the value of |\if@rl|, we cannot use the macro
+% |\@brackets| to determine the correct brackets to be used with
+% |\p@enumiii|; instead, we let the language environment determine an
+% explicit definition.
+% \begin{macrocode}
+\def\label#1{\@bsphack
+ \if@rl
+ \def\p@enumiii{\p@enumii)\theenumii(}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{#1}{{\beginR\@currentlabel\endR}{\thepage}}}%
+ \else
+ \def\p@enumiii{\p@enumii(\theenumii)}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{#1}{{\beginL\@currentlabel\endL}{\thepage}}}%
+ \fi
+ \@esphack}
+% \end{macrocode}
+% NOTE: it appears that the definition of |\label| is
+% language-independent and thus belongs in \pkg{rlbabel.def}, but
+% this is not the case. The decision to typeset label numerals
+% in the font of the surrounding language is reasonable for Hebrew,
+% because mixed-font (1b) and (2dalet) are somewhat acceptable. The
+% same may not be acceptable for Arabic, whose numeral glyphs are
+% radically different from those in the Latin fonts. The decision
+% about the direction may also be different for Arabic, which is
+% more right-to-left oriented than Hebrew (two examples: dates like
+% 15/6/2003 are written left-to-right in Hebrew but right-to-left
+% in Arabic; equations like $1+2=3$ are written left-to-right in
+% Hebrew but right-to-left in Arabic elementary school textbooks
+% using Arabic numeral glyphs). My personal hunch is that a label
+% like~(1b) in an Arabic text would be typeset left-to-right if
+% the~`1' is a Western glyph, but right-to-left if the~`1' is an
+% Arabic glyph. But this is just a guess, I'd have to ask Arab
+% typesetters to find the correct answer. --RA.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\appendix}
+% The following code provides for the proper printing of appendix
+% numbers in tables of contents. Section and chapter headings are
+% normally bilingual: regardless of the text language, the author
+% supplies each section/chapter with two headings---one for the
+% Hebrew table of contents and one for the Latin table of contents.
+% It makes sense that the label should be a Latin letter in the
+% Latin table of contents and a Hebrew letter in the Hebrew table
+% of contents. The definition is similar to that of |\theenumii|
+% and |\theenumiv| above, but additional |\protect| commands ensure
+% that the entire condition is written the |.aux| file. The
+% appendix number will therefore be typeset according to the
+% environment in which it is used rather than issued: a Hebrew
+% number (with apostrophes) in a Hebrew environment and a Latin
+% capital letter in a Latin environment (the command
+% |\@@Alph| is set in \pkg{rlbabel.def} to hold the default meaning
+% of \LaTeX\ [latin] |\@Alph|, regardless of the mode in which it is
+% issued). The net result is that
+% the second appendix will be marked with~`B' in the Latin table of
+% contents and with `bet' in the Hebrew table of contents; the mark
+% in the main text will depend on the language of the appendix itself.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{%
+\@ifclassloaded{slides}{}{%
+ \let\@@appendix=\appendix%
+ \@ifclassloaded{article}{%
+ \renewcommand\appendix{\@@appendix%
+ \renewcommand\thesection
+ {\protect\if@rl\protect\Hebrewnumeral{\number\c@section}%
+ \protect\else\@@Alph\c@section\protect\fi}}}
+ {\renewcommand\appendix{\@@appendix%
+ \renewcommand\thechapter
+ {\protect\if@rl\protect\Hebrewnumeral{\number\c@chapter}%
+ \protect\else\@@Alph\c@chapter\protect\fi}}}}}
+% \end{macrocode}
+% QUESTION: is this also the appropriate way to refer to an
+% appendix in the text, or should we retain the original label the
+% same way we did with |enumerate| labels?
+% ANOTHER QUESTION: are similar redefinitions needed for other
+% counters that generate texts in bilingual lists like |.lof/.fol|
+% and |.lot/.tol|? --RA.
+% \end{macro}
+% \begin{macro}{\@hebrew@numeral}
+% The command |\@hebrew@numeral| prints a Hebrew number. The groups
+% of thousands, millions, billions are separated by apostrophes and
+% typeset without apostrophes or final letters; the remainder
+% (under 1000) is typeset conventionally, with the selected styles
+% for apostrophes and final letters.
+% The function calls on |\gim@no@mil| to typeset each
+% three-digit block. The algorithm
+% is recursive, but the maximum recursion depth is~4 because \TeX\
+% only allows numbers up to $2^{31}-1 = 2{,}147{,}483{,}647$.
+% The typesetting routine is wrapped in |\@hebrew| in order to
+% ensure that numbers are always typeset in Hebrew mode.
+%
+% Initialize: |\@tempcnta| holds the value, |\@tempcntb| is used for
+% calculations.
+% \begin{macrocode}
+\newcommand*{\@hebrew@numeral}[1]
+{\@hebrew{\@tempcnta=#1\@tempcntb=#1\relax
+ \divide\@tempcntb by 1000
+% \end{macrocode}
+% If we're under 1000, call |\gim@nomil|
+% \begin{macrocode}
+ \ifnum\@tempcntb=0\gim@nomil\@tempcnta\relax
+% \end{macrocode}
+% If we're above 1000 then force no apostrophe and no final letter
+% styles for the value above~1000, recur for the value above~1000,
+% add an apostrophe, and call |\gim@nomil| for the remainder.
+% \begin{macrocode}
+ \else{\@gim@apostfalse\@gim@finalfalse\@hebrew@numeral\@tempcntb}'%
+ \multiply\@tempcntb by 1000\relax
+ \advance\@tempcnta by -\@tempcntb\relax
+ \gim@nomil\@tempcnta\relax
+ \fi
+}}
+% \end{macrocode}
+% NOTE: is it the case that 15,000 and 16,000 are written as
+% yod-he and yod-vav, rather than tet-vav and tet-zayin? This
+% vaguely rings a bell, but I'm not certain. If this is the case,
+% then the current behavior is incorrect and should be changed. --RA.
+% \end{macro}
+% \begin{macro}{\gim@nomil}
+% The command |\gim@nomil| typesets an integer between 0~and~999
+% (for~0 it typesets nothing). The code has been modified from the
+% old |hebcal.sty|
+% (appropriate credits---Boris Lavva and Michail Rozman ?).
+% |\@tempcnta| holds the total value that remains to be typeset.
+% At each stage we find the highest valued letter that is
+% less than or equal to |\@tempcnta|, and call on |\gim@print| to
+% subtract this value and print the letter.
+%
+% Initialize: |\@tempcnta| holds the value, there is no previous
+% letter.
+% \begin{macrocode}
+\newcommand*{\gim@nomil}[1]{\@tempcnta=#1\@gim@prevfalse
+% \end{macrocode}
+% Find the hundreds digit.
+% \begin{macrocode}
+ \@tempcntb=\@tempcnta\divide\@tempcntb by 100\relax % hundreds digit
+ \ifcase\@tempcntb % print nothing if no hundreds
+ \or\gim@print{100}{\hebqof}%
+ \or\gim@print{200}{\hebresh}%
+ \or\gim@print{300}{\hebshin}%
+ \or\gim@print{400}{\hebtav}%
+ \or\hebtav\@gim@prevtrue\gim@print{500}{\hebqof}%
+ \or\hebtav\@gim@prevtrue\gim@print{600}{\hebresh}%
+ \or\hebtav\@gim@prevtrue\gim@print{700}{\hebshin}%
+ \or\hebtav\@gim@prevtrue\gim@print{800}{\hebtav}%
+ \or\hebtav\@gim@prevtrue\hebtav\gim@print{900}{\hebqof}%
+ \fi
+% \end{macrocode}
+% Find the tens digit. The numbers 15 and 16 are traditionally
+% printed as tet-vav ($9+6$) and tet-zayin ($9+7$) to avoid
+% spelling the Lord's name.
+% \begin{macrocode}
+ \@tempcntb=\@tempcnta\divide\@tempcntb by 10\relax % tens digit
+ \ifcase\@tempcntb % print nothing if no tens
+ \or % number between 10 and 19
+ \ifnum\@tempcnta = 16 \gim@print {9}{\hebtet}% tet-zayin
+ \else\ifnum\@tempcnta = 15 \gim@print {9}{\hebtet}% tet-vav
+ \else \gim@print{10}{\hebyod}%
+ \fi % \@tempcnta = 15
+ \fi % \@tempcnta = 16
+% \end{macrocode}
+% Initial or final forms are selected according to the current
+% style option; |\gim@print| will force a non-final letter in
+% non-final position by means of a local style change.
+% \begin{macrocode}
+ \or\gim@print{20}{\if@gim@final\hebfinalkaf\else\hebkaf\fi}%
+ \or\gim@print{30}{\heblamed}%
+ \or\gim@print{40}{\if@gim@final\hebfinalmem\else\hebmem\fi}%
+ \or\gim@print{50}{\if@gim@final\hebfinalnun\else\hebnun\fi}%
+ \or\gim@print{60}{\hebsamekh}%
+ \or\gim@print{70}{\hebayin}%
+ \or\gim@print{80}{\if@gim@final\hebfinalpe\else\hebpe\fi}%
+ \or\gim@print{90}{\if@gim@final\hebfinaltsadi\else\hebtsadi\fi}%
+ \fi
+% \end{macrocode}
+% Print the ones digit.
+% \begin{macrocode}
+ \ifcase\@tempcnta % print nothing if no ones
+ \or\gim@print{1}{\hebalef}%
+ \or\gim@print{2}{\hebbet}%
+ \or\gim@print{3}{\hebgimel}%
+ \or\gim@print{4}{\hebdalet}%
+ \or\gim@print{5}{\hebhe}%
+ \or\gim@print{6}{\hebvav}%
+ \or\gim@print{7}{\hebzayin}%
+ \or\gim@print{8}{\hebhet}%
+ \or\gim@print{9}{\hebtet}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\gim@print}
+% \begin{macro}{\if@gim@prev}
+% The actual printing routine typesets a digit with the appropriate
+% apostrophes: if a number sequence consists of a
+% single letter then it is followed by a single apostrophe, and if
+% it consists of more than one letter then a double
+% apostrophe is inserted before the last letter.
+% We typeset the letters one at a time, keeping a flag that tells
+% us if any previous letters had been typeset.
+% \begin{macrocode}
+\newif\if@gim@prev % flag if a previous letter has been typeset
+% \end{macrocode}
+% For each letter, we
+% first subtract its value from the total. Then,
+% \begin{itemize}
+% \item
+% if the result is zero then this is the last letter; we check
+% the flag to see if this is the only letter and print it with
+% the appropriate apostrophe;
+% \item
+% if the result is not zero then there remain additional letters
+% to be typeset; we print without an apostrophe and set the
+% `previous letter' flag.
+% \end{itemize}
+% |\@tempcnta| holds the total value that remains to be typeset.
+% We first deduct the letter's value from |\@tempcnta|,
+% so |\@tempcnta| is zero if and only if this is the last letter.
+% \begin{macrocode}
+\newcommand*{\gim@print}[2]{% #2 is a letter, #1 is its value.
+ \advance\@tempcnta by -#1\relax% deduct the value from the remainder
+% \end{macrocode}
+% If this is the last letter, we print with the appropriate
+% apostrophe (depending on the style option):
+% if there is a preceding letter, print |"x| if the style calls for
+% apostrophes, |x| if it doesn't;
+% otherwise, this is the only letter: print |x'| if the style calls
+% for apostrophes, |x| if it doesn't.
+% \begin{macrocode}
+ \ifnum\@tempcnta=0% if this is the last letter
+ \if@gim@prev\if@gim@apost"\fi#2%
+ \else#2\if@gim@apost'\fi\fi%
+% \end{macrocode}
+% If this is not the last letter: print a non-final form (by
+% forcing a local style option) and set the `previous letter' flag.
+% \begin{macrocode}
+ \else{\@gim@finalfalse#2}\@gim@prevtrue\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\hebr}
+% \begin{macro}{\gim}
+% The older Hebrew counter commands |\hebr| and |\gim| are retained
+% in order to keep older documents from breaking. They are set to
+% be equivalent to |\alph|, and their use is deprecated. Note that
+% |\hebr| gives different results than it had in the past---it
+% now typesets 11 as yod-alef rather than kaf.
+% \begin{macrocode}
+\let\hebr=\alph
+\let\gim=\alph
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% For backward compatibility with `older' \pkg{hebrew.sty}
+% packages, we define Hebrew equivalents of some useful \LaTeX\
+% commands. Note, however, that 8-bit macros defined in Hebrew
+% are no longer supported.
+% \begin{macrocode}
+\def\hebcopy{\protect\R{\hebhe\hebayin\hebtav\hebqof}}
+\def\hebincl{\protect\R{\hebresh\hebtsadi"\hebbet}}
+\def\hebpage{\protect\R{\hebayin\hebmem\hebvav\hebdalet}}
+\def\hebto{\protect\R{\hebayin\hebdalet}}
+% \end{macrocode}
+% |\hadgesh| produce ``poor man's bold'' (heavy printout), when
+% used with normal font glyphs. It is advisable to use bold font
+% (for example, \emph{Dead Sea}) instead of this macro.
+% \begin{macrocode}
+\def\hadgesh#1{\leavevmode\setbox0=\hbox{#1}%
+ \kern-.025em\copy0\kern-\wd0
+ \kern.05em\copy0\kern-\wd0
+ \kern-.025em\raise.0433em\box0 }
+% \end{macrocode}
+% |\piska| and |\piskapiska| sometimes used in `older' hebrew
+% sources, and should not be used in \LaTeXe.
+% \begin{macrocode}
+\if@compatibility
+ \def\piska#1{\item{#1}\hangindent=-\hangindent}
+ \def\piskapiska#1{\itemitem{#1}\hangindent=-\hangindent}
+\fi
+% \end{macrocode}
+% The following commands are simply synonyms for the standard ones,
+% provided with \LaTeXe.
+% \begin{macrocode}
+\let\makafgadol=\textendash
+\let\makafanak=\textemdash
+\let\geresh=\textquoteright
+\let\opengeresh=\textquoteright
+\let\closegeresh=\textquoteleft
+\let\openquote=\textquotedblright
+\let\closequote=\textquotedblleft
+\let\leftquotation=\textquotedblright
+\let\rightquotation=\textquotedblleft
+% \end{macrocode}
+%
+% We need to ensure that Hebrew is used as the default
+% right-to-left language at |\begin{document}|. The mechanism of
+% defining the |\@rllanguagename| is the same as in \babel 's
+% |\languagename|: the last right-to-left language in the
+% |\usepackage{babel}| line is set as the default right-to-left
+% language at document beginning.
+%
+% For example, the following code:
+% \begin{quote}
+% |\usepackage[russian,hebrew,arabic,greek,english]{babel}|
+% \end{quote}
+% will set the Arabic language as the default right-to-left
+% language and the English language as the default language.
+% As a result, the commands |\L{}| and |\embox{}| will use English
+% and |\R{}| and |\hmbox{}| will use Arabic by default. These
+% defaults can be changed with the next |\sethebrew| or
+% |\selectlanguage{|\emph{language name}|}| command.
+% \begin{macrocode}
+\AtBeginDocument{\def\@rllanguagename{hebrew}}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a configuration
+% file, setting the main language to be switched on at
+% |\begin{document}| and resetting the category code of |@| to its
+% original value.
+% \begin{macrocode}
+\ldf@finish{hebrew}
+%</hebrew>
+% \end{macrocode}
+%
+% \subsection{Right to left support}
+%
+% This file \pkg{rlbabel.def} defines necessary bidirectional macro
+% support for \LaTeXe. It is designed for use not only with Hebrew,
+% but with any Right-to-Left languages, supported by \babel. The
+% macros provided in this file are language and encoding
+% independent.
+%
+% Right-to-left languages will use \TeX\ extensions, namely \TeX\
+% primitives |\beginL|, |\endL| and |\beginR|, |\endR|, currently
+% implemented only in $\varepsilon$-\TeX\ and in \TeX{-}{-}\XeT.
+%
+% If $\varepsilon$-\TeX\ is used, we should switch it to the
+% \emph{enhanced} mode:
+% \begin{macrocode}
+%<*rightleft>
+\ifx\TeXXeTstate\undefined\else%
+ \TeXXeTstate=1
+\fi
+% \end{macrocode}
+%
+% Note, that $\varepsilon$-\TeX 's format file should be created
+% for \emph{extended} mode. Mode can be checked by running
+% $\varepsilon$-\TeX\ on some \TeX{} file, for example:
+% \begin{quote}
+% |This is e-TeX, Version 3.14159-1.1 (Web2c 7.0)|\\
+% |entering extended mode|
+% \end{quote}
+% The second line should be \texttt{entering extended mode}.
+%
+% We check if user uses Right-to-Left enabled engine instead of
+% regular Knuth's \TeX:
+% \begin{macrocode}
+\ifx\beginL\@undefined%
+ \newlinechar`\^^J
+ \typeout{^^JTo avoid this error message,^^J%
+ run TeX--XeT or e-TeX engine instead of regular TeX.^^J}
+ \errmessage{Right-to-Left Support Error: use TeX--XeT or e-TeX
+ engine}%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Switching from LR to RL mode and back}
+%
+% \cs{@torl} and \cs{@fromrl} are called each time the horizontal
+% direction changes. They do all that is necessary besides changing
+% the direction. Currently their task is to change the encoding
+% information and mode (condition \cs{if@rl}). They should not
+% normally be called by users: user-level macros, such as
+% \cs{sethebrew} and \cs{unsethebrew}, as well as \babel 's
+% \cs{selectlanguage} are defined in language-definition files and
+% should be used to change default language (and direction).
+%
+% Local direction changing commands (for small pieces of text):
+% |\L{}|, |\R{}|, |\embox{}| and |\hmbox{}| are defined below in
+% this file in language-independent manner.
+%
+% \begin{macro}{\if@rl}
+% \begin{description}\scrunch
+% \item[|\@rltrue|] means that the main mode is currently
+% Right-to-Left.
+% \item[|\@rlfalse|] means that the main mode is currently
+% Left-to-Right.
+% \end{description}
+% \begin{macrocode}
+\newif\if@rl
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@rlmain}
+% This is the main direction of the document. Unlike |\if@rl|
+% it is set once and never changes.
+% \begin{description}\scrunch
+% \item[|\@rltrue|] means that the document is Right-to-Left.
+% \item[|\@rlfalse|] means that the document is Left-to-Right.
+% \end{description}
+% Practically |\if@rlmain| is set according to the value of |\if@rl|
+% in the beginning of the run.
+% \begin{macrocode}
+\AtBeginDocument{% Here we set the main document direction
+ \newif\if@rlmain%
+ \if@rl% e.g: if the options to babel were [english,hebrew]
+ \@rlmaintrue%
+ \else% e.g: if the options to babel were [hebrew,english]
+ \@rlmainfalse%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@torl}
+% Switches current direction to Right-to-Left: saves current
+% Left-to-Right encoding in |\lr@encodingdefault|, sets required
+% Right-to-Left language name in |\@rllanguagename| (similar to
+% \babel 's |\languagename|) and changes derection.
+%
+% The Right-to-Left language encoding should be defined in |.ldf|
+% file as special macro created by concatenation of the language
+% name and string \texttt{encoding}, for example, for Hebrew it
+% will be |\hebrewencoding|.
+% \begin{macrocode}
+\DeclareRobustCommand{\@torl}[1]{%
+ \if@rl\else%
+ \let\lr@encodingdefault=\encodingdefault%
+ \fi%
+ \def\@rllanguagename{#1}%
+ \def\encodingdefault{\csname#1encoding\endcsname}%
+ \fontencoding{\encodingdefault}%
+ \selectfont%
+ \@rltrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@fromrl}
+% Opposite to |\@torl|, switches current direction to
+% Left-to-Right: restores saved Left-to-Right encoding
+% (|\lr@encodingdefault|) and changes direction.
+% \begin{macrocode}
+\DeclareRobustCommand{\@fromrl}{%
+ \if@rl%
+ \let\encodingdefault=\lr@encodingdefault%
+ \fi%
+ \fontencoding{\encodingdefault}%
+ \selectfont%
+ \@rlfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\selectlanguage}
+% This standard \babel 's macro should be redefined to support
+% bidirectional tables. We divide |\selectlanguage| implementation
+% to two parts, and the first part calls the second
+% |\@@selectlanguage|.
+% \begin{macrocode}
+\expandafter\def\csname selectlanguage \endcsname#1{%
+ \edef\languagename{%
+ \ifnum\escapechar=\expandafter`\string#1\@empty
+ \else \string#1\@empty\fi}%
+ \@@selectlanguage{\languagename}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@selectlanguage}
+% This new internal macro redefines a final part of the standard
+% \babel 's |\select|\-|language| implementation.
+%
+% Standard \LaTeX\ provides us with 3 tables: Table of Contents
+% (|.toc|), List of Figures (|.lof|), and List of Tables
+% (|.lot|). In multi-lingual texts mixing Left-to-Right languages
+% with Right-to-Left ones, the use of various directions in one
+% table results in very ugly output. Therefore, these 3 standard
+% tables will be used now only for Left-to-Right languages, and we
+% will add 3 Right-to-Left tables (their extensions are simply
+% reversed ones): RL Table of Contents (|.cot|), RL List of Figures
+% (|.fol|), and RL List of Tables (|.lof|).
+% \begin{macrocode}
+\def\@@selectlanguage#1{%
+ \select@language{#1}%
+ \if@filesw
+ \protected@write\@auxout{}{\string\select@language{#1}}%
+ \if@rl%
+ \addtocontents{cot}{\xstring\select@language{#1}}%
+ \addtocontents{fol}{\xstring\select@language{#1}}%
+ \addtocontents{tol}{\xstring\select@language{#1}}%
+ \else%
+ \addtocontents{toc}{\xstring\select@language{#1}}%
+ \addtocontents{lof}{\xstring\select@language{#1}}%
+ \addtocontents{lot}{\xstring\select@language{#1}}%
+ \fi%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setrllanguage}
+% \begin{macro}{\unsetrllanguage}
+% The |\setrllanguage| and |\unsetrllanguage| pair of macros is
+% proved to very useful in bilingual texts, for example, in
+% Hebrew-English texts. The language-specific commands, for example,
+% |\sethebrew| and |\unsethebrew| use these macros as basis.
+%
+% Implementation saves and restores other language in
+% |\other@languagename| variable, and uses internal macro
+% |\@@selectlanguage|, defined above, to switch between languages.
+% \begin{macrocode}
+\let\other@languagename=\languagename
+\DeclareRobustCommand{\setrllanguage}[1]{%
+ \if@rl\else%
+ \let\other@languagename=\languagename%
+ \fi%
+ \def\languagename{#1}%
+ \@@selectlanguage{\languagename}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\unsetrllanguage}[1]{%
+ \if@rl%
+ \let\languagename=\other@languagename%
+ \fi
+ \@@selectlanguage{\languagename}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\L}
+% \begin{macro}{\R}
+% \begin{macro}{\HeblatexRedefineL}
+% Macros for changing direction, originally taken from TUGboat.
+% Usage: |\L{|\emph{Left to Right text}|}| and |\R{|\emph{Right to
+% Left text}|}|. Numbers should also be enclosed in |\L{}|, as in
+% |\L{123}|.
+%
+% Note, that these macros do not receive language name as
+% parameter. Instead, the saved |\@rllanguagename| will be
+% used. We assume that each Right-to-Left language defines
+% |\to|\emph{languagename} and |\from|\emph{languagename} macros in
+% language definition file, for example, for Hebrew: |\tohebrew|
+% and |\fromhebrew| macros in \pkg{hebrew.ldf} file.
+%
+% The macros \cs{L} and \cs{R} include `protect' to to make them robust and
+% allow use, for example, in tables.
+%
+% Due to the fact that some packages have different definitions for \cs{L}
+% the macro |\HeblatexRedefineL| is provided to overide them. This may
+% be required with hyperref, for instance.
+% \begin{macrocode}
+\let\next=\
+\def\HeblatexRedefineL{%
+ \def\L{\protect\pL}%
+}
+\HeblatexRedefineL
+\def\pL{\protect\afterassignment\moreL \let\next= }
+\def\moreL{\bracetext \aftergroup\endL \beginL\csname
+ from\@rllanguagename\endcsname}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\R{\protect\pR}
+\def\pR{\protect\afterassignment\moreR \let\next= }
+\def\moreR{\bracetext \aftergroup\endR \beginR\csname
+ to\@rllanguagename\endcsname}
+\def\bracetext{\ifcat\next{\else\ifcat\next}\fi
+ \errmessage{Missing left brace has been substituted}\fi \bgroup}
+\everydisplay{\if@rl\aftergroup\beginR\fi }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@ensure@R}
+% \begin{macro}{\@ensure@L}
+% Two small internal macros, a-la |\ensuremath|
+% \begin{macrocode}
+\def\@ensure@R#1{\if@rl#1\else\R{#1}\fi}
+\def\@ensure@L#1{\if@rl\L{#1}\else#1\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Take care of Right-to-Left indentation in every paragraph.
+% Originally, \cs{noindent} was redefined for right-to-left by
+% Yaniv Bargury, then the implementation was rewritten by Alon Ziv
+% using an idea by Chris Rowley: \cs{noindent} now works
+% unmodified.
+% \begin{macrocode}
+\def\rl@everypar{\if@rl{\setbox\z@\lastbox\beginR\usebox\z@}\fi}
+\let\o@everypar=\everypar
+\def\everypar#1{\o@everypar{\rl@everypar#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\hmbox}
+% \begin{macro}{\embox}
+% Useful vbox commands. All text in math formulas is best enclosed
+% in these: LR text in |\embox| and RL text in |\hmbox|. |\mbox{}|
+% is useless for both cases, since it typesets in Left-to-Right
+% even for Right-to-Left languages (additions by Yaniv Bargury).
+% \begin{macrocode}
+\newcommand{\hmbox}[1]{\mbox{\R{#1}}}
+\newcommand{\embox}[1]{\mbox{\L{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@brackets}
+% When in Right-to-Left mode, brackets should be swapped. This
+% macro receives 3 parameters: left bracket, content, right
+% bracket. Brackets can be square brackets, braces, or
+% parentheses.
+% \begin{macrocode}
+\def\@brackets#1#2#3{\protect\if@rl #3#2#1\protect\else
+ #1#2#3\protect\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@number}
+% \begin{macro}{\@latin}
+% \cs{@number} preserves numbers direction from Left to Right.
+% \cs{@latin} in addition switches current encoding to the latin.
+% \begin{macrocode}
+\def\@@number#1{\ifmmode\else\beginL\fi#1\ifmmode\else\endL\fi}
+\def\@@latin#1{\@@number{{\@fromrl#1}}}
+\def\@number{\protect\@@number}
+\def\@latin{\protect\@@latin}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Counters}
+%
+% To make counter references work in Right to Left text, we need
+% to surround their original definitions with an
+% |\@number{|\ldots|}| or |\@latin{|\ldots|}|. Note, that
+% language-specific counters, such as \cs{hebr} or \cs{gim} are
+% provided with language definition file.
+%
+% We start with saving the original definitions:
+% \begin{macrocode}
+\let\@@arabic=\@arabic
+\let\@@roman=\@roman
+\let\@@Roman=\@Roman
+\let\@@alph=\@alph
+\let\@@Alph=\@Alph
+% \end{macrocode}
+%
+% \begin{macro}{\@arabic}
+% \begin{macro}{\@roman}
+% \begin{macro}{\@Roman}
+% Arabic and roman numbers should be from Left to Right. In
+% addition, roman numerals, both lower- and upper-case should be in
+% latin encoding.
+% \begin{macrocode}
+\def\@arabic#1{\@number{\@@arabic#1}}
+\def\@roman#1{\@latin{\@@roman#1}}
+\def\@Roman#1{\@latin{\@@Roman#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\arabicnorl}
+% This macro preserves the original definition of |\arabic|
+% (overrides the overriding of |\@arabic|)
+% \begin{macrocode}
+\def\arabicnorl#1{\expandafter\@@arabic\csname c@#1\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make@lr}
+% In Right to Left documents all counters defined in the standard
+% document classes \emph{article}, \emph{report} and \emph{book}
+% provided with \LaTeXe, such as |\thesection|, |\thefigure|,
+% |\theequation| should be typed as numbers from left to right. To
+% ensure direction, we use the following
+% |\make@lr{|\emph{counter}|}| macro:
+% \begin{macrocode}
+\def\make@lr#1{\begingroup
+ \toks@=\expandafter{#1}%
+ \edef\x{\endgroup
+ \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
+ \x}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{%
+ \@ifclassloaded{slides}{}{%
+ \make@lr\thesection
+ \make@lr\thesubsection
+ \make@lr\thesubsubsection
+ \make@lr\theparagraph
+ \make@lr\thesubparagraph
+ \make@lr\thefigure
+ \make@lr\thetable
+ }
+ \make@lr\theequation
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Preserving logos}
+%
+% Preserve \TeX, \LaTeX\ and \LaTeXe\ logos.
+% \begin{macro}{\TeX}
+% \begin{macrocode}
+\let\@@TeX\TeX
+\def\TeX{\@latin{\@@TeX}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LaTeX}
+% \begin{macrocode}
+\let\@@LaTeX\LaTeX
+\def\LaTeX{\@latin{\@@LaTeX}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LaTeXe}
+% \begin{macrocode}
+\let\@@LaTeXe\LaTeXe
+\def\LaTeXe{\@latin{\@@LaTeXe}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{List environments}
+%
+% List environments in Right-to-Left languages, are ticked and
+% indented from the right instead of from the left. All the
+% definitions that caused indentation are revised for Right-to-Left
+% languages. \LaTeX\ keeps track on the indentation with the
+% \cs{leftmargin} and \cs{rightmargin} values.
+%
+% \begin{macro}{list}
+% Thus we need to override the definition of the |\list| macro: when
+% in RTL mode, the right margins are the begining of the line.
+% \begin{macrocode}
+\def\list#1#2{%
+ \ifnum \@listdepth >5\relax
+ \@toodeep
+ \else
+ \global\advance\@listdepth\@ne
+ \fi
+ \rightmargin\z@
+ \listparindent\z@
+ \itemindent\z@
+ \csname @list\romannumeral\the\@listdepth\endcsname
+ \def\@itemlabel{#1}%
+ \let\makelabel\@mklab
+ \@nmbrlistfalse
+ #2\relax
+ \@trivlist
+ \parskip\parsep
+ \parindent\listparindent
+ \advance\linewidth -\rightmargin
+ \advance\linewidth -\leftmargin
+% \end{macrocode}
+% The only change in the macro is the |\if@rl| case:
+% \begin{macrocode}
+ \if@rl
+ \advance\@totalleftmargin \rightmargin
+ \else
+ \advance\@totalleftmargin \leftmargin
+ \fi
+ \parshape \@ne \@totalleftmargin \linewidth
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\labelenumii}
+% \begin{macro}{\p@enumiii}
+% The \cs{labelenumii} and \cs{p@enumiii} commands use
+% \emph{parentheses}. They are revised to work Right-to-Left with
+% the help of \cs{@brackets} macro defined above.
+% \begin{macrocode}
+\def\labelenumii{\@brackets(\theenumii)}
+\def\p@enumiii{\p@enumii\@brackets(\theenumii)}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Tables of moving stuff}
+%
+% Tables of moving arguments: table of contents (|toc|), list of
+% figures (|lof|) and list of tables (|lot|) are handles here. These
+% three default \LaTeX\ tables will be used now exclusively for
+% Left to Right stuff.
+%
+% Three additional Right-to-Left tables: RL table of contents
+% (|cot|), RL list of figures (|fol|), and RL list of tables
+% (|tol|) are added.
+% These three tables will be used exclusively for Right to
+% Left stuff.
+%
+% \begin{macro}{\@tableofcontents}
+% \begin{macro}{\@listoffigures}
+% \begin{macro}{\@listoftables}
+% We define 3 new macros similar to the standard \LaTeX\ tables,
+% but with one parameter --- table file extension. These macros
+% will help us to define our additional tables below.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{% other
+\@ifclassloaded{slides}{}{% other
+ \@ifclassloaded{article}{% article
+ \newcommand\@tableofcontents[1]{%
+ \section*{\contentsname\@mkboth%
+ {\MakeUppercase\contentsname}%
+ {\MakeUppercase\contentsname}}%
+ \@starttoc{#1}}
+ \newcommand\@listoffigures[1]{%
+ \section*{\listfigurename\@mkboth%
+ {\MakeUppercase\listfigurename}%
+ {\MakeUppercase\listfigurename}}%
+ \@starttoc{#1}}
+ \newcommand\@listoftables[1]{%
+ \section*{\listtablename\@mkboth%
+ {\MakeUppercase\listtablename}%
+ {\MakeUppercase\listtablename}}%
+ \@starttoc{#1}}}%
+ {% else report or book
+ \newcommand\@tableofcontents[1]{%
+ \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn%
+ \fi\chapter*{\contentsname\@mkboth%
+ {\MakeUppercase\contentsname}%
+ {\MakeUppercase\contentsname}}%
+ \@starttoc{#1}\if@restonecol\twocolumn\fi}
+ \newcommand\@listoffigures[1]{%
+ \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn%
+ \fi\chapter*{\listfigurename\@mkboth%
+ {\MakeUppercase\listfigurename}%
+ {\MakeUppercase\listfigurename}}%
+ \@starttoc{#1}\if@restonecol\twocolumn\fi}
+ \newcommand\@listoftables[1]{%
+ \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi%
+ \chapter*{\listtablename\@mkboth%
+ {\MakeUppercase\listtablename}%
+ {\MakeUppercase\listtablename}}%
+ \@starttoc{#1}\if@restonecol\twocolumn\fi}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\lrtableofcontents}
+% \begin{macro}{\lrlistoffigures}
+% \begin{macro}{\lrlistoftables}
+% Left-to-Right tables are called now |\lr|\emph{xxx} and defined
+% with the aid of three macros defined above (extensions |toc|,
+% |lof|, and |lot|).
+% \begin{macrocode}
+ \newcommand\lrtableofcontents{\@tableofcontents{toc}}%
+ \newcommand\lrlistoffigures{\@listoffigures{lof}}%
+ \newcommand\lrlistoftables{\@listoftables{lot}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\rltableofcontents}
+% \begin{macro}{\rllistoffigures}
+% \begin{macro}{\rllistoftables}
+% Right-to-Left tables will be called |\rl|\emph{xxx} and defined
+% with the aid of three macros defined above (extensions |cot|,
+% |fol|, and |tol|).
+% \begin{macrocode}
+ \newcommand\rltableofcontents{\@tableofcontents{cot}}%
+ \newcommand\rllistoffigures{\@listoffigures{fol}}%
+ \newcommand\rllistoftables{\@listoftables{tol}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tableofcontents}
+% \begin{macro}{\listoffigures}
+% \begin{macro}{\listoftables}
+% Let |\|\emph{xxx} be |\rl|\emph{xxx} if the current direction is
+% Right-to-Left and |\lr|\emph{xxx} if it is Left-to-Right.
+% \begin{macrocode}
+ \renewcommand\tableofcontents{\if@rl\rltableofcontents%
+ \else\lrtableofcontents\fi}
+ \renewcommand\listoffigures{\if@rl\rllistoffigures%
+ \else\lrlistoffigures\fi}
+ \renewcommand\listoftables{\if@rl\rllistoftables%
+ \else\lrlistoftables\fi}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@dottedtocline}
+% The following makes problems when making a Right-to-Left tables,
+% since it uses \cs{leftskip} and \cs{rightskip} which are both
+% mode dependent.
+% \begin{macrocode}
+\def\@dottedtocline#1#2#3#4#5{%
+ \ifnum #1>\c@tocdepth \else
+ \vskip \z@ \@plus.2\p@
+ {\if@rl\rightskip\else\leftskip\fi #2\relax
+ \if@rl\leftskip\else\rightskip\fi \@tocrmarg \parfillskip
+ -\if@rl\leftskip\else\rightskip\fi
+ \parindent #2\relax\@afterindenttrue
+ \interlinepenalty\@M
+ \leavevmode
+ \@tempdima #3\relax
+ \advance\if@rl\rightskip\else\leftskip\fi \@tempdima
+ \null\nobreak\hskip -\if@rl\rightskip\else\leftskip\fi
+ {#4}\nobreak
+ \leaders\hbox{$\m@th
+ \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
+ mu$}\hfill
+ \nobreak
+ \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor \beginL#5\endL}%
+ \par}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@part}
+% This standard macro was redefined for table of contents since it
+% uses \cs{rightskip} which is mode dependent.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{% other
+\@ifclassloaded{slides}{}{% other
+\renewcommand*\l@part[2]{%
+ \ifnum \c@tocdepth >-2\relax
+ \addpenalty{-\@highpenalty}%
+ \addvspace{2.25em \@plus\p@}%
+ \begingroup
+ \setlength\@tempdima{3em}%
+ \parindent \z@ \if@rl\leftskip\else\rightskip\fi \@pnumwidth
+ \parfillskip -\@pnumwidth
+ {\leavevmode
+ \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss#2}}\par
+ \nobreak
+ \global\@nobreaktrue
+ \everypar{\global\@nobreakfalse\everypar{}}%
+ \endgroup
+ \fi}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@part}
+% Part is redefined to support new Right-to-Left table of contents
+% (|cot|) as well as the Left-to-Right one (|toc|).
+% \begin{macrocode}
+\@ifclassloaded{article}{% article class
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \addcontentsline{cot}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \addcontentsline{cot}{part}{#1}%
+ \fi
+ {\parindent \z@ \raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \Large\bfseries \partname~\thepart
+ \par\nobreak
+ \fi
+ \huge \bfseries #2%
+ \markboth{}{}\par}%
+ \nobreak
+ \vskip 3ex
+ \@afterheading}%
+}{% report and book classes
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \addcontentsline{cot}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \addcontentsline{cot}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \partname~\thepart
+ \par
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\par}%
+ \@endpart}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sect}
+% Section was redefined from the \pkg{latex.ltx} file. It is
+% changed to support both Left-to-Right (|toc|) and Right-to-Left
+% (|cot|) table of contents simultaneously.
+% \begin{macrocode}
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M #8\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ #7}%
+ \addcontentsline{cot}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec #8}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ #7}%
+ \addcontentsline{cot}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@caption}
+% Caption was redefined from the \pkg{latex.ltx} file. It is
+% changed to support Left-to-Right list of figures and list of
+% tables (|lof| and |lot|) as well as new Right-to-Left lists
+% (|fol| and |tol|) simultaneously.
+% \begin{macrocode}
+\long\def\@caption#1[#2]#3{%
+ \par
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}%
+ \def\@fignm{figure}
+ \ifx#1\@fignm\addcontentsline{fol}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}\fi%
+ \def\@tblnm{table}
+ \ifx#1\@tblnm\addcontentsline{tol}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}\fi%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@chapter}
+% This standard macro was redefined for table of contents since it
+% uses \cs{rightskip} which is mode dependent.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{%
+\@ifclassloaded{slides}{}{%
+ \@ifclassloaded{article}{}{%
+ \renewcommand*\l@chapter[2]{%
+ \ifnum \c@tocdepth >\m@ne
+ \addpenalty{-\@highpenalty}%
+ \vskip 1.0em \@plus\p@
+ \setlength\@tempdima{1.5em}%
+ \begingroup
+ \parindent \z@ \if@rl\leftskip\else\rightskip\fi \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode \bfseries
+ \advance\if@rl\rightskip\else\leftskip\fi\@tempdima
+ \hskip -\if@rl\rightskip\else\leftskip\fi
+ #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss#2}\par
+ \penalty\@highpenalty
+ \endgroup
+ \fi}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@section}
+% \begin{macro}{\l@subsection}
+% \begin{macro}{\l@subsubsection}
+% \begin{macro}{\l@paragraph}
+% \begin{macro}{\l@subparagraph}
+% The toc entry for section did not work in article style.
+% Also it does not print dots, which is funny when most of your
+% work is divided into sections.
+%
+% It was revised to use |\@dottedtocline| as in \pkg{report.sty}
+% (by Yaniv Bargury) and was updated later for all kinds of
+% sections (by Boris Lavva).
+% \begin{macrocode}
+\@ifclassloaded{article}{%
+\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
+\renewcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
+\renewcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
+\renewcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Two-column mode}
+%
+% This is the support of \texttt{twocolumn} option for the standard
+% \LaTeXe\ classes.
+% The following code was originally borrowed from the Arab\TeX\
+% package, file \pkg{latexext.sty}, copyright by Klaus Lagally,
+% Institut fuer Informatik, Universitaet Stuttgart. It was updated
+% for this package by Boris Lavva.
+%
+% \begin{macro}{\@outputdblcol}
+% \begin{macro}{\set@outputdblcol}
+% \begin{macro}{rl@outputdblcol}
+% First column is \cs{@leftcolumn} will be shown at the right side,
+% Second column is \cs{@outputbox} will be shown at the left side.
+%
+% |\set@outputdblcol| IS CURRENTLY DISABLED. TODO: REMOVE IT [tzafrir]
+% \begin{macrocode}
+\let\@@outputdblcol\@outputdblcol
+%\def\set@outputdblcol{%
+% \if@rl\renewcommand{\@outputdblcol}{\rl@outputdblcol}%
+% \else\renewcommand{\@outputdblcol}{\@@outputdblcol}\fi}
+\renewcommand{\@outputdblcol}{%
+ \if@rlmain%
+ \rl@outputdblcol%
+ \else%
+ \@@outputdblcol%
+ \fi%
+}
+\newcommand{\rl@outputdblcol}{%
+ \if@firstcolumn
+ \global \@firstcolumnfalse
+ \global \setbox\@leftcolumn \box\@outputbox
+ \else
+ \global \@firstcolumntrue
+ \setbox\@outputbox \vbox {\hb@xt@\textwidth {%
+ \hskip\columnwidth%
+ \hfil\vrule\@width\columnseprule\hfil
+ \hb@xt@\columnwidth {%
+ \box\@leftcolumn \hss}%
+ \hb@xt@\columnwidth {%
+ \hskip-\textwidth%
+ \box\@outputbox \hss}%
+ \hskip\columnsep%
+ \hskip\columnwidth}}%
+ \@combinedblfloats
+ \@outputpage
+ \begingroup
+ \@dblfloatplacement
+ \@startdblcolumn
+ \@whilesw\if@fcolmade \fi
+ {\@outputpage
+ \@startdblcolumn}%
+ \endgroup
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Footnotes}
+%
+% \begin{macro}{\footnoterule}
+% The Right-to-Left footnote rule is simply reversed default
+% Left-to-Right one. Footnotes can be used in RL or LR main
+% modes, but changing mode while a footnote is pending is still
+% unsolved.
+% \begin{macrocode}
+\let\@@footnoterule=\footnoterule
+\def\footnoterule{\if@rl\hb@xt@\hsize{\hss\vbox{\@@footnoterule}}%
+ \else\@@footnoterule\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Headings and two-side support}
+%
+% When using \texttt{headings} or \texttt{myheadings} modes, we
+% have to ensure that the language and direction of heading is the
+% same as the whole chapter/part of the document. This is
+% implementing by setting special variable \cs{headlanguage} when
+% starting new chapter/part.
+%
+% In addition, when selecting the \texttt{twoside} option (default in
+% \texttt{book} document class), the LR and RL modes need to be set
+% properly for things on the heading and footing. This is done
+% here too.
+%
+% \begin{macro}{ps@headings}
+% \begin{macro}{ps@myheadings}
+% \begin{macro}{headeven}
+% \begin{macro}{headodd}
+% First, we will support the standard \pkg{letter} class:
+% \begin{macrocode}
+\@ifclassloaded{letter}{%
+ \def\headodd{\protect\if@rl\beginR\fi\headtoname{}
+ \ignorespaces\toname
+ \hfil \@date
+ \hfil \pagename{} \thepage\protect\if@rl\endR\fi}
+ \if@twoside
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@oddhead{\select@language{\headlanguage}\headodd}
+ \let\@evenhead\@oddhead}
+ \else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\select@language{\headlanguage}\headodd}}
+ \fi
+ \def\headfirst{\protect\if@rl\beginR\fi\fromlocation \hfill %
+ \telephonenum\protect\if@rl\endR\fi}
+ \def\ps@firstpage{%
+ \let\@oddhead\@empty
+ \def\@oddfoot{\raisebox{-45\p@}[\z@]{%
+ \hb@xt@\textwidth{\hspace*{100\p@}%
+ \ifcase \@ptsize\relax
+ \normalsize
+ \or
+ \small
+ \or
+ \footnotesize
+ \fi
+ \select@language{\headlanguage}\headfirst}}\hss}}
+%
+ \renewcommand{\opening}[1]{%
+ \let\headlanguage=\languagename%
+ \ifx\@empty\fromaddress%
+ \thispagestyle{firstpage}%
+ {\raggedleft\@date\par}%
+ \else % home address
+ \thispagestyle{empty}%
+ {\raggedleft
+ \if@rl\begin{tabular}{@{\beginR\csname%
+ to\@rllanguagename\endcsname}r@{\endR}}\ignorespaces
+ \fromaddress \\*[2\parskip]%
+ \@date \end{tabular}\par%
+ \else\begin{tabular}{l}\ignorespaces
+ \fromaddress \\*[2\parskip]%
+ \@date \end{tabular}\par%
+ \fi}%
+ \fi
+ \vspace{2\parskip}%
+ {\raggedright \toname \\ \toaddress \par}%
+ \vspace{2\parskip}%
+ #1\par\nobreak}
+}
+% \end{macrocode}
+% Then, the \pkg{article}, \pkg{report} and \pkg{book} document
+% classes are supported. Note, that in one-sided mode
+% \cs{markright} was changed to \cs{markboth}.
+% \begin{macrocode}
+{% article, report, book
+ \def\headeven{\protect\if@rl\beginR\thepage\hfil\rightmark\endR
+ \protect\else\thepage\hfil{\slshape\leftmark}
+ \protect\fi}
+ \def\headodd{\protect\if@rl\beginR\leftmark\hfil\thepage\endR
+ \protect\else{\slshape\rightmark}\hfil\thepage
+ \protect\fi}
+ \@ifclassloaded{article}{% article
+ \if@twoside % two-sided
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\select@language{\headlanguage}\headeven}%
+ \def\@oddhead{\select@language{\headlanguage}\headodd}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection\quad
+ \fi
+ ##1}}{}}%
+ \def\subsectionmark##1{%
+ \markright{%
+ \ifnum \c@secnumdepth >\@ne
+ \thesubsection\quad
+ \fi
+ ##1}}}
+ \else % one-sided
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\headodd}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markboth{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \thesection\quad
+ \fi
+ ##1}}{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \thesection\quad
+ \fi
+ ##1}}}}
+ \fi
+%
+ \def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\select@language{\headlanguage}\headeven}%
+ \def\@oddhead{\select@language{\headlanguage}\headodd}%
+ \let\@mkboth\@gobbletwo
+ \let\sectionmark\@gobble
+ \let\subsectionmark\@gobble
+ }}{% report and book
+ \if@twoside % two-sided
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\select@language{\headlanguage}\headeven}
+ \def\@oddhead{\select@language{\headlanguage}\headodd}
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ %
+ \fi
+ ##1}}{}}%
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection. \ %
+ \fi
+ ##1}}}}
+ \else % one-sided
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\select@language{\headlanguage}\headodd}
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ %
+ \fi
+ ##1}}{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ %
+ \fi
+ ##1}}}}
+ \fi
+ \def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\select@language{\headlanguage}\headeven}%
+ \def\@oddhead{\select@language{\headlanguage}\headodd}%
+ \let\@mkboth\@gobbletwo
+ \let\chaptermark\@gobble
+ \let\sectionmark\@gobble
+ }}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Postscript Porblems}
+% Any command that is implemented by PostScript directives, e.g
+% commands from the ps-tricks package, needs to be fixed, because the
+% PostScript directives are being interpeted after the document has been
+% converted by \TeX to visual Hebrew (DVI, PostScript and PDF have visual
+% Hebrew).
+%
+% For instance: Suppose you wrote in your document:
+%
+% |\textcolor{cyan}{some ltr text}|
+%
+% This would be interpeted by \TeX to something like:
+%
+% |[postscript:make color cyan]some LTR text[postscript:make color black]|
+%
+%
+% However, with the bidirectionality support we get:
+%
+% |\textcolor{cyan}{\hebalef\hebbet}|
+%
+% Translated to:
+%
+% |[postscript:make color black]{bet}{alef}[postscript:make color cyan]|
+%
+% While we want:
+%
+% |[postscript:make color cyan]{bet}{alef}[postscript:make color black]|
+%
+% The following code will probably work at least with code that stays in the
+% same line:
+% \begin{macro}{@textcolor}
+% \begin{macrocode}
+\AtBeginDocument{%
+ %I assume that \@textcolor is only defined by the package color
+ \ifx\@textcolor\@undefined\else%
+ % If that macro was defined before the beginning of the document,
+ % that is: the package was loaded: redefine it with bidi support
+ \def\@textcolor#1#2#3{%
+ \if@rl%
+ \beginL\protect\leavevmode{\color#1{#2}\beginR#3\endR}\endL%
+ \else%
+ \protect\leavevmode{\color#1{#2}#3}%
+ \fi%
+ }%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\thetrueSlideCounter}
+% This macro probably needs to be overriden for when using |prosper|,
+% (waiting for feedback. Tzafrir)
+% \begin{macrocode}
+\@ifclassloaded{prosper}{%
+ \def\thetrueSlideCounter{\arabicnorl{trueSlideCounter}}
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Miscellaneous internal \LaTeX\ macros}
+%
+% \begin{macro}{\raggedright}
+% \begin{macro}{\raggedleft}
+% \cs{raggedright} was changed from \pkg{latex.ltx} file to support
+% Right-to-Left mode, because of the bug in its implementation.
+% \begin{macrocode}
+\def\raggedright{%
+ \let\\\@centercr
+ \leftskip\z@skip\rightskip\@flushglue
+ \parindent\z@\parfillskip\z@skip}
+% \end{macrocode}
+% Swap meanings of \cs{raggedright} and \cs{raggedleft} in
+% Right-to-Left mode.
+% \begin{macrocode}
+\let\@@raggedleft=\raggedleft
+\let\@@raggedright=\raggedright
+\renewcommand\raggedleft{\if@rl\@@raggedright%
+ \else\@@raggedleft\fi}
+\renewcommand\raggedright{\if@rl\@@raggedleft%
+ \else\@@raggedright\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\author}
+% \cs{author} is inserted with \texttt{tabular} environment, and
+% will be used in restricted horizontal mode. Therefore we have to
+% add explicit direction change command when in Right-to-Left
+% mode.
+% \begin{macrocode}
+\let\@@author=\author
+\renewcommand{\author}[1]{\@@author{\if@rl\beginR #1\endR\else #1\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeUppercase}
+% \begin{macro}{\MakeLowercase}
+% There are no uppercase and lowercase letters in most
+% Right-to-Left languages, therefore we should redefine
+% \cs{MakeUppercase} and \cs{MakeLowercase} \LaTeXe\ commands.
+% \begin{macrocode}
+\let\@@MakeUppercase=\MakeUppercase
+\def\MakeUppercase#1{\if@rl#1\else\@@MakeUppercase{#1}\fi}
+\let\@@MakeLowercase=\MakeLowercase
+\def\MakeLowercase#1{\if@rl#1\else\@@MakeLowercase{#1}\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\underline}
+% We should explicitly use \cs{L} and \cs{R} commands in
+% \cs{underline}d text.
+% \begin{macrocode}
+\let\@@@underline=\underline
+\def\underline#1{\@@@underline{\if@rl\R{#1}\else #1\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \cs{undertext} was added for \LaTeX 2.09 compatibility mode.
+% \begin{macrocode}
+\if@compatibility
+ \let\undertext=\underline
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\@xnthm}
+% \begin{macro}{\@opargbegintheorem}
+% The following has been inserted to correct the appearance of the
+% number in \cs{newtheorem} to reorder theorem number components. A
+% similar correction in the definition of \cs{@opargbegintheorem}
+% was added too.
+% \begin{macrocode}
+\def\@xnthm#1#2[#3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname
+ {\@definecounter{#1}\@addtoreset{#1}{#3}%
+ \expandafter\xdef\csname the#1\endcsname{\noexpand\@number
+ {\expandafter\noexpand\csname the#3\endcsname \@thmcountersep
+ \@thmcounter{#1}}}%
+ \global\@namedef{#1}{\@thm{#1}{#2}}%
+ \global\@namedef{end#1}{\@endtheorem}}}
+%
+\def\@opargbegintheorem#1#2#3{%
+ \trivlist
+ \item[\hskip \labelsep{\bfseries #1\ #2\
+ \@brackets({#3})}]\itshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@chapter}
+% \begin{macro}{\@schapter}
+% The following was added for pretty printing of the chapter
+% numbers, for supporting Right-to-Left tables (\texttt{cot},
+% \texttt{fol}, and \texttt{tol}), to save \cs{headlanguage}
+% for use in running headers, and to start two-column mode
+% depending on chapter's main language.
+% \begin{macrocode}
+\@ifclassloaded{article}{}{%
+ % For pretty priniting
+ \def\@@chapapp{Chapter}
+ \def\@@thechapter{\@@arabic\c@chapter}
+ \def\@chapter[#1]#2{%
+ \let\headlanguage=\languagename%
+ %\set@outputdblcol%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@@chapapp\space\@@thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}#1}
+ \addcontentsline{cot}{chapter}%
+ {\protect\numberline{\thechapter}#1}
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \addcontentsline{cot}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{fol}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \addtocontents{tol}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+ %
+ \def\@schapter#1{%
+ \let\headlanguage=\languagename%
+ %\set@outputdblcol%
+ \if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \@makeschapterhead{#1}%
+ \@afterheading
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\appendix}
+% Changed mainly for pretty printing of appendix numbers, and to
+% start two-column mode with the right language (if needed).
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{% other
+\@ifclassloaded{slides}{}{% other
+ \@ifclassloaded{article}{% article
+ \renewcommand\appendix{\par
+ \setcounter{section}{0}%
+ \setcounter{subsection}{0}%
+ \renewcommand\thesection{\@Alph\c@section}}
+ }{% report and book
+ \renewcommand\appendix{\par
+ %\set@outputdblcol%
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \renewcommand\@chapapp{\appendixname}%
+ % For pretty priniting
+ \def\@@chapapp{Appendix}%
+ \def\@@thechapter{\@@Alph\c@chapter}
+ \renewcommand\thechapter{\@Alph\c@chapter}}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Bibliography and citations}
+%
+% \begin{macro}{\@cite}
+% \begin{macro}{\@biblabel}
+% \begin{macro}{\@lbibitem}
+% Citations are produced by the macro
+% |\@cite{|\emph{LABEL}|}{|\emph{NOTE}|}|. Both the citation label
+% and the note is typeset in the current direction. We have to use
+% \cs{@brackets} macro in \cs{@cite} and \cs{@biblabel} macros. In
+% addition, when using \emph{alpha} or similar bibliography style,
+% the \cs{@lbibitem} is used and have to be update to support bot
+% Right-to-Left and Left-to-Right citations.
+%
+% \begin{macrocode}
+\def\@cite#1#2{\@brackets[{#1\if@tempswa , #2\fi}]}
+\def\@biblabel#1{\@brackets[{#1}]}
+\def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw
+ {\let\protect\noexpand
+ \immediate
+ \if@rl\write\@auxout{\string\bibcite{#2}{\R{#1}}}%
+ \else\write\@auxout{\string\bibcite{#2}{\L{#1}}}\fi%
+ }\fi\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{thebibliography}
+% Use \cs{rightmargin} instead of \cs{leftmargin} when in RL mode.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{% other
+\@ifclassloaded{slides}{}{% other
+\@ifclassloaded{article}{%
+ \renewenvironment{thebibliography}[1]
+ {\section*{\refname\@mkboth%
+ {\MakeUppercase\refname}%
+ {\MakeUppercase\refname}}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \if@rl\leftmargin\else\rightmargin\fi\labelwidth
+ \advance\if@rl\leftmargin\else\rightmargin\fi\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist}}%
+{\renewenvironment{thebibliography}[1]{%
+ \chapter*{\bibname\@mkboth%
+ {\MakeUppercase\bibname}%
+ {\MakeUppercase\bibname}}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \if@rl\leftmargin\else\rightmargin\fi\labelwidth
+ \advance\if@rl\leftmargin\else\rightmargin\fi\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist}}}}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@verbatim}
+% All kinds of verbs (\cs{verb},\cs{verb*},\texttt{verbatim} and
+% \texttt{verbatim*}) now can be used in Right-to-Left mode. Errors
+% in latin mode solved too.
+% \begin{macrocode}
+\def\@verbatim{%
+ \let\do\@makeother \dospecials%
+ \obeylines \verbatim@font \@noligs}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption}
+% Captions are set always centered. This allows us to use bilingual
+% captions, for example: |\caption{\R{RLtext} \\ \L{LRtext}}|,
+% which will be formatted as:
+% \begin{center}
+% Right to left caption here (RLtext) \\
+% Left to right caption here (LRtext)
+% \end{center}
+% See also \cs{bcaption} command below.
+% \begin{macrocode}
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip%
+ \begin{center}%
+ #1: #2%
+ \end{center} \par%
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Additional bidirectional commands}
+%
+% \begin{itemize}
+% \item Section headings are typeset with the default global
+% direction.
+% \item Text in section headings in the reverse language \emph{do
+% not} have to be protected for the reflection command, as in:
+% |\protect\L{|\emph{Latin Text}|}|, because \cs{L} and \cs{R} are
+% robust now.
+% \item Table of contents, list of figures and list of tables
+% should be typeset with the \cs{tableofcontents},
+% \cs{listoffigures} and \cs{listoftables} commands respectively.
+% \item The above tables will be typeset in the main direction (and
+% language) in effect where the above commands are placed.
+% \item Only 2 tables of each kind are supported: one for
+% Right-to-Left and another for Left-to-Right directions.
+% \end{itemize}
+%
+% How to include line to both tables? One has to use bidirectional
+% sectioning commands as following:
+% \begin{enumerate}
+% \item Use the |\b|\emph{xxx} version of the sectioning commands
+% in the text instead of the |\|\emph{xxx} version (\emph{xxx} is
+% one of: \texttt{part}, \texttt{chapter}, \texttt{section},
+% \texttt{subsection}, \texttt{subsubsection}, \texttt{caption}).
+% \item Syntax of the |\b|\emph{xxx} command is
+% |\b|\emph{xxx}|{|\emph{RL text}|}{|\emph{LR text}|}|.
+% Both arguments are typeset in proper direction by default (no
+% need to change direction for the text inside).
+% \item The section header inside the document will be typeset in
+% the global direction in effect at the time. i.e. The |{|\emph{RL
+% text}|}| will be typeset if Right-to-Left mode is in effect and
+% |{|\emph{LR text}|}| otherwise.
+% \end{enumerate}
+%
+% \begin{macro}{\bpart}
+% \begin{macrocode}
+\newcommand{\bpart}[2]{\part{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bchapter}
+% \begin{macrocode}
+\newcommand{\bchapter}[2]{\chapter{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bsection}
+% \begin{macrocode}
+\newcommand{\bsection}[2]{\section{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bsubsection}
+% \begin{macrocode}
+\newcommand{\bsubsection}[2]{\subsection{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bsubsubsection}
+% \begin{macrocode}
+\newcommand{\bsubsubsection}[2]{\subsubsection{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bcaption}
+% \begin{macrocode}
+\newcommand{\bcaption}[2]{%
+ \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
+ \if@rl\R{#1}\protect\\ \L{#2}
+ \else\L{#2}\protect\\ \R{#1}\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% The following definition is a modified version of \cs{bchapter}, meant
+% as a bilingual twin for \cs{chapter*} and \cs{section*}
+% (added by Irina Abramovici).
+%
+% \begin{macro}{\bchapternn}
+% \begin{macrocode}
+\newcommand{\bchapternn}[2]{\chapter*{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bsectionnn}
+% \begin{macrocode}
+\newcommand{\bsectionnn}[2]{\section*{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% Finally, at end of \babel\ package, the \cs{headlanguage} and
+% two-column mode will be initialized according to the current
+% language.
+% \begin{macrocode}
+\AtEndOfPackage{\rlAtEndOfPackage}
+%
+\def\rlAtEndOfPackage{%
+ \global\let\headlanguage=\languagename%\set@outputdblcol%
+}
+%</rightleft>
+% \end{macrocode}
+%
+% \subsection{Hebrew calendar}
+%
+% The original version of the package \pkg{hebcal.sty}\footnote{The
+% following description of \pkg{hebcal} package is based on the
+% comments included with original source by the author, Michail
+% Rozman.} for \TeX\ and \LaTeX2.09, entitled ``\TeX{} \& \LaTeX{}
+% macros for computing Hebrew date from Gregorian one'' was created
+% by Michail Rozman, |misha@iop.tartu.ew.su|\footnote{Please direct
+% any comments, bug reports, questions, etc. about the package to
+% this address.}
+%
+% \begin{tabular}{@{}lr@{}c@{}ll}
+% Released: &Tammuz 12, 5751&--&June 24, 1991 &\\
+% Corrected:&Shebat 10, 5752&--&January 15, 1992&by Rama Porrat\\
+% Corrected:&Adar II 5, 5752&--&March 10, 1992 &by Misha\\
+% Corrected:&Tebeth, 5756 &--&January 1996 &Dan Haran\\
+% &&&&(haran@math.tau.ac.il)
+% \end{tabular}
+%
+% The package was adjusted for \babel{} and \LaTeXe{} by Boris
+% Lavva.
+%
+% Changes to the printing routine (only) by Ron Artstein, June 1,
+% 2003.
+%
+% This package should be included \emph{after} the \pkg{babel} with
+% \pkg{hebrew} option, as following:
+% \begin{quote}
+% |\documentclass[|\ldots|]{|\ldots|}|\\
+% |\usepackage[hebrew,|\ldots|,|\emph{other languages}|,|
+% \ldots|]{babel}|\\
+% |\usepackage{hebcal}|
+% \end{quote}
+%
+% Two main user-level commands are provided by this package:
+%
+% \DescribeMacro{\Hebrewtoday}
+% Computes today's Hebrew date and prints it. If we are presently
+% in Hebrew mode, the date will be printed in Hebrew, otherwise ---
+% in English (like Shebat 10, 5752).
+%
+% \DescribeMacro{\Hebrewdate}
+% Computes the Hebrew date from the given Gregorian date and
+% prints it. If we are presently in Hebrew mode, the date will be
+% printed in Hebrew, otherwise --- in English (like Shebat 10,
+% 5752). An example of usage is shown below:
+% \begin{quote}
+% |\newcount\hd \newcount\hm \newcount\hy|\\
+% |\hd=10 \hm=3 \hy=1992|\\
+% |\Hebrewdate{\hd}{\hm}{\hy}|
+% \end{quote}
+%
+% \DescribeMacro{full}
+% The package option |full| sets the flag |\@full@hebrew@year|,
+% which causes years from the current millenium to be printed with
+% the thousands digit (he-tav-shin-samekh-gimel). Without this
+% option, thousands are not printed for the current millenium.
+% NOTE: should this be a command option rather than a package
+% option? --RA.
+%
+% \subsubsection{Introduction}
+%
+% The Hebrew calendar is inherently complicated: it is lunisolar --
+% each year starts close to the autumn equinox, but each month must
+% strictly start at a new moon. Thus Hebrew calendar must be
+% harmonized simultaneously with both lunar and solar events. In
+% addition, for reasons of the religious practice, the year cannot
+% start on Sunday, Wednesday or Friday.
+%
+% For the full description of Hebrew calendar and for the list of
+% references see:
+% \begin{quote}
+% Nachum Dershowitz and Edward M. Reingold,
+% \emph{``Calendarical Calculations''}, Software--Pract.Exper.,
+% vol. 20 (9), pp.899--928 (September 1990).
+% \end{quote}
+% |C| translation of |LISP| programs from the above article
+% available from Mr. Wayne Geiser, |geiser%pictel@uunet.uu.net|.
+%
+% The 4\textsuperscript{th} distribution (July 1989) of hdate/hcal
+% (Hebrew calendar programs similar to UNIX date/cal) by Mr. Amos
+% Shapir, |amos@shum.huji.ac.il|, contains short and very clear
+% description of algorithms.
+%
+% \subsubsection{Registers, Commands, Formatting Macros}
+%
+% The command |\Hebrewtoday| produces today's date for Hebrew
+% calendar. It is similar to the standard \LaTeXe{} command
+% |\today|. In addition three numerical registers |\Hebrewday|,
+% |\Hebrewmonth| and |\Hebrewyear| are set.
+% For setting this registers without producing of date string
+% command |\Hebrewsetreg| can be used.
+%
+% The command
+% |\Hebrewdate{|\emph{Gday}|}{|\emph{Gmonth}|}{|\emph{Gyear}|}|
+% produces Hebrew calendar date corresponding to Gregorian date
+% |Gday.Gmonth.Gyear|. Three numerical registers |\Hebrewday|,
+% |\Hebrewmonth| and |\Hebrewyear| are set.
+%
+% For converting arbitrary Gregorian date |Gday.Gmonth.Gyear|
+% to Hebrew date |Hday.Hmonth.Hyear| without producing date string
+% the command:
+% \begin{center}
+% |\HebrewFromGregorian{|\emph{Gday}|}{|\emph{Gmonth}|}{|%
+% \emph{Gyear}|}{|\emph{Hday}|}{|\emph{Hmonth}|}{|\emph{Hyear}|}|
+% \end{center}
+% can be used.
+%
+% \begin{macrocode}
+%<*calendar>
+\newif\if@full@hebrew@year
+\@full@hebrew@yearfalse
+\DeclareOption{full}{\@full@hebrew@yeartrue}
+\ProcessOptions
+\newcount\Hebrewday \newcount\Hebrewmonth \newcount\Hebrewyear
+% \end{macrocode}
+%
+% \begin{macro}{\Hebrewdate}
+% Hebrew calendar date corresponding to Gregorian date
+% |Gday.Gmonth.Gyear|. If Hebrew (right-to-left) fonts \& macros
+% are not loaded, we have to use English format.
+% \begin{macrocode}
+\def\Hebrewdate#1#2#3{%
+ \HebrewFromGregorian{#1}{#2}{#3}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \ifundefined{if@rl}%
+ \FormatForEnglish{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \else%
+ \FormatDate{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Hebrewtoday}
+% Today's date in Hebrew calendar.
+% \begin{macrocode}
+\def\Hebrewtoday{\Hebrewdate{\day}{\month}{\year}}
+\let\hebrewtoday=\Hebrewtoday
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Hebrewsetreg}
+% Set registers: today's date in hebrew calendar.
+% \begin{macrocode}
+\def\Hebrewsetreg{%
+ \HebrewFromGregorian{\day}{\month}{\year}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FormatDate}
+% Prints a Hebrew calendar date |Hebrewday.Hebrewmonth.Hebrewyear|.
+% \begin{macrocode}
+\def\FormatDate#1#2#3{%
+ \if@rl%
+ \FormatForHebrew{#1}{#2}{#3}%
+ \else%
+ \FormatForEnglish{#1}{#2}{#3}
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% To prepare another language version of Hebrew calendar commands,
+% one should change or add commands here.
+%
+% We start with Hebrew language macros.
+% \begin{macro}{\HebrewYearName}
+% Prints Hebrew year as a Hebrew number. Disambiguates strings by
+% adding lamed-pe-gimel to years of the first Jewish millenium and
+% to years divisible by 1000. Suppresses the thousands digit in the
+% current millenium unless the package option |full| is selected.
+% NOTE: should this be provided as a command option rather than a
+% package option? --RA.
+% \begin{macrocode}
+\def\HebrewYearName#1{{%
+ \@tempcnta=#1\divide\@tempcnta by 1000\multiply\@tempcnta by 1000
+ \ifnum#1=\@tempcnta\relax % divisible by 1000: disambiguate
+ \Hebrewnumeralfinal{#1}\ )\heblamed\hebpe"\hebgimel(%
+ \else % not divisible by 1000
+ \ifnum#1<1000\relax % first millennium: disambiguate
+ \Hebrewnumeralfinal{#1}\ )\heblamed\hebpe"\hebgimel(%
+ \else
+ \ifnum#1<5000
+ \Hebrewnumeralfinal{#1}%
+ \else
+ \ifnum#1<6000 % current millenium, print without thousands
+ \@tempcnta=#1\relax
+ \if@full@hebrew@year\else\advance\@tempcnta by -5000\fi
+ \Hebrewnumeralfinal{\@tempcnta}%
+ \else % #1>6000
+ \Hebrewnumeralfinal{#1}%
+ \fi
+ \fi
+ \fi
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewMonthName}
+% The macro |\HebrewMonthName{|\emph{month}|}{|\emph{year}|}|
+% returns the name of month in the `year'.
+% \begin{macrocode}
+\def\HebrewMonthName#1#2{%
+ \ifnum #1 = 7 %
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap \hebalef\hebdalet\hebresh\ \hebbet'%
+ \else \hebalef\hebdalet\hebresh%
+ \fi%
+ \else%
+ \ifcase#1%
+ % nothing for 0
+ \or\hebtav\hebshin\hebresh\hebyod%
+ \or\hebhet\hebshin\hebvav\hebfinalnun%
+ \or\hebkaf\hebsamekh\heblamed\hebvav%
+ \or\hebtet\hebbet\hebtav%
+ \or\hebshin\hebbet\hebtet%
+ \or\hebalef\hebdalet\hebresh\ \hebalef'%
+ \or\hebalef\hebdalet\hebresh\ \hebbet'%
+ \or\hebnun\hebyod\hebsamekh\hebfinalnun%
+ \or\hebalef\hebyod\hebyod\hebresh%
+ \or\hebsamekh\hebyod\hebvav\hebfinalnun%
+ \or\hebtav\hebmem\hebvav\hebzayin%
+ \or\hebalef\hebbet%
+ \or\hebalef\heblamed\hebvav\heblamed%
+ \fi%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewDayName}
+% Name of day in Hebrew letters (gimatria).
+% \begin{macrocode}
+\def\HebrewDayName#1{\Hebrewnumeral{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\FormatForHebrew}
+% The macro |\FormatForHebrew{|\emph{hday}|}{|\emph{hmonth}
+% |}{|\emph{hyear}|}| returns the formatted Hebrew date in Hebrew
+% language.
+% \begin{macrocode}
+\def\FormatForHebrew#1#2#3{%
+ \HebrewDayName{#1}~\hebbet\HebrewMonthName{#2}{#3},~%
+ \HebrewYearName{#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% We continue with two English language macros for Hebrew calendar.
+% \begin{macro}{\HebrewMonthNameInEnglish}
+% The macro |\HebrewMonthNameInEnglish{|\emph{month}|}{|%
+% \emph{year}|}| is similar to |\Hebrew|\-|Month|\-|Name| described
+% above. It returns the name of month in the Hebrew `year' in
+% English.
+% \begin{macrocode}
+\def\HebrewMonthNameInEnglish#1#2{%
+ \ifnum #1 = 7%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap Adar II\else Adar\fi%
+ \else%
+ \ifcase #1%
+ % nothing for 0
+ \or Tishrei%
+ \or Heshvan%
+ \or Kislev%
+ \or Tebeth%
+ \or Shebat%
+ \or Adar I%
+ \or Adar II%
+ \or Nisan%
+ \or Iyar%
+ \or Sivan%
+ \or Tammuz%
+ \or Av%
+ \or Elul%
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FormatForEnglish}
+% The macro |\FormatForEnglish{|\emph{hday}|}{|\emph{hmonth}
+% |}{|\emph{hyear}|}| is similar to |\Format|\-|For|\-|Hebrew|
+% macro described above and returns the formatted Hebrew date in
+% English.
+% \begin{macrocode}
+\def\FormatForEnglish#1#2#3{%
+ \HebrewMonthNameInEnglish{#2}{#3} \number#1,\ \number#3}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Auxiliary Macros}
+%
+% \begin{macrocode}
+\newcount\@common
+% \end{macrocode}
+% \begin{macro}{\Remainder}
+% |\Remainder{|\emph{a}|}{|\emph{b}|}{|\emph{c}|}| calculates
+% $c = a\%b == a-b\times\frac{a}{b}$
+% \begin{macrocode}
+\def\Remainder#1#2#3{%
+ #3 = #1% % c = a
+ \divide #3 by #2% % c = a/b
+ \multiply #3 by -#2% % c = -b(a/b)
+ \advance #3 by #1}% % c = a - b(a/b)
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\newif\if@Divisible
+% \end{macrocode}
+% \begin{macro}{\CheckIfDivisible}
+% |\CheckIfDivisible{|\emph{a}|}{|\emph{b}|}| sets
+% |\@Divisibletrue| if $a\%b == 0$
+% \begin{macrocode}
+\def\CheckIfDivisible#1#2{%
+ {%
+ \countdef\tmp = 0% \tmp == \count0 - temporary variable
+ \Remainder{#1}{#2}{\tmp}%
+ \ifnum \tmp = 0%
+ \global\@Divisibletrue%
+ \else%
+ \global\@Divisiblefalse%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifundefined}
+% From the \TeX book, ex. 7.7:
+% \begin{quote}
+% |\ifundefined{|\emph{command}|}<true text>\else<false text>\fi|
+% \end{quote}
+% \begin{macrocode}
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Gregorian Part}
+%
+% \begin{macrocode}
+\newif\if@GregorianLeap
+% \end{macrocode}
+% \begin{macro}{\IfGregorianLeap}
+% Conditional which is true if Gregorian `year' is a leap year:
+% $((year\%4==0)\wedge(year\%100\neq 0))\vee(year\%400==0)$
+% \begin{macrocode}
+\def\IfGregorianLeap#1{%
+ \CheckIfDivisible{#1}{4}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{100}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{400}%
+ \if@Divisible%
+ \@GregorianLeaptrue%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \else%
+ \@GregorianLeaptrue%
+ \fi%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \if@GregorianLeap}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\GregorianDaysInPriorMonths}
+% The macro |\GregorianDaysInPriorMonths{|\emph{month}|}{|^^A
+% \emph{year}|}{|\emph{days}|}| calculates the number of days in
+% months prior to `month' in the `year'.
+% \begin{macrocode}
+\def\GregorianDaysInPriorMonths#1#2#3{%
+ {%
+ #3 = \ifcase #1%
+ 0 \or% % no month number 0
+ 0 \or%
+ 31 \or%
+ 59 \or%
+ 90 \or%
+ 120 \or%
+ 151 \or%
+ 181 \or%
+ 212 \or%
+ 243 \or%
+ 273 \or%
+ 304 \or%
+ 334%
+ \fi%
+ \IfGregorianLeap{#2}%
+ \ifnum #1 > 2% % if month after February
+ \advance #3 by 1% % add leap day
+ \fi%
+ \fi%
+ \global\@common = #3}%
+ #3 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\GregorianDaysInPriorYears}
+% The macro |\GregorianDaysInPriorYears{|\emph{year}|}{|^^A
+% \emph{days}|}| calculates the number of days in years prior to
+% the `year'.
+% \begin{macrocode}
+\def\GregorianDaysInPriorYears#1#2{%
+ {%
+ \countdef\tmpc = 4% % \tmpc==\count4
+ \countdef\tmpb = 2% % \tmpb==\count2
+ \tmpb = #1% %
+ \advance \tmpb by -1% %
+ \tmpc = \tmpb% % \tmpc = \tmpb = year-1
+ \multiply \tmpc by 365% % Days in prior years =
+ #2 = \tmpc% % = 365*(year-1) ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 4% % \tmpc = (year-1)/4
+ \advance #2 by \tmpc% % ... plus Julian leap days ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 100% % \tmpc = (year-1)/100
+ \advance #2 by -\tmpc% % ... minus century years ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 400% % \tmpc = (year-1)/400
+ \advance #2 by \tmpc% % ... plus 4-century years.
+ \global\@common = #2}%
+ #2 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AbsoluteFromGregorian}
+% The macro |\AbsoluteFromGregorian{|\emph{day}|}{|\emph{month}^^A
+% |}{|\emph{year}|}{|\emph{absdate}|}| calculates the absolute date
+% (days since $01.01.0001$) from Gregorian date |day.month.year|.
+% \begin{macrocode}
+\def\AbsoluteFromGregorian#1#2#3#4{%
+ {%
+ \countdef\tmpd = 0% % \tmpd==\count0
+ #4 = #1% % days so far this month
+ \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior months
+ \GregorianDaysInPriorYears{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior years
+ \global\@common = #4}%
+ #4 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Hebrew Part}
+%
+% \begin{macrocode}
+\newif\if@HebrewLeap
+% \end{macrocode}
+% \begin{macro}{\CheckLeapHebrewYear}
+% Set |\@HebrewLeaptrue| if Hebrew `year' is a leap year, i.e.\ if
+% $(1+7\times year)\%19 < 7$ then \emph{true} else \emph{false}
+% \begin{macrocode}
+\def\CheckLeapHebrewYear#1{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+%
+ \tmpa = #1%
+ \multiply \tmpa by 7%
+ \advance \tmpa by 1%
+ \Remainder{\tmpa}{19}{\tmpb}%
+ \ifnum \tmpb < 7% % \tmpb = (7*year+1)%19
+ \global\@HebrewLeaptrue%
+ \else%
+ \global\@HebrewLeapfalse%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewElapsedMonths}
+% The macro |\HebrewElapsedMonths{|\emph{year}|}{|\emph{months}|}|
+% determines the number of months elapsed from the Sunday prior to
+% the start of the Hebrew calendar to the mean conjunction of
+% Tishri of Hebrew `year'.
+% \begin{macrocode}
+\def\HebrewElapsedMonths#1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \tmpa = #1% %
+ \advance \tmpa by -1% %
+ #2 = \tmpa% % #2 = \tmpa = year-1
+ \divide #2 by 19% % Number of complete Meton cycles
+ \multiply #2 by 235% % #2 = 235*((year-1)/19)
+%
+ \Remainder{\tmpa}{19}{\tmpb}% \tmpa = years%19-years this cycle
+ \tmpc = \tmpb% %
+ \multiply \tmpb by 12% %
+ \advance #2 by \tmpb% % add regular months this cycle
+%
+ \multiply \tmpc by 7% %
+ \advance \tmpc by 1% %
+ \divide \tmpc by 19% % \tmpc = (1+7*((year-1)%19))/19 -
+% % number of leap months this cycle
+ \advance #2 by \tmpc% % add leap months
+%
+ \global\@common = #2}%
+ #2 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewElapsedDays}
+% The macro |\HebrewElapsedDays{|\emph{year}|}{|\emph{days}|}|
+% determines the number of days elapsed from the Sunday prior to
+% the start of the Hebrew calendar to the mean conjunction of
+% Tishri of Hebrew `year'.
+% \begin{macrocode}
+\def\HebrewElapsedDays#1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \HebrewElapsedMonths{#1}{#2}%
+ \tmpa = #2% %
+ \multiply \tmpa by 13753% %
+ \advance \tmpa by 5604% % \tmpa=MonthsElapsed*13758 + 5604
+ \Remainder{\tmpa}{25920}{\tmpc}% \tmpc == ConjunctionParts
+ \divide \tmpa by 25920%
+%
+ \multiply #2 by 29%
+ \advance #2 by 1%
+ \advance #2 by \tmpa% % #2 = 1 + MonthsElapsed*29 +
+% % PartsElapsed/25920
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpc < 19440%
+ \ifnum \tmpc < 9924%
+ \else% % New moon at 9 h. 204 p. or later
+ \ifnum \tmpa = 2% % on Tuesday ...
+ \CheckLeapHebrewYear{#1}% of a common year
+ \if@HebrewLeap%
+ \else%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum \tmpc < 16789%
+ \else% % New moon at 15 h. 589 p. or later
+ \ifnum \tmpa = 1% % on Monday ...
+ \advance #1 by -1%
+ \CheckLeapHebrewYear{#1}% at the end of leap year
+ \if@HebrewLeap%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \advance #2 by 1% % new moon at or after midday
+ \fi%
+%
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpa = 0% % if Sunday ...
+ \advance #2 by 1%
+ \else% %
+ \ifnum \tmpa = 3% % Wednesday ...
+ \advance #2 by 1%
+ \else%
+ \ifnum \tmpa = 5% % or Friday
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \global\@common = #2}%
+ #2 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DaysInHebrewYear}
+% The macro |\DaysInHebrewYear{|\emph{year}|}{|\emph{days}|}|
+% calculates the number of days in Hebrew `year'.
+% \begin{macrocode}
+\def\DaysInHebrewYear#1#2{%
+ {%
+ \countdef\tmpe = 12% % \tmpe==\count12
+%
+ \HebrewElapsedDays{#1}{\tmpe}%
+ \advance #1 by 1%
+ \HebrewElapsedDays{#1}{#2}%
+ \advance #2 by -\tmpe%
+ \global\@common = #2}%
+ #2 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewDaysInPriorMonths}
+% The macro |\HebrewDaysInPriorMonths{|\emph{month}|}{|^^A
+% \emph{year}|}{|\emph{days}|}| calculates the nu\-mber of days in
+% months prior to `month' in the `year'.
+% \begin{macrocode}
+\def\HebrewDaysInPriorMonths#1#2#3{%
+ {%
+ \countdef\tmpf= 14% % \tmpf==\count14
+%
+ #3 = \ifcase #1% % Days in prior month of regular year
+ 0 \or% % no month number 0
+ 0 \or% % Tishri
+ 30 \or% % Heshvan
+ 59 \or% % Kislev
+ 89 \or% % Tebeth
+ 118 \or% % Shebat
+ 148 \or% % Adar I
+ 148 \or% % Adar II
+ 177 \or% % Nisan
+ 207 \or% % Iyar
+ 236 \or% % Sivan
+ 266 \or% % Tammuz
+ 295 \or% % Av
+ 325 \or% % Elul
+ 400% % Dummy
+ \fi%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap% % in leap year
+ \ifnum #1 > 6% % if month after Adar I
+ \advance #3 by 30% % add 30 days
+ \fi%
+ \fi%
+ \DaysInHebrewYear{#2}{\tmpf}%
+ \ifnum #1 > 3%
+ \ifnum \tmpf = 353% %
+ \advance #3 by -1% %
+ \fi% % Short Kislev
+ \ifnum \tmpf = 383% %
+ \advance #3 by -1% %
+ \fi% %
+ \fi%
+%
+ \ifnum #1 > 2%
+ \ifnum \tmpf = 355% %
+ \advance #3 by 1% %
+ \fi% % Long Heshvan
+ \ifnum \tmpf = 385% %
+ \advance #3 by 1% %
+ \fi% %
+ \fi%
+ \global\@common = #3}%
+ #3 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AbsoluteFromHebrew}
+% The macro |\AbsoluteFromHebrew{|\emph{day}|}{|\emph{month}^^A
+% |}{|\emph{year}|}{|\emph{absdate}|}| calculates the absolute date
+% of Hebrew date |day.month.year|.
+% \begin{macrocode}
+\def\AbsoluteFromHebrew#1#2#3#4{%
+ {%
+ #4 = #1%
+ \HebrewDaysInPriorMonths{#2}{#3}{#1}%
+ \advance #4 by #1% % Add days in prior months this year
+ \HebrewElapsedDays{#3}{#1}%
+ \advance #4 by #1% % Add days in prior years
+ \advance #4 by -1373429% % Subtract days before Gregorian
+ \global\@common = #4}% % 01.01.0001
+ #4 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewFromGregorian}
+% The macro |\HebrewFromGregorian{|\emph{Gday}|}{|\emph{Gmonth}^^A
+% |}{|\emph{Gyear}|}{|\emph{Hday}|}{|\emph{Hmonth}|}|\-|{|^^A
+% \emph{Hyear}|}| evaluates Hebrew date |Hday|, |Hmonth|, |Hyear|
+% from Gregorian date |Gday|, |Gmonth|, |Gyear|.
+% \begin{macrocode}
+\def\HebrewFromGregorian#1#2#3#4#5#6{%
+ {%
+ \countdef\tmpx= 17% % \tmpx==\count17
+ \countdef\tmpy= 18% % \tmpy==\count18
+ \countdef\tmpz= 19% % \tmpz==\count19
+%
+ #6 = #3% %
+ \global\advance #6 by 3761% approximation from above
+ \AbsoluteFromGregorian{#1}{#2}{#3}{#4}%
+ \tmpz = 1 \tmpy = 1%
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \ifnum \tmpx > #4% %
+ \global\advance #6 by -1% Hyear = Gyear + 3760
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \fi% %
+ \advance #4 by -\tmpx% % Days in this year
+ \advance #4 by 1% %
+ #5 = #4% %
+ \divide #5 by 30% % Approximation for month from below
+ \loop% % Search for month
+ \HebrewDaysInPriorMonths{#5}{#6}{\tmpx}%
+ \ifnum \tmpx < #4%
+ \advance #5 by 1%
+ \tmpy = \tmpx%
+ \repeat%
+ \global\advance #5 by -1%
+ \global\advance #4 by -\tmpy}}
+%</calendar>
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/hebrew.fdd b/Master/texmf-dist/source/generic/babel/hebrew.fdd
new file mode 100644
index 00000000000..f61d06f430e
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/hebrew.fdd
@@ -0,0 +1,1297 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{610}
+%
+% \iffalse meta-comment
+%% File `hebrew.fdd' for installing the Hebrew encodings and fonts.
+%% Copyright (C) 1997 -- 2005 Boris Lavva.
+%
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+% \fi
+% \iffalse
+%<LHEenc>\ProvidesFile{lheenc.def}
+%<LHEcmr>\ProvidesFile{lhecmr.fd}
+%<LHEcmss>\ProvidesFile{lhecmss.fd}
+%<LHEcmtt>\ProvidesFile{lhecmtt.fd}
+%<LHEclas>\ProvidesFile{lheclas.fd}
+%<LHEshold>\ProvidesFile{lheshold.fd}
+%<LHEshscr>\ProvidesFile{lheshscr.fd}
+%<LHEshstk>\ProvidesFile{lheshstk.fd}
+%<LHEfr>\ProvidesFile{lhefr.fd}
+%<LHEcrml>\ProvidesFile{lhecrml.fd}
+%<LHEredis>\ProvidesFile{lheredis.fd}
+%<HE8enc>\ProvidesFile{HE8enc.def}
+%<HE8cmr>\ProvidesFile{HE8cmr.fd}
+%<HE8cmss>\ProvidesFile{HE8cmss.fd}
+%<HE8cmtt>\ProvidesFile{HE8cmtt.fd}
+% The recoded Omega font (only Hebrew glyphs. Lacks other glyphs)
+%<HE8OmegaHebrew>\ProvidesFile{HE8OmegaHebrew.fd}
+% The culmus fonts:
+%<HE8aharoni>\ProvidesFile{HE8aharoni.fd}
+%<HE8david>\ProvidesFile{HE8david.fd}
+%<HE8drugulin>\ProvidesFile{HE8drugulin.fd}
+%<HE8ellinia>\ProvidesFile{HE8ellinia.fd}
+%<HE8frankruehl>\ProvidesFile{HE8frankruehl.fd}
+%<HE8yad>\ProvidesFile{HE8yad.fd}
+%<HE8miriam>\ProvidesFile{HE8miriam.fd}
+%<HE8nachlieli>\ProvidesFile{HE8nachlieli.fd}
+% The IBM Type1 fonts (not freely distributable
+%<HE8CourierShalom>\ProvidesFile{HE8CourierShalom.fd}
+%<HE8HelveticaNarkissTam>\ProvidesFile{HE8HelveticaNarkissTam.fd}
+%<HE8TimesNarkissim>\ProvidesFile{HE8TimesNarkissim.fd}
+% Placeholders for windows fonts:
+%<HE8mfdavid>\ProvidesFile{HE8mfdavid.fd}
+%<HE8mffrank>\ProvidesFile{HE8mffrank.fd}
+%<HE8mffrankthick>\ProvidesFile{HE8mffrankthick.fd}
+%<HE8mffrankthin>\ProvidesFile{HE8mffrankthin.fd}
+%<HE8mfmiriam>\ProvidesFile{HE8mfmiriam.fd}
+%<HE8mfmiriamwide>\ProvidesFile{HE8mfmiriamwide.fd}
+%<HE8mfnarkistam>\ProvidesFile{HE8mfnarkistam.fd}
+%<hebfont>\ProvidesPackage{hebfont}
+%<*driver>
+\ProvidesFile{hebrew.drv}
+%</driver>
+% \fi
+% \ProvidesFile{hebrew.fdd}
+ [2005/05/20 v1.2c %
+% \iffalse
+%<LHEenc> 7-bit Hebrew font encoding
+%<LHEcmr> Hebrew default font
+%<LHEcmss> Hebrew sans-serif font
+%<LHEcmtt> Hebrew typewriter font
+%<LHEclas> Hebrew classic font (by Joel M. Hoffman)
+%<LHEshold> Hebrew shalom old font (by Jonathan Brecher)
+%<LHEshscr> Hebrew shalom script font (by Jonathan Brecher)
+%<LHEshstk> Hebrew shalom stick font (by Jonathan Brecher)
+%<LHEfr> Hebrew frank-ruehl font
+%<LHEcrml> Hebrew carmel font (by Dr. Samy Zafrany)
+%<LHEredis> Hebrew redis font (by Prof. Jacques J. Goldberg)
+%<HE8enc> 8-bit Hebrew font encoding
+%<HE8cmr> Hebrew default font
+%<HE8cmss> Hebrew sans-serif font
+%<HE8cmtt> Hebrew typewriter font
+%<HE8OmegaHebrew> Hebrew font from the Omega project (by ???)
+%<HE8aharoni> Hebrew sans-serif font (Culmus)
+%<HE8david> Hebrew serif font (Culmus)
+%<HE8drugulin> Hebrew old serif font (Culmus)
+%<HE8ellinia> Hebrew sans-serif font (Culmus)
+%<HE8frankruehl> Hebrew serif font (Culmus)
+%<HE8yad> Hebrew handwriting font (Culmus)
+%<HE8miriam> Hebrew monospaced font (Culmus)
+%<HE8nachlieli> Hebrew sans-serif font (Culmus)
+%<HE8CourierShalom> Hebrew Shalom (Courier) font (by IBM)
+%<HE8HelveticaNarkissTam> Hebrew NarkisTam (Helvetica) (by Zvi Narkis)
+%<HE8TimesNarkissim> Hebrew Narkissim (Times) (by Zvi Narkis)
+%<HE8mfdavid> Hebrew David font (by ???)
+%<HE8mffrank> Hebrew Frank-Ruehl font (by ??)
+%<HE8mffrankthick> Hebrew Frank-Ruehl (thick) font (by ??)
+%<HE8mffrankthin> Hebrew Frank-Ruehl (thin) font (by ??)
+%<HE8mfmiriam> Hebrew Miriam font (by ???)
+%<HE8mfmiriamwide> Hebrew Miriam (wide) font (by ???)
+%<HE8mfnarkistam> Hebrew Narkis Tam font (by ???)
+%<hebfont> Hebrew font switching commands
+%<driver> Driver file for hebrew.fdd file
+% \fi
+% Hebrew font encodings support
+ (test version: still liable to change)]
+%
+% \font\manual=logo10
+% \providecommand\MF{{\manual META}\-{\manual FONT}}
+% \providecommand\PS{\textsc{PostScript}}
+% \providecommand\dst{\textsc{docstrip}}
+% \providecommand\LHE{\texttt{LHE}}
+% \providecommand\HEH{\texttt{HE8}}
+% \providecommand\file[1]{\texttt{#1}}
+% \providecommand\pkg[1]{\texttt{#1}}
+% \GetFileInfo{hebrew.fdd}
+%
+% \changes{hebfdd-1.0a}{1998/01/01}{%
+% Initial version. Supports only 7-bit LHE font encoding and all
+% available Hebrew \TeX\ fonts (by Boris Lavva)}
+% \changes{hebfdd-1.0b}{2001/08/16}{%
+% fixed lhecmr.fd to use oldjaf10 for a slanted font
+% available Hebrew \TeX\ fonts (by Tzafrir Cohen)}
+% \changes{hebfdd-1.1a}{2001/08/16}{%
+% Adding 8-bit HE8 fonts. Note that most of them cannot be distributed
+% with heb\LaTeX\ (by Tzafrir Cohen)}
+% \changes{hebfdd-1.2a}{2003/08/19}{%
+% Adding configurations for the Culmus fonts, currently 0.90
+% (by Tzafrir Cohen)}
+% \changes{hebfdd-1.2b}{2004/02/20}{Reinstated the test whether LHE or
+% HE8 is to be used}
+%
+% \changes{hebrew-1.2c}{2005/05/18}{Typo's in the docstrip guards made
+% HE8nachlieli.fd unusable}
+% \section{Hebrew font encodings}\label{sec:hebfdd}
+%
+% % Don't forget to update the docs...
+% \subsection{THIS SECTION IS OUT OF DATE. UPDATE DOCS TO MATCH HE8
+% ENCODING}
+%
+% The file \file{\filename}\footnote{The files described in this
+% section have version number \fileversion{} and were last revised
+% on \filedate.} contains the Local Hebrew Encoding (\LHE)
+% definition, the external font information needed to use the
+% Hebrew 7-bit fonts (old code fonts) and \pkg{hebfont} package
+% that provides Hebrew font switching commands.
+%
+% Using this file as an input, |lheenc.def| encoding definition
+% file, all |.fd| files (font definition files) and font switching
+% package for available Hebrew fonts are generated. We chose to use
+% 7-bit encoding as default font encoding, because:
+% \begin{enumerate}
+% \item There are many 7-bit encoded Hebrew fonts available, more
+% then for any other encoding.
+% \item Available \TeX{} Hebrew fonts do not include latin
+% alphabet, and we can safely map Hebrew glyphs to the
+% \texttt{ASCII} positions (0 -- 127).
+% \end{enumerate}
+%
+% Current definition of the \LHE{} encoding supports only Hebrew
+% letters (|\hebalef|--|\hebtav|), but not Hebrew points, such as
+% |\hebdagesh|, |\hebqamats|, |\hebpatah|, |\hebshindot|, etc. We
+% are working now on such addition.
+%
+% \StopEventually{}
+%
+% \iffalse
+% \subsection{A driver for this document}
+%
+% The next bit of code contains the documentation driver file for
+% \TeX{}, i.e., the file that will produce the documentation you are
+% currently reading. It will be extracted from this file by the \dst{}
+% program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\title{Hebrew font encodings for use with \LaTeXe}
+\author{Boris Lavva}
+\date{Printed \today}
+\begin{document}
+ \maketitle
+ \DocInput{hebrew.fdd}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \subsection{The {\normalfont\dst{}} modules}
+%
+% The following modules are used in the implementation to direct
+% \dst{} in generating external files:
+% \begin{center}
+% \begin{tabular}{@{}ll}
+% driver & produce a documentation driver file \\[4pt]
+% HE8enc & produce the encoding definition for CodePage 1255
+% (\HEH)\\[4pt]
+% HE8cmr & make Hebrew default font in \HEH\\
+% HE8cmss & make Hebrew sans-serif font in \HEH\\
+% HE8cmtt & make Hebrew typewriter font in \HEH\\
+% HE8OmegaHebrew & Hebrew font from the Omega project (by ???)\\
+% HE8aharoni & Hebrew sans-serif font (Culmus)\\
+% HE8david & Hebrew serif font (Culmus)\\
+% HE8drugulin & Hebrew old serif font (Culmus)\\
+% HE8ellinia & Hebrew isans-serif font (Culmus)\\
+% HE8frankruehl & Hebrew serif font (Culmus)\\
+% HE8KtavYad & Hebrew handwriting font (Culmus)\\
+% HE8MiriamMono & Hebrew monospaced font\\
+% HE8Nachlieli & Hebrew sans-serif font (Culmus)\\
+% HE8CourierShalom & Hebrew Shalom (Courier) font (by IBM)\\
+% HE8HelveticaNarkissTam &Hebrew NarkisTam (Helvetica) (by Zvi Narkis)\\
+% HE8TimesNarkissim & Hebrew Narkissim (Times) (by Zvi Narkis) \\
+% HE8mfdavid & Hebrew David font (by ???)\\
+% HE8mffrank & Hebrew Frank-Ruehl font (by ??)\\
+% HE8mffrankthick & Hebrew Frank-Ruehl (thick) font (by ??)\\
+% HE8mffrankthin & Hebrew Frank-Ruehl (thin) font (by ??)\\
+% HE8mfmiriam & Hebrew Miriam font (by ???)\\
+% HE8mfmiriamwide & Hebrew Miriam (wide) font (by ???)\\
+% HE8mfnarkistam & Hebrew Narkis Tam font (by ???)\\
+% LHEenc & produce the encoding definition for Local Hebrew
+% Encoding (\LHE)\\[4pt]
+% LHEcmr & make Hebrew default font in \LHE\\
+% LHEcmss & make Hebrew sans-serif font in \LHE\\
+% LHEcmtt & make Hebrew typewriter font in \LHE\\
+% LHEclas & make Hebrew classic font (by Joel M.~Hoffman) in \LHE\\
+% LHEshold & make Hebrew shalom old font (by Jonathan Brecher)
+% in \LHE\\
+% LHEshscr & make Hebrew shalom script font (by Jonathan Brecher)
+% in \LHE\\
+% LHEshstk & make Hebrew shalom stick font (by Jonathan Brecher)
+% in \LHE\\
+% LHEfr & make Hebrew frank-ruehl font in \LHE\\
+% LHEcrml & make Hebrew carmel font (by Dr. Samy Zafrany) in \LHE\\
+% LHEredis & make Hebrew redis font (by Prof. Jacques J.~Goldberg)
+% in \LHE\\[4pt]
+% nowarn & option for font definition files, that used\\
+% & to produce ``silent'' font substitutions without
+% giving warnings\\[4pt]
+% hebfont & create Hebrew font switching commands package
+% \end{tabular}
+% \end{center}
+% A typical \dst{} command file would then have entries like:
+%\begin{verbatim}
+%\generateFile{lhecmr.fd}{t}{\from{hebrew.fdd}{LHEcmr,nowarn}}
+%\end{verbatim}
+%
+% \subsection{The \LHE encoding definition file}
+%
+% The Hebrew font encoding \LHE{} is based upon the old-code encoding
+% also known as the Israeli Standard SI-960. Many Hebrew \TeX{}
+% fonts from the Hebrew University of Jerusalem are encoded
+% in this encoding. It only uses the lower 128 positions of the font
+% table. As local encoding its name start with the letter `L'.
+%
+% First we define the Local Hebrew Encoding; specify a default
+% for the font substitution process for the \LHE{} encoding and
+% supply a font to be used when all else fails.
+%
+% \begin{macrocode}
+%<*LHEenc>
+\DeclareFontEncoding{LHE}{}{}
+\DeclareFontSubstitution{LHE}{cmr}{m}{n}
+\DeclareErrorFont{LHE}{cmr}{m}{n}{10}
+%</LHEenc>
+% \end{macrocode}
+% Then we define a few commands in the \LHE{} encoding.
+% \begin{macrocode}
+%<*LHEenc>
+\ProvideTextCommand{\textcopyright}{LHE}{\textcircled{\@latin{c}}}
+\ProvideTextCommand{\textregistered}{LHE}{\textcircled{\scshape%
+ \@latin{r}}}
+\ProvideTextCommand{\texttrademark}{LHE}{\textsuperscript{\@latin{TM}}}
+%</LHEenc>
+% \end{macrocode}
+%
+% Because not everyone can input Hebrew input text directly from
+% the keyboard we need to define control sequences for all the
+% Hebrew glyphs in the fonts. In addition, we want to support
+% many input encodings for Hebrew and to keep the language
+% definition file (|hebrew.ldf|) independent of the
+% encoding. Therefore, we exploit the standard \LaTeXe{} font
+% encoding mechanism to define control sequences for all the Hebrew
+% glyphs in the fonts in encoding-specific way. The language
+% definition file uses only the control sequences and doesn't need
+% to check the current font or input encoding.
+%
+% In the \LHE{} encoding (7-bit encoding) all the Hebrew glyphes
+% reside in the \emph{lower} half of the font. Currently, only the
+% Hebrew letters are supported. They use the same positions as the
+% latin small letters in |ASCII| encoding and the position of |`|.
+%
+% The symbol |`| (glyph 96) is used by Hebrew letter \emph{Alef},
+% so we need to define its |lccode| to allow hyphenation. All other
+% letters retain the same |lccode|s as their latin counterparts.
+% \begin{macrocode}
+%<+LHEenc>\lccode``=``
+% \end{macrocode}
+% Hebrew letters occupy the positions 96--122 in \LHE{} encoding:
+% \begin{macrocode}
+%<*LHEenc>
+\DeclareTextSymbol{\hebalef}{LHE}{96}
+\DeclareTextSymbol{\hebbet}{LHE}{97}
+\DeclareTextSymbol{\hebgimel}{LHE}{98}
+\DeclareTextSymbol{\hebdalet}{LHE}{99}
+\DeclareTextSymbol{\hebhe}{LHE}{100}
+\DeclareTextSymbol{\hebvav}{LHE}{101}
+\DeclareTextSymbol{\hebzayin}{LHE}{102}
+\DeclareTextSymbol{\hebhet}{LHE}{103}
+\DeclareTextSymbol{\hebtet}{LHE}{104}
+\DeclareTextSymbol{\hebyod}{LHE}{105}
+\DeclareTextSymbol{\hebfinalkaf}{LHE}{106}
+\DeclareTextSymbol{\hebkaf}{LHE}{107}
+\DeclareTextSymbol{\heblamed}{LHE}{108}
+\DeclareTextSymbol{\hebfinalmem}{LHE}{109}
+\DeclareTextSymbol{\hebmem}{LHE}{110}
+\DeclareTextSymbol{\hebfinalnun}{LHE}{111}
+\DeclareTextSymbol{\hebnun}{LHE}{112}
+\DeclareTextSymbol{\hebsamekh}{LHE}{113}
+\DeclareTextSymbol{\hebayin}{LHE}{114}
+\DeclareTextSymbol{\hebfinalpe}{LHE}{115}
+\DeclareTextSymbol{\hebpe}{LHE}{116}
+\DeclareTextSymbol{\hebfinaltsadi}{LHE}{117}
+\DeclareTextSymbol{\hebtsadi}{LHE}{118}
+\DeclareTextSymbol{\hebqof}{LHE}{119}
+\DeclareTextSymbol{\hebresh}{LHE}{120}
+\DeclareTextSymbol{\hebshin}{LHE}{121}
+\DeclareTextSymbol{\hebtav}{LHE}{122}
+%</LHEenc>
+% \end{macrocode}
+% Letter |\hebsin| is defined as a synonym of |\hebshin|:
+% \begin{macrocode}
+%<+LHEenc>\let\hebsin=\hebshin
+% \end{macrocode}
+%
+% \subsection{The font definition files (in \LHE{} encoding)}
+%
+% \subsubsection{Hebrew default font}
+%
+% It uses \emph{Jerusalem} font for regular font, \emph{Old
+% Jaffa} font for italic shape and small-caps, \emph{Dead Sea}
+% font for bold face, and \emph{Tel-Aviv} for bold-italic
+% \begin{macrocode}
+%<*LHEcmr>
+\DeclareFontFamily{LHE}{cmr}{\hyphenchar\font45}
+\DeclareFontShape{LHE}{cmr}{m}{n}
+ {<-> jerus10 }{}
+%%%%%%% Italicized shape
+\DeclareFontShape{LHE}{cmr}{m}{it}
+ {<-> oldjaf10 }{}
+\DeclareFontShape{LHE}{cmr}{m}{sl}
+ {<-> oldjaf10 }{}
+\DeclareFontShape{LHE}{cmr}{m}{sc}
+ {<-> oldjaf10 }{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{cmr}{bx}{n}
+ {<-> deads10 }{}
+\DeclareFontShape{LHE}{cmr}{b}{n}
+ {<-> deads10 }{}
+%%%%%%% Bold extended (Italic) series
+\DeclareFontShape{LHE}{cmr}{bx}{sl}
+ {<-> telav10 }{}
+\DeclareFontShape{LHE}{cmr}{bx}{it}
+ {<-> telav10 }{}
+%</LHEcmr>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew sans-serif font}
+%
+% We use \emph{Tel Aviv} font for the Sans family. \emph{Old
+% Jaffa} font is used for italic shape and \emph{Dead Sea}
+% used for bold face.
+% \begin{macrocode}
+%<*LHEcmss>
+\DeclareFontFamily{LHE}{cmss}{\hyphenchar\font45}
+\DeclareFontShape{LHE}{cmss}{m}{n}
+ {<-> telav10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{m}{sc}
+%<-nowarn> {<->sub * cmss/m/n}{}
+%<+nowarn> {<->ssub * cmss/m/n}{}
+%%%%%%% Italicized shape
+\DeclareFontShape{LHE}{cmss}{m}{it}
+ {<-> oldjaf10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{m}{sl}
+%<-nowarn> {<->sub * cmss/m/it}{}
+%<+nowarn> {<->ssub * cmss/m/it}{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{cmss}{bx}{n}
+ {<-> deads10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{b}{n}
+%<-nowarn> {<->sub * cmss/bx/n}{}
+%<+nowarn> {<->ssub * cmss/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{bx}{sl}
+%<-nowarn> {<->sub * cmss/bx/n}{}
+%<+nowarn> {<->ssub * cmss/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{bx}{it}
+%<-nowarn> {<->sub * cmss/bx/n}{}
+%<+nowarn> {<->ssub * cmss/bx/n}{}
+%</LHEcmss>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew typewriter font}
+%
+% We use \emph{Tel Aviv} font as the typewriter font. \emph{Old
+% Jaffa} font is used for italic shape and \emph{Dead Sea}
+% used for bold face.
+% \begin{macrocode}
+%<*LHEcmtt>
+\DeclareFontFamily{LHE}{cmtt}{\hyphenchar \font\m@ne}
+\DeclareFontShape{LHE}{cmtt}{m}{n}
+ {<-> telav10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmtt}{m}{sc}
+%<-nowarn> {<->sub * cmtt/m/n}{}
+%<+nowarn> {<->ssub * cmtt/m/n}{}
+%%%%%%% Italicized shape
+\DeclareFontShape{LHE}{cmtt}{m}{it}
+ {<-> oldjaf10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmtt}{m}{sl}
+%<-nowarn> {<->sub * cmtt/m/it}{}
+%<+nowarn> {<->ssub * cmtt/m/it}{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{cmtt}{bx}{n}
+ {<-> deads10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmtt}{bx}{it}
+%<-nowarn> {<->sub * cmtt/bx/n}{}
+%<+nowarn> {<->ssub * cmtt/bx/n}{}
+%</LHEcmtt>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew classic font}
+%
+% \emph{Hclassic} and \emph{hcaption} fonts are distributed freely
+% from |CTAN| sites and copyrighted by Joel M.~Hoffman, of 19
+% Hillcrest Lane, Rye, NY 10580 USA, e-mail:
+% |72700.402@compuserve.com|.
+%
+% Hclassic is a modernized Classical Hebrew font (in the same way
+% that Knuth's |cmr| family is a modernized Roman font --- but his
+% fonts are much nicer). Hcaption is a slanted version of hclassic
+% font. Both fonts contain all of the Hebrew consonants,
+% the (rarely used) ligature \emph{alef-lamed} and two versions of
+% the letter \emph{ayin} for use with and without
+% vowels. Hclassic also contains all of the vowels found in Hebrew,
+% a symbol for \emph{meteg}, and dots for use as a \emph{dagesh}
+% and for differentiating \emph{shin} and \emph{sin} letters.
+%
+% Currently, only the Hebrew consonants (\emph{hebalef} -- \emph{hebtav})
+% from these fonts are supported by \LaTeXe{}, however one can use
+% vowels and dots directly with \PlainTeX{} macros. We are working
+% on generic vowels and dots support for \LaTeXe.
+%
+% \begin{macrocode}
+%<*LHEclas>
+\DeclareFontFamily{LHE}{clas}{}
+\DeclareFontShape{LHE}{clas}{m}{n}
+ {<-> s * [0.83345] hclassic }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{clas}{m}{sc}
+%<-nowarn> {<->sub * clas/m/n}{}
+%<+nowarn> {<->ssub * clas/m/n}{}
+%%%%%%% Slanted shape
+\DeclareFontShape{LHE}{clas}{m}{sl}
+ {<-> s * [0.69389] hcaption }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{clas}{m}{it}
+%<-nowarn> {<->sub * clas/m/sl}{}
+%<+nowarn> {<->ssub * clas/m/sl}{}
+%</LHEclas>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew shalom fonts}
+%
+% All three shalom fonts (\emph{ShalomScript10},
+% \emph{ShalomStick10} and \emph{ShalomOldStyle10}) have been
+% created by Jonathan Brecher, of 9 Skyview Road, Lexington, MA
+% 02173-1112 USA, e-mail: |brecher@husc.harvard.edu|.
+%
+% All shalom fonts have been written in \PS{} via Fontographer on a
+% Mac. The fonts have been converted to \MF{} by Rama Porrat
+% (e-mail: |rama@cc.huji.ac.il|), using
+% the utility typo, a font editor + converter between font formats
+% (a commercial product). |ShalomScript10.mf| is the \MF{}
+% equivalent of |ShalomScript.ps|, |ShalomStick10.mf| came from
+% |ShalomStick.ps| and |ShalomOldStyle10.mf| originated in
+% |ShalomOldStyle.ps|.
+%
+% The fonts differ in the letters' style. ShalomScript10 contains
+% hand writing Hebrew letters; ShalomStick10 contains sans-serif
+% letters, and ShalomOldStyle10 contains old style letters. All
+% three fonts contain vowels and dots (nikud). While converting to
+% \MF{}, letters and symbols within the fonts have been arranged
+% so as to get a usable font for writing Hebrew documents in \TeX{}
+% or \LaTeX{}, with as well as without vowels.
+%
+% Currently, only the Hebrew consonants (\emph{hebalef} -- \emph{hebtav})
+% from these fonts are supported by \LaTeXe{}, however one can use
+% vowels and dots directly with \PlainTeX{} macros. We are working
+% on generic vowels and dots support for \LaTeXe.
+%
+% \begin{macrocode}
+%<*LHEshold>
+\DeclareFontFamily{LHE}{shold}{}
+\DeclareFontShape{LHE}{shold}{m}{n}
+ {<-> shold10 }{}
+%</LHEshold>
+%<*LHEshscr>
+\DeclareFontFamily{LHE}{shscr}{}
+\DeclareFontShape{LHE}{shscr}{m}{n}
+ {<-> shscr10 }{}
+%</LHEshscr>
+%<*LHEshstk>
+\DeclareFontFamily{LHE}{shstk}{}
+\DeclareFontShape{LHE}{shstk}{m}{n}
+ {<-> shstk10 }{}
+%</LHEshstk>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew frank-ruehl font}
+%
+% \emph{Frank Ruehl} font was written in \MF{} and includes three
+% shapes: regular, bold extaneded and slanted.
+%
+% \begin{macrocode}
+%<*LHEfr>
+\DeclareFontFamily{LHE}{fr}{}
+\DeclareFontShape{LHE}{fr}{m}{n}
+ {<-> fr }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{m}{sc}
+%<-nowarn> {<->sub * fr/m/n}{}
+%<+nowarn> {<->ssub * fr/m/n}{}
+%%%%%%% Slanted shape
+\DeclareFontShape{LHE}{fr}{m}{sl}
+ {<-> frsl }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{m}{it}
+%<-nowarn> {<->sub * fr/m/sl}{}
+%<+nowarn> {<->ssub * fr/m/sl}{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{fr}{bx}{n}
+ {<-> frbx }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{b}{n}
+%<-nowarn> {<->sub * fr/bx/n}{}
+%<+nowarn> {<->ssub * fr/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{bx}{sl}
+%<-nowarn> {<->sub * fr/bx/n}{}
+%<+nowarn> {<->ssub * fr/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{bx}{it}
+%<-nowarn> {<->sub * fr/bx/n}{}
+%<+nowarn> {<->ssub * fr/bx/n}{}
+%</LHEfr>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew carmel font}
+%
+% \emph{Carmel} font includes regular and slanted shapes. It was
+% created by Dr.~Samy Zafrany of the Technion, Haifa, Israel with
+% the intention of making nice fonts for headers and emphasized
+% text.
+%
+% \begin{macrocode}
+%<*LHEcrml>
+\DeclareFontFamily{LHE}{crml}{}
+\DeclareFontShape{LHE}{crml}{m}{n}
+ {<-> crml10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{crml}{m}{sc}
+%<-nowarn> {<->sub * crml/m/n}{}
+%<+nowarn> {<->ssub * crml/m/n}{}
+%%%%%%% Slanted shape
+\DeclareFontShape{LHE}{crml}{m}{sl}
+ {<-> crmlsl10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{crml}{m}{it}
+%<-nowarn> {<->sub * crml/m/sl}{}
+%<+nowarn> {<->ssub * crml/m/sl}{}
+%</LHEcrml>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew redis font}
+%
+% \emph{Redis} font has been created by Prof.~Jacques J.~Goldberg
+% of the Technion. Haifa, Israel. The font is available in regular,
+% slanted and bold extanded shapes. This font contains a full set
+% of Hebrew letters in a ``sans-serif vectorized'' style, and
+% selected punctuation.
+%
+% \begin{macrocode}
+%<*LHEredis>
+\DeclareFontFamily{LHE}{redis}{}
+\DeclareFontShape{LHE}{redis}{m}{n}{%
+ <5> <6> redis7
+ <7> <8> <9> <10> <12> gen * redis
+ <10.95> redis10
+ <14.4> redis12
+ <17.28> <20.74> <24.88> redis17}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{m}{sc}
+%<-nowarn> {<->sub * redis/m/n}{}
+%<+nowarn> {<->ssub * redis/m/n}{}
+%%%%%%% Slanted shape
+\DeclareFontShape{LHE}{redis}{m}{sl}{%
+ <5> <6> <7> rediss8
+ <8> <9> <10> <12> gen * rediss
+ <10.95> rediss10
+ <14.4> <17.28> <20.74> <24.88> rediss12}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{m}{it}
+%<-nowarn> {<->sub * redis/m/sl}{}
+%<+nowarn> {<->ssub * redis/m/sl}{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{redis}{bx}{n}{%
+ <5> <6> <7> <8> <9> <10> <10.95> <12>
+ <14.4> <17.28> <20.74> <24.88> redisb10}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{b}{n}
+%<-nowarn> {<->sub * redis/bx/n}{}
+%<+nowarn> {<->ssub * redis/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{bx}{sl}
+%<-nowarn> {<->sub * redis/bx/n}{}
+%<+nowarn> {<->ssub * redis/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{bx}{it}
+%<-nowarn> {<->sub * redis/bx/n}{}
+%<+nowarn> {<->ssub * redis/bx/n}{}
+%</LHEredis>
+% \end{macrocode}
+%
+% \subsection{The \HEH encoding definition file}
+%
+% The Hebrew font encoding \HEH{} is based upon an extention by
+% Microsoft to the ISO-8859-8 standard. This is an 8bit encoding. The
+% extentions include hebrew points (``Nikud'').
+%
+% First we define the Codepage 1255; specify a default
+% for the font substitution process for the \HEH{} encoding and
+% supply a font to be used when all else fails.
+%
+% \begin{macrocode}
+%<*HE8enc>
+\DeclareFontEncoding{HE8}{}{}
+\DeclareFontSubstitution{HE8}{cmr}{m}{n}
+\DeclareErrorFont{HE8}{cmr}{m}{n}{10}
+%</HE8enc>
+% \end{macrocode}
+% Then we define a few commands in the \HEH{} encoding.
+% \begin{macrocode}
+%<*HE8enc>
+\ProvideTextCommand{\textcopyright}{HE8}{\textcircled{\@latin{c}}}
+\ProvideTextCommand{\textregistered}{HE8}{\textcircled{\scshape%
+ \@latin{r}}}
+\ProvideTextCommand{\texttrademark}{HE8}{\textsuperscript{\@latin{TM}}}
+%</HE8enc>
+% \end{macrocode}
+%
+% \subsubsection{CHECK HERE FOR HE8 UPDATES}
+%
+% Because not everyone can input Hebrew input text directly from
+% the keyboard we need to define control sequences for all the
+% Hebrew glyphs in the fonts. In addition, we want to support
+% many input encodings for Hebrew and to keep the language
+% definition file (|hebrew.ldf|) independent of the
+% encoding. Therefore, we exploit the standard \LaTeXe{} font
+% encoding mechanism to define control sequences for all the Hebrew
+% glyphs in the fonts in encoding-specific way. The language
+% definition file uses only the control sequences and doesn't need
+% to check the current font or input encoding.
+%
+% % In the \LHE{} encoding (7-bit encoding) all the Hebrew glyphes
+% % reside in the \emph{lower} half of the font. Currently, only the
+% % Hebrew letters are supported. They use the same positions as the
+% % latin small letters in |ASCII| encoding and the position of |`|.
+%
+% Some general symbols:
+% \begin{macrocode}
+%<*HE8enc>
+\ProvideTextCommand{\textcopyright}{HE8}{\textcircled{\@latin{c}}}
+\ProvideTextCommand{\textregistered}{HE8}{\textcircled{\scshape%
+ \@latin{r}}}
+\ProvideTextCommand{\texttrademark}{HE8}{\textsuperscript{\@latin{TM}}}
+%</HE8enc>
+% \end{macrocode}
+%
+% The hebrew points:
+% \begin{macrocode}
+%<*HE8enc>
+\DeclareTextSymbol{\sheva}{HE8}{192}
+\DeclareTextSymbol{\hatafsegol}{HE8}{193}
+\DeclareTextSymbol{\hatafpatah}{HE8}{194}
+\DeclareTextSymbol{\hatafqamats}{HE8}{195}
+\DeclareTextSymbol{\hiriq}{HE8}{196}
+\DeclareTextSymbol{\tsere}{HE8}{197}
+\DeclareTextSymbol{\segol}{HE8}{198}
+\DeclareTextSymbol{\patah}{HE8}{199}
+\DeclareTextSymbol{\qamats}{HE8}{200}
+\DeclareTextSymbol{\holam}{HE8}{201}
+\DeclareTextSymbol{\qubuts}{HE8}{203}
+\DeclareTextSymbol{\dagesh}{HE8}{204}
+\DeclareTextSymbol{\meteg}{HE8}{205}
+\DeclareTextSymbol{\maqaf}{HE8}{206}
+\DeclareTextSymbol{\rafe}{HE8}{207}
+\DeclareTextSymbol{\paseq}{HE8}{208}
+\DeclareTextSymbol{\shindot}{HE8}{209}
+\DeclareTextSymbol{\sindot}{HE8}{210}
+\DeclareTextSymbol{\sofpasuq}{HE8}{211}
+\DeclareTextSymbol{\doublevav}{HE8}{212}
+\DeclareTextSymbol{\vavyod}{HE8}{213}
+\DeclareTextSymbol{\doubleyod}{HE8}{214}
+%</HE8enc>
+% \end{macrocode}
+%
+% Hebrew letters occupy the positions 224--250 in \HEH{} encoding [WHAT
+% ABOUT OTHER MARKS]:
+% \begin{macrocode}
+%<*HE8enc>
+% \lccode``=`` % probably not needed (Tzafrir)
+\DeclareTextSymbol{\hebalef}{HE8}{224}
+\DeclareTextSymbol{\hebbet}{HE8}{225}
+\DeclareTextSymbol{\hebgimel}{HE8}{226}
+\DeclareTextSymbol{\hebdalet}{HE8}{227}
+\DeclareTextSymbol{\hebhe}{HE8}{228}
+\DeclareTextSymbol{\hebvav}{HE8}{229}
+\DeclareTextSymbol{\hebzayin}{HE8}{230}
+\DeclareTextSymbol{\hebhet}{HE8}{231}
+\DeclareTextSymbol{\hebtet}{HE8}{232}
+\DeclareTextSymbol{\hebyod}{HE8}{233}
+\DeclareTextSymbol{\hebfinalkaf}{HE8}{234}
+\DeclareTextSymbol{\hebkaf}{HE8}{235}
+\DeclareTextSymbol{\heblamed}{HE8}{236}
+\DeclareTextSymbol{\hebfinalmem}{HE8}{237}
+\DeclareTextSymbol{\hebmem}{HE8}{238}
+\DeclareTextSymbol{\hebfinalnun}{HE8}{239}
+\DeclareTextSymbol{\hebnun}{HE8}{240}
+\DeclareTextSymbol{\hebsamekh}{HE8}{241}
+\DeclareTextSymbol{\hebayin}{HE8}{242}
+\DeclareTextSymbol{\hebfinalpe}{HE8}{243}
+\DeclareTextSymbol{\hebpe}{HE8}{244}
+\DeclareTextSymbol{\hebfinaltsadi}{HE8}{245}
+\DeclareTextSymbol{\hebtsadi}{HE8}{246}
+\DeclareTextSymbol{\hebqof}{HE8}{247}
+\DeclareTextSymbol{\hebresh}{HE8}{248}
+\DeclareTextSymbol{\hebshin}{HE8}{249}
+\DeclareTextSymbol{\hebtav}{HE8}{250}
+%</HE8enc>
+% \end{macrocode}
+% Letter |\hebsin| is defined as a synonym of |\hebshin|:
+% \begin{macrocode}
+%<+HE8enc>\let\hebsin=\hebshin
+% \end{macrocode}
+%
+% \subsection{The font definition files (in \HEH{} encoding)}
+%
+% \subsubsection{Hebrew default font}
+%
+% It uses \emph{OmegaHebrew} font for regular font, \emph{Old
+% Jaffa} font for italic shape and small-caps, \emph{Dead Sea}
+% font for bold face, and \emph{Tel-Aviv} for bold-italic
+% \begin{macrocode}
+%<*HE8cmr>
+\DeclareFontFamily{HE8}{cmr}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{cmr}{m}{n}
+ {<-> david }{}
+%%%%%%% Italicized shape
+\DeclareFontShape{HE8}{cmr}{m}{it}
+ {<-> davidi }{}
+\DeclareFontShape{HE8}{cmr}{m}{sl}
+ {<-> davidi }{}
+\DeclareFontShape{HE8}{cmr}{m}{sc}
+ {<-> david }{}
+%%%%%%% Bold extended series
+\DeclareFontShape{HE8}{cmr}{bx}{n}
+ {<-> davidb }{}
+\DeclareFontShape{HE8}{cmr}{b}{n}
+ {<-> davidb }{}
+%%%%%%% Bold extended (Italic) series
+\DeclareFontShape{HE8}{cmr}{bx}{sl}
+ {<-> davidbi }{}
+\DeclareFontShape{HE8}{cmr}{bx}{it}
+ {<-> davidbi }{}
+%</HE8cmr>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew sans-serif font}
+%
+% Until we have a real sans-serif font in this distribution, this file
+% will remain a copy of the roman fonts definitons above.
+% \begin{macrocode}
+%<*HE8cmss>
+\DeclareFontFamily{HE8}{cmss}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{cmss}{m}{n}
+ {<-> nachlieli }{}
+%%%%%%% Italicized shape
+\DeclareFontShape{HE8}{cmss}{m}{it}
+ {<-> nachlieli }{}
+\DeclareFontShape{HE8}{cmss}{m}{sl}
+ {<-> nachlieli }{}
+\DeclareFontShape{HE8}{cmss}{m}{sc}
+ {<-> nachlieli }{}
+%%%%%%% Bold extended series
+\DeclareFontShape{HE8}{cmss}{bx}{n}
+ {<-> nachlieli }{}
+\DeclareFontShape{HE8}{cmss}{b}{n}
+ {<-> nachlieli }{}
+%%%%%%% Bold extended (Italic) series
+\DeclareFontShape{HE8}{cmss}{bx}{sl}
+ {<-> nachlieli }{}
+\DeclareFontShape{HE8}{cmss}{bx}{it}
+ {<-> nachlieli }{}
+%</HE8cmss>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew typewriter font}
+%
+% Until we have a real sans-serif font in this distribution, this file
+% will remain a copy of the roman fonts definitons above.
+% \begin{macrocode}
+%<*HE8cmtt>
+\DeclareFontFamily{HE8}{cmtt}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{cmtt}{m}{n}
+ {<-> miriam }{}
+%%%%%%% Italicized shape
+\DeclareFontShape{HE8}{cmtt}{m}{it}
+ {<-> miriam }{}
+\DeclareFontShape{HE8}{cmtt}{m}{sl}
+ {<-> miriam }{}
+\DeclareFontShape{HE8}{cmtt}{m}{sc}
+ {<-> miriam }{}
+%%%%%%% Bold extended series
+\DeclareFontShape{HE8}{cmtt}{bx}{n}
+ {<-> miriam }{}
+\DeclareFontShape{HE8}{cmtt}{b}{n}
+ {<-> miriam }{}
+%%%%%%% Bold extended (Italic) series
+\DeclareFontShape{HE8}{cmtt}{bx}{sl}
+ {<-> miriam }{}
+\DeclareFontShape{HE8}{cmtt}{bx}{it}
+ {<-> miriam }{}
+%</HE8cmtt>
+% \end{macrocode}
+%
+% \subsubsection{8Bit OmegaHebrew font}
+%
+% \emph{OmegaHebrew} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8OmegaHebrew>
+\def\OmegaHebrewscale{0.9}
+\DeclareFontFamily{HE8}{OmegaHebrew}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{OmegaHebrew}{m}{n}{<-> [\OmegaHebrewscale] OmegaHebrew }{}
+%\endinput % is it needed [tzafrir]
+%</HE8OmegaHebrew>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit Aharoni font}
+%
+% \emph{Aharoni} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8aharoni>
+\def\Aharoniscale{1.0}
+\DeclareFontFamily{HE8}{aharoni}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{aharoni}{m}{n} {<-> [\Aharoniscale] aharoni}{}
+\DeclareFontShape{HE8}{aharoni}{m}{it} {<-> [\Aharoniscale] aharonii}{}
+\DeclareFontShape{HE8}{aharoni}{m}{sl} {<-> [\Aharoniscale] aharonii}{}
+\DeclareFontShape{HE8}{aharoni}{b}{n} {<-> [\Aharoniscale] aharonib}{}
+\DeclareFontShape{HE8}{aharoni}{bx}{n} {<-> [\Aharoniscale] aharonib}{}
+\DeclareFontShape{HE8}{aharoni}{bx}{it} {<-> [\Aharoniscale] aharonibi}{}
+
+%\endinput % is it needed [tzafrir]
+%</HE8aharoni>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit David font}
+%
+% \emph{David} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8david>
+\def\Davidscale{1.0}
+\DeclareFontFamily{HE8}{david}{\hyphenchar\font45}
+
+\DeclareFontShape{HE8}{david}{m}{n} {<-> [\Davidscale] david}{}
+\DeclareFontShape{HE8}{david}{m}{it} {<-> [\Davidscale] davidi}{}
+\DeclareFontShape{HE8}{david}{m}{sl} {<-> [\Davidscale] davidi}{}
+\DeclareFontShape{HE8}{david}{b}{n} {<-> [\Davidscale] davidb}{}
+\DeclareFontShape{HE8}{david}{bx}{n} {<-> [\Davidscale] davidb}{}
+\DeclareFontShape{HE8}{david}{bx}{it} {<-> [\Davidscale] davidbi}{}
+
+
+%\endinput % is it needed [tzafrir]
+%</HE8david>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit Drugulin font}
+%
+% \emph{Drugulin} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8drugulin>
+\def\Drugulinscale{1.0}
+\DeclareFontFamily{HE8}{drugulin}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{drugulin}{m}{n} {<-> [\Drugulinscale] drugulinb}{}
+\DeclareFontShape{HE8}{drugulin}{m}{it} {<-> [\Drugulinscale] drugulinbi}{}
+\DeclareFontShape{HE8}{drugulin}{m}{sl} {<-> [\Drugulinscale] drugulinbi}{}
+\DeclareFontShape{HE8}{drugulin}{b}{n} {<-> [\Drugulinscale] drugulinb}{}
+\DeclareFontShape{HE8}{drugulin}{bx}{n} {<-> [\Drugulinscale] drugulinb}{}
+\DeclareFontShape{HE8}{drugulin}{bx}{it} {<-> [\Drugulinscale] drugulinbi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8drugulin>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit Ellinia font}
+%
+% \emph{Ellinia} is a sans-serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8ellinia>
+\def\Elliniascale{1.0}
+\DeclareFontFamily{HE8}{ellinia}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{ellinia}{m}{n} {<-> [\Elliniascale] ellinia}{}
+\DeclareFontShape{HE8}{ellinia}{m}{it} {<-> [\Elliniascale] elliniai}{}
+\DeclareFontShape{HE8}{ellinia}{m}{sl} {<-> [\Elliniascale] elliniai}{}
+\DeclareFontShape{HE8}{ellinia}{b}{n} {<-> [\Elliniascale] elliniab}{}
+\DeclareFontShape{HE8}{ellinia}{bx}{n} {<-> [\Elliniascale] elliniab}{}
+\DeclareFontShape{HE8}{ellinia}{bx}{it} {<-> [\Elliniascale] elliniabi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8ellinia>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit FrankRuehl font}
+%
+% \emph{FrankRuehl} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8frankruehl>
+\def\FrankRuehlscale{1.0}
+\DeclareFontFamily{HE8}{frank}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{frank}{m}{n} {<-> [\FrankRuehlscale] frank}{}
+\DeclareFontShape{HE8}{frank}{m}{it} {<-> [\FrankRuehlscale] franki}{}
+\DeclareFontShape{HE8}{frank}{m}{sl} {<-> [\FrankRuehlscale] franki}{}
+\DeclareFontShape{HE8}{frank}{b}{n} {<-> [\FrankRuehlscale] frankb}{}
+\DeclareFontShape{HE8}{frank}{bx}{n} {<-> [\FrankRuehlscale] frankb}{}
+\DeclareFontShape{HE8}{frank}{bx}{it} {<-> [\FrankRuehlscale] frankbi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8frankruehl>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit KtavYad font}
+%
+% \emph{KtavYad} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8yad>
+\def\KtavYadscale{1.0}
+\DeclareFontFamily{HE8}{yad}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{yad}{m}{n} {<-> [\KtavYadscale] yadi}{}
+\DeclareFontShape{HE8}{yad}{m}{it} {<-> [\KtavYadscale] yadi}{}
+\DeclareFontShape{HE8}{yad}{m}{sl} {<-> [\KtavYadscale] yadi}{}
+\DeclareFontShape{HE8}{yad}{b}{n} {<-> [\KtavYadscale] yadbi}{}
+\DeclareFontShape{HE8}{yad}{bx}{n} {<-> [\KtavYadscale] yadbi}{}
+\DeclareFontShape{HE8}{yad}{bx}{it} {<-> [\KtavYadscale] yadbi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8yad>
+% \end{macrocode}
+%
+% \subsubsection{8Bit MiriamMono font}
+%
+% \emph{MiriamMono} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8miriam>
+\def\MiriamMonoscale{1.0}
+\DeclareFontFamily{HE8}{miriam}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{miriam}{m}{n} {<-> [\MiriamMonoscale] miriam}{}
+\DeclareFontShape{HE8}{miriam}{m}{it} {<-> [\MiriamMonoscale] miriami}{}
+\DeclareFontShape{HE8}{miriam}{m}{sl} {<-> [\MiriamMonoscale] miriami}{}
+\DeclareFontShape{HE8}{miriam}{b}{n} {<-> [\MiriamMonoscale] miriamb}{}
+\DeclareFontShape{HE8}{miriam}{bx}{n} {<-> [\MiriamMonoscale] miriamb}{}
+\DeclareFontShape{HE8}{miriam}{bx}{it} {<-> [\MiriamMonoscale] miriambi}{}
+
+%\endinput % is it needed [tzafrir]
+%</HE8miriam>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit Nachlieli font}
+%
+% \emph{Nachlieli} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8nachlieli>
+\def\Nachlieliscale{1.0}
+\DeclareFontFamily{HE8}{nachlieli}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{nachlieli}{m}{n} {<-> [\Nachlieliscale] nachlieli}{}
+\DeclareFontShape{HE8}{nachlieli}{m}{it} {<-> [\Nachlieliscale] nachlielii}{}
+\DeclareFontShape{HE8}{nachlieli}{m}{sl} {<-> [\Nachlieliscale] nachlielii}{}
+\DeclareFontShape{HE8}{nachlieli}{b}{n} {<-> [\Nachlieliscale] nachlielib}{}
+\DeclareFontShape{HE8}{nachlieli}{bx}{n} {<-> [\Nachlieliscale] nachlielib}{}
+\DeclareFontShape{HE8}{nachlieli}{bx}{it} {<-> [\Nachlieliscale] nachlielibi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8nachlieli>
+% \end{macrocode}
+%
+%
+% \subsubsection{Hebrew font switching commands}
+%
+% The \pkg{hebfont} package defines a number of high-level commands
+% (all starting with |\text..| similar to the standard \LaTeXe{}
+% font-change commands, for example |\textbf|) that have one
+% argument and typeset this argument in the requested way. These
+% commands are defined for all available Hebrew fonts defined above
+% and change only font parameters but not direction.
+%
+% For example, to use Hebrew Classic font family, the following
+% sequence of commands should be included in a \LaTeXe{} document:
+% \begin{quote}
+% |\sethebrew|\\
+% |\textclas{Hebrew text printed with Classic fonts}|
+% \end{quote}
+% or to use Hebrew with Classic fonts locally:
+% \begin{quote}
+% |\R{\textclas{Hebrew text printed with Classic fonts}}|
+% \end{quote}
+%
+% \begin{table}[t]
+% \begin{center}
+% \begin{tabular}{lll}
+% \textit{Command} & \textit{Corresponds to} &
+% \textit{Font family} \\[4pt]
+% |\textjm{..}| & |\rmfamily| & Jerusalem font \\
+% |\textds{..}| & |\bfseries| & Dead Sea font \\
+% |\textoj{..}| & |\itshape| & Old Jaffa font \\
+% & |\slshape| & \\
+% & |\emph| & \\
+% |\textta{..}| & |\sffamily| & Tel-Aviv font \\
+% & |\ttfamily| & \\[2pt]
+% |\textcrml{..}| & |\fontfamily{crml}| & Carmel fonts \\[2pt]
+% |\textfr{..}| & |\fontfamily{fr}| & Frank-Ruehl fonts \\[2pt]
+% |\textredis{..}| & |\fontfamily{redis}| & Redis fonts \\[2pt]
+% |\textclas{..}| & |\fontfamily{redis}| & Classic fonts \\[2pt]
+% |\textshold{..}| & |\fontfamily{shold}| & Shalom Old Style font \\
+% |\textshscr{..}| & |\fontfamily{shscr}| & Shalom Script font \\
+% |\textshstk{..}| & |\fontfamily{shstk}| & Shalom Stick font
+% \end{tabular}
+% \end{center}
+% \caption{Hebrew font-change commands with arguments}
+% \label{tab:fntcmds}
+% \begin{quote}
+% The font change commands provided here all start with |\text..|
+% to emphasize that they are for use in normal text and to be
+% easily memorable.
+% \end{quote}
+% \end{table}
+%
+% We declare \LaTeXe{} font commands, e.g.\ |\textjm{|\ldots|}|
+% for all available fonts. Table~\ref{tab:fntcmds} shows the
+% meanings of all these new high-level commands.
+%
+% \begin{macro}{\textjm}
+% Switches to \emph{Jerusalem} font which is default regular Hebrew
+% font (``roman'' family). Commands |\textrm{|\ldots|}| and
+% old-style |{\rm |\ldots|}| will produce the same result.
+% \begin{macrocode}
+%<*hebfont>
+\def\ivritex@tmp{HE8}
+\ifx\ivritex@tmp\HeblatexEncoding %
+ % compatibility with hebfonts:
+ \DeclareTextFontCommand{\textjm}{\rmfamily\selectfont}
+ \DeclareTextFontCommand{\textds}{\bfseries\selectfont}
+ \DeclareTextFontCommand{\textoj}{\itshape\selectfont}
+ \DeclareTextFontCommand{\textta}{\sffamily\selectfont}
+
+ % an attempt to give some replacements to the original hebfonts:
+ %
+ \DeclareTextFontCommand{\textcrml}{\fontfamily{david}\selectfont}
+ \DeclareTextFontCommand{\textfr}{\fontfamily{frank}\selectfont}
+ \DeclareTextFontCommand{\textredis}{\fontfamily{aharoni}\selectfont}
+ \DeclareTextFontCommand{\textclas}{\fontfamily{drugulin}\selectfont}
+ \DeclareTextFontCommand{\textshold}{\fontfamily{frank}\selectfont}
+ \DeclareTextFontCommand{\textshscr}{\fontfamily{yad}\selectfont}
+ \DeclareTextFontCommand{\textshstk}{\fontfamily{aharoni}\selectfont}
+ % note that redis is larger than shstk
+
+
+ \DeclareTextFontCommand{\textaha}{\fontfamily{aharoni}\selectfont}
+ \DeclareTextFontCommand{\textdav}{\fontfamily{david}\selectfont}
+ \DeclareTextFontCommand{\textdru}{\fontfamily{drugulin}\selectfont}
+ \DeclareTextFontCommand{\textel} {\fontfamily{ellinia}\selectfont}
+ % \textfr is already declared above
+ \DeclareTextFontCommand{\textmir}{\fontfamily{miriam}\selectfont}
+ \DeclareTextFontCommand{\textna} {\fontfamily{nachlieli}\selectfont}
+ % is this necessary:
+ \DeclareTextFontCommand{\textyad} {\fontfamily{yad}\selectfont}
+
+\else%
+\DeclareTextFontCommand{\textjm}{\rmfamily\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textds}
+% Switches to \emph{Dead Sea} font which is default bold font in
+% Hebrew. Commands |\textbf{|\ldots|}| and old-style
+% |{\bf |\ldots|}| will produce the same result.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textds}{\bfseries\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textoj}
+% Switches to \emph{Old Jaffa} font which is default italic font in
+% Hebrew. Commands |\textit{|\ldots|}|, |\textsl{|\ldots|}|,
+% |\emph{|\ldots|}| and old-style |{\it |\ldots|}| or
+% |{\em |\ldots|}| will produce the same result.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textoj}{\itshape\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textta}
+% Switches to \emph{Tel-Aviv} font which is default sans-serif font
+% in Hebrew. Commands |\textsf{|\ldots|}|, |\texttt{|\ldots|}| and
+% old-style |{\sf |\ldots|}| or |{\tt |\ldots|}| will produce the
+% same result (because sans-serif is used as typewriter font when
+% in Hebrew mode).
+% \begin{macrocode}
+\DeclareTextFontCommand{\textta}{\sffamily\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textcrml}
+% Switches to \emph{Carmel} font. Regular and slanted variants of
+% carmel font will be used..
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcrml}{\fontfamily{crml}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textfr}
+% Switches to \emph{Frank-Ruehl} font family. Regular, bold and
+% slanted frank ruehl fonts will be used.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textfr}{\fontfamily{fr}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textredis}
+% Switches to \emph{Redis} font family. Regular, bold and slanted
+% redis fonts of various sizes will be used.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textredis}{\fontfamily{redis}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textclas}
+% Switches to \emph{Classic} font family. The normal font will be
+% hclassic and slanted --- hcaption.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textclas}{\fontfamily{clas}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textshold}
+% Switches to \emph{Shalom Old Style} font.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textshold}{\fontfamily{shold}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textshscr}
+% Switches to \emph{Shalom Script} font.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textshscr}{\fontfamily{shscr}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textshstk}
+% Switches to \emph{Shalom Stick} font.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textshstk}{\fontfamily{shstk}\selectfont}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% Finally, for backward compatibility with \LaTeX2.09. four old
+% font commands, e.g.\ |{\jm |\ldots|}| are defined too (see
+% Table~\ref{tab:oldcmds}).
+% \begin{table}[t]
+% \begin{center}
+% \begin{tabular}{lll}
+% \textit{Old font command} & \textit{Font name} &
+% \textit{Comment}\\[4pt]
+% |{\jm ..}| & Jerusalem & default regular (roman) font \\
+% |{\ds ..}| & Dead Sea & default bold font \\
+% |{\oj ..}| & Old Jaffa & default italic and slanted font \\
+% & & used also to emphasize text \\
+% |{\ta ..}| & Tel-Aviv & default sans-serif and typewriter font\\
+% \end{tabular}
+% \end{center}
+% \caption{Hebrew old font-change commands for compatibility mode}
+% \label{tab:oldcmds}
+% \end{table}
+% \begin{macrocode}
+\if@compatibility
+ \DeclareOldFontCommand{\jm}{\normalfont\rmfamily\selectfont}%
+ {\@nomath\jm}
+ \DeclareOldFontCommand{\ds}{\normalfont\bfseries\selectfont}%
+ {\@nomath\ds}
+ \DeclareOldFontCommand{\oj}{\normalfont\itshape\selectfont}%
+ {\@nomath\oj}
+ \DeclareOldFontCommand{\ta}{\normalfont\sffamily\selectfont}%
+ {\@nomath\ta}
+\fi
+%</hebfont>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/hebrew.ins b/Master/texmf-dist/source/generic/babel/hebrew.ins
new file mode 100644
index 00000000000..80f35a41eca
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/hebrew.ins
@@ -0,0 +1,215 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+%%
+%% Copyright (C) 1997 -- 1998 Boris Lavva.
+%% Copyright (C) 1989 -- 2004 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+%%
+%% This file is contributed to the `babel' system.
+%%
+%% You are allowed to distribute this file together with all files
+%% mentioned in manifest.bbl.
+%%
+%% You are not allowed to modify its contents.
+%%
+\def\filedate{2004/02/20}
+\def\batchfile{hebrew.ins}
+\input docstrip
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+
+This is a generated file.
+
+Copyright 1997-2004 Boris Lavva and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+
+This is a generated file.
+
+Copyright 1997-2004 Boris Lavva and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\Msg{*** Generating hebrew font encoding files ***}
+\usepreamble\fdpreamble
+\generate{\file{lheenc.def}{\from{hebrew.fdd}{LHEenc}}
+ \file{lhecmr.fd}{\from{hebrew.fdd}{LHEcmr,nowarn}}
+ \file{lhecmss.fd}{\from{hebrew.fdd}{LHEcmss,nowarn}}
+ \file{lhecmtt.fd}{\from{hebrew.fdd}{LHEcmtt,nowarn}}
+ \file{lheclas.fd}{\from{hebrew.fdd}{LHEclas,nowarn}}
+ \file{he8enc.def}{\from{hebrew.fdd}{HE8enc}}
+ \file{he8cmr.fd}{\from{hebrew.fdd}{HE8cmr,nowarn}}
+ \file{he8cmss.fd}{\from{hebrew.fdd}{HE8cmss,nowarn}}
+ \file{he8cmtt.fd}{\from{hebrew.fdd}{HE8cmtt,nowarn}}
+ \file{he8aharoni.fd}{\from{hebrew.fdd}{HE8aharoni,nowarn}}
+ \file{he8david.fd}{\from{hebrew.fdd}{HE8david,nowarn}}
+ \file{he8drugulin.fd}{\from{hebrew.fdd}{HE8drugulin,nowarn}}
+ \file{he8frankruehl.fd}{\from{hebrew.fdd}{HE8frankruehl,nowarn}}
+ \file{he8yad.fd}{\from{hebrew.fdd}{HE8yad,nowarn}}
+ \file{he8miriam.fd}{\from{hebrew.fdd}{HE8miriam,nowarn}}
+ \file{he8nachlieli.fd}{\from{hebrew.fdd}{HE8nachlieli,nowarn}}
+ \file{he8OmegaHebrew.fd}{\from{hebrew.fdd}{HE8OmegaHebrew,nowarn}}
+ \file{lheshold.fd}{\from{hebrew.fdd}{LHEshold,nowarn}}
+ \file{lheshscr.fd}{\from{hebrew.fdd}{LHEshscr,nowarn}}
+ \file{lheshstk.fd}{\from{hebrew.fdd}{LHEshstk,nowarn}}
+ \file{lhefr.fd}{\from{hebrew.fdd}{LHEfr,nowarn}}
+ \file{lhecrml.fd}{\from{hebrew.fdd}{LHEcrml,nowarn}}
+ \file{lheredis.fd}{\from{hebrew.fdd}{LHEredis,nowarn}}
+ \file{hebfont.sty}{\from{hebrew.fdd}{hebfont}}
+ }
+
+\Msg{*** Generating hebrew input encoding files ***}
+\usepreamble\mainpreamble
+\generate{\file{8859-8.def}{\from{hebinp.dtx}{8859-8}}
+ \file{cp1255.def}{\from{hebinp.dtx}{cp1255}}
+ \file{cp862.def}{\from{hebinp.dtx}{cp862}}
+ \file{si960.def}{\from{hebinp.dtx}{si960}}
+ }
+
+\Msg{*** Generating hebrew language support files ***}
+\generate{\file{hebrew.ldf}{\from{hebrew.dtx}{hebrew}}
+ \file{rlbabel.def}{\from{hebrew.dtx}{rightleft}}
+ \file{hebcal.sty}{\from{hebrew.dtx}{calendar}}
+ }
+
+\Msg{*** Generating hebrew 2.09 compatibility files ***}
+\generate{\file{hebrew_newcode.sty}{\from{heb209.dtx}{newcode}}
+ \file{hebrew_p.sty}{\from{heb209.dtx}{pccode}}
+ \file{hebrew_oldcode.sty}{\from{heb209.dtx}{oldcode}}
+ }
+
+\ifToplevel{
+\Msg{*************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.cls, *.sty, *.ldf, *.fd and *.def}
+\Msg{*}
+\Msg{* To produce the documentation run `hebrew.dtx' through LaTeX}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{*************************************************************}
+}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/generic/babel/icelandic.dtx b/Master/texmf-dist/source/generic/babel/icelandic.dtx
new file mode 100644
index 00000000000..7b4be56c383
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/icelandic.dtx
@@ -0,0 +1,749 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{546}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{icelandic.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{icelandic}
+%\fi
+%\ProvidesFile{icelandic.dtx}
+ [2005/03/30 v1.1g Icelandic support from the babel system]
+%\iffalse
+%% File iceland.dtx
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989--2005
+%% by Johannes Braams, TeXniek
+%
+%% Icelandic Language Definition File
+%% Copyright (C) 1996--2005
+%% by Einar \'Arnason <einar@lif.hi.is>
+%% Johannes Braams, TeXniek
+%
+%% Please report errors to: Einar \'Arnason
+%% einar at lif.hi.is
+%% or to: J.L. Braams
+%% babel at braams.cistron.nl
+%%
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage{t1enc}
+\usepackage[icelandic,english]{babel}
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+\begin{center}
+ \textbf{\Large A Babel language definition file for
+ Icelandic}\\[3mm]^^A\]
+ Einar \'Arnason\\
+ \texttt{einar@lif.hi.is}
+\end{center}
+ \DocInput{icelandic.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{iceland.dtx}
+%
+%
+% \changes{icelandic-1.1c}{1997/05/21}{Removed code already present in
+% \file{babel.def}}
+%
+% \section{The Icelandic language}
+%
+% \subsection{Overview}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. } defines all the language definition macros for
+% the Icelandic language
+%
+% Customization for the Icelandic language was made following
+% several official and semiofficial publications~\cite{74:_augl,
+% 77:_augl,88:_reglur,94:_si,97:_forst_fs}. These publications do
+% not always agree and we indicate those instances.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:icelandic-extras} an overview is given of its
+% purpose.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{otherlanguage*}{icelandic}
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"~| & for a compound word mark without a breakpoint. \\
+% |"=| & for a compound word mark with a breakpoint, allowing
+% hyphenation in the composing words. \\
+% |"`| & for Icelandic left double quotes (looks like ,,). \\
+% |"'| & for Icelandic right double quotes. \\
+% |">| & for Icelandic `french' left double quotes
+% (similar to $>>$).\\
+% |"<| & for Icelandic `french' right double quotes
+% (similar to $<<$).\\
+% |"o| & for old Icelandic "o \\
+% |"O| & for old Icelandic "O \\
+% |"ó| & for old Icelandic "ó \\
+% |"Ó| & for old Icelandic "Ó \\
+% |"e| & for old Icelandic "e \\
+% |"E| & for old Icelandic "E \\
+% |"é| & for old Icelandic "é \\
+% |"É| & for old Icelandic "É \\
+% |\tala| & for typesetting numbers\\
+% |\grada| & for the `degree' symbol\\
+% |\gradur| & for `degrees', e.g. 5~\gradur C\\
+% |\upp| & for textsuperscript \\
+% \end{tabular}
+% \end{otherlanguage*}
+% \caption{The shorthands and extra definitions made
+% by \file{icelandic.ldf}}\label{tab:icelandic-extras}
+% \end{center}
+% \end{table}
+% The shorthands in table~\ref{tab:icelandic-extras} can also be
+% typeset by using the commands in
+% table~\ref{tab:icelandic-commands}.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{otherlanguage*}{icelandic}
+% \begin{tabular}{lp{8cm}}
+% |\ilqq| & for Icelandic left double quotes
+% (looks like ,,). \\
+% |\irqq| & for Icelandic right double quotes
+% (looks like ``). \\
+% |\ilq| & for Icelandic left single quotes
+% (looks like ,). \\
+% |\irq| & for Icelandic right single quotes
+% (looks like `). \\
+% |\iflqq| & for Icelandic `french' left double quotes
+% (similar to $>>$).\\
+% |\ifrqq| & for Icelandic `french' right double quotes
+% (similar to $<<$).\\
+% |\ifrq| & for Icelandic `french' right single quotes
+% (similar to $<$).\\
+% |\iflq| & for Icelandic `french' left single quotes
+% (similar to $>$). \\
+% |\dq| & the original quotes character (|"|). \\
+% |\oob| & for old Icelandic "o \\
+% |\Oob| & for old Icelandic "O \\
+% |\ooob| & for old Icelandic "ó \\
+% |\OOob| & for old Icelandic "Ó \\
+% |\eob| & for old Icelandic "e \\
+% |\Eob| & for old Icelandic "E \\
+% |\eeob| & for old Icelandic "é \\
+% |\EEob| & for old Icelandic "É \\
+% \end{tabular}
+% \end{otherlanguage*}
+% \caption{Commands which produce quotes and old Icelandic
+% diacritics, defined by
+% \file{icelandic.ldf}}\label{tab:icelandic-commands}
+% \end{center}
+% \end{table}
+%
+% \begin{thebibliography}{1}
+%
+% \bibitem{88:_reglur}
+% Alþingi.
+% \newblock {\em Reglur um frágang þingskjala og prentun umræðna},
+% 1988.
+%
+% \bibitem{74:_augl}
+% Auglýsing um greinarmerkjasetningu.
+% \newblock Stj.tíð B, nr. 133/1974, 1974.
+%
+% \bibitem{77:_augl}
+% Auglýsing um breyting auglýsingu nr. 132/1974 um íslenska
+% stafsetningu.
+% \newblock Stj.tíð B, nr. 261/1977, 1977.
+%
+% \bibitem{unknown72:_first_gramm_treat}
+% Einar Haugen, editor.
+% \newblock {\em First Grammatical Treatise}.
+% \newblock Longman, London, 2 edition, 1972.
+%
+% \bibitem{97:_forst_fs}
+% Staðlaráð Íslands og Fagráð í upplýsingatækni, Reykjavík.
+% \newblock {\em Forstaðall FS 130:1997}, 1997.
+%
+% \bibitem{94:_si}
+% STRÍ Staðlaráð Íslands.
+% \newblock {\em SI - kerfið}, 2 edition, 1994.
+%
+% \end{thebibliography}
+%
+% \StopEventually{}
+%
+%
+% \subsection{\TeX{}nical details}
+%
+% When this file was read through the option \Lopt{icelandic} we make
+% it behave as if \Lopt{icelandic} was specified.
+%
+% \begin{macrocode}
+\def\bbl@tempa{icelandic}
+\ifx\CurrentOption\bbl@tempa
+ \def\CurrentOption{icelandic}
+\fi
+% \end{macrocode}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{icelandic} will be an `unknown' language, so we
+% have to make it known. So we check for the existence of
+% |\l@icelandic| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@icelandic\@undefined
+ \@nopatterns{Icelandic}
+ \adddialect\l@icelandic0
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\if@Two@E}
+% We will need a new `if' : |\if@Two@E| is true if and only if
+% \LaTeXe{} is running \emph{not} in compatibility mode. It is
+% used in the definitions of the command |\tala| and |\upp|.
+% The definition is somewhat complicated, due to the fact that
+% |\if@compatibility| is not recognized as a |\if| in
+% \LaTeX-2.09 based formats.
+% \begin{macrocode}
+\newif\if@Two@E \@Two@Etrue
+\def\@FI@{\fi}
+\ifx\@compatibilitytrue\@undefined
+ \@Two@Efalse \def\@FI@{\relax}
+\else
+ \if@compatibility \@Two@Efalse \fi
+\@FI@
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\extrasicelandic}
+% \begin{macro}{\noextrasicelandic}
+%
+% The macro |\extrasicelandic|
+% will perform all the extra definitions needed for the Icelandic
+% language. The macro |\noextrasicelandic| is used to cancel the
+% actions of |\extrasicelandic|.
+%
+% For Icelandic the \texttt{"} character is
+% made active. This is done once, later on its definition may vary.
+% \begin{macrocode}
+\initiate@active@char{"}
+\@namedef{extras\CurrentOption}{%
+ \languageshorthands{icelandic}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{icelandic-1.1e}{1999/12/17}{Deactivate shorthands ouside of
+% Icelandic}
+% \begin{macrocode}
+\addto\noextrasicelandic{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% The icelandic hyphenation patterns can be used with
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{icelandic-1.1f}{2000/09/22}{Now use \cs{providehyphenmins}
+% to provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The code above is necessary because we need an extra active
+% character. This character is then used as indicated in
+% table~\ref{tab:icelandic-commands}.
+%
+% To be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+% \subsection{Captionnames and date}
+%
+% The next step consists of defining the Icelandic equivalents for
+% the \LaTeX{} captionnames.
+%
+% \begin{macro}{\captionsicelandic}
+% The macro |\captionsicelandic| will define all strings used
+% used in the four standard document classes provided
+% with \LaTeX.
+% \changes{icelandic-1.1f}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{icelandic-1.1g}{2002/01/00}{Only use 7-bit ASCII characters
+% in order to keep the texts input encoding independant}
+% \changes{icelandic-1.1g}{2002/01/09}{Added translation for Glossary}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Form\'{a}li}%
+ \def\refname{Heimildir}%
+ \def\abstractname{\'{U}tdr\'{a}ttur}%
+ \def\bibname{Heimildir}%
+ \def\chaptername{Kafli}%
+ \def\appendixname{Vi{\dh}auki}%
+ \def\contentsname{Efnisyfirlit}%
+ \def\listfigurename{Myndaskr\'{a}}%
+ \def\listtablename{T\"{o}fluskr\'{a}}%
+ \def\indexname{Atri{\dh}isor{\dh}askr\'{a}}%
+ \def\figurename{Mynd}%
+ \def\tablename{Tafla}%
+ \def\partname{Hluti}%
+ \def\enclname{Hj\'{a}lagt}%
+ \def\ccname{Samrit}%
+ \def\headtoname{Til:}% in letter
+ \def\pagename{Bla{\dh}s\'{\i}{\dh}a}%
+ \def\seename{Sj\'{a}}%
+ \def\alsoname{Sj\'{a} einnig}%
+ \def\proofname{S\"{o}nnun}%
+ \def\glossaryname{Or{\dh}alisti}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateicelandic}
+% The macro |\dateicelandic| redefines the command |\today|
+% to produce Icelandic dates.
+% \changes{icelandic-1.1c}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{icelandic-1.1c}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\dateicelandic{%
+ \def\today{\number\day.~\ifcase\month\or
+ jan\'{u}ar\or febr\'{u}ar\or mars\or apr\'{\i}l\or ma\'{\i}\or
+ j\'{u}n\'{\i}\or j\'{u}l\'{\i}\or \'{a}g\'{u}st\or september\or
+ okt\'{o}ber\or n\'{o}vember\or desember\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Icelandic quotation marks}
+%
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the icelandic and icelandic `french' quotes.
+% The icelandic `french' guillemets are the reverse of french
+% guillemets. We define single icelandic `french' quotes for
+% compatibility. Shorthands are provided for a number of different
+% quotation marks, which make them useable both outside and
+% inside mathmode.
+%
+% \begin{macrocode}
+\let\ilq\grq
+\let\irq\grq
+\let\iflq\frq
+\let\ifrq\flq
+\let\ilqq\glqq
+\let\irqq\grqq
+\let\iflqq\frqq
+\let\ifrqq\flqq
+% \end{macrocode}
+%
+% \begin{macrocode}
+\declare@shorthand{icelandic}{"`}{\glqq}
+\declare@shorthand{icelandic}{"'}{\grqq}
+\declare@shorthand{icelandic}{">}{\frqq}
+\declare@shorthand{icelandic}{"<}{\flqq}
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{icelandic}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{icelandic}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}}
+\declare@shorthand{icelandic}{""}{\hskip\z@skip}
+\declare@shorthand{icelandic}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{icelandic}{"=}{\nobreak-\hskip\z@skip}
+% \end{macrocode}
+%
+%
+% \subsection{Old Icelandic}
+% \label{oldicelandic}
+%
+% \changes{icelandic-1.1}{1997/04/24}{Added definitions for old
+% icelandic.}
+%
+% In old Icelandic some letters have special diacritical marks,
+% described for example in \emph{First Grammatical
+% Treatise}~\cite{unknown72:_first_gramm_treat,97:_forst_fs}. We
+% provide these in the \texttt{T1} encoding with the `ogonek'. The
+% ogonek is placed with the letters `o', and `O', `ó' and `Ó', `e'
+% and `E', and `é' and `É'. Shorthands are provided for these as
+% well.
+%
+% The following code by Leszek Holenderski lifted from
+% \texttt{polish.dtx} is designed to position the diacritics
+% correctly for every font in every size. These macros need a
+% few extra dimension variables.
+%
+% \begin{macrocode}
+\newdimen\pl@left
+\newdimen\pl@down
+\newdimen\pl@right
+\newdimen\pl@temp
+% \end{macrocode}
+%
+% \begin{macro}{\sob}
+% The macro |\sob| is used to put the `ogonek' in the right
+% place.
+%
+% \begin{macrocode}
+\def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo
+ \setbox0\hbox{#1}\setbox1\hbox{\k{}}\setbox2\hbox{p}%
+ \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
+ \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
+ \pl@left=\pl@right \advance\pl@left by\wd1
+ \pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
+ \leavevmode
+ \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\oob}
+% \begin{macro}{\Oob}
+% \begin{macro}{\ooob}
+% \begin{macro}{\OOob}
+% \begin{macro}{\eob}
+% \begin{macro}{\Eob}
+% \begin{macro}{\eeob}
+% \begin{macro}{\EEob}
+% \begin{macrocode}
+\DeclareTextCommand{\oob}{T1}{\sob {o}{.85}{0}{.04}{0}}
+\DeclareTextCommand{\Oob}{T1}{\sob {O}{.7}{0}{0}{0}}
+\DeclareTextCommand{\ooob}{T1}{\sob {ó}{.85}{0}{.04}{0}}
+\DeclareTextCommand{\OOob}{T1}{\sob {Ó}{.7}{0}{0}{0}}
+\DeclareTextCommand{\eob}{T1}{\sob {e}{1}{0}{.04}{0}}
+\DeclareTextCommand{\Eob}{T1}{\sob {E}{1}{0}{.04}{0}}
+\DeclareTextCommand{\eeob}{T1}{\sob {é}{1}{0}{.04}{0}}
+\DeclareTextCommand{\EEob}{T1}{\sob {É}{1}{0}{.04}{0}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\declare@shorthand{icelandic}{"o}{\oob}
+\declare@shorthand{icelandic}{"O}{\Oob}
+\declare@shorthand{icelandic}{"ó}{\ooob}
+\declare@shorthand{icelandic}{"Ó}{\OOob}
+\declare@shorthand{icelandic}{"e}{\eob}
+\declare@shorthand{icelandic}{"E}{\Eob}
+\declare@shorthand{icelandic}{"é}{\eeob}
+\declare@shorthand{icelandic}{"É}{\EEob}
+% \end{macrocode}
+%
+% \subsection{Formatting numbers}
+% \label{numbers}
+%
+% \changes{icelandic-1.1a}{1997/04/26}{Added definitions for
+% formatting numbers in Icelandic and some extra utilities.}
+% This section is lifted from \texttt{frenchb.dtx} by D. Flipo.
+% In English the decimal part starts with a point and thousands
+% should be separated by a comma: an approximation of $1000\pi$
+% should be inputed as |$3{,}141.592{,}653$| in math-mode and
+% as |3,141.592,653| in text.
+% \changes{icelandic-1.1b}{1997/05/05}{Added references to various
+% publications used}
+%
+% In Icelandic the decimal part starts with a comma and thousands
+% should be separated by a space~\cite{88:_reglur} or by a
+% period~\cite{97:_forst_fs}; we have the space. The above
+% approximation of $1000\pi$ should be inputed as
+% |$3\;141{,}592\;653$| in math-mode and as something like
+% |3~141,592~653| in text. Braces are mandatory around the comma in
+% math-mode, the reason is mentioned in the \TeX{}book p.~134:
+% the comma is of type |\mathpunct| (thus normally followed by a
+% space) while the point is of type |\mathord| (no space added).
+%
+% Thierry Bouche suggested that a second type of comma, of type
+% |\mathord| would be useful in math-mode, and proposed to
+% introduce a command (named |\decimalsep| in this package),
+% the expansion of which would depend on the current language.
+%
+% Vincent Jalby suggested a command |\nombre| to conveniently
+% typeset numbers: inputting |\nombre{3141,592653}| either in
+% text or in math-mode will format this number properly according
+% to the current language (Icelandic or non-Icelandic). We use
+% |\nombre| to define command |\tala| in Icelandic.
+%
+% |\tala| accepts an optional argument which happens to be
+% useful with the extension `dcolumn', it specifies the decimal
+% separator used in the \emph{source code}:
+% |\newcolumntype{d}{D{,}{\decimalsep}{-1}}| \\
+% |\begin{tabular}{|d|}\hline | \\
+% | 3,14 \\ | \\
+% | \tala[,]{123,4567} \\ | \\
+% | \tala[,]{9876,543}\\\hline| \\
+% |\end{tabular} | \\
+% will print a column of numbers aligned on the decimal point
+% (comma or point depending on the current language), each slice
+% of 3 digits being separated by a space or a comma according to
+% the current language.
+%
+% \begin{macro}{\decimalsep}
+% \begin{macro}{\thousandsep}
+% We need a internal definition, valid in both text and math-mode,
+% for the comma (|\@comma@|) and another one for the unbreakable
+% fixed length space (no glue) used in Icelandic (|\f@thousandsep|).
+%
+% The commands |\decimalsep| and |\thousandsep| get default
+% definitions (for the English language) when |icelandic| is loaded;
+% these definitions will be updated when the current language is
+% switched to or from Icelandic.
+% \begin{macrocode}
+\mathchardef\m@comma="013B \def\@comma@{\ifmmode\m@comma\else,\fi}
+\def\f@thousandsep{\ifmmode\mskip5.5mu\else\penalty\@M\kern.3em\fi}
+\newcommand{\decimalsep}{.} \newcommand{\thousandsep}{\@comma@}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\decimalsep{\@comma@}%
+ \def\thousandsep{\f@thousandsep}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \def\decimalsep{.}%
+ \def\thousandsep{\@comma@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tala}
+% The decimal separator used when \emph{inputing} a number
+% with |\tala| \emph{has to be a comma}.
+% |\tala| splits the inputed number into two parts: what
+% comes before the first comma will be formatted by
+% \cs{@integerpart} while the rest (if not empty) will be
+% formatted by \cs{@decimalpart}. Both parts, once formatted
+% separately will be merged together with between them, either
+% the decimal separator \cs{decimalsep} or (in \LaTeXe{}
+% \emph{only}) the optional argument of |\tala|.
+%
+% \begin{macrocode}
+\if@Two@E
+ \newcommand{\tala}[2][\decimalsep]{%
+ \def\@decimalsep{#1}\@tala#2\@empty,\@empty,\@nil}
+\else
+ \newcommand{\tala}[1]{%
+ \def\@decimalsep{\decimalsep}\@tala#1\@empty,\@empty,\@nil}
+\fi
+\def\@tala#1,#2,#3\@nil{%
+ \ifx\@empty#2%
+ \@integerpart{#1}%
+ \else
+ \@integerpart{#1}\@decimalsep\@decimalpart{#2}%
+ \fi}
+% \end{macrocode}
+% The easiest bit is the decimal part:
+% We attempt to read the first four digits of the decimal part, if
+% it has less than 4 digits, we just have to print them, otherwise
+% |\thousandsep| has to be appended after the third digit, and the
+% algorithm is applied recursively to the rest of the decimal part.
+% \begin{macrocode}
+\def\@decimalpart#1{\@@decimalpart#1\@empty\@empty\@empty}
+\def\@@decimalpart#1#2#3#4{#1#2#3%
+ \ifx\@empty#4%
+ \else
+ \thousandsep\expandafter\@@decimalpart\expandafter#4%
+ \fi}
+% \end{macrocode}
+% Formatting the integer part is more difficult because the slices
+% of 3 digits start from the \emph{bottom} while the number is
+% read from the top!
+% This (tricky) code is borrowed from David Carlisle's comma.sty.
+% \begin{macrocode}
+\def\@integerpart#1{\@@integerpart{}#1\@empty\@empty\@empty}
+\def\@@integerpart#1#2#3#4{%
+ \ifx\@empty#2%
+ \@addthousandsep#1\relax
+ \else
+ \ifx\@empty#3%
+ \@addthousandsep\@empty\@empty#1#2\relax
+ \else
+ \ifx\@empty#4%
+ \@addthousandsep\@empty#1#2#3\relax
+ \else
+ \@@integerpartafterfi{#1#2#3#4}%
+ \fi
+ \fi
+ \fi}
+\def\@@integerpartafterfi#1\fi\fi\fi{\fi\fi\fi\@@integerpart{#1}}
+\def\@addthousandsep#1#2#3#4{#1#2#3%
+ \if#4\relax
+ \else
+ \thousandsep\expandafter\@addthousandsep\expandafter#4%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Extra utilities}
+%
+% We now provide the Icelandic user with some extra utilities.
+%
+% \begin{macro}{\upp}
+% |\upp| is for typesetting superscripts. |\upp| relies on
+% \begin{macro}{\upp@size}
+% The internal macro |\upp@size| holds the size at which the
+% superscript will be typeset. The reason for this is that we have
+% to specify it differently for different formats.
+% \begin{macrocode}
+\ifx\sevenrm\@undefined
+ \ifx\@ptsize\@undefined
+ \let\upp@size\small
+ \else
+ \ifx\selectfont\@undefined
+% \end{macrocode}
+% In this case the format is the original \LaTeX-2.09:
+% \begin{macrocode}
+ \ifcase\@ptsize
+ \let\upp@size\ixpt\or
+ \let\upp@size\xpt\or
+ \let\upp@size\xipt
+ \fi
+% \end{macrocode}
+% When |\selectfont| is defined we probably have NFSS available:
+% \begin{macrocode}
+ \else
+ \ifcase\@ptsize
+ \def\upp@size{\fontsize\@ixpt{10pt}\selectfont}\or
+ \def\upp@size{\fontsize\@xpt{11pt}\selectfont}\or
+ \def\upp@size{\fontsize\@xipt{12pt}\selectfont}
+ \fi
+ \fi
+ \fi
+\else
+% \end{macrocode}
+% If we end up here it must be a plain based \TeX{} format, so:
+% \begin{macrocode}
+ \let\upp@size\sevenrm
+\fi
+% \end{macrocode}
+% \end{macro}
+% Now we can define |\upp|. When \LaTeXe{} runs in
+% compatibility mode (\LaTeX-2.09 emulation), |\textsuperscript| is
+% also defined, but does no good job, so we give two different
+% definitions for |\upp| using |\if@Two@E|.
+% \begin{macrocode}
+\if@Two@E
+ \DeclareRobustCommand*{\upp}[1]{\textsuperscript{#1}}
+\else
+ \DeclareRobustCommand*{\upp}[1]{%
+ \leavevmode\raise1ex\hbox{\upp@size#1}}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Some definitions for special characters.
+% |\grada| needs a special treatment: it is |\char6|
+% in T1-encoding and |\char23| in OT1-encoding.
+% \begin{macrocode}
+\ifx\fmtname\LaTeXeFmtName
+ \DeclareTextSymbol{\grada}{T1}{6}
+ \DeclareTextSymbol{\grada}{OT1}{23}
+\else
+ \def\T@one{T1}
+ \ifx\f@encoding\T@one
+ \newcommand{\grada}{\char6}
+ \else
+ \newcommand{\grada}{\char23}
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\gradur}
+% Macro for typesetting the abbreviation for `degrees' (as in
+% `degrees Celsius'). As the bounding box of the character `degree'
+% has \emph{very} different widths in CMR/DC and PostScript fonts,
+% we fix the width of the bounding box of |\gradur| to 0.3\,em,
+% this lets the symbol `degree' stick to the preceding
+% (e.g., |45\gradur|) or following character (e.g., |20~\gradur C|).
+% \begin{macrocode}
+\DeclareRobustCommand*{\gradur}{%
+ \leavevmode\hbox to 0.3em{\hss\grada\hss}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/icelandic.ins b/Master/texmf-dist/source/generic/babel/icelandic.ins
new file mode 100644
index 00000000000..21ba5daade9
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/icelandic.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2000/09/26}
+\def\batchfile{icelandic.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{icelandic.ldf}{\from{icelandic.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/interlingua.dtx b/Master/texmf-dist/source/generic/babel/interlingua.dtx
new file mode 100644
index 00000000000..56b109fdca7
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/interlingua.dtx
@@ -0,0 +1,207 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{85}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{interlingua.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{interlingua}
+%\fi
+%\ProvidesFile{interlingua.dtx}
+ [2005/03/30 v1.6 Interlingua support from the babel system]
+%\iffalse
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source code for
+% the Interlingua language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\usepackage{url}
+\begin{document}
+ \DocInput{interlingua.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{interlingua.dtx}
+%
+% \section{The Interlingua language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Interlingua language. This file was contributed by Peter
+% Kleiweg, kleiweg at let.rug.nl.
+%
+% Interlingua is an auxiliary language, built from the common
+% vocabulary of Spanish/Portuguese, English, Italian and French,
+% with some normalisation of spelling. The grammar is very easy,
+% more similar to English's than to neolatin languages. The site
+% \url{http://www.interlingua.com} is mostly written in interlingua
+% (as is \url{http://interlingua.altervista.org}), in case you want
+% to read some sample of it.
+%
+% You can have a look at the grammar at
+% \url{http://www.geocities.com/linguablau}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{interlingua}{captionsinterlingua}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{interlingua} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@interlingua| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\undefined\l@interlingua
+ \@nopatterns{Interlingua}
+ \adddialect\l@interlingua0\fi
+% \end{macrocode}
+
+% The next step consists of defining commands to switch to (and
+% from) the Interlingua language.
+%
+%
+% \begin{macro}{\interlinguahyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{interlingua}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsinterlingua}
+% The macro |\captionsinterlingua| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\def\captionsinterlingua{%
+ \def\prefacename{Prefacio}%
+ \def\refname{Referentias}%
+ \def\abstractname{Summario}%
+ \def\bibname{Bibliographia}%
+ \def\chaptername{Capitulo}%
+ \def\appendixname{Appendice}%
+ \def\contentsname{Contento}%
+ \def\listfigurename{Lista de figuras}%
+ \def\listtablename{Lista de tabellas}%
+ \def\indexname{Indice}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabella}%
+ \def\partname{Parte}%
+ \def\enclname{Incluso}%
+ \def\ccname{Copia}%
+ \def\headtoname{A}%
+ \def\pagename{Pagina}%
+ \def\seename{vide}%
+ \def\alsoname{vide etiam}%
+ \def\proofname{Prova}%
+ \def\glossaryname{Glossario}%
+ }
+% \end{macrocode}
+% \end{macro}
+
+
+% \begin{macro}{\dateinterlingua}
+% The macro |\dateinterlingua| redefines the command |\today| to
+% produce Interlingua dates.
+% \begin{macrocode}
+\def\dateinterlingua{%
+ \def\today{le~\number\day\space de \ifcase\month\or
+ januario\or februario\or martio\or april\or maio\or junio\or
+ julio\or augusto\or septembre\or octobre\or novembre\or
+ decembre\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\extrasinterlingua}
+% \begin{macro}{\noextrasinterlingua}
+% The macro |\extrasinterlingua| will perform all the extra
+% definitions needed for the Interlingua language. The macro
+% |\noextrasinterlingua| is used to cancel the actions of
+% |\extrasinterlingua|. For the moment these macros are empty but
+% they are defined for compatibility with the other
+% language definition files.
+%
+% \begin{macrocode}
+\addto\extrasinterlingua{}
+\addto\noextrasinterlingua{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{interlingua}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/Master/texmf-dist/source/generic/babel/interlingua.ins b/Master/texmf-dist/source/generic/babel/interlingua.ins
new file mode 100644
index 00000000000..679af1e10c4
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/interlingua.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2003/11/13}
+\def\batchfile{interlingua.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{interlingua.ldf}{\from{interlingua.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/irish.dtx b/Master/texmf-dist/source/generic/babel/irish.dtx
new file mode 100644
index 00000000000..221c08f91a5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/irish.dtx
@@ -0,0 +1,218 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{122}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{irish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{irish}
+%\fi
+%\ProvidesFile{irish.dtx}
+ [2005/03/30 v1.0h Irish support from the babel system]
+%\iffalse
+%% File `irish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Irish language definition file.
+%
+% The Gaeilge or Irish Gaelic terms were tranlated from those
+% provided by Fraser Grant \texttt{FRASER@CERNVM} by Marion Gunn.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{irish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{irish.dtx}
+%
+% \changes{irish-1.0b}{1995/06/14}{Corrected typo (PR1652)}
+% \changes{irish-1.0e}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Irish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Marion Gunn.} defines all
+% the language definition macros for the Irish language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{irish-1.0e}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{irish}\captionsirish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{irish} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@irish| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@irish\@undefined
+ \@nopatterns{irish}
+ \adddialect\l@irish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Irish language.
+%
+% \begin{macro}{\irishhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{irish-1.0f}{1998/06/08}{Added definition of
+% \cs{hyphenmins}}
+% \changes{irish-1.0h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsirish}
+% The macro |\captionsirish| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{irish-1.0c}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{irish-1.0f}{1998/06/08}{Added missing translations provided
+% in PR 2719}
+% \changes{irish-1.0h}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsirish{%
+ \def\prefacename{R\'eamhr\'a}% <-- also "Brollach"
+ \def\refname{Tagairt\'{\i}}%
+ \def\abstractname{Achoimre}%
+ \def\bibname{Leabharliosta}%
+ \def\chaptername{Caibidil}%
+ \def\appendixname{Aguis\'{\i}n}%
+ \def\contentsname{Cl\'ar \'Abhair}%
+ \def\listfigurename{L\'ear\'aid\'{\i}}%
+ \def\listtablename{T\'abla\'{\i}}%
+ \def\indexname{Inn\'eacs}%
+ \def\figurename{L\'ear\'aid}%
+ \def\tablename{T\'abla}%
+ \def\partname{Cuid}%
+ \def\enclname{faoi iamh}%
+ \def\ccname{cc}% abrv. `c\'oip chuig'
+ \def\headtoname{Go}%
+ \def\pagename{Leathanach}%
+ \def\seename{f\'each}%
+ \def\alsoname{f\'each freisin}%
+ \def\proofname{Cruth\'unas}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateirish}
+% The macro |\dateirish| redefines the command |\today| to produce
+% Irish dates.
+% \changes{irish-1.0f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{irish-1.0f}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\dateirish{%
+ \def\today{%
+ \number\day\space \ifcase\month\or
+ Ean\'air\or Feabhra\or M\'arta\or Aibre\'an\or
+ Bealtaine\or Meitheamh\or I\'uil\or L\'unasa\or
+ Me\'an F\'omhair\or Deireadh F\'omhair\or
+ M\'{\i} na Samhna\or M\'{\i} na Nollag\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasirish}
+% \begin{macro}{\noextrasirish}
+% The macro |\extrasirish| will perform all the extra definitions
+% needed for the Irish language. The macro |\noextrasirish| is used
+% to cancel the actions of |\extrasirish|. For the moment these
+% macros are empty but they are defined for compatibility with the
+% other language definition files.
+%
+% \begin{macrocode}
+\addto\extrasirish{}
+\addto\noextrasirish{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{irish-1.0e}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{irish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/Master/texmf-dist/source/generic/babel/irish.ins b/Master/texmf-dist/source/generic/babel/irish.ins
new file mode 100644
index 00000000000..33a3172ee2b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/irish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{irish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{irish.ldf}{\from{irish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/italian.dtx b/Master/texmf-dist/source/generic/babel/italian.dtx
new file mode 100644
index 00000000000..ea9899f79f2
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/italian.dtx
@@ -0,0 +1,857 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{419}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{italian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{italian}
+%\fi
+%\ProvidesFile{italian.dtx}
+ [2005/02/05 v1.2q Italian support from the babel system]
+%\iffalse
+%% File `italian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams babel at braams.cistron.nl
+%% Claudio Beccari beccari at polito.it
+%
+% This file is part of the babel system, it provides the source
+% code for the Italian language definition file.
+% The original version of this file was written by Maurizio
+% Codogno, (mau@beatles.cselt.stet.it). Several features were added
+% by Claudio Beccari, (beccari@polito.it).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{italian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{italian.dtx}
+%
+% \changes{italian-0.99}{1990/07/11}{First version, from english.doc}
+% \changes{italian-1.0}{1991/04/23}{Modified for babel 3.0}
+% \changes{italian-1.0a}{1991/05/23}{removed typo}
+% \changes{italian-1.0b}{1991/05/29}{Removed bug found by van der Meer}
+% \changes{italian-1.0e}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{italian-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{italian-1.2}{1994/02/09}{Update for\ LaTeXe}
+% \changes{italian-1.2e}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{italian-1.2f}{1995/05/28}{Updated for babel 3.5}
+% \changes{italian-1.2i}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{italian-1.2l}{1999/04/24}{Added \cs{unit}, \cs{ap}, and
+% \cs{ped} macros}
+% \changes{italian-1.2m}{2000/01/05}{Added support for etymological
+% hyphenation}
+% \changes{italian-1.2n}{2000/02/02}{Completely modified etymological
+% hyphenation facility}
+% \changes{italian-1.2n}{2000/05/28}{Added several commands for the
+% caporali double quotes and for simplifying the accented vowel input}
+% \changes{italian-1.2o}{2000/12/12}{Added \cs{glossaryname}}
+% \changes{italian-1.2p}{2002/07/10}{Removed redefinition of
+% \cs{add@acc} since its functionality has been introduced into the
+% kernel of LaTeX 2001/06/01}
+% \changes{italian-1.2q}{2005/02/05}{Added test for avoiding conflict
+% with package units.sty; adjusted caporali functionality, since
+% the previous one did not work with the standard (although obsolete)
+% slides class file}
+% \section{The Italian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author is Maurizio Codogno,
+% (\texttt{mau@beatles.cselt.stet.it}). It has been largely revised
+% by Johannes Braams and Claudio Beccari} defines all the
+% language-specific macros for the Italian language.
+%
+% The features of this language definition file are the following:
+% \begin{enumerate}
+% \item The Italian hyphenation is invoked, provided that file
+% \texttt{ithyph.tex} was loaded when the \LaTeXe\ format was
+% built; in case it was not, read the information coming with your
+% distribution of the \TeX\ software, and the \babel\
+% documentation.
+% \item The language dependent fixed words to be inserted by such
+% commands as |\chapter|, |\caption|, |\tableofcontents|,
+% etc. are redefined in accordance with the Italian
+% typographical practice.
+% \item Since Italian can be easily hyphenated and Italian practice
+% allows to break a word before the last two letters, hyphenation
+% parameters have been set accordingly, but a very high demerit
+% value has been set in order to avoid word breaks in the
+% penultimate line of a paragraph. Specifically the |\clubpenalty|,
+% and the |\widowpenalty| are set to rather high values and
+% |\finalhyphendemerits| is set to such a high value that
+% hyphenation is prohibited between the last two lines of a
+% paragraph.
+% \item Some language specific shortcuts have been defined so as to
+% allow etymological hyphenation, specifically |"| inserts a
+% break point in any word boundary that the typesetter chooses,
+% provided it is not followed by and accented letter (very unlikely
+% in Italian, where compulsory accents fall only on the last and
+% ending vowel of a word, but may take place with compound words
+% that include foreign roots), and \verb="|= when the desired break
+% point falls before an accented letter.
+% \item The shortcut |""| introduces the raised (English) opening
+% double quotes; this shortcut proves its usefulness when one
+% reminds that the Italian keyboard misses the backtick key, and
+% the backtick on a Windows based platform may be obtained only by
+% pressing the \texttt{Alt} key while inputting the numerical code
+% 0096; very, very annoying!
+% \item The shortcuts |"<| and |">| insert the French guillemots,
+% sometimes used in Italian typography; with the T1 font encoding
+% the ligatures |<<| and |>>| should insert such signs directly,
+% but not all the virtual fonts that claim to follow the T1 font
+% encoding actually contain the guillemots; with the OT1 encoding
+% the guillemots are not available and must be faked in some
+% way. By using the |"<| and |">| shortcuts (even with the T1
+% encoding) the necessary tests are performed and in case the
+% suitable glyphs are taken from other fonts normally available
+% with any good, modern \LaTeX\ distribution.
+% \item Three new specific commands |\unit|, |\ped|, and |\ap| are
+% introduced so as to enable the correct composition of technical
+% mathematics according to the ISO~31/XI recommendations. |\unit|
+% does not get redefined if the \babel\ package is loaded \emph{after}
+% the package \texttt{units.sty} whose homonymous command plays
+% a different role and follows a different syntax.
+% \end{enumerate}
+%
+% For this language a limited number of shortcuts has been defined,
+% table~\ref{t:itshrtct}, some of which are used to overcome
+% certain limitations of the Italian keyboard; in
+% section~\ref{s:itkbd} there are other comments and hints in order
+% to overcome some other keyboard limitations.
+%
+% \begin{table}[htb]\centering
+% \begin{tabular}{cp{80mm}}
+% |"| & inserts a compound word mark where hyphenation is legal;
+% it allows etymological hyphenation which is recommended
+% for technical terms, chemical names and the like; it
+% does not work if the next character is represented with
+% a control sequence or is an accented character.\\
+% \texttt{\string"\string|}
+% & the same as the above without the limitation on
+% characters represented with control sequences or accented
+% ones.\\
+% |""| & inserts open quotes ``.\\ %^^A'' emacs matching
+% |"<| & inserts open guillemots.\\
+% |">| & inserts closed guillemots.\\
+% |"/| & equivalent to |\slash|
+% \end{tabular}
+% \caption{Shortcuts for the Italian language}\label{t:itshrtct}
+% \end{table}
+%
+% \StopEventually{%
+% \begin{thebibliography}{1}
+% \bibitem{CBec} Beccari C., ``Computer Aided Hyphenation for
+% Italian and Modern Latin'', \textsf{TUGboat} vol.~13, n.~1,
+% pp.~23-33 (1992).
+% \bibitem{Becc2} Beccari C., ``Typesetting mathematics for science
+% and technology according to ISO\,31/XI'', \textsf{TUGboat}
+% vol.~18, n.~1, pp.~39-48 (1997).
+% \end{thebibliography}}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{italian-1.2i}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{italian-1.2j}{1996/12/29}{Added braces around second arg of
+% \cs{LdfInit}}
+% \begin{macrocode}
+%<*code>
+\LdfInit{italian}{captionsitalian}%
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{italian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@italian| to see whether we have to do something here.
+%
+% \changes{italian-1.0}{1991/04/23}{Now use \cs{adddialect} if
+% language undefined}
+% \changes{italian-1.0h}{1991/10/08}{Removed use of \cs{@ifundefined}}
+% \changes{italian-1.1}{1992/02/16}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{italian-1.2e}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@italian\@undefined
+ \@nopatterns{Italian}%
+ \adddialect\l@italian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Italian language.
+%
+% \begin{macro}{\captionsitalian}
+% The macro |\captionsitalian| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \changes{italian-1.0c}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{italian-1.0c}{1991/06/06}{\cs{pagename} should be
+% \cs{headpagename}}
+% \changes{italian-1.0d}{1991/07/01}{`contiene' substitued by `Allegati'
+% as suggested by Marco Bozzo (\texttt{BOZZO@CERNVM}).}
+% \changes{italian-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{italian-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{italian-1.2b}{1994/05/19}{Changed some of the words
+% following suggestions from Claudio Beccari}
+% \changes{italian-1.2g}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{italian-1.2h}{1995/07/27}{Added translation of `Proof'}
+% \begin{macrocode}
+\addto\captionsitalian{%
+ \def\prefacename{Prefazione}%
+ \def\refname{Riferimenti bibliografici}%
+ \def\abstractname{Sommario}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Capitolo}%
+ \def\appendixname{Appendice}%
+ \def\contentsname{Indice}%
+ \def\listfigurename{Elenco delle figure}%
+ \def\listtablename{Elenco delle tabelle}%
+ \def\indexname{Indice analitico}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabella}%
+ \def\partname{Parte}%
+ \def\enclname{Allegati}%
+ \def\ccname{e~p.~c.}%
+ \def\headtoname{Per}%
+ \def\pagename{Pag.}% % in Italian the abbreviation is preferred
+ \def\seename{vedi}%
+ \def\alsoname{vedi anche}%
+ \def\proofname{Dimostrazione}%
+ \def\glossaryname{Glossario}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateitalian}
+% The macro |\dateitalian| redefines the command
+% |\today| to produce Italian dates.
+% \changes{italian-1.0c}{1991/06/06}{Removed \cs{global} definitions}
+% \begin{macrocode}
+\def\dateitalian{%
+ \def\today{\number\day~\ifcase\month\or
+ gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or
+ luglio\or agosto\or settembre\or ottobre\or novembre\or
+ dicembre\fi\space \number\year}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\italianhyphenmins}
+% \changes{italian-1.2b}{1994/05/19}{Added setting of left and
+% righthyphenmin according to Claudio Beccari's suggestion}
+%
+% The italian hyphenation patterns can be used with both
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{italian-1.2m}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasitalian}
+% \begin{macro}{\noextrasitalian}
+%
+% \changes{italian-1.2b}{1994/05/19}{Added setting of club- and
+% widowpenalty}
+% Lower the chance that clubs or widows occur.
+% \begin{macrocode}
+\addto\extrasitalian{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\widowpenalty
+ \clubpenalty3000\widowpenalty3000}%
+% \end{macrocode}
+%
+% \changes{italian-1.2b}{1994/05/19}{Added setting of
+% finalhyphendemerits}
+%
+% Never ever break a word between the last two lines of a paragraph
+% in italian texts.
+% \begin{macrocode}
+\addto\extrasitalian{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}%
+% \end{macrocode}
+%
+% \changes{italian-1.2h}{1995/11/10}{Now give the apostrophe a
+% lowercase code}
+% \changes{italian-1.2l}{1999/04/5}{Changed example ``begl'italiani''
+% (obsolete spelling) with another, ``nell'altezza'', that behaves
+% the same way}
+% In order to enable the hyphenation of words such as
+% ``nell'altezza'' we give the \texttt{'} a non-zero lower case
+% code. When we do that \TeX\ finds the following hyphenation
+% points |nel-l'al-tez-za| instead of none.
+% \begin{macrocode}
+\addto\extrasitalian{%
+ \lccode`'=`'}%
+\addto\noextrasitalian{%
+ \lccode`'=0}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{italian-1.2m}{2000/01/05}{Support for etymological
+% hyphenation}
+%
+% \subsection{Support for etymological hyphenation}
+%
+% In his article on Italian hyphenation \cite{CBec} Beccari pointed
+% out that the Italian language gets hyphenated on a phonetic
+% basis, although etymological hyphenation is allowed; this is in
+% contrast with what happens in Latin, for example, where
+% etymological hyphenation is always used. Since the patterns for
+% both languages would become too complicated in order to cope with
+% etymological hyphenation, in his paper Beccari proposed the
+% definition of an active character `|_|' such that it could insert
+% a ``soft'' discretionary hyphen at the compound word
+% boundary. For several reasons that idea and the specific active
+% character proved to be unpractical and was abandoned.
+%
+% This problem is so important with the majority of the European
+% languages, that \babel\ from the very beginning developed
+% the tradition of making the |"| character active so as to perform
+% several actions that turned useful with every language.
+% One of these actions consisted in defining the shortcut \verb="|=
+% that was extensively used in German and in many other languages
+% in order to insert a discretionary hyphen such that hyphenation
+% would not be precluded in the rest of the word as it happens with
+% the standard \TeX\ command |\-|.
+%
+% Meanwhile the \texttt{ec} fonts with the double Cork encoding
+% (thus formerly called the \texttt{dc} fonts) have become more or
+% less standard and are widely used by virtually all Europeans that
+% write languages with many special national characters; by so
+% doing they avoid the use of the |\accent| primitive which would
+% be required with the standard \texttt{cm} fonts; with the latter
+% fonts the primitive command |\accent| is such that hyphenation
+% becomes almost impossible, in any case strongly impeached.
+%
+% The \texttt{ec} fonts contain a special character, named
+% ``compound word mark'', that occupies position 23 in the font
+% scheme and may be input with the sequence |^^W|. Up to now,
+% apparently, this special character has never been used in a
+% practical way for the typesetting of languages rich of compound
+% words; also it has never been inserted in the hyphenation pattern
+% files of any language. Beccari modified his pattern file
+% \file{ithyph.tex v4.8b} for Italian so as to contain five new
+% patterns that involve |^^W|, and he tried to give the
+% \babel\ active character |"| a new shortcut definition,
+% so as to allow the insertion of the ``compound word mark'' in the
+% proper place within any word where two semantic fragments join
+% up. With such facility for marking the compound word boundaries,
+% etymological hyphenation becomes possible even if the patterns
+% know nothing about etymology (but the typesetter hopefully
+% does!).
+% In Italian such etymological hyphenation is desirable with
+% technical terms, chemical names, and the like.
+%
+% Even this solution proved to be inconvenient on certain UN*X
+% platforms, so Beccari resorted to another approach that uses the
+% \babel\ active character |"| and relies on the category
+% code of the character that follows |"|.
+%
+% \changes{italian-1.2n}{2000/02/02}{Completely new etymological
+% hyphenation facility}
+%
+% \begin{macrocode}
+\initiate@active@char{"}%
+\addto\extrasitalian{\bbl@activate{"}\languageshorthands{italian}}%
+% \end{macrocode}
+% \begin{macro}{\it@cwm}
+% The active character |"| is now defined for language |italian| so
+% as to perform different actions in math mode compared to text
+% mode; specifically in math mode a double quote is inserted so as
+% to produce a double prime sign, while in text mode the temporary
+% macro |\it@next| is defined so as to defer any further action
+% until the next token category code has been tested.
+% \begin{macrocode}
+\declare@shorthand{italian}{"}{%
+\ifmmode
+ \def\it@next{''}%
+\else
+ \def\it@next{\futurelet\it@temp\it@cwm}%
+\fi
+\it@next
+}%
+% \end{macrocode}
+% \begin{macro}{\it@cwm}
+% The \cs{it@next} service control sequence is such that upon its
+% execution a temporary variable \cs{it@temp} is made equivalent to
+% the next token in the input list without actually removing
+% it. Such temporary token is then tested by the macro \cs{it@cwm}
+% and if it is found to be a letter token, then it introduces a
+% compound word separator control sequence \cs{it@allowhyphens}
+% whose expansion introduces a discretionary hyphen and an
+% unbreakable space; in case the token is not a letter, then it is
+% tested against \verb=|=$_{12}$: if so a compound word separator
+% is inserted and the \verb=|= token is removed, otherwise another
+% test is performed so as to see if another double quote sign
+% follows: in this case a double open quote mark is inserted,
+% otherwise two other tests are performed so as to see if
+% guillemets have to be inserted, otherwise nothing is done.
+% The double quote shortcut for inserting a double open quote sign
+% is useful for people who are inputting Italian text by means of
+% an Italian keyboard that unfortunately misses the grave or
+% backtick key.
+% By this shortcut |""| becomes equivalent to |``| for inserting
+% raised open high double quotes.
+% \begin{macrocode}
+\def\it@@cwm{\nobreak\discretionary{-}{}{}\hskip\z@skip}%
+\def\it@@ocap#1{\it@ocap}\def\it@@ccap#1{\it@ccap}%
+\DeclareRobustCommand*{\it@cwm}{\let\it@@next\relax
+\ifcat\noexpand\it@temp a%
+ \def\it@@next{\it@@cwm}%
+\else
+ \if\noexpand\it@temp \string|%
+ \def\it@@next{\it@@cwm\@gobble}%
+ \else
+ \if\noexpand\it@temp \string<%
+ \def\it@@next{\it@@ocap}%
+ \else
+ \if\noexpand\it@temp \string>%
+ \def\it@@next{\it@@ccap}%
+ \else
+ \if\noexpand\it@temp\string/%
+ \def\it@next{\slash\@gobble}%
+ \else
+ \ifx\it@temp"%
+ \def\it@@next{``\@gobble}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+\fi
+\it@@next}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{sloppypar}
+% By this definition of |"| if one types |macro"istruzione| the
+% possible break points become \textsf{ma-cro-istru-zio-ne}, while
+% without the |"| mark they would be \textsf{ma-croi-stru-zio-ne},
+% according to the phonetic rules such that the |macro| prefix is
+% not taken as a unit.
+% A chemical name such as \texttt{des"clor"fenir"amina"cloridrato}
+% is breakable as \textsf{des-clor-fe-nir-ami-na-clo-ri-dra-to}
+% instead of \textsf{de-sclor-fe-ni-ra-mi-na-...}
+%
+% In other language description files a shortcut is defined so as
+% to allow a break point without actually inserting any hyphen
+% sign; examples are given such as \mbox{entrada/salida}; actually
+% if one wants to allow a breakpoint after the slash, it is much
+% clearer to type |\slash| instead of |/| and \LaTeX\ does
+% everything by itself; here the shortcut |"/| was introduced to
+% stand for |\slash| so that one can type |input"/output| and allow
+% a line break after the slash.
+% This shortcut works only for the slash, since in Italian such
+% constructs are extremely rare.
+% \end{sloppypar}
+%
+% Attention: the expansion of |"| takes place before the actual
+% expansion of OT1 or T1 accented sequences such as |\`{a}|;
+% therefore this etymological hyphenation facility works as it
+% should only when the semantic word fragments \textit{do not
+% start} with an accented letter; this in Italian is always
+% avoidable, because compulsory accents fall only on the last
+% vowel, but it may be necessary to mark a compound word where one
+% or more components come from a foreign language and contain
+% diacritical marks according to the spelling rules of that
+% language. In this case the special shorthand \verb!"|! may be
+% used that performs exactly as |"| normally does, except that the
+% \verb!|! sign is removed from the token input list:
+% \verb!kilo"|{\"o}rsted! gets hyphenated as
+% \texttt{ki-lo-\"or-sted}.
+%
+% \changes{italian-1.2l}{1999/04/05}{Added useful macros for
+% fulfilling ISO 31/XI regulations}
+%
+% \subsection{Facilities required by the ISO 31/XI regulations}
+% The ISO 31/XI regulations require that units of measure are
+% typeset in upright font in any circumstance, math or text, and
+% that in text mode they are separated from the numerical
+% indication of the measure with an unbreakable (thin) space.
+% The command |\unit| that was defined for achieving this
+% goal happened to conflict with the homonymous command defined by
+% the package \texttt{units.sty}; we therefore need to test if that
+% package has already been loaded so as to avoid conflicts; we assume
+% that if the user loads that package, s/he wants to use that package
+% facilities and command syntax.
+%
+% The same regulations require also that super and subscripts
+% (apices and pedices) are in upright font, \emph{not in math
+% italics}, when they represent ``adjectives'' or appositions to
+% mathematical or physical variables that do not represent
+% countable or measurable entities such as, for example,
+% $V_{\mathrm{max}}$ or $V_{\mathrm{rms}}$ for a maximum or a root
+% mean square voltage, compared to $V_i$ or $V_T$ as the $i$-th
+% voltage in a set, or a voltage that depends on the thermodynamic
+% temperature $T$. See \cite{Becc2} for a complete description of
+% the ISO regulations in connection with typesetting.
+%
+% More rarely it happens to use superscripts that are not
+% mathematical variables, such as the notation
+% $\mathbf{A}^{\!\mathrm{T}}$ to denote the transpose of matrix
+% $\mathbf{A}$; text superscripts are useful also as ordinals or
+% in old fashioned abbreviations in text mode; for example the
+% feminine ordinal $1^{\mathrm{a}}$ or the old fashioned obsolete
+% abbreviation F$^{\mathrm{lli}}$ for \mbox{Fratelli} in company
+% names (compare with ``Bros.'' for \underline{bro}ther\underline{s}
+% in American English); text subscripts are mostly used in logos.
+%
+% \begin{macro}{\unit}
+% \begin{macro}{\ap}
+% \begin{macro}{\ped}
+% First we define the new (internal) commands |\bbl@unit|, |\bbl@ap|,
+% and |\bbl@ped| as robust ones.
+% \changes{italian-1.2q}{2005/02/05}{Added testing for avoiding conflicts
+% with the units.sty package}
+% \begin{macrocode}
+\@ifpackageloaded{units}{}{%
+ \DeclareRobustCommand*{\bbl@unit}[1]{%
+ \textormath{\,\mbox{#1}}{\,\mathrm{#1}}}%
+ }%
+\DeclareRobustCommand*{\bbl@ap}[1]{%
+ \textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}%
+\DeclareRobustCommand*{\bbl@ped}[1]{%
+ \textormath{$_{\mbox{\fontsize\sf@size\z@
+ \selectfont#1}}$}{_\mathrm{#1}}}%
+% \end{macrocode}
+% Then we can use |\let| to define the user level commands, but in
+% case the macros already have a different meaning before entering
+% in Italian mode typesetting, we first memorize their meaning so
+% as to restore them on exit.
+% \begin{macrocode}
+\@ifpackageloaded{units}{}{%
+ \addto\extrasitalian{%
+ \babel@save\unit\let\unit\bbl@unit}%
+ }%
+\addto\extrasitalian{%
+ \babel@save\ap\let\ap\bbl@ap
+ \babel@save\ped\let\ped\bbl@ped
+ }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Accents}\label{s:itkbd}
+% Most of the other language description files introduce a number
+% of shortcuts for inserting accents and other language specific
+% diacritical marks in a more comfortable way compared with the
+% lengthy standard \TeX\ conventions. When an Italian keyboard is
+% being used on a Windows based platform, it exhibits such
+% limitations that up to now no convenient shortcuts have been
+% developed; the reason lies in the fact that the Italian keyboard
+% lacks the grave accent (also known as ``backtick''), which is
+% compulsory on all accented vowels except the `e', but, on the
+% opposite, it carries the keys with all the accented lowercase
+% vowels; the keyboard lacks also the tie |~| (tilde) key, while
+% the curly braces require pressing three keys simultaneously.
+%
+% The best solution Italians have found so far is to use a smart
+% editor that accepts shortcut definitions such that, for example,
+% by striking |"(| one gets directly |{| on the screen and the same
+% sign is saved into the \file{.tex} file; the same smart editor
+% should be capable of translating the accented characters into the
+% standard \TeX\ sequences when writing a file to disk (for the
+% sake of file portability), and to transform the standard \TeX\
+% sequences into the corresponding signs when loading a \file{.tex}
+% file from disk to memory. Such smart editors do exist and can be
+% downloaded from the \textsc{ctan} archives.
+%
+% \changes{italian-1.2p}{2002/07/10}{Removed redefinition of \cs{add@acc} since its
+% functionality has been introduced into the kernel of LaTeX 2001/06/01}
+%
+% For what concerns the missing backtick key,
+% which is used also for inputting the open quotes, it must be
+% noticed that the shortcut |""| described above completely solves
+% the problem for \textit{double} raised open quotes; according to
+% the traditions of particular publishing houses, since there are
+% no compulsory regulations on the matter, the French guillemets
+% may be used; in this case the T1 font encoding solves the problem
+% by means of its built in ligatures |<<| and |>>|. But\dots
+%
+% \subsection{\emph{Caporali} or French double quotes}
+% Although the T1 font encoding ligatures solve the problem, there
+% are some circumstances where even the T1 font encoding cannot be
+% used, either because the author\slash typesetter wants to use the
+% OT1 encoding, or because s/he uses a font set that does
+% not comply completely with the T1 font encoding; some virtual
+% fonts, for example, are supposed to implement the double Cork
+% font encoding but actually miss some glyphs; one such virtual
+% font set is given by the \texttt{ae} virtual fonts, because they
+% are supposed to implement such double font encoding simply using
+% the \texttt{cm} fonts, of which the type~1 PostScript version
+% exists and is freely available. Since guillemets (in Italian
+% \emph{caporali}) do not exist in any \texttt{cm} latin font,
+% their glyphs must be substituted with something else that
+% approaches them.
+%
+% \changes{italian-1.2q}{2005/02/05}{Redefined the caporali machinery
+% so as to avoid incompatibilities with the slides class, as there
+% are no Cyrillic slides fonts as there are for Latins script}
+%
+% Since in French typesetting guillemets are compulsory, the French
+% language definition file resorts to a clever font substitution;
+% such file exploits the \LaTeXe\ font selection machinery so as to
+% get the guillemets from the Cyrillic fonts, because it suffices
+% to locally change the default encoding. There are several sets of
+% Cyrillic fonts, but the ones that obey the OT2 font encoding are
+% generally distributed with all recent implementations of the
+% \TeX\ software; they are part of the American Mathematical
+% Society fonts and come both as \textsf{METAFONT} source files and
+% Type~1 PostScript \texttt{.pfb} files. The availability of such
+% fonts should be guaranteed by the presence of the
+% \texttt{OT2cmr.fd} font description file. Actually the presence
+% of this file does not guarantee the completeness of your \TeX\
+% implementation; should \LaTeX\ complain about a missing Cyrillic
+% \texttt{.tfm} file (that kind of file that contains the font
+% metric parameters) and/or about missing Cyrillic \texttt(.mf)
+% files, then your \TeX\ system is \emph{incomplete} and you should
+% download such fonts from the \textsc{ctan} archives. Temporarily
+% you may issue the command |\LtxSymbCaporali| so as to approximate
+% the missing glyphs with the \LaTeX\ symbol fonts. In some case
+% warning messages are issued so as to inform the typesetter about
+% the necessity of resorting to some \emph{poor man} solution.
+%
+% In spite of these alternate fonts, we must avoid invoking unusual
+% fonts if the available encoding allows to use built in caporali.
+% As far as I know (CB) the only T1-encoded font families that miss
+% the guillemets are the AE ones; we therefore first test if the
+% default encoding id the T1 one and in this case if the AE families
+% are the default ones; in order for this to work properly it is
+% necessary to load these optional packages \emph{before} \babel.
+% If the T1 encoding is not the default one when the Italian language
+% is specified, then some substitutions must be done.
+%
+% \begin{macro}{\LtxSymbCaporali}
+% \begin{macro}{\it@ocap}
+% \begin{macro}{\it@ccap}
+% We define some macros for substituting the default guillemets; first the
+% emulation by means of the \LaTeX\ symbols; each one of these macro sets
+% actually redefines the control sequences |\it@ocap| and |\it@ccap| that
+% are the ones effectively activated by the shortcuts |"<| and |">|.
+% \begin{macrocode}
+\def\LtxSymbCaporali{%
+ \DeclareRobustCommand*{\it@ocap}{\mbox{%
+ \fontencoding{U}\fontfamily{lasy}\selectfont(\kern-0.20em(}%
+ \ignorespaces}%
+ \DeclareRobustCommand*{\it@ccap}{\ifdim\lastskip>\z@\unskip\fi
+ \mbox{%
+ \fontencoding{U}\fontfamily{lasy}\selectfont)\kern-0.20em)}}%
+}%
+% \end{macrocode}
+% Then the substitution with any specific font that contains such
+% glyphs; it might be the CBgreek fonts, the Cyrillic one, the super-cm ones, the lm ones,
+% or any other the user might prefer (the code is adapted from the one
+% that appears in the \texttt{frenchb.ld} file; thanks to Daniel Flipo).
+% By default if the user did not select the T1 encoding, the existence of the
+% CBgreek fonts is tested; if they exist the guillemets are taken from this
+% font, and since its families are a superset of the default CM ones and they apply also
+% to typeset slides with the standard class \texttt{slides}. If the
+% CBgreek fonts are not found, then the existence of the Cyrillic ones is tested,
+% although this choice is not suited for typesetting slides;
+% otherwise the poor man solution of the \LaTeX\ special symbols is used.
+% In any case the user can force the use of the Cyrillic guillemets substitution
+% by issuing the declaration |\CyrillicCaporali| just before the
+% |\begin{document}| statement; in alternative the user can specify with
+% \begin {flushleft}
+% |\CaporaliFrom|\marg{encoding}\marg{family}\marg{opening number}\marg{closing number}
+% \end{flushleft}
+% the encoding and family of the font s/he prefers, and the slot numbers of the opening
+% and closing guillemets respectively. For example if the T1-encoded Latin Modern fonts
+% are desired the specific command should be
+% \begin {flushleft}
+% |\CaporaliFrom{T1}{lmr}{19}{20}|
+% \end{flushleft}
+% These user choices might be necessary for assuring the correct typesetting
+% with fonts that contain the required glyphs and are available also in PostScript form
+% so as to use them directly di \texttt{pdflatex}, for example.
+% \begin{macrocode}
+\def\CaporaliFrom#1#2#3#4{%
+ \DeclareFontEncoding{#1}{}{}%
+ \DeclareTextCommand{\it@ocap}{T1}{%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3\ignorespaces}}%
+ \DeclareTextCommand{\it@ccap}{T1}{\ifdim\lastskip>\z@\unskip\fi%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}%
+ \DeclareTextCommand{\it@ocap}{OT1}{%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3\ignorespaces}}%
+ \DeclareTextCommand{\it@ccap}{OT1}{\ifdim\lastskip>\z@\unskip\fi%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}}
+% \end{macrocode}
+% Then we set a boolean variable and test the default family;
+% if such family has a name that starts with the letters ``ae''
+% then we have no built in guillemets; of course if the AE font family is chosen
+% after the \babel\ package is loaded, the test does not perform as required.
+% \begin{macrocode}
+\def\get@ae#1#2#3!{\def\bbl@ae{#1#2}}%
+\def\@ifT@one@noCap{\expandafter\get@ae\f@family!%
+\def\bbl@temp{ae}\ifx\bbl@ae\bbl@temp\expandafter\@firstoftwo\else
+ \expandafter\@secondoftwo\fi}%
+% \end{macrocode}
+% We set another couple of boolean variables for testing the existence of the
+% CBgreek or the Cyrillic fonts
+% \begin{macrocode}
+\newif\if@CBgreekEncKnown
+\IfFileExists{lgrcmr.fd}%
+ {\@CBgreekEncKnowntrue}{\@CBgreekEncKnownfalse}
+\newif\if@CyrEncKnown
+\IfFileExists{ot2cmr.fd}%
+ {\@CyrEncKnowntrue}{\@CyrEncKnownfalse}%
+% \end{macrocode}
+% \begin {macro}{\CBgreekCaporali}
+% \begin {macro}{\CyrillicCaporali}
+% \begin {macro}{\T@unoCaporali}
+% Next we define the macros |\CBgreekCaporali|, |\T@unoCaporali|,
+% and |\CyrillicCaporali|;
+% with the latter one we test the loaded class, and if it's \texttt{slides}
+% nothing gets done. In any case each one of these declarations, if used, must be specified
+% in the preamble.
+% \begin{macrocode}
+\def\CBgreekCaporali{\@ifclassloaded{slides}{%
+ \IfFileExists{lgrlcmss.fd}{\DeclareFontEncoding{LGR}{}{}%
+ \DeclareRobustCommand*{\it@ccap}%
+ {\ifdim\lastskip>\z@\unskip\fi
+ {\fontencoding{LGR}\selectfont))}}%
+ \DeclareRobustCommand*{\it@ocap}%
+ {{\fontencoding{LGR}\selectfont((}\ignorespaces}}%
+ {\LtxSymbCaporali}}%
+ {\DeclareFontEncoding{LGR}{}{}%
+ \DeclareRobustCommand*{\it@ccap}%
+ {\ifdim\lastskip>\z@\unskip
+ \fi{\fontencoding{LGR}\selectfont))}}%
+ \DeclareRobustCommand*{\it@ocap}%
+ {{\fontencoding{LGR}\selectfont((}\ignorespaces}}%
+ }%
+\def\CyrillicCaporali{\@ifclassloaded{slides}{\relax}%
+ {\DeclareFontEncoding{OT2}{}{}%
+ \DeclareRobustCommand*{\it@ccap}%
+ {\ifdim\lastskip>\z@\unskip\fi
+ {\fontencoding{OT2}\selectfont\char62\relax}}%
+ \DeclareRobustCommand*{\it@ocap}%
+ {{\fontencoding{OT2}\selectfont\char60\relax}\ignorespaces}}}%
+\@onlypreamble{\CBgreekCaporali}\@onlypreamble{\CyrillicCaporali}%
+\def\T@unoCaporali{\DeclareRobustCommand*{\it@ocap}{<<\ignorespaces}%
+ \DeclareRobustCommand*{\it@ccap}{\ifdim\lastskip>\z@\unskip\fi>>}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% Now we can do some real setting; first we start testing the encoding;
+% if the encoding is T1 we test if the font family is the AE one; if so,
+% we further test for other possibilities
+% \begin{macrocode}
+\ifx\cf@encoding\bbl@t@one
+ \@ifT@one@noCap{%
+ \if@CBgreekEncKnown
+ \CBgreekCaporali
+ \else
+ \if@CyrEncKnown
+ \CyrilicCaporali
+ \else
+ \LtxSymbCaporali
+ \fi
+ \fi}%
+ {\T@unoCaporali}%
+% \end{macrocode}
+% But if the default encoding is not the T1 one, then the
+% substitutions must be performed.
+% \begin{macrocode}
+\else
+ \if@CBgreekEncKnown
+ \CBgreekCaporali
+ \else
+ \if@CyrEncKnown
+ \CyrilicCaporali
+ \else
+ \LtxSymbCaporali
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Finishing commands}
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{italian-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{italian}%
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/italian.ins b/Master/texmf-dist/source/generic/babel/italian.ins
new file mode 100644
index 00000000000..e7e51cbbd19
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/italian.ins
@@ -0,0 +1,155 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+%%
+%% Questo file serve per generare dal file italian.dtx il file
+%% italian.ldf mediante il programma LaTeX/docstrip che toglie
+%% praticamente tutti i commenti e ne rende il caricamento molto
+%% veloce. La documentazione puo' essere ottenuta passando a
+%% LaTeX2e il file sorgente italian.dtx
+%%
+\def\filedate{2001/01/19}
+\def\batchfile{italian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{italian.ldf}{\from{italian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/latin.dtx b/Master/texmf-dist/source/generic/babel/latin.dtx
new file mode 100644
index 00000000000..c3b3a599990
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/latin.dtx
@@ -0,0 +1,623 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{434}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{latin.dtx}
+%</dtx>
+%<code>\ProvidesFile{latin.ldf}
+%\fi
+%\ProvidesFile{latin.dtx}%
+ [2005/03/30 v2.0f Latin support from the babel system]
+%\iffalse
+%% File `latin.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams babel at braams.cistron.nl
+%% Claudio Beccari beccari at polito.it
+%
+% This file is part of the babel system, it provides the source
+% code for the Latin language definition file.
+% The original version of this file was written by
+% Claudio Beccari, (beccari@polito.it) and includes contributions
+% by Krzysztof Konrad \.Zelechowski, (\texttt{kkz@alfa.mimuw.edu.pl}).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\providecommand*\pkg[1]{\textsf{#1}}
+\begin{document}
+ \DocInput{latin.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{latin.dtx}
+%
+% \changes{latin-0.99}{1999/12/06}{First version, from italian.dtx (CB)}
+% \changes{latin-0.99}{1999/12/06}{Added shortcuts for breve, macron,
+% and etymological hyphenation (CB)}
+% \changes{latin-1.2}{2000/01/31}{Added suggestions from Krzysztof
+% Konrad \.Zelechowski (CB)}
+% \changes{latin-2.0}{2000/02/10}{Completely new etymological
+% hyphenation (CB)}
+% \changes{latin-2.0a}{2000/10/15}{Revised by JB}
+% \changes{latin-2.0b}{2000/12/13}{Simplified shortcuts for
+% etymological hyphenation; modified breve and macro shortcuts;
+% language attribute medieval declared}
+% \changes{latin-2.0d}{2001/06/04}{Restored caret and equals sign
+% category codes before exiting}
+% \changes{latin-2.0e}{2003/04/11}{Introduced the language attribute
+% `withprosodicmarks'; modified use of breve and macron shortcuts
+% in order to avoid possible conflicts with other packages}
+%
+% \section{The Latin language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author is Claudio Beccari with
+% contributions by Krzysztof Konrad \.Zelechowski,
+% (\texttt{kkz@alfa.mimuw.edu.pl})} defines all the
+% language-specific macros for the Latin language both in modern
+% and medieval spelling.
+%
+% For this language two ``styles'' of typesetting are implemented:
+% ``regular'' or modern-spelling Latin, and medieval Latin.
+% The medieval Latin specific commands can be activated by means of
+% the language attribute |medieval|; the medieval spelling differs
+% from the modern one by the systematic use of the lower case `u'
+% also where in modern spelling the letter `v' is used; when
+% typesetting with capital letters, on the opposite, the letter 'V'
+% is used also in place of 'U'.
+% Medieval spelling also includes the ligatures |\ae| (\ae), |\oe|
+% (\oe), |\AE| (\AE), and |\OE| (\OE) that are not used in modern
+% spelling, nor were used in the classical times.
+%
+% Furthermore a third typesetting style |withprosodicmarks| is
+% defined in order to use special shortcuts for inserting breves
+% and macrons when typesetting grammars, dictionaries, teaching
+% texts, and the like, where prosodic marks are important for the
+% complete information on the words or the verses. The shortcuts,
+% listed in table~\ref{t:lashrtct} and described in
+% section~\ref{s:shrtcts}, may interfere with other packages;
+% therefore by default this third style is off and no interference
+% is introduced. If this third style is used and interference is
+% experienced, there are special commands for turning on and off
+% the specific short hand commands of this style.
+%
+% For what concerns \textsf{babel} and typesetting with \LaTeX, the
+% differences between the two styles of spelling reveal themselves
+% in the strings used to name for example the ``Preface'' that
+% becomes ``Praefatio'' or ``Pr\ae fatio'' respectively.
+% Hyphenation rules are also different, but the hyphenation pattern
+% file \file{lahyph.tex} takes care of both versions of the
+% language. Needless to say that such patterns must be loaded in
+% the \LaTeX\ format by by running |initex| (or whatever the name
+% of the initializer) on |latex.ltx|.
+%
+% The name strings for chapters, figures, tables, etcetera, are
+% suggested by prof. Raffaella Tabacco, a classicist of the
+% University of Turin, Italy, to whom we address our warmest
+% thanks. The names suggested by Krzysztof Konrad \.Zelechowski,
+% when different, are used as the names for the medieval variety,
+% since he made a word and spelling choice more suited for this
+% variety.
+%
+% For this language some shortcuts are defined according to
+% table~\ref{t:lashrtct}; all of them are supposed to work with
+% both spelling styles, except where the opposite is explicitly
+% stated.
+% \begin{table}[htb]\centering
+% \begin{tabular}{cp{80mm}}
+% |^i| & inserts the breve accent as \u{\i}; valid also for the
+% other lowercase vowels, but it does not operate on the
+% medieval ligatures \ae\ and \oe.\\
+% |=a| & inserts the macron accent as \=a; valid also for the
+% other lowercase vowels, but it does not operate on the
+% medieval ligatures \ae\ and \oe.\\
+% |"| & inserts a compound word mark where hyphenation is legal;
+% the next character must not be a medieval ligature \ae\
+% or \oe, nor an accented letter (foreign names).\\
+% \texttt{\string"\string|}
+% & same as above, but operates also when the next character
+% is a medieval ligature or an accented letter.
+% \end{tabular}
+% \caption[]{Shortcuts defined for the Latin language. The
+% characters \texttt{\string^} and \texttt{\string=} are
+% active only when the language attribute
+% \texttt{withprosodicmarks} has been declared,
+% otherwise they are disabled; see
+% section~\ref{s:shrtcts} for more details.}%
+% \label{t:lashrtct}
+% \end{table}
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{latin}{captionslatin}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{latin} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@latin| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@latin\@undefined
+ \@nopatterns{Latin}
+ \adddialect\l@latin0\fi
+% \end{macrocode}
+%
+%
+% Now we declare the |medieval| language attribute.
+% \begin{macrocode}
+\bbl@declare@ttribute{latin}{medieval}{%
+ \addto\captionslatin{\def\prefacename{Pr{\ae}fatio}}%
+ \def\november{Nouembris}%
+ \expandafter\addto\expandafter\extraslatin
+ \expandafter{\extrasmedievallatin}%
+ }
+% \end{macrocode}
+%
+% The third typesetting style |withprosodicmarks| is defined here
+% \begin{macrocode}
+\bbl@declare@ttribute{latin}{withprosodicmarks}{%
+ \expandafter\addto\expandafter\extraslatin
+ \expandafter{\extraswithprosodicmarks}%
+ }
+% \end{macrocode}
+% It must be remembered that the |medieval| and the |withprosodicmarks|
+% styles may be used together.
+%
+% The next step consists of defining commands to switch to (and
+% from) the Latin language\footnote{Most of these names were
+% kindly suggested by Raffaella Tabacco.}.
+%
+% \begin{macro}{\captionslatin}
+% The macro |\captionslatin| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \begin{macrocode}
+\@namedef{captionslatin}{%
+ \def\prefacename{Praefatio}%
+ \def\refname{Conspectus librorum}%
+ \def\abstractname{Summarium}%
+ \def\bibname{Conspectus librorum}%
+ \def\chaptername{Caput}%
+ \def\appendixname{Additamentum}%
+ \def\contentsname{Index}%
+ \def\listfigurename{Conspectus descriptionum}%
+ \def\listtablename{Conspectus tabularum}%
+ \def\indexname{Index rerum notabilium}%
+ \def\figurename{Descriptio}%
+ \def\tablename{Tabula}%
+ \def\partname{Pars}%
+ \def\enclname{Adduntur}% Or " Additur" ? Or simply Add.?
+ \def\ccname{Exemplar}% Use the recipient's dative
+ \def\headtoname{\ignorespaces}% Use the recipient's dative
+ \def\pagename{Charta}%
+ \def\seename{cfr.}%
+ \def\alsoname{cfr.}% R.Tabacco never saw "cfr. atque" or similar forms
+ \def\proofname{Demonstratio}%
+ \def\glossaryname{Glossarium}%
+ }
+% \end{macrocode}
+% \end{macro}
+% In the above definitions there are some points that might change
+% in the future or that require a minimum of attention from the
+% typesetter.
+% \begin{enumerate}
+% \item the \cs{enclname} is translated by a passive verb, that
+% literally means ``(they) are being added''; if just one
+% enclosure is joined to the document, the plural passive is not
+% suited any more; nevertheless a generic plural passive might be
+% incorrect but suited for most circumstances. On the opposite
+% ``Additur'', the corresponding singular passive, might be more
+% correct with one enclosure and less suited in general: what
+% about the abbreviation ``Add.'' that works in both cases, but
+% certainly is less elegant?
+% \item The \cs{headtoname} is empty and gobbles the possible
+% following space; in practice the typesetter should use the
+% dative of the recipient's name; since nowadays not all such
+% names can be translated into Latin, they might result
+% indeclinable. The clever use of an appellative by the
+% typesetter such as ``Domino'' or ``Dominae'' might solve the
+% problem, but the header might get too impressive. The typesetter
+% must make a decision on his own.
+% \item The same holds true for the copy recipient's name in the
+% ``Cc'' field of \cs{ccname}.
+% \end{enumerate}
+%
+% \begin{macro}{\datelatin}
+% The macro |\datelatin| redefines the command |\today| to produce
+% Latin dates; the choice of faked small caps Latin numerals is
+% arbitrary and may be changed in the future. For medieval latin
+% the spelling of `Novembris' should be \textit{Nouembris}. This is
+% taken care of by using a control sequence which can be redefined
+% when the attribute `medieval' is selected.
+% \changes{latin-2.0f}{2005/03/30}{Added a comment character to
+% prevent unwanted space}
+% \begin{macrocode}
+\def\datelatin{%
+ \def\november{Novembris}%
+ \def\today{%
+ {\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont
+ \uppercase\expandafter{\romannumeral\day}}\nobreakspace
+ \ifcase\month\or
+ Ianuarii\or Februarii\or Martii\or Aprilis\or Maii\or Iunii\or
+ Iulii\or Augusti\or Septembris\or Octobris\or \november\or
+ Decembris\fi
+ \space{\uppercase\expandafter{\romannumeral\year}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\romandate}
+% Thomas Martin Widmann (\texttt{viralbus@daimi.au.dk}) developed a
+% macro originally named |\latindate| (but to be renamed
+% |\romandate| so as not to conflict with the standard \babel\
+% conventions) that should compute and translate the current date
+% into a date \textit{ab urbe condita} with days numbered according
+% to the kalendae and idus; for the moment this is a placeholder
+% for Thomas' macro, waiting for a self standing one that keeps
+% local all the intermediate data, counters, etc. If he succeeds,
+% here is the place to add his macro.
+% \end{macro}
+%
+% \begin{macro}{\latinhyphenmins}
+% The Latin hyphenation patterns can be used with both
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{latin-2.0a}{2000/10/15}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extraslatin}
+% \begin{macro}{\noextraslatin}
+% For this language the |\clubpenalty|, |\widowpenalty| are set to
+% rather high values and |\finalhyphendemerits| is set to such a
+% high value that hyphenation is prohibited between the last two
+% lines of a paragraph.
+% \begin{macrocode}
+\addto\extraslatin{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\widowpenalty
+ \clubpenalty3000\widowpenalty3000}
+% \end{macrocode}
+% Never ever break a word between the last two lines of a paragraph
+% in latin texts.
+% \begin{macrocode}
+\addto\extraslatin{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% With medieval Latin we need the suitable correspondence between
+% upper case V and lower case u, since in that spelling there is
+% only one sign, and the u shape is the (uncial) version of the
+% capital V. Everything else is identical with Latin.
+% \begin{macrocode}
+\addto\extrasmedievallatin{%
+\babel@savevariable{\lccode`\V}%
+\babel@savevariable{\uccode`\u}%
+\lccode`\V=`\u \uccode`\u=`\V}
+% \end{macrocode}
+%
+% \begin{macro}{\SetLatinLigatures}
+% We need also the lccodes for \ae\ and \oe; since they occupy
+% different positions in the OT1 \TeX-fontencoding compared to the
+% T1 one, we must save the lc- and the uccodes for both encodings,
+% but we specify the new lc- and uccodes separately as it appears
+% natural not to change encoding while typesetting the same
+% language. The encoding is assumed to be set before starting to
+% use the Latin language, so that if Latin is the default language,
+% the font encoding must be chosen before requiring the \pkg{babel}
+% package with the |latin| option, in any case before any
+% |\selectlanguage| or |\foreignlanguage| command.
+%
+% All this fuss is made in order to allow the use of the medieval
+% ligatures \ae\ and \oe\ while typesetting with the medieval
+% spelling; I have my doubts that the medieval spelling should be
+% used at all in modern books, reports, and the like, as the uncial
+% `u' shape of the lower case `v' and the above ligatures were
+% used until the middle of the XVII century. Since my opinion (CB)
+% may be wrong, I managed to set up the instruments and it is up
+% to the typesetter to use them or not.
+%
+% \begin{macrocode}
+\addto\extrasmedievallatin{%
+ \babel@savevariable{\lccode`\^^e6}% T1 \ae
+ \babel@savevariable{\uccode`\^^e6}% T1 \ae
+ \babel@savevariable{\lccode`\^^c6}% T1 \AE
+ \babel@savevariable{\lccode`\^^f7}% T1 \oe
+ \babel@savevariable{\uccode`\^^f7}% T1 \OE
+ \babel@savevariable{\lccode`\^^d7}% T1 \OE
+ \babel@savevariable{\lccode`\^^1a}% OT1 \ae
+ \babel@savevariable{\uccode`\^^1a}% OT1 \ae
+ \babel@savevariable{\lccode`\^^1d}% OT1 \AE
+ \babel@savevariable{\lccode`\^^1b}% OT1 \oe
+ \babel@savevariable{\uccode`\^^1b}% OT1 \OE
+ \babel@savevariable{\lccode`\^^1e}% OT1 \OE
+ \SetLatinLigatures}
+\providecommand\SetLatinLigatures{%
+ \def\@tempA{T1}\ifx\@tempA\f@encoding
+ \catcode`\^^e6=11 \lccode`\^^e6=`\^^e6 \uccode`\^^e6=`\^^c6 % \ae
+ \catcode`\^^c6=11 \lccode`\^^c6=`\^^e6 % \AE
+ \catcode`\^^f7=11 \lccode`\^^f7=`\^^f7 \uccode`\^^f7=`\^^d7 % \oe
+ \catcode`\^^d7=11 \lccode`\^^d7=`\^^f7 % \OE
+ \else
+ \catcode`\^^1a=11 \lccode`\^^1a=`\^^1a \uccode`\^^1a=`\^^1d % \ae
+ \catcode`\^^1d=11 \lccode`\^^1d=`\^^1a % \AE (^^])
+ \catcode`\^^1b=11 \lccode`\^^1b=`\^^1b \uccode`\^^1b=`\^^1e % \oe
+ \catcode`\^^1e=11 \lccode`\^^1e=`\^^1b % \OE (^^^)
+ \fi
+ \let\@tempA\@undefined
+ }
+% \end{macrocode}
+% With the above definitions we are sure that |\MakeUppercase|
+% works properly and |\MakeUppercase{C{\ae}sar}| correctly `yields
+% `C{\AE}SAR''; correspondingly |\MakeUppercase{Heluetia}|
+% correctly yields ``HELVETIA''.
+% \end{macro}
+%
+% \section{Latin shortcuts}\label{s:shrtcts}
+% For writing dictionaries or didactic texts we defined a third
+% language attribute, or a third typesetting style, where a couple
+% of other active characters are defined: |^| for marking a vowel
+% with the breve sign, and |=| for marking a vowel with the macro
+% sign. Please take notice that neither the OT1 font encoding, nor
+% the T1 one for most vowels, contain directly the marked vowels,
+% therefore hyphenation of words containing these ``accents'' may
+% become problematic; for this reason the above active characters
+% not only introduce the required accent, but also the necessary
+% code for allowing hyphenation in the rest of the word.
+%
+% It must be remarked that the active characters |^| and |=| may
+% have other meanings in other contexts. For example the equals
+% sign is used by the graphic extensions for specifying keyword
+% options for handling the graphic elements to be included in the
+% document. At the same time, as mentioned in the previous
+% paragraph, diacritical marking in Latin is used only for
+% typesetting certain kind of documents, such as grammars and
+% dictionaries. It is reasonable that the breve and macron active
+% characters may be switched on and off at will, and in particular
+% that they are off by default if the attribute |withprosodicmarks|
+% has not been set.
+%
+% \begin{macro}{\ProsodicMarksOn}
+% \begin{macro}{\ProsodicMarksOff}
+% We begin by adding to the normal typesetting style the
+% definitions of the new commands |\ProsodicMarksOn| and
+% |\ProsodicMarksOff| that should produce error messages when the
+% third style is not declared:
+% \begin{macrocode}
+\addto\extraslatin{\def\ProsodicMarksOn{%
+\GenericError{(latin)\@spaces\@spaces\@spaces\@spaces}%
+ {Latin language error: \string\ProsodicMarksOn\space
+ is defined by setting the\MessageBreak
+ language attribute to `withprosodicmarks'\MessageBreak
+ If you continue you are likely to encounter\MessageBreak
+ fatal errors that I can't recover}%
+ {See the Latin language description in the babel
+ documentation for explanation}{\@ehd}}}
+\addto\extraslatin{\let\ProsodicMarksOff\relax}
+% \end{macrocode}
+%
+% Then we temporarily set the caret and the equals sign to active
+% characters so that they can receive their definitions:
+% \begin{macrocode}
+\catcode`\= \active
+\catcode`\^ \active
+% \end{macrocode}
+% and we add the necessary declarations to the macros that are
+% being activated when the Latin language and its typesetting
+% styles are declared:
+% \begin{macrocode}
+\addto\extraslatin{\languageshorthands{latin}}%
+\addto\extraswithprosodicmarks{\bbl@activate{^}}%
+\addto\extraswithprosodicmarks{\bbl@activate{=}}%
+\addto\noextraswithprosodicmarks{\bbl@deactivate{^}}%
+\addto\noextraswithprosodicmarks{\bbl@deactivate{=}}%
+\addto\extraswithprosodicmarks{\ProsodicMarks}
+% \end{macrocode}
+%
+% \begin{macro}{\ProsodicMarks}
+% Next we define the defining macro for the active characters
+% \begin{macrocode}
+\def\ProsodicMarks{%
+\def\ProsodicMarksOn{\catcode`\^ 13\catcode`\= 13\relax}%
+\def\ProsodicMarksOff{\catcode`\^ 7\catcode`\= 12\relax}%
+% \end{macrocode}
+% Notice that with the above redefinitions of the commands
+% |\ProsodicMarksOn| and |\ProsodicMarksOff|, the operation of the
+% newly defined shortcuts may be switched on and off at will, so
+% that even if a picture has to be inserted in the document by
+% means of the commands and keyword options of the |graphicx|
+% package, it suffices to switch them off before invoking the
+% picture including command, and switched on again afterwards; or,
+% even better, since the picture very likely is being inserted
+% within a |figure| environment, it suffices the switch them off
+% within the environment, being conscious that their deactivation
+% remains local to the environment.
+% \begin{macrocode}
+\initiate@active@char{^}%
+\initiate@active@char{=}%
+\declare@shorthand{latin}{^a}{%
+ \textormath{\u{a}\allowhyphens}{\hat{a}}}%
+\declare@shorthand{latin}{^e}{%
+ \textormath{\u{e}\allowhyphens}{\hat{e}}}%
+\declare@shorthand{latin}{^i}{%
+ \textormath{\u{\i}\allowhyphens}{\hat{\imath}}}%
+\declare@shorthand{latin}{^o}{%
+ \textormath{\u{o}\allowhyphens}{\hat{o}}}%
+\declare@shorthand{latin}{^u}{%
+ \textormath{\u{u}\allowhyphens}{\hat{u}}}%
+\declare@shorthand{latin}{=a}{%
+ \textormath{\={a}\allowhyphens}{\bar{a}}}%
+\declare@shorthand{latin}{=e}{%
+ \textormath{\={e}\allowhyphens}{\bar{e}}}%
+\declare@shorthand{latin}{=i}{%
+ \textormath{\={\i}\allowhyphens}{\bar{\imath}}}%
+\declare@shorthand{latin}{=o}{%
+ \textormath{\={o}\allowhyphens}{\bar{o}}}%
+\declare@shorthand{latin}{=u}{%
+ \textormath{\={u}\allowhyphens}{\bar{u}}}%
+}
+% \end{macrocode}
+% Notice that the short hand definitions are given only for lower
+% case letters; it would not be difficult to extend the set of
+% definitions to upper case letters, but it appears of very little
+% use in view of the kind of documents where prosodic marks are
+% supposed to be used. Nevertheless in those rare cases when it's
+% required to set some uppercase letters with their prosodic
+% marks, it is always possible to use the standard \LaTeX\ commands
+% such as |\u{I}| for typesetting \u{I}, or |\={A}| for
+% typesetting~\=A.
+%
+% Finally we restore the caret and equals sign initial default
+% category codes.
+% \begin{macrocode}
+\catcode`\= 12\relax
+\catcode`\^ 7\relax
+% \end{macrocode}
+% \end{macro}
+%
+% It must be understood that by using the above prosodic marks,
+% line breaking is somewhat impeached; since such prosodic marks
+% are used almost exclusively in dictionaries, grammars, and poems
+% (only in school textbooks), this shouldn't be of any importance
+% for what concerns the quality of typesetting.
+% \end{macro}
+% \end{macro}
+%
+% \section{Etymological hyphenation}
+% In order to deal in a clean way with prefixes and compound words
+% to be divided etymologically, the active character |"| is given
+% a special definition so as to behave as a discretionary break
+% with hyphenation allowed after it.
+% Most of the code for dealing with the active |"| is already
+% contained in the core of \babel, but we are going to use it as a
+% single character shorthand for Latin.
+% \begin{macrocode}
+\initiate@active@char{"}%
+\addto\extraslatin{\bbl@activate{"}%
+}
+% \end{macrocode}
+%
+% A temporary macro is defined so as to take different actions in
+% math mode and text mode: specifically in the former case the
+% macro inserts a double quote as it should in math mode, otherwise
+% another delayed macro comes into action.
+% \begin{macrocode}
+\declare@shorthand{latin}{"}{%
+ \ifmmode
+ \def\lt@@next{''}%
+ \else
+ \def\lt@@next{\futurelet\lt@temp\lt@cwm}%
+ \fi
+ \lt@@next
+}%
+% \end{macrocode}
+% In text mode the \cs{lt@next} control sequence is such that upon
+% its execution a temporary variable \cs{lt@temp} is made
+% equivalent to the next token in the input list without actually
+% removing it. Such temporary token is then tested by the macro
+% \cs{lt@cwm} and if it is found to be a letter token, then it
+% introduces a compound word separator control sequence
+% \cs{lt@allowhyphens} whose expansion introduces a discretionary
+% hyphen and an unbreakable space; in case the token is not a
+% letter, the token is tested again to find if it is the character
+% \texttt{\string|}, in which case it is gobbled and a
+% discretionary break is introduced.
+% \begin{macrocode}
+\def\lt@allowhyphens{\nobreak\discretionary{-}{}{}\hskip\z@skip}
+\newcommand*{\lt@cwm}{\let\lt@n@xt\relax
+ \ifcat\noexpand\lt@temp a%
+ \let\lt@n@xt\lt@allowhyphens
+ \else
+ \if\noexpand\lt@temp\string|%
+ \def\lt@n@xt{\lt@allowhyphens\@gobble}%
+ \fi
+ \fi
+ \lt@n@xt}%
+% \end{macrocode}
+%
+% Attention: the category code comparison does not work if the
+% temporary control sequence \cs{lt@temp} has been let equal to an
+% implicit character, such as |\ae|; therefore this etymological
+% hyphenation facility does not work with medieval Latin spelling
+% when |"| immediately precedes a ligature. in order to overcome
+% this drawback the shorthand \verb!"|! may be used in such cases;
+% it behaves exactly as |"|, but it does not test the implicit
+% character control sequence. An input such as
+% \verb!super"|{\ae}quitas!\footnote{This word does not exist in
+% ``regular'' Latin, and it is used just as an example.}
+% gets hyphenated as \texttt{su-per-{\ae}qui-tas} instead of
+% \texttt{su-pe-r\ae-qui-tas}.
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{latin}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/latin.ins b/Master/texmf-dist/source/generic/babel/latin.ins
new file mode 100644
index 00000000000..88bfe93d36d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/latin.ins
@@ -0,0 +1,150 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{latin.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+
+Copyright 1999-2001 Claudio Beccari All rights reserved.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{latin.ldf}{\from{latin.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/lsorbian.dtx b/Master/texmf-dist/source/generic/babel/lsorbian.dtx
new file mode 100644
index 00000000000..9f528f8aa9c
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/lsorbian.dtx
@@ -0,0 +1,239 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{129}
+% \iffalse
+%
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{lsorbian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{lsorbian}
+%\fi
+%\ProvidesFile{lsorbian.dtx}
+ [2005/03/31 v1.0f Lower Sorbian support from the babel system]
+%\iffalse
+%% File `lsorbian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Lower Sorbian Language Definition File
+%% Copyright (C) 1994 - 2005
+%% by Eduard Werner
+% Werner, Eduard",
+% Serbski institut z. t.,
+% Dw\'orni\v{s}\'cowa 6
+% 02625 Budy\v{s}in/Bautzen
+% Germany",
+% (??)3591 497223",
+% edi at kaihh.hanse.de",
+%
+%% Please report errors to: Eduard Werner edi at kaihh.hanse.de
+%%
+% This file is part of the babel system, it provides the source
+% code for the Lower Sorbian definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{lsorbian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{lsorbian.dtx}
+%
+% \changes{lsorbian-0.1}{1994/10/10}{First version}
+% \changes{lsorbian-1.0d}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Lower Sorbian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was written by Eduard Werner
+% (\texttt{edi@kaihh.hanse.de}).} It defines all the
+% language-specific macros for Lower Sorbian.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{lsorbian-1.0d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{lsorbian}\captionslsorbian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{lsorbian} will be an `unknown' languagein which
+% case we have to make it known. So we check for the existence of
+% |\l@lsorbian| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@lsorbian\@undefined
+ \@nopatterns{Lsorbian}
+ \adddialect\l@lsorbian\l@usorbian\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Lower Sorbian language.
+%
+% \begin{macro}{\captionslsorbian}
+% The macro |\captionslsorbian| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{lsorbian-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{lsorbian-1.0f}{2000/09/22}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionslsorbian{%
+ \def\prefacename{Zawod}%
+ \def\refname{Referency}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literatura}%
+ \def\chaptername{Kapitl}%
+ \def\appendixname{Dodawki}%
+ \def\contentsname{Wop\'simje\'se}%
+ \def\listfigurename{Zapis wobrazow}%
+ \def\listtablename{Zapis tabulkow}%
+ \def\indexname{Indeks}%
+ \def\figurename{Wobraz}%
+ \def\tablename{Tabulka}%
+ \def\partname{\'Z\v el}%
+ \def\enclname{P\'si\l oga}%
+ \def\ccname{CC}%
+ \def\headtoname{Komu}%
+ \def\pagename{Strona}%
+ \def\seename{gl.}%
+ \def\alsoname{gl.~teke}%
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newdatelsorbian}
+% The macro |\newdatelsorbian| redefines the command |\today| to
+% produce Lower Sorbian dates.
+% \changes{lsorbian-1.0e}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{lsorbian-1.0e}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\newdatelsorbian{%
+ \def\today{\number\day.~\ifcase\month\or
+ januara\or februara\or m\v erca\or apryla\or maja\or
+ junija\or julija\or awgusta\or septembra\or oktobra\or
+ nowembra\or decembra\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\olddatelsorbian}
+% The macro |\olddatelsorbian| redefines the command |\today| to
+% produce old-style Lower Sorbian dates.
+% \begin{macrocode}
+\def\olddatelsorbian{%
+ \def\today{\number\day.~\ifcase\month\or
+ wjelikego ro\v zka\or
+ ma\l ego ro\v zka\or
+ nal\v etnika\or
+ jat\v sownika\or
+ ro\v zownika\or
+ sma\v znika\or
+ pra\v znika\or
+ \v znje\'nca\or
+ po\v znje\'nca\or
+ winowca\or
+ nazymnika\or
+ godownika\fi \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% The default will be the new-style dates.
+% \begin{macrocode}
+\let\datelsorbian\newdatelsorbian
+% \end{macrocode}
+%
+% \begin{macro}{\extraslsorbian}
+% \begin{macro}{\noextraslsorbian}
+% The macro |\extraslsorbian| will perform all the extra
+% definitions needed for the lsorbian language. The macro
+% |\noextraslsorbian| is used to cancel the actions of
+% |\extraslsorbian|. For the moment these macros are empty but
+% they are defined for compatibility with the other language
+% definition files.
+%
+% \begin{macrocode}
+\addto\extraslsorbian{}
+\addto\noextraslsorbian{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{lsorbian-1.0d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{lsorbian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/magyar.dtx b/Master/texmf-dist/source/generic/babel/magyar.dtx
new file mode 100644
index 00000000000..febd734ad76
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/magyar.dtx
@@ -0,0 +1,1411 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{1538}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{magyar.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{magyar}
+%\fi
+%\ProvidesFile{magyar.dtx}
+ [2005/03/30 v1.4j Magyar support from the babel system]
+%\iffalse
+%% File `magyar.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Magyar Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%% \'Arp\'ad B\'IR\'O
+%% J\'ozsef B\'ERCES
+%
+% Please report errors to: J.L. Braams babel braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Hungarian language definition file. A contribution
+% was made by Attila Koppanyi (attila@cernvm.cern.ch).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{magyar.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{magyar.dtx}
+%
+% \changes{magyar-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{magyar-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{magyar-1.1d}{1994/02/08}{Further spelling corrections}
+% \changes{magyar-1.1e}{1994/02/09}{Still more spelling corrections}
+% \changes{magyar-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{magyar-1.3c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{magyar-1.3g}{1996/07/12}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{magyar-1.4a}{1998/06/04}{order inverting in
+% headings/titles/captions; definite article handling; active char
+% for special hyphenation}
+% \changes{magyar-1.4d}{2001/11/15}{Corrected checksum}
+% \changes{magyar-1.4j}{2004/11/17}{Added missing comment characters
+% in the redefinitions of \cs{ps@headings} to prevent spurious
+% spaces}
+%
+% \section{The Hungarian language}
+%
+% The file option \file{\filename} defines all the
+% language definition macros for the Hungarian language.
+%
+% The \babel{} support for the Hungarian language until file
+% version 1.3i was essentially changing the English document
+% elements to Hungarian ones, but because of the differences
+% between these too languages this was actually unusable (`Part I'
+% was transferred to `R\'esz I' which is not usable instead of `I.\
+% r\'esz'). To enhance the typesetting facilities for Hungarian
+% the following should be considered:
+% \begin{itemize}
+% \item In Hungarian documents there is a period after
+% the part, section, subsection \mbox{etc.} numbers.
+%
+% \item In the part, chapter, appendix name the number
+% (or letter) goes before the name, so `Part I' translates to
+% `I.\ r\'esz'.
+%
+% \item The same is true with captions
+% (`Table 2.1' goes to `2.1.\ t\'abl\'azat').
+%
+% \item There is a period after the caption name instead of a colon.
+% (`Table 2.1:' goes to `2.1.\ t\'abl\'azat.')
+%
+% \item There is a period at the end of the title in a run-in head
+% (when |afterskip<0| in |\@startsection|).
+%
+% \item Special hyphenation rules must be applied
+% for the so-called long double consonants (ccs, ssz,\dots).
+%
+% \item The opening quotation mark is like the German one
+% (the closing is the same as in English).
+%
+% \item In Hungarian figure, table, \mbox{etc.}
+% referencing a definite article is also incorporated.
+% The Hungarian definite articles behave like the English
+% indefinite ones (`a/an'). `a' is used for words beginning
+% with a consonant and `az' goes for a vowel.
+% Since some numbers begin with a vowel some others
+% with a consonant some commands should be provided for
+% automatic definite article generation.
+% \end{itemize}
+%
+% Until file version 1.3i\footnote{That file was
+% last revised on 1996/12/23 with a contribution by the next
+% authors: Attila Kopp\'anyi (\texttt{attila@cernvm.cern.ch}),
+% \'Arp\'ad B\'{\i}r\'o (\texttt{JZP1104@HUSZEG11.bitnet}),
+% Istv\'an Hamecz (\texttt{hami@ursus.bke.hu)} and
+% Dezs\H{o} Horv\'ath (\texttt{horvath@pisa.infn.it}).}
+% the special typesetting rules of the Hungarian language
+% mentioned above were not taken into consideration.
+% This version (\fileversion)\footnote{It was written by J\'ozsef
+% B\'erces (\texttt{jozsi@docs4.mht.bme.hu}) with some help from
+% Ferenc Wettl (\texttt{wettl@math.bme.hu}) and an idea from David
+% Carlisle (\texttt{david@dcarlisle.demon.co.uk}).}
+% enables \babel{} to typeset `good-looking' Hungarian texts.
+%
+% \DescribeMacro\ontoday
+% The |\ontoday| command works like |\today| but
+% produces a slightly different date format used in expressions such
+% as `on February 10th'.
+%
+% \DescribeMacro\Az
+% The commands |\Az#1| and |\az#1| write the correct
+% definite article for the argument and the argument itself
+% (separated with a |~|). The star-forms (|\Az*| and |\az*|)
+% produce the article only.
+%
+% \DescribeMacro\Azr
+% |\Azr#1| and |\azr#1| treat the argument as a label so expand
+% it then write the definite article for |\r@#1|, a non-breakable
+% space then the label expansion. The star-forms do not print
+% the label expansion. |\Azr(#1| and |\azr(#1| are used for
+% equation referencing with the syntax |\azr(|\textit{label}|)|.
+%
+% \DescribeMacro\Aref
+% There are two aliases |\Aref| and |\aref| for |\Azr| and |\azr|,
+% respectively. During the preparation of a document it is not
+% known in general, if the code `|a~\ref{|\textit{label}|}|' or the code
+% `|az~\ref{|\textit{label}|}|' is the grammatically correct one. Writing
+% `|\aref{|\textit{label}|}|' instead of the previous ones solves the
+% problem.
+%
+% \DescribeMacro\Azp
+% |\Azp#1| and |\azp#1| also treat the argument as a label but
+% use the label's page for definite article determination.
+% There are star-forms giving only the definite article without
+% the page number.
+%
+% \DescribeMacro\Apageref
+% There are aliases |\Apageref| and |\apageref| for |\Azp| and
+% |\azp|, respectively. The code |\apageref{|\textit{label}|}|
+% is equivalent either to |a~\pageref{|\textit{label}|}| or
+% to |az~\pageref{|\textit{label}|}|.
+%
+% \DescribeMacro\Azc
+% |\Azc| and |\azc| work like the |\cite| command but
+% (of course) they insert the definite article. There can be
+% several comma separated cite labels and in that case the
+% definite article is given for the first one.
+% They accept |\cite|'s optional argument.
+% There are star-forms giving the definite article only.
+%
+% \DescribeMacro\Acite
+% There are aliases |\Acite| and |\acite| for
+% |\Azc| and |\azc|, respectively.
+%
+% For this language the character |`| is made active.
+% Table~\ref{tab:hun-actives} shows the shortcuts.
+% The main reason for the activation of the |`| character
+% is to handle the special hyphenation of the long double
+% consonants.
+% \begin{table}
+% \begin{center}
+% \begin{tabular}{lp{45mm}p{47mm}}
+% shortcut & explanation & example \\
+% \hline
+% |``| & same as |\glqq| in \babel{}, or
+% |\quotedblbase| in T1
+% (opening quotation mark, like ,,)
+% & |``id\'ezet''|$\longrightarrow$,,id\'ezet'{}' \\
+% |`c|, |`C| & ccs is hyphenated as cs-cs
+% & |lo`ccsan|$\longrightarrow$locs-csan \\
+% |`d|, |`D| & ddz is hyphenated as dz-dz
+% & |e`ddz\"unk|$\longrightarrow$edz-dz\"unk \\
+% |`g|, |`G| & ggy is hyphenated as gy-gy
+% & |po`ggy\'asz|$\longrightarrow$pogy-gy\'asz \\
+% |`l|, |`L| & lly is hyphenated as ly-ly
+% & |Kod\'a`llyal|$\longrightarrow$Kod\'aly-lyal \\
+% |`n|, |`N| & nny is hyphenated as ny-ny
+% & |me`nnyei|$\longrightarrow$meny-nyei \\
+% |`s|, |`S| & ssz is hyphenated as sz-sz
+% & |vi`ssza|$\longrightarrow$visz-sza \\
+% |`t|, |`T| & tty is hyphenated as ty-ty
+% & |po`ttyan|$\longrightarrow$poty-tyan \\
+% |`z|, |`Z| & zzs is hyphenated as zs-zs
+% & |ri`zzsel|$\longrightarrow$rizs-zsel \\
+% \end{tabular}
+% \caption{The shortcuts defined in \file{magyar.ldf}}
+% \label{tab:hun-actives}
+% \end{center}
+% \end{table}
+%
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{magyar-1.3h}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{magyar}{caption\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{magyar} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@magyar| or |\l@hungarian| to see whether we have to do
+% something here.
+%
+% \changes{magyar-1.0b}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{magyar-1.1}{1992/02/16}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{magyar-1.3c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \changes{magyar-1.4d}{2003/09/18}{The \cs{else} clause got outside
+% of the \cs{if} statement, breaking the Hungarian support}
+% \changes{magyar-1.4g}{2003/10/07}{Further change to make it work
+% when neither \cs{l@magyar} nor \cs{l@hugarian} are defined}
+% \begin{macrocode}
+\ifx\l@magyar\@undefined
+ \ifx\l@hungarian\@undefined
+ \@nopatterns{Magyar}
+ \adddialect\l@magyar0
+ \else
+ \let\l@magyar\l@hungarian
+ \fi
+\fi
+% \end{macrocode}
+% The statement above makes sure that |\l@magyar| is always
+% defined; if |\l@hungarian| is still undefined we make it equal to
+% |\l@magyar|.
+% \begin{macrocode}
+\ifx\l@hungarian\@undefined
+ \let\l@hungarian\l@magyar
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Hungarian language.
+%
+% \begin{macro}{\captionsmagyar}
+% The macro |\captionsmagyar| defines all strings used in the four
+% standard document classes provided with \LaTeX.
+% \changes{magyar-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{magyar-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{magyar-1.1c}{1994/01/05}{Added translations, fixed typos}
+% \changes{magyar-1.3e}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{magyar-1.3f}{1996/04/18}{translated Proof and replaced some
+% translations}
+% \changes{magyar-1.4a}{1998/06/04}{the initial letter of fejezet,
+% t\'abl\'azat, r\'esz, l\'asd changed to lowercase}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{El\H osz\'o}%
+% \end{macrocode}
+% For the list of references at the end of an article we have a
+% choice between two words, `Referenci\'ak' (a Hungarian version of
+% the English word) and `Hivatkoz\'asok'. The latter seems to
+% be in more widespread use.
+% \begin{macrocode}
+ \def\refname{Hivatkoz\'asok}%
+% \end{macrocode}
+% If you have a document with a summary instead of an abstract you
+% might want to replace the word `Kivonat' with
+% `\"Osszefoglal\'o'.
+% \begin{macrocode}
+ \def\abstractname{Kivonat}%
+% \end{macrocode}
+% The Hungarian version of `Bibliography' is `Bibliogr\'afia', but
+% a more natural word to use is `Irodalomjegyz\'ek'.
+% \begin{macrocode}
+ \def\bibname{Irodalomjegyz\'ek}%
+ \def\chaptername{fejezet}%
+ \def\appendixname{F\"uggel\'ek}%
+ \def\contentsname{Tartalomjegyz\'ek}%
+ \def\listfigurename{\'Abr\'ak jegyz\'eke}%
+ \def\listtablename{T\'abl\'azatok jegyz\'eke}%
+ \def\indexname{T\'argymutat\'o}%
+ \def\figurename{\'abra}%
+ \def\tablename{t\'abl\'azat}%
+ \def\partname{r\'esz}%
+ \def\enclname{Mell\'eklet}%
+ \def\ccname{K\"orlev\'el--c\'\i mzettek}%
+ \def\headtoname{C\'\i mzett}%
+ \def\pagename{oldal}%
+ \def\seename{l\'asd}%
+ \def\alsoname{l\'asd m\'eg}%
+% \end{macrocode}
+% Besides the Hungarian word for Proof, `Bizony\'\i t\'as' we can
+% also name Corollary (K\"ovetkezm\'eny), Theorem (T\'etel) and
+% Lemma (Lemma).
+% \changes{magyar-1.4b}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{magyar-1.4h}{2003/11/20}{Inserted translation for Glossary}
+% \begin{macrocode}
+ \def\proofname{Bizony\'\i t\'as}%
+ \def\glossaryname{Sz\'ojegyz\'ek}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datemagyar}
+% The macro |\datemagyar| redefines the command |\today| to produce
+% Hungarian dates.
+% \changes{magyar-1.1d}{1994/02/08}{Rewritten to produce the correct
+% date format}
+% \changes{magyar-1.4a}{1998/06/10}{Use \cs{number}\cs{day} instead of
+% \cs{ifcase} construct}
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{%
+ \number\year.\nobreakspace\ifcase\month\or
+ janu\'ar\or febru\'ar\or m\'arcius\or
+ \'aprilis\or m\'ajus\or j\'unius\or
+ j\'ulius\or augusztus\or szeptember\or
+ okt\'ober\or november\or december\fi
+ \space\number\day.}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ondatemagyar}
+% The macro |\ondatemagyar| produces Hungarian dates which have the
+% meaning `\emph{on this day}'. It does not redefine the command
+% |\today|.
+% \changes{magyar-1.1c}{1994/01/05}{The date number should not be
+% followed by a dot.}
+% \changes{magyar-1.1d}{1994/02/08}{Renamed from \cs{datemagyar};
+% nolonger redefines \cs{today}.}
+% \begin{macrocode}
+\@namedef{ondate\CurrentOption}{%
+ \number\year.\nobreakspace\ifcase\month\or
+ janu\'ar\or febru\'ar\or m\'arcius\or
+ \'aprilis\or m\'ajus\or j\'unius\or
+ j\'ulius\or augusztus\or szeptember\or
+ okt\'ober\or november\or december\fi
+ \space\ifcase\day\or
+ 1-j\'en\or 2-\'an\or 3-\'an\or 4-\'en\or 5-\'en\or
+ 6-\'an\or 7-\'en\or 8-\'an\or 9-\'en\or 10-\'en\or
+ 11-\'en\or 12-\'en\or 13-\'an\or 14-\'en\or 15-\'en\or
+ 16-\'an\or 17-\'en\or 18-\'an\or 19-\'en\or 20-\'an\or
+ 21-\'en\or 22-\'en\or 23-\'an\or 24-\'en\or 25-\'en\or
+ 26-\'an\or 27-\'en\or 28-\'an\or 29-\'en\or 30-\'an\or
+ 31-\'en\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasmagyar}
+% \begin{macro}{\noextrasmagyar}
+% The macro |\extrasmagyar| will perform all the extra definitions
+% needed for the Hungarian language. The macro |\noextrasmagyar| is
+% used to cancel the actions of |\extrasmagyar|.
+%
+% \begin{macrocode}
+ \@namedef{extras\CurrentOption}{%
+ \expandafter\let\expandafter\ontoday
+ \csname ondate\CurrentOption\endcsname}
+\@namedef{noextras\CurrentOption}{\let\ontoday\@undefined}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Now we redefine some commands included into \file{latex.ltx}.
+% The original form of a command is always saved with
+% |\babel@save| and the changes are added to |\extrasmagyar|.
+% This ensures that the Hungarian version of a macro is alive
+% \emph{only} if the Hungarian language is active.
+%
+% \begin{macro}{\fnum@figure}
+% \begin{macro}{\fnum@table}
+% In figure and table captions the order of the figure/table
+% number and |\figurename|\hspace{0pt}/|\tablename| must be changed.
+% To achieve this |\fnum@figure| and |\fnum@table| are
+% redefined and added to |\extrasmagyar|.
+% \changes{magyar-1.4i}{2004/02/20}{Use \cs{nobreakspace} instead of
+% tilde}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\fnum@figure
+ \def\fnum@figure{\thefigure.\nobreakspace\figurename}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\fnum@table
+ \def\fnum@table{\thetable.\nobreakspace\tablename}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption}
+% The colon in a figure/table caption must be replaced by a dot
+% by redefining |\@makecaption|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@makecaption
+ \def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1. #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ {#1. #2\csname par\endcsname}
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@caption}
+% There should be a dot after the figure/table number in lof/lot,
+% so |\@caption| is redefined.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@caption
+ \long\def\@caption#1[#2]#3{%
+ \csname par\endcsname
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces #3}\csname par\endcsname
+ \endgroup}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@seccntformat}
+% In order to have a dot after the section number
+% |\@seccntformat| is redefined.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@seccntformat
+ \def\@seccntformat#1{\csname the#1\endcsname.\quad}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sect}
+% Alas, |\@sect| must also be redefined to have that dot in toc too.
+% On the other hand, we include a dot after a run-in head.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@sect
+ \def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M #8\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname.}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec #8.}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname.}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ssect}
+% In order to have that dot after a run-in head when the star form of the
+% sectioning commands is used, we have to redefine |\@ssect|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@ssect
+ \def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+ \interlinepenalty \@M #5\@@par}%
+ \endgroup
+ \else
+ \def\@svsechd{#4{\hskip #1\relax #5.}}%
+ \fi
+ \@xsect{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@begintheorem}
+% \begin{macro}{\@opargbegintheorem}
+% Order changing and dot insertion in theorem by redefining
+% |\@begintheorem| and |\@opargbegintheorem|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@begintheorem
+ \def\@begintheorem#1#2{\trivlist
+ \item[\hskip \labelsep{\bfseries #2.\ #1.}]\itshape}%
+ \babel@save\@opargbegintheorem
+ \def\@opargbegintheorem#1#2#3{\trivlist
+ \item[\hskip \labelsep{\bfseries #2.\ #1\ (#3).}]\itshape}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The next step is to redefine some macros included into the
+% class files. It is determined which class file is loaded
+% then the original form of the macro is saved and the changes
+% are added to |\extrasmagyar|.
+%
+% First we check if the \file{book.cls} is loaded.
+% \begin{macrocode}
+\@ifclassloaded{book}{%
+% \end{macrocode}
+% \begin{macro}{\ps@headings}
+% The look of the headings is changed: we have to insert some dots
+% and change the order of chapter number and |\chaptername|.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\ps@headings}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \if@twoside
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\thepage\hfil\slshape\leftmark}%
+ \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \thechapter. \@chapapp. \ %
+ \fi
+ \fi
+ ##1}}{}}%
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection. \ %
+ \fi
+ ##1}}}}%
+ \else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \thechapter. \@chapapp. \ %
+ \fi
+ \fi
+ ##1}}}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@part}
+% At the beginning of a part we need \mbox{eg.} `I.\ r\'esz'
+% instead of `Part I' (in toc too).
+% To achieve this |\@part| is redefined.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@part
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \thepart.\nobreakspace\partname
+ \csname par\endcsname
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\csname par\endcsname}%
+ \@endpart}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@chapter}
+% The same changes are made to chapter.
+% First the screen typeout and the toc are changed by
+% redefining |\@chapter|.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@chapter
+ \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\thechapter.\space\@chapapp.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter.}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@makechapterhead}
+% Then the look of the chapter-start is modified by redefining
+% |\@makechapterhead|.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@makechapterhead
+ \def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \huge\bfseries \thechapter.\nobreakspace\@chapapp{}
+ \csname par\endcsname\nobreak
+ \vskip 20\p@
+ \fi
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\csname par\endcsname\nobreak
+ \vskip 40\p@
+ }}}%
+% \end{macrocode}
+% \end{macro}
+% This the end of the book class modification.
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% Now we check if \file{report.cls} is loaded.
+% \begin{macrocode}
+\@ifclassloaded{report}{%
+% \end{macrocode}
+% \begin{macro}{\ps@headings}
+% First the headings are modified just in case of the book class.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\ps@headings}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \if@twoside
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\thepage\hfil\slshape\leftmark}%
+ \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \thechapter. \@chapapp. \ %
+ \fi
+ ##1}}{}}%
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection. \ %
+ \fi
+ ##1}}}}%
+ \else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \thechapter. \@chapapp. \ %
+ \fi
+ ##1}}}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@chapter}
+% Chapter-start modification with |\@chapter|
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@chapter
+ \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\thechapter.\space\@chapapp.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter.}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@makechapterhead}
+% and |\@makechapterhead|.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@makechapterhead
+ \def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \huge\bfseries \thechapter.\nobreakspace\@chapapp{}
+ \csname par\endcsname\nobreak
+ \vskip 20\p@
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\csname par\endcsname\nobreak
+ \vskip 40\p@
+ }}}%
+% \end{macrocode}
+% \end{macro}
+% End of report class modification.
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% Checking if \file{article.cls} is loaded.
+% \begin{macrocode}
+\@ifclassloaded{article}{%
+% \end{macrocode}
+% \begin{macro}{\ps@headings}
+% Changing headings by redefining |\ps@headings|.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\ps@headings}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \if@twoside
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\thepage\hfil\slshape\leftmark}%
+ \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection.\quad
+ \fi
+ ##1}}{}}%
+ \def\subsectionmark##1{%
+ \markright {%
+ \ifnum \c@secnumdepth >\@ne
+ \thesubsection.\quad
+ \fi
+ ##1}}}%
+ \else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \thesection.\quad
+ \fi
+ ##1}}}}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+% No more necessary changes specific to the article class.
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% And now this is the turn of \file{letter.cls}.
+% \begin{macrocode}
+\@ifclassloaded{letter}{%
+% \end{macrocode}
+% \begin{macro}{\ps@headings}
+% In the headings the page number must be followed by a dot
+% and then |\pagename|.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\ps@headings}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \if@twoside
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@oddhead{\slshape\headtoname{:} \ignorespaces\toname
+ \hfil \@date
+ \hfil \thepage.\nobreakspace\pagename}%
+ \let\@evenhead\@oddhead}
+ \else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\slshape\headtoname{:} \ignorespaces\toname
+ \hfil \@date
+ \hfil \thepage.\nobreakspace\pagename}}
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+% End of letter class.
+% \begin{macrocode}
+}{}
+% \end{macrocode}
+%
+% After making the changes to the \LaTeX{}
+% macros we define some new ones to handle the problem
+% with definite articles.
+% \begin{macro}{\az}
+% |\az| is a user-level command which decides if the next
+% character is a star. |\@az| is called for |\az*| and
+% |\az@| for |\az|.
+% \begin{macrocode}
+\def\az{a\@ifstar{\@az}{\az@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Az}
+% |\Az| is used at the beginning of a sentence. Otherwise it behaves
+% the same as |\az|.
+% \begin{macrocode}
+\def\Az{A\@ifstar{\@az}{\az@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\az@}
+% |\az@| is called if there is no star after |\az| or |\Az|.
+% It calls |\@az| and writes |#1| separating with a non-breakable
+% space.
+% \begin{macrocode}
+\def\az@#1{\@az{#1}\nobreakspace#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@az}
+% This macro calls |\hun@tempadef| to remove the accents from
+% the argument then calls |\@@az| that determines if a `z'
+% should be written after a/A (written by |\az|/|\Az|).
+% \begin{macrocode}
+\def\@az#1{%
+ \hun@tempadef{relax}{relax}{#1}%
+ \edef\@tempb{\noexpand\@@az\@tempa\hbox!}%
+ \@tempb}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hun@tempadef}
+% The macro |\hun@tempadef| has three tasks:
+% \begin{itemize}
+% \item Accent removal. Accented letters confuse
+% |\@@az|, the main definite article determinator
+% macro, so they must be changed to their non-accented
+% counterparts. Special letters must also be changed,
+% \mbox{eg.} \oe$\,\rightarrow\,$o.
+% \item Labels must be expanded.
+% \item To handle Roman numerals correctly, commands starting
+% with |\hun@| are defined for labels containing Roman
+% numbers with the Roman numerals
+% replaced by their Arabic representation.
+% This macro can check if there is a |\hun@| command.
+% \end{itemize}
+% There are three arguments:
+% \begin{enumerate}
+% \item The primary command that should be expanded if it exists.
+% This is usually the |\hun@| command for a label.
+% \item The secondary command which is used if the first one
+% is |\relax|. This is usually the original \LaTeX{}
+% command for a label.
+% \item This is used if the first two is |\relax|. For this one
+% no expansion is carried out but the accents are still
+% removed and special letters are changed.
+% \end{enumerate}
+% \changes{magyar-1.4f}{2003/09/29}{Added
+% \cs{def}\cs{safe@activesfalse{}} as a fix for PR3426}
+% \begin{macrocode}
+\def\hun@tempadef#1#2#3{%
+ \begingroup
+ \def\@safe@activesfalse{}%
+ \def\setbox ##1{}% to get rid of accents and special letters
+ \def\hbox ##1{}%
+ \def\accent ##1 ##2{##2}%
+ \def\add@accent ##1##2{##2}%
+ \def\@text@composite@x ##1##2{##2}%
+ \def\i{i}\def\j{j}%
+ \def\ae{a}\def\AE{A}\def\oe{o}\def\OE{O}%
+ \def\ss{s}\def\L{L}%
+ \def\d{}\def\b{}\def\c{}\def\t{}%
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\ifx\csname #2\endcsname\relax
+ \xdef\@tempa{#3}%
+ \else
+ \xdef\@tempa{\csname #2\endcsname}%
+ \fi
+ \else
+ \xdef\@tempa{\csname #1\endcsname}%
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% The following macros are used to determine the definite
+% article for a label's expansion.
+% \begin{macro}{\aref}
+% |\aref| is an alias for |\azr|.
+% \begin{macrocode}
+\def\aref{\azr}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Aref}
+% |\Aref| is an alias for |\Azr|.
+% \begin{macrocode}
+\def\Aref{\Azr}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azr}
+% |\azr| calls |\@azr| if the next character is a star,
+% otherwise it calls |\azr@|.
+% \begin{macrocode}
+\def\azr{a\@ifstar{\@azr}{\azr@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Azr}
+% |\Azr| is the same as |\azr| except that it writes `A'
+% instead of `a'.
+% \begin{macrocode}
+\def\Azr{A\@ifstar{\@azr}{\azr@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azr@}
+% |\azr@| decides if the next character is |(| and
+% in that case it calls |\azr@@@| which writes an extra |(|
+% for equation referencing. Otherwise |\azr@@| is called.
+% \begin{macrocode}
+\def\azr@{\@ifnextchar ({\azr@@@}{\azr@@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azr@@}
+% Calls |\@azr| then writes the label's expansion preceded by
+% a non-breakable space.
+% \begin{macrocode}
+\def\azr@@#1{\@azr{#1}\nobreakspace\ref{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azr@@@}
+% Same as |\azr@@| but inserts a |(| between the
+% non-breakable space and the label expansion.
+% \begin{macrocode}
+\def\azr@@@(#1{\@azr{#1}\nobreakspace(\ref{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@azr}
+% Calls |\hun@tempadef| to choose between the label's
+% |\hun@| or original \LaTeX{} command and to expand
+% it with accent removal and special letter substitution.
+% Then calls |\@@az|, the core macro of definite article handling.
+% \begin{macrocode}
+\def\@azr#1{%
+ \hun@tempadef{hun@r@#1}{r@#1}{}%
+ \ifx\@tempa\empty
+ \else
+ \edef\@tempb{\noexpand\@@az\expandafter\@firstoftwo\@tempa\hbox!}%
+ \@tempb
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The following commands are used to generate the definite article
+% for the page number of a label.
+% \begin{macro}{\apageref}
+% |\apageref| is an alias for |\azp|.
+% \begin{macrocode}
+\def\apageref{\azp}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Apageref}
+% |\Apageref| is an alias for |\Azp|.
+% \begin{macrocode}
+\def\Apageref{\Azp}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azp}
+% Checks if the next character is |*| and calls
+% |\@azp| or |\azp@|.
+% \begin{macrocode}
+\def\azp{a\@ifstar{\@azp}{\azp@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Azp}
+% Same as |\azp| except that it writes `A' instead of `a'.
+% \begin{macrocode}
+\def\Azp{A\@ifstar{\@azp}{\azp@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azp@}
+% Calls |\@azp| then writes the label's page preceded by
+% a non-breakable space.
+% \begin{macrocode}
+\def\azp@#1{\@azp{#1}\nobreakspace\pageref{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@azp}
+% Calls |\hun@tempadef| then takes the label's page and passes
+% it to |\@@az|.
+% \begin{macrocode}
+\def\@azp#1{%
+ \hun@tempadef{hun@r@#1}{r@#1}{}%
+ \ifx\@tempa\empty
+ \else
+ \edef\@tempb{\noexpand\@@az\expandafter\@secondoftwo\@tempa\hbox!}%
+ \@tempb
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The following macros are used to give the definite article to
+% citations.
+% \begin{macro}{\acite}
+% This is an alias for |\azc|.
+% \begin{macrocode}
+\def\acite{\azc}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Acite}
+% This is an alias for |\Azc|.
+% \begin{macrocode}
+\def\Acite{\Azc}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azc}
+% Checks if the next character is a star and
+% calls |\@azc| or |\azc@|.
+% \begin{macrocode}
+\def\azc{a\@ifstar{\@azc}{\azc@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Azc}
+% Same as |\azc| but used at the beginning of sentences.
+% \begin{macrocode}
+\def\Azc{A\@ifstar{\@azc}{\azc@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azc@}
+% If there is no star we accept an optional argument,
+% just like the |\cite| command.
+% \begin{macrocode}
+\def\azc@{\@ifnextchar [{\azc@@}{\azc@@[]}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\azc@@}
+% First calls |\@azc| then |\cite|.
+% \begin{macrocode}
+\def\azc@@[#1]#2{%
+ \@azc{#2}\nobreakspace\def\@tempa{#1}%
+ \ifx\@tempa\@empty\cite{#2}\else\cite[#1]{#2}\fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@azc}
+% This is an auxiliary macro to get the first cite label
+% from a comma-separated list.
+% \begin{macrocode}
+\def\@azc#1{\@@azc#1,\hbox!}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@azc}
+% This one uses only the first argument, that is the first
+% element of the comma-separated list of cite labels.
+% Calls |\hun@tempadef| to expand the cite label with accent
+% removal and special letter replacement.
+% Then |\@@az|, the core macro, is called.
+% \begin{macrocode}
+\def\@@azc#1,#2\hbox#3!{%
+ \hun@tempadef{hun@b@#1}{b@#1}{}%
+ \ifx\@tempa\empty
+ \else
+ \edef\@tempb{\noexpand\@@az\@tempa\hbox!}%
+ \@tempb
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hun@number@lehgth}
+% This macro is used to count the number of digits in its
+% argument until a non-digit character is found or
+% the end of the argument is reached.
+% It must be called as
+% |\hun@number@lehgth|\textit{arg}|\hbox\hbox!| and
+% |\count@| must be zeroed.
+% It is called by |\@@az|.
+% \begin{macrocode}
+\def\hun@number@lehgth#1#2\hbox#3!{%
+ \ifcat\noexpand#11%
+ \ifnum\expandafter`\csname#1\endcsname>47
+ \ifnum\expandafter`\csname#1\endcsname<58
+ \advance\count@ by \@ne
+ \hun@number@lehgth#2\hbox\hbox!\fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hun@alph@lehgth}
+% This is used to count the number of letters until a
+% non-letter is found or the end of the argument is reached.
+% It must be called as
+% |\hun@alph@lehgth|\textit{arg}|\hbox\hbox!| and
+% |\count@| must be set to zero.
+% It is called by |\@@az@string|.
+% \begin{macrocode}
+\def\hun@alph@lehgth#1#2\hbox#3!{%
+ \ifcat\noexpand#1A%
+ \advance\count@ by \@ne
+ \hun@alph@lehgth#2\hbox\hbox!\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@az@string}
+% This macro is called by |\@@az| if the argument begins
+% with a letter.
+% The task of |\@@az@string| is to determine if the argument
+% starts with a vowel and in that case |\let\@tempa\@tempb|.
+% After checking if the first letter is A, E, I, O, or U,
+% |\hun@alph@lehgth| is called
+% to determine the length of the argument. If it gives 1
+% (that is the argument is a single-letter one or the second
+% character is not letter) then the letters L, M, N, R, S, X, and Y
+% are also considered as a vowel since their Hungarian pronounced
+% name starts with a vowel.
+% \begin{macrocode}
+\def\@@az@string#1#2{%
+ \ifx#1A%
+ \let\@tempa\@tempb
+ \else\ifx#1E%
+ \let\@tempa\@tempb
+ \else\ifx#1I%
+ \let\@tempa\@tempb
+ \else\ifx#1O%
+ \let\@tempa\@tempb
+ \else\ifx#1U%
+ \let\@tempa\@tempb
+ \fi\fi\fi\fi\fi
+ \ifx\@tempa\@tempb
+ \else
+ \count@\z@
+ \hun@alph@lehgth#1#2\hbox\hbox!%
+ \ifnum\count@=\@ne
+ \ifx#1F%
+ \let\@tempa\@tempb
+ \else\ifx#1L%
+ \let\@tempa\@tempb
+ \else\ifx#1M%
+ \let\@tempa\@tempb
+ \else\ifx#1N%
+ \let\@tempa\@tempb
+ \else\ifx#1R%
+ \let\@tempa\@tempb
+ \else\ifx#1S%
+ \let\@tempa\@tempb
+ \else\ifx#1X%
+ \let\@tempa\@tempb
+ \else\ifx#1Y%
+ \let\@tempa\@tempb
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@az}
+% This macro is the core of definite article handling.
+% It determines if the argument needs `az' or `a' definite
+% article by setting |\@tempa| to `z' or |\@empty|.
+% It sets |\@tempa| to `z' if
+% \begin{itemize}
+% \item the first character of the argument is 5; or
+% \item the first character of the argument is 1 and
+% the $\mathit{length\ of\ the\ number} \pmod 3 = 1$
+% (one--egy, thousand--ezer, million--egymilli\'o,\dots); or
+% \item the first character of the argument is
+% a, A, e, E, i, I, o, O, u, or U; or
+% \item the first character of the argument is
+% l, L, m, M, n, N, r, R, s, S, x, X, y, or Y
+% and the length of the argument is 1 or the second
+% character is a non-letter.
+% \end{itemize}
+% At the end it calls |\@tempa|, that is, it either typesets a `z'
+% or nothing.
+% \begin{macrocode}
+\def\@@az#1#2\hbox#3!{%
+ \let\@tempa\@empty
+ \def\@tempb{z}%
+ \uppercase{%
+ \ifx5#1%
+ \let\@tempa\@tempb
+ \else\ifx1#1%
+ \count@\@ne
+ \hun@number@lehgth#2\hbox\hbox!%
+ \loop
+ \ifnum\count@>\thr@@
+ \advance\count@-\thr@@
+ \repeat
+ \ifnum\count@=\@ne
+ \let\@tempa\@tempb
+ \fi
+ \else
+ \@@az@string{#1}{#2}%
+ \fi\fi
+ }%
+ \@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\refstepcounter}
+% |\refstepcounter| must be redefined in order to keep
+% |\@currentlabel| unexpanded. This is necessary to enable
+% the |\label| command to write a |\hunnewlabel| command
+% to the aux file with the Roman numerals substituted by
+% their Arabic representations.
+% Of course, the original definition of |\refstepcounter| is
+% saved and restored if the Hungarian language is switched off.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\refstepcounter
+ \def\refstepcounter#1{\stepcounter{#1}%
+ \def\@currentlabel{\csname p@#1\endcsname\csname the#1\endcsname}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\label}
+% |\label| is redefined to write another line into the aux
+% file: |\hunnewlabel{ }{ }| where the Roman numerals
+% are replaced their Arabic representations.
+% The original definition of |\label| is saved into
+% |\old@label| and it is also called by |\label|.
+% On leaving the Hungarian typesetting mode |\label|'s
+% original is restored since it is added to |\noextrasmagyar|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \let\old@label\label
+ \def\label#1{\@bsphack
+ \old@label{#1}%
+ \begingroup
+ \let\romannumeral\number
+ \def\@roman##1{\number ##1}%
+ \def\@Roman##1{\number ##1}%
+ {\toks0={\noexpand\noexpand\noexpand\number}%
+ \def\number##1{\the\toks0 ##1}\xdef\tempb@{\thepage}}%
+ \edef\@tempa##1{\noexpand\protected@write\@auxout{}%
+ {\noexpand\string\noexpand\hunnewlabel
+ {##1}{{\@currentlabel}{\tempb@}}}}%
+ \@tempa{#1}%
+ \endgroup
+ \@esphack}%
+}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \let\label\old@label
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hunnewlabel}
+% Finally, |\hunnewlabel| is defined.
+% It checks if the label's expansion (|#2|) differs from that
+% one given in the |\newlabel| command. If yes
+% (that is, the label contains some Roman numerals),
+% it defines the macro |\hun@r@|\textit{label},
+% otherwise it does nothing.
+% \begin{macrocode}
+\def\hunnewlabel#1#2{%
+ \def\@tempa{#2}%
+ \expandafter\ifx\csname r@#1\endcsname\@tempa
+ \relax% \message{No need for def: #1}%
+ \else
+ \global\expandafter\let\csname hun@r@#1\endcsname\@tempa%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% For Hungarian the |`| character is made active.
+% \changes{magyar-1.4c}{2001/03/05}{Make sure that the grave accent
+% has catcode 12 \emph{before} it is made \cs{active}}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \if@filesw\immediate\write\@auxout{\catcode096=12}\fi}
+\initiate@active@char{`}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \languageshorthands{magyar}%
+ \bbl@activate{`}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{`}}
+% \end{macrocode}
+%
+% The character sequence |``| is declared as a shorthand
+% in order to produce
+% the opening quotation sign appropriate for Hungarian.
+% \begin{macrocode}
+\declare@shorthand{magyar}{``}{\glqq}
+% \end{macrocode}
+%
+% In Hungarian there are some long double consonants which
+% must be hyphenated specially.
+% For all these long double consonants (except dzzs, that is
+% extremely very-very rare) a shortcut is defined.
+% \begin{macrocode}
+\declare@shorthand{magyar}{`c}{\textormath{\bbl@disc{c}{cs}}{c}}
+\declare@shorthand{magyar}{`C}{\textormath{\bbl@disc{C}{CS}}{C}}
+\declare@shorthand{magyar}{`d}{\textormath{\bbl@disc{d}{dz}}{d}}
+\declare@shorthand{magyar}{`D}{\textormath{\bbl@disc{D}{DZ}}{D}}
+\declare@shorthand{magyar}{`g}{\textormath{\bbl@disc{g}{gy}}{g}}
+\declare@shorthand{magyar}{`G}{\textormath{\bbl@disc{G}{GY}}{G}}
+\declare@shorthand{magyar}{`l}{\textormath{\bbl@disc{l}{ly}}{l}}
+\declare@shorthand{magyar}{`L}{\textormath{\bbl@disc{L}{LY}}{L}}
+\declare@shorthand{magyar}{`n}{\textormath{\bbl@disc{n}{ny}}{n}}
+\declare@shorthand{magyar}{`N}{\textormath{\bbl@disc{N}{NY}}{N}}
+\declare@shorthand{magyar}{`s}{\textormath{\bbl@disc{s}{sz}}{s}}
+\declare@shorthand{magyar}{`S}{\textormath{\bbl@disc{S}{SZ}}{S}}
+\declare@shorthand{magyar}{`t}{\textormath{\bbl@disc{t}{ty}}{t}}
+\declare@shorthand{magyar}{`T}{\textormath{\bbl@disc{T}{TY}}{T}}
+\declare@shorthand{magyar}{`z}{\textormath{\bbl@disc{z}{zs}}{z}}
+\declare@shorthand{magyar}{`Z}{\textormath{\bbl@disc{Z}{ZS}}{Z}}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{magyar-1.3h}{1996/10/30}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/magyar.ins b/Master/texmf-dist/source/generic/babel/magyar.ins
new file mode 100644
index 00000000000..ea4b4851d12
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/magyar.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{magyar.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{magyar.ldf}{\from{magyar.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/ngermanb.dtx b/Master/texmf-dist/source/generic/babel/ngermanb.dtx
new file mode 100644
index 00000000000..12b940fdceb
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/ngermanb.dtx
@@ -0,0 +1,357 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{266}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{ngermanb.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{ngermanb}
+%\fi
+%\ProvidesFile{ngermanb.dtx}
+ [2004/02/20 v2.6m new German support from the babel system]
+%\iffalse
+%% File `ngermanb.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2004
+%% by Johannes Braams, TeXniek
+%
+%% new Germanb Language Definition File
+%% Copyright (C) 1989 - 2004
+%% by Bernd Raichle raichle at azu.Informatik.Uni-Stuttgart.de
+%% Johannes Braams, TeXniek,
+%% Walter Schmidt.
+% This file is based on german.tex version 2.5e
+% by Bernd Raichle, Hubert Partl et.al.
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{ngermanb.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{ngermanb.dtx}
+%
+% \changes{ngermanb-2.6f}{1999/03/24}{Renamed from \file{germanb.ldf};
+% language names changed from \texttt{german} and \texttt{austrian}
+% to \texttt{ngerman} and \texttt{naustrian}.}
+%
+% \section{The German language -- new orthography}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% German language with the `new orthography' introduced in
+% August 1998. This includes also the Austrian dialect of this
+% language.
+%
+% As with the `traditional' German orthography,
+% the character |"| is made active, and
+% the commands in table~\ref{tab:german-quote} can be used, except
+% for |"ck| and |"ff| etc., which are no longer required.
+%
+% The internal language names are |ngerman| and |naustrian|.
+%
+% \StopEventually{}
+%
+% When this file was read through the option \Lopt{ngermanb} we make
+% it behave as if \Lopt{ngerman} was specified.
+% \begin{macrocode}
+\def\bbl@tempa{ngermanb}
+\ifx\CurrentOption\bbl@tempa
+ \def\CurrentOption{ngerman}
+\fi
+% \end{macrocode}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{ngerman} will be an `unknown' language, so we
+% have to make it known. So we check for the existence of
+% |\l@ngerman| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@ngerman\@undefined
+ \@nopatterns{ngerman}
+ \adddialect\l@ngerman0
+\fi
+% \end{macrocode}
+%
+% For the Austrian version of these definitions we just add another
+% language.
+% \begin{macrocode}
+\adddialect\l@naustrian\l@ngerman
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the German language.
+%
+% \begin{macro}{\captionsngerman}
+% \begin{macro}{\captionsnaustrian}
+% Either the macro |\captionnsgerman| or the macro
+% |\captionsnaustrian| will define all strings used in the four
+% standard document classes provided with \LaTeX.
+%
+% \changes{ngermanb-2.6k}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Vorwort}%
+ \def\refname{Literatur}%
+ \def\abstractname{Zusammenfassung}%
+ \def\bibname{Literaturverzeichnis}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Anhang}%
+ \def\contentsname{Inhaltsverzeichnis}% % oder nur: Inhalt
+ \def\listfigurename{Abbildungsverzeichnis}%
+ \def\listtablename{Tabellenverzeichnis}%
+ \def\indexname{Index}%
+ \def\figurename{Abbildung}%
+ \def\tablename{Tabelle}% % oder: Tafel
+ \def\partname{Teil}%
+ \def\enclname{Anlage(n)}% % oder: Beilage(n)
+ \def\ccname{Verteiler}% % oder: Kopien an
+ \def\headtoname{An}%
+ \def\pagename{Seite}%
+ \def\seename{siehe}%
+ \def\alsoname{siehe auch}%
+ \def\proofname{Beweis}%
+ \def\glossaryname{Glossar}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\datengerman}
+% The macro |\datengerman| redefines the command
+% |\today| to produce German dates.
+% \begin{macrocode}
+\def\month@ngerman{\ifcase\month\or
+ Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
+ Juli\or August\or September\or Oktober\or November\or Dezember\fi}
+\def\datengerman{\def\today{\number\day.~\month@ngerman
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateanustrian}
+% The macro |\datenaustrian| redefines the command
+% |\today| to produce Austrian version of the German dates.
+% \begin{macrocode}
+\def\datenaustrian{\def\today{\number\day.~\ifnum1=\month
+ J\"anner\else \month@ngerman\fi \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasngerman}
+% \begin{macro}{\extrasnaustrian}
+% \begin{macro}{\noextrasngerman}
+% \begin{macro}{\noextrasnaustrian}
+% Either the macro |\extrasngerman| or the macros |\extrasnaustrian|
+% will perform all the extra definitions needed for the German
+% language. The macro |\noextrasngerman| is used to cancel the
+% actions of |\extrasngerman|.
+%
+% For German (as well as for Dutch) the \texttt{"} character is
+% made active. This is done once, later on its definition may vary.
+% \begin{macrocode}
+\initiate@active@char{"}
+\@namedef{extras\CurrentOption}{%
+ \languageshorthands{ngerman}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{ngermanb-2.6j}{1999/12/16}{Deactivate shorthands ouside of
+% German}
+% \begin{macrocode}
+\addto\noextrasngerman{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+%
+% In order for \TeX\ to be able to hyphenate German words which
+% contain `\ss' (in the \texttt{OT1} position |^^Y|) we have to
+% give the character a nonzero |\lccode| (see Appendix H, the \TeX
+% book).
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable{\lccode25}%
+ \lccode25=25}
+% \end{macrocode}
+%
+% The umlaut accent macro |\"| is changed to lower the umlaut dots.
+% The redefinition is done with the help of |\umlautlow|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\"\umlautlow}
+\@namedef{noextras\CurrentOption}{\umlauthigh}
+% \end{macrocode}
+% The current
+% version of the `new' German hyphenation patterns (\file{dehyphn.tex}
+% is to be used with |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{ngermanb-2.6k}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% For German texts we need to make sure that |\frenchspacing| is
+% turned on.
+% \changes{ngermanb-2.6m}{2001/01/26}{Turn frenchspacing on, as in
+% \texttt{german.sty}}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchspacing}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The code above is necessary because we need an extra active
+% character. This character is then used as indicated in
+% table~\ref{tab:german-quote}.
+%
+% To be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the doublequote macros: the umlauts,
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
+\declare@shorthand{ngerman}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
+\declare@shorthand{ngerman}{"u}{\textormath{\"{u}\allowhyphens}{\ddot u}}
+\declare@shorthand{ngerman}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
+\declare@shorthand{ngerman}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
+\declare@shorthand{ngerman}{"U}{\textormath{\"{U}\allowhyphens}{\ddot U}}
+% \end{macrocode}
+% tremas,
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"e}{\textormath{\"{e}}{\ddot e}}
+\declare@shorthand{ngerman}{"E}{\textormath{\"{E}}{\ddot E}}
+\declare@shorthand{ngerman}{"i}{\textormath{\"{\i}}%
+ {\ddot\imath}}
+\declare@shorthand{ngerman}{"I}{\textormath{\"{I}}{\ddot I}}
+% \end{macrocode}
+% german es-zet (sharp s),
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"s}{\textormath{\ss}{\@SS{}}}
+\declare@shorthand{ngerman}{"S}{\SS}
+\declare@shorthand{ngerman}{"z}{\textormath{\ss}{\@SS{}}}
+\declare@shorthand{ngerman}{"Z}{SZ}
+% \end{macrocode}
+% german and french quotes,
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"`}{\glqq}
+\declare@shorthand{ngerman}{"'}{\grqq}
+\declare@shorthand{ngerman}{"<}{\flqq}
+\declare@shorthand{ngerman}{">}{\frqq}
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{ngerman}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{ngerman}{""}{\hskip\z@skip}
+\declare@shorthand{ngerman}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{ngerman}{"=}{\penalty\@M-\hskip\z@skip}
+% \end{macrocode}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% All that's left to do now is to define a couple of commands
+% for reasons of compatibility with \file{german.sty}.
+% \begin{macrocode}
+\def\mdqon{\shorthandon{"}}
+\def\mdqoff{\shorthandoff{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/norsk.dtx b/Master/texmf-dist/source/generic/babel/norsk.dtx
new file mode 100644
index 00000000000..6fe166ca066
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/norsk.dtx
@@ -0,0 +1,453 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%\CheckSum{305}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{norsk.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{norsk}
+%\fi
+%\ProvidesFile{norsk.dtx}
+ [2005/03/30 v2.0h Norsk support from the babel system]
+%\iffalse
+%%File `norsk.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Norwegian language definition file. Contributions
+% were made by Haavard Helstrup (HAAVARD@CERNVM) and Alv Kjetil
+% Holme (HOLMEA@CERNVM); the `nynorsk' variant has been supplied by
+% Per Steinar Iversen (iversen@vxcern.cern.ch) and Terje Engeset
+% Petterst (TERJEEP@VSFYS1.FI.UIB.NO)
+%
+% Rune Kleveland (runekl at math.uio.no) added the shorthand
+% definitions
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{norsk.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{norsk.dtx}
+%
+% \changes{norsk-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{norsk-1.1a}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{norsk-1.1c}{1993/11/11}{Added a couple of translations
+% (from Per Norman Oma, TeX@itk.unit.no)}
+% \changes{norsk-1.2a}{1994/02/27}{Update for \LaTeXe}
+% \changes{norsk-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{norsk-1.2h}{1996/07/12}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{norsk-1.2h}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+%
+% \section{The Norwegian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Haavard Helstrup
+% (\texttt{HAAVARD@CERNVM)} and Alv Kjetil Holme
+% (\texttt{HOLMEA@CERNVM}); the `nynorsk' variant has been supplied
+% by Per Steinar Iversen \texttt{iversen@vxcern.cern.ch}) and Terje
+% Engeset Petterst (\texttt{TERJEEP@VSFYS1.FI.UIB.NO)}; the
+% shorthand definitions were provided by Rune Kleveland
+% (\texttt{runekl@math.uio.no}).} defines all the language definition
+% macros for the Norwegian language as well as for an alternative
+% variant `nynorsk' of this language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:norsk-quote} an overview is given of its purpose.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{.7\textwidth}}
+% |"ff|& for |ff| to be hyphenated as |ff-f|,
+% this is also implemented for b, d, f, g, l, m, n,
+% p, r, s, and t. (|o"ppussing|) \\
+% |"ee|& Hyphenate |"ee| as |\'e-e|. (|komit"een|) \\
+% |"-| & an explicit hyphen sign, allowing hyphenation in the
+% composing words. Use this for compound words when the
+% hyphenation patterns fail to hyphenate
+% properly. (|alpin"-anlegg|) \\
+% \verb="|= & Like |"-|, but inserts 0.03em space. Use it if
+% the compound point is spanned by a ligature.
+% (\verb=hoff"|intriger=) \\
+% |""| & Like |"-|, but producing no hyphen sign.
+% (|i""g\aa{}r|) \\
+% |"~| & Like |-|, but allows no hyphenation at all. (|E"~cup|)\\
+% |"=| & Like |-|, but allowing hyphenation in the composing
+% words. (|marksistisk"=leninistisk|) \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{norsk.sty}}\label{tab:norsk-quote}
+% \end{center}
+% \end{table}
+% \changes{norsk-2.0a}{1998/06/24}{Describe the use of double quote as
+% active character}
+%
+% Rune Kleveland distributes a Norwegian dictionary for ispell
+% (570000 words). It can be found at
+% |http://www.uio.no/~runekl/dictionary.html|.
+%
+% This dictionary supports the spellings |spi"sslede| for
+% `spisslede' (hyphenated spiss-slede) and other such words, and
+% also suggest the spelling |spi"sslede| for `spisslede' and
+% `spissslede'.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{norsk-1.2h}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{norsk} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@norsk| to see whether we have to do something here.
+%
+% \changes{norsk-1.0c}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{norsk-1.1a}{1992/02/16}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{norsk-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to produce
+% the warning}
+% \begin{macrocode}
+\ifx\l@norsk\@undefined
+ \@nopatterns{Norsk}
+ \adddialect\l@norsk0\fi
+% \end{macrocode}
+%
+% \begin{macro}{\norskhyphenmins}
+% Some sets of Norwegian hyphenation patterns can be used with
+% |\lefthyphenmin| set to~1 and |\righthyphenmin| set to~2, but
+% the most common set |nohyph.tex| can't. So we use
+% |\lefthyphenmin=2| by default.
+% \changes{norsk-1.2f}{1995/07/02}{Added setting of hyphenmin
+% parameters}
+% \changes{norsk-2.0a}{1998/06/24}{Changed setting of hyphenmin
+% parameters to 2~2}
+% \changes{norsk-2.0e}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% Now we have to decide which version of the captions should be
+% made available. This can be done by checking the contents of
+% |\CurrentOption|.
+% \begin{macrocode}
+\def\bbl@tempa{norsk}
+\ifx\CurrentOption\bbl@tempa
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Norwegian language.
+%
+% \begin{macro}{\captionsnorsk}
+% The macro |\captionsnorsk| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{norsk-1.1a}{1992/02/16}{Added \cs{seename}, \cs{alsoname} and
+% \cs{prefacename}}
+% \changes{norsk-1.1b}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{norsk-1.2f}{1995/07/02}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{norsk-1.2g}{1996/04/01}{Replaced `Proof' by its
+% translation}
+% \changes{norsk-2.0e}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{norsk-2.0g}{1996/04/01}{Replaced `Glossary' by its
+% translation}
+% \begin{macrocode}
+ \def\captionsnorsk{%
+ \def\prefacename{Forord}%
+ \def\refname{Referanser}%
+ \def\abstractname{Sammendrag}%
+ \def\bibname{Bibliografi}% or Litteraturoversikt
+ % or Litteratur or Referanser
+ \def\chaptername{Kapittel}%
+ \def\appendixname{Tillegg}% or Appendiks
+ \def\contentsname{Innhold}%
+ \def\listfigurename{Figurer}% or Figurliste
+ \def\listtablename{Tabeller}% or Tabelliste
+ \def\indexname{Register}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabell}%
+ \def\partname{Del}%
+ \def\enclname{Vedlegg}%
+ \def\ccname{Kopi sendt}%
+ \def\headtoname{Til}% in letter
+ \def\pagename{Side}%
+ \def\seename{Se}%
+ \def\alsoname{Se ogs\aa{}}%
+ \def\proofname{Bevis}%
+ \def\glossaryname{Ordliste}%
+ }
+\else
+% \end{macrocode}
+% \end{macro}
+%
+% For the `nynorsk' version of these definitions we just add a
+% ``dialect''.
+% \begin{macrocode}
+ \adddialect\l@nynorsk\l@norsk
+% \end{macrocode}
+%
+% \begin{macro}{\captionsnynorsk}
+% The macro |\captionsnynorsk| defines all strings used in the four
+% standard documentclasses provided with \LaTeX, but using a
+% different spelling than in the command |\captionsnorsk|.
+% \changes{norsk-1.1a}{1992/02/16}{Added \cs{seename}, \cs{alsoname} and
+% \cs{prefacename}}
+% \changes{norsk-1.1b}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{norsk-1.2g}{1996/04/01}{Replaced `Proof' by its
+% translation}
+% \changes{norsk-2.0e}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{norsk-2.0g}{1996/04/01}{Replaced `Glossary' by its
+% translation}
+% \changes{norks-2.0h}{2001/01/12}{Changed \cs{ccname} and \cs{alsoname}}
+% \begin{macrocode}
+ \def\captionsnynorsk{%
+ \def\prefacename{Forord}%
+ \def\refname{Referansar}%
+ \def\abstractname{Samandrag}%
+ \def\bibname{Litteratur}% or Litteraturoversyn
+ % or Referansar
+ \def\chaptername{Kapittel}%
+ \def\appendixname{Tillegg}% or Appendiks
+ \def\contentsname{Innhald}%
+ \def\listfigurename{Figurar}% or Figurliste
+ \def\listtablename{Tabellar}% or Tabelliste
+ \def\indexname{Register}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabell}%
+ \def\partname{Del}%
+ \def\enclname{Vedlegg}%
+ \def\ccname{Kopi til}%
+ \def\headtoname{Til}% in letter
+ \def\pagename{Side}%
+ \def\seename{Sj\aa{}}%
+ \def\alsoname{Sj\aa{} \`{o}g}%
+ \def\proofname{Bevis}%
+ \def\glossaryname{Ordliste}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datenorsk}
+% The macro |\datenorsk| redefines the command |\today| to produce
+% Norwegian dates.
+% \changes{norsk-1.2i}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{norsk-1.2i}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day.~\ifcase\month\or
+ januar\or februar\or mars\or april\or mai\or juni\or
+ juli\or august\or september\or oktober\or november\or desember
+ \fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasnorsk}
+% \begin{macro}{\extrasnynorsk}
+% The macro |\extrasnorsk| will perform all the extra definitions
+% needed for the Norwegian language. The macro |\noextrasnorsk| is
+% used to cancel the actions of |\extrasnorsk|.
+%
+% Norwegian typesetting requires |\frencspacing| to be in effect.
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{\bbl@frenchspacing}
+\@namedef{noextras\CurrentOption}{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% For Norsk the \texttt{"} character is made active. This is done
+% once, later on its definition may vary.
+% \changes{norsk-2.0a}{1998/06/24}{Made double quote character active}
+% \begin{macrocode}
+\initiate@active@char{"}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \languageshorthands{norsk}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{norsk-2.0c}{1999/12/17}{Deactivate shorthands ouside of
+% Norsk}
+% \begin{macrocode}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{"}}
+% \end{macrocode}
+%
+% The code above is necessary because we need to define a number of
+% shorthand commands. These sharthand commands are then used as
+% indicated in table~\ref{tab:norsk-quote}.
+%
+% To be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the discretionary shorthand commands.
+% The number of words where such hyphenation is required is for
+% each character
+% \begin{center}
+% \begin{tabular}{*{11}c}
+% b&d&f &g&k &l &n&p &r&s &t \\
+% 4&4&15&3&43&30&8&12&1&33&35
+% \end{tabular}
+% \end{center}
+% taken from a list of 83000 ispell-roots.
+%
+% \changes{norsk-2.0d}{2000/02/29}{Shorthands are the same for both
+% spelling variants, no need to use \cs{CurrentOption}}
+% \begin{macrocode}
+\declare@shorthand{norsk}{"b}{\textormath{\bbl@disc b{bb}}{b}}
+\declare@shorthand{norsk}{"B}{\textormath{\bbl@disc B{BB}}{B}}
+\declare@shorthand{norsk}{"d}{\textormath{\bbl@disc d{dd}}{d}}
+\declare@shorthand{norsk}{"D}{\textormath{\bbl@disc D{DD}}{D}}
+\declare@shorthand{norsk}{"e}{\textormath{\bbl@disc e{\'e}}{}}
+\declare@shorthand{norsk}{"E}{\textormath{\bbl@disc E{\'E}}{}}
+\declare@shorthand{norsk}{"F}{\textormath{\bbl@disc F{FF}}{F}}
+\declare@shorthand{norsk}{"g}{\textormath{\bbl@disc g{gg}}{g}}
+\declare@shorthand{norsk}{"G}{\textormath{\bbl@disc G{GG}}{G}}
+\declare@shorthand{norsk}{"k}{\textormath{\bbl@disc k{kk}}{k}}
+\declare@shorthand{norsk}{"K}{\textormath{\bbl@disc K{KK}}{K}}
+\declare@shorthand{norsk}{"l}{\textormath{\bbl@disc l{ll}}{l}}
+\declare@shorthand{norsk}{"L}{\textormath{\bbl@disc L{LL}}{L}}
+\declare@shorthand{norsk}{"n}{\textormath{\bbl@disc n{nn}}{n}}
+\declare@shorthand{norsk}{"N}{\textormath{\bbl@disc N{NN}}{N}}
+\declare@shorthand{norsk}{"p}{\textormath{\bbl@disc p{pp}}{p}}
+\declare@shorthand{norsk}{"P}{\textormath{\bbl@disc P{PP}}{P}}
+\declare@shorthand{norsk}{"r}{\textormath{\bbl@disc r{rr}}{r}}
+\declare@shorthand{norsk}{"R}{\textormath{\bbl@disc R{RR}}{R}}
+\declare@shorthand{norsk}{"s}{\textormath{\bbl@disc s{ss}}{s}}
+\declare@shorthand{norsk}{"S}{\textormath{\bbl@disc S{SS}}{S}}
+\declare@shorthand{norsk}{"t}{\textormath{\bbl@disc t{tt}}{t}}
+\declare@shorthand{norsk}{"T}{\textormath{\bbl@disc T{TT}}{T}}
+% \end{macrocode}
+% We need to treat |"f| a bit differently in order to preserve the
+% ff-ligature.
+% \changes{norsk-2.0b}{1999/11/19}{Copied the coding for \texttt{"f}
+% from germanb.dtx version 2.6g}
+% \begin{macrocode}
+\declare@shorthand{norsk}{"f}{\textormath{\bbl@discff}{f}}
+\def\bbl@discff{\penalty\@M
+ \afterassignment\bbl@insertff \let\bbl@nextff= }
+\def\bbl@insertff{%
+ \if f\bbl@nextff
+ \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+ {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}
+\let\bbl@nextff=f
+% \end{macrocode}
+% We now define the French double quotes and some commands
+% concerning hyphenation:
+% \changes{norsk-2.0b}{1999/11/22}{added the french double quotes}
+% \changes{norsk-2.0d}{2000/01/28}{Use \cs{bbl@allowhyphens} in
+% \texttt{"-}}
+% \begin{macrocode}
+\declare@shorthand{norsk}{"<}{\flqq}
+\declare@shorthand{norsk}{">}{\frqq}
+\declare@shorthand{norsk}{"-}{\penalty\@M\-\bbl@allowhyphens}
+\declare@shorthand{norsk}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{norsk}{""}{\hskip\z@skip}
+\declare@shorthand{norsk}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{norsk}{"=}{\penalty\@M-\hskip\z@skip}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{norsk-1.2h}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/norsk.ins b/Master/texmf-dist/source/generic/babel/norsk.ins
new file mode 100644
index 00000000000..9ec2729e642
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/norsk.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{norsk.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{norsk.ldf}{\from{norsk.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/polish.dtx b/Master/texmf-dist/source/generic/babel/polish.dtx
new file mode 100644
index 00000000000..a2e66978558
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/polish.dtx
@@ -0,0 +1,563 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{543}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{polish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{polish}
+%\fi
+%\ProvidesFile{polish.dtx}
+ [2005/03/31 v1.2l Polish support from the babel system]
+%\iffalse
+%% File `polish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Polish Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Elmar Schalueck, Michael Janich
+% Universitaet-Gesamthochschule Paderborn
+% Warburger Strasse 100
+% 4790 Paderborn
+% Germany
+% elmar at uni-paderborn.de
+% massa at uni-paderborn.de
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Polish language definition file. It was developped
+% out of Polish.tex, which was written by Elmar Schalueck and
+% Michael Janich. Polish.tex was based on code by Leszek
+% Holenderski, Jerzy Ryll and J. S. Bie\'n from Faculty of
+% Mathematics,Informatics and Mechanics of Warsaw University, exept
+% of Jerzy Ryll (Instytut Informatyki Uniwersytetu Warszawskiego).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{polish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{polish.dtx}
+%
+% \changes{polish-1.1c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of babel.def}
+% \changes{polish-1.2d}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Polish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language-specific macros for the
+% Polish language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:polish-quote} an overview is given of its purpose.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"a| & or |\aob|, for tailed-a (like \c{a})\\
+% |"A| & or |\Aob|, for tailed-A (like \c{A})\\
+% |"e| & or |\eob|, for tailed-e (like \c{e})\\
+% |"E| & or |\Eob|, for tailed-E (like \c{E})\\
+% |"c| & or |\'c|, for accented c (like \'c),
+% same with uppercase letters and n,o,s\\
+% |"l| & or |\lpb{}|, for l with stroke (like \l)\\
+% |"L| & or |\Lpb{}|, for L with stroke (like \L)\\
+% |"r| & or |\zkb{}|, for pointed z (like \.z), cf.
+% pronounciation\\
+% |"R| & or |\Zkb{}|, for pointed Z (like \.Z)\\
+% |"z| & or |\'z|, for accented z\\
+% |"Z| & or |\'Z|, for accented Z\\
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"`| & for German left double quotes (looks like ,,). \\
+% |"'| & for German right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$).\\
+% \end{tabular}
+% \caption{The extra definitions made by \file{polish.sty}}
+% \label{tab:polish-quote}
+% \end{center}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{polish-1.2d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{polish}\captionspolish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{polish} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@polish| to see whether we have to do something here.
+%
+% \changes{polish-1.1c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@polish\@undefined
+ \@nopatterns{Polish}
+ \adddialect\l@polish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Polish language.
+%
+% \begin{macro}{\captionspolish}
+% The macro |\captionspolish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{polish-1.2b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{polish-1.2f}{1997/09/11}{Added translation for Proof and
+% changed translation of Contents}
+% \changes{polish-1.2i}{2000/09/19}{\cs{bibname} and \cs{refname} were
+% swapped}
+% \changes{polish-1.2i}{2000/09/19}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionspolish{%
+ \def\prefacename{Przedmowa}%
+ \def\refname{Literatura}%
+ \def\abstractname{Streszczenie}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Rozdzia\l}%
+ \def\appendixname{Dodatek}%
+ \def\contentsname{Spis tre\'sci}%
+ \def\listfigurename{Spis rysunk\'ow}%
+ \def\listtablename{Spis tablic}%
+ \def\indexname{Indeks}%
+ \def\figurename{Rysunek}%
+ \def\tablename{Tablica}%
+ \def\partname{Cz\eob{}\'s\'c}%
+ \def\enclname{Za\l\aob{}cznik}%
+ \def\ccname{Kopie:}%
+ \def\headtoname{Do}%
+ \def\pagename{Strona}%
+ \def\seename{Por\'ownaj}%
+ \def\alsoname{Por\'ownaj tak\.ze}%
+ \def\proofname{Dow\'od}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datepolish}
+% The macro |\datepolish| redefines the command |\today| to produce
+% Polish dates.
+% \changes{polish-1.2f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{polish-1.2f}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \changes{polish-1.2i}{2000/01/08}{A missing comment character caused
+% an unwanted space character in the output}
+% \begin{macrocode}
+\def\datepolish{%
+ \def\today{\number\day~\ifcase\month\or
+ stycznia\or lutego\or marca\or kwietnia\or maja\or czerwca\or lipca\or
+ sierpnia\or wrze\'snia\or pa\'zdziernika\or listopada\or grudnia\fi
+ \space\number\year}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extraspolish}
+% \begin{macro}{\noextraspolish}
+% The macro |\extraspolish| will perform all the extra definitions
+% needed for the Polish language. The macro |\noextraspolish| is
+% used to cancel the actions of |\extraspolish|.
+%
+% For Polish the \texttt{"} character is made active. This is
+% done once, later on its definition may vary. Other languages in
+% the same document may also use the \texttt{"} character for
+% shorthands; we specify that the polish group of shorthands
+% should be used.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extraspolish{\languageshorthands{polish}}
+\addto\extraspolish{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{polish-1.2h}{1999/12/17}{Deactivate shorthands ouside of
+% Polish}
+% \begin{macrocode}
+\addto\noextraspolish{\bbl@deactivate{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The code above is necessary because we need an extra
+% active character. This character is then used as indicated in
+% table~\ref{tab:polish-quote}.
+%
+% If you have problems at the end of a word with a linebreak, use
+% the other version without hyphenation tricks. Some TeX wizard may
+% produce a better solution with forcasting another token to decide
+% whether the character after the double quote is the last in a
+% word. Do it and let us know.
+%
+% In Polish texts some letters get special diacritical marks.
+% Leszek Holenderski designed the following code to position the
+% diacritics correctly for every font in every size. These macros
+% need a few extra dimension variables.
+%
+% \begin{macrocode}
+\newdimen\pl@left
+\newdimen\pl@down
+\newdimen\pl@right
+\newdimen\pl@temp
+% \end{macrocode}
+%
+% \begin{macro}{\sob}
+% The macro |\sob| is used to put the `ogonek' in the right
+% place.
+%
+% \changes{polish-1.2d}{1996/08/18}{This macro is meant to be used in
+% horizontal mode; so leave vertical mode if necessary}
+% \begin{macrocode}
+\def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo
+ \setbox0\hbox{#1}\setbox1\hbox{$_\mathchar'454$}\setbox2\hbox{p}%
+ \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
+ \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
+ \pl@left=\pl@right \advance\pl@left by\wd1
+ \pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
+ \leavevmode
+ \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\aob}
+% \begin{macro}{\Aob}
+% \begin{macro}{\eob}
+% \begin{macro}{\Eob}
+% The ogonek is placed with the letters `a', `A', `e', and `E'.
+% \changes{polish-1.2d}{1996/08/18}{Use the constructed version of the
+% characters only in OT1; use proper characters in T1.}
+% \begin{macrocode}
+\DeclareTextCommand{\aob}{OT1}{\sob a{.66}{.20}{0}{.90}}
+\DeclareTextCommand{\Aob}{OT1}{\sob A{.80}{.50}{0}{.90}}
+\DeclareTextCommand{\eob}{OT1}{\sob e{.50}{.35}{0}{.93}}
+\DeclareTextCommand{\Eob}{OT1}{\sob E{.60}{.35}{0}{.90}}
+% \end{macrocode}
+% For the 'new' \texttt{T1} encoding we can provide simpler
+% definitions.
+% \begin{macrocode}
+\DeclareTextCommand{\aob}{T1}{\k a}
+\DeclareTextCommand{\Aob}{T1}{\k A}
+\DeclareTextCommand{\eob}{T1}{\k e}
+\DeclareTextCommand{\Eob}{T1}{\k E}
+% \end{macrocode}
+% Construct the characters by default from the OT1 encoding.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\aob}{\UseTextSymbol{OT1}{\aob}}
+\ProvideTextCommandDefault{\Aob}{\UseTextSymbol{OT1}{\Aob}}
+\ProvideTextCommandDefault{\eob}{\UseTextSymbol{OT1}{\eob}}
+\ProvideTextCommandDefault{\Eob}{\UseTextSymbol{OT1}{\Eob}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\spb}
+% The macro |\spb| is used to put the `poprzeczka' in the
+% right place.
+%
+% \changes{polish-1.2d}{1996/08/18}{\cs{spb} is meant to be used in
+% horizontal mode; so leave vertical mode if necessary}
+% \begin{macrocode}
+\def\spb#1#2#3#4#5{%
+ \setbox0\hbox{#1}\setbox1\hbox{\char'023}%
+ \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
+ \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
+ \pl@left=\pl@right \advance\pl@left by\wd1
+ \ht1=\pl@down \dp1=-\pl@down
+ \leavevmode
+ \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\skb}
+% The macro |\skb| is used to put the `kropka' in the
+% right place.
+%
+% \changes{polish-1.2d}{1996/08/18}{\cs{skb} is meant to be used in
+% horizontal mode; so leave vertical mode if necessary}
+% \begin{macrocode}
+\def\skb#1#2#3#4#5{%
+ \setbox0\hbox{#1}\setbox1\hbox{\char'056}%
+ \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
+ \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
+ \pl@left=\pl@right \advance\pl@left by\wd1
+ \leavevmode
+ \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textpl}
+% For the `poprzeczka' and the `kropka' in text fonts we don't need
+% any special coding, but we can (almost) use what is already
+% available.
+%
+% \begin{macrocode}
+\def\textpl{%
+ \def\lpb{\plll}%
+ \def\Lpb{\pLLL}%
+ \def\zkb{\.z}%
+ \def\Zkb{\.Z}}
+% \end{macrocode}
+% Initially we assume that typesetting is done with text fonts.
+% \changes{polish-1.0a}{1993/11/05}{Initially execute `textpl}
+% \begin{macrocode}
+\textpl
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\lll=\l \let\LLL=\L
+\def\plll{\lll}
+\def\pLLL{\LLL}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\telepl}
+% But for the `teletype' font in `OT1' encoding we have to take some
+% special actions, involving the macros defined above.
+%
+% \begin{macrocode}
+\def\telepl{%
+ \def\lpb{\spb l{.45}{.5}{.4}{.8}}%
+ \def\Lpb{\spb L{.23}{.5}{.4}{.8}}%
+ \def\zkb{\skb z{.5}{.5}{1.2}{0}}%
+ \def\Zkb{\skb Z{.5}{.5}{1.1}{0}}}
+% \end{macrocode}
+% \end{macro}
+%
+% To activate these codes the font changing commands as they are
+% defined in \LaTeX\ are modified. The same is done for plain
+% \TeX's font changing commands.
+%
+% When |\selectfont| is undefined the current format is spposed to be
+% either plain (based) or \LaTeX$\:$2.09.
+% \changes{polish-1.2a}{1995/06/06}{Don't modify \cs{rm} and friends for
+% \LaTeXe, take \cs{selectfont } instead}
+% \begin{macrocode}
+\ifx\selectfont\@undefined
+ \ifx\prm\@undefined \addto\rm{\textpl}\else \addto\prm{\textpl}\fi
+ \ifx\pit\@undefined \addto\it{\textpl}\else \addto\pit{\textpl}\fi
+ \ifx\pbf\@undefined \addto\bf{\textpl}\else \addto\pbf{\textpl}\fi
+ \ifx\psl\@undefined \addto\sl{\textpl}\else \addto\psl{\textpl}\fi
+ \ifx\psf\@undefined \else \addto\psf{\textpl}\fi
+ \ifx\psc\@undefined \else \addto\psc{\textpl}\fi
+ \ifx\ptt\@undefined \addto\tt{\telepl}\else \addto\ptt{\telepl}\fi
+\else
+% \end{macrocode}
+% When |\selectfont| exists we assume \LaTeXe.
+% \begin{macrocode}
+ \expandafter\addto\csname selectfont \endcsname{%
+ \csname\f@encoding @pl\endcsname}
+\fi
+% \end{macrocode}
+% Currently we support the OT1 and T1 encodings. For T1 we don't
+% have to make a difference between typewriter fonts and other
+% fonts, they all have the same glyphs.
+% \begin{macrocode}
+\expandafter\let\csname T1@pl\endcsname\textpl
+% \end{macrocode}
+% For OT1 we need to check the current font family, stored in
+% |\f@family|. Unfortunately we need a hack as |\ttdefault| is
+% defined as a |\long| macro, while |\f@family| is not.
+% \begin{macrocode}
+\expandafter\def\csname OT1@pl\endcsname{%
+ \long\edef\curr@family{\f@family}%
+ \ifx\curr@family\ttdefault
+ \telepl
+ \else
+ \textpl
+ \fi}
+% \end{macrocode}
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the doublequote macros for diacritics,
+% \changes{polish-1.1d}{1995/01/31}{The dqmacro for C used \cs{'c}}
+% \begin{macrocode}
+\declare@shorthand{polish}{"a}{\textormath{\aob}{\ddot a}}
+\declare@shorthand{polish}{"A}{\textormath{\Aob}{\ddot A}}
+\declare@shorthand{polish}{"c}{\textormath{\'c}{\acute c}}
+\declare@shorthand{polish}{"C}{\textormath{\'C}{\acute C}}
+\declare@shorthand{polish}{"e}{\textormath{\eob}{\ddot e}}
+\declare@shorthand{polish}{"E}{\textormath{\Eob}{\ddot E}}
+\declare@shorthand{polish}{"l}{\textormath{\lpb}{\ddot l}}
+\declare@shorthand{polish}{"L}{\textormath{\Lpb}{\ddot L}}
+\declare@shorthand{polish}{"n}{\textormath{\'n}{\acute n}}
+\declare@shorthand{polish}{"N}{\textormath{\'N}{\acute N}}
+\declare@shorthand{polish}{"o}{\textormath{\'o}{\acute o}}
+\declare@shorthand{polish}{"O}{\textormath{\'O}{\acute O}}
+\declare@shorthand{polish}{"s}{\textormath{\'s}{\acute s}}
+\declare@shorthand{polish}{"S}{\textormath{\'S}{\acute S}}
+% \end{macrocode}
+% \begin{macro}{\polishrz}
+% \begin{macro}{\polishzx}
+% \changes{polish-1.2j}{2000/11/11}{Added support for two
+% notationstyles for kropka and accented z}
+% The command |\polishrz| defines the shorthands |"r|, |"z| and
+% |"x| to produce pointed z, accented z and |"x|. This is the
+% default as these shorthands were defined by this language
+% definition file for quite some time.
+% \begin{macrocode}
+\newcommand*{\polishrz}{%
+ \declare@shorthand{polish}{"r}{\textormath{\zkb}{\ddot r}}%
+ \declare@shorthand{polish}{"R}{\textormath{\Zkb}{\ddot R}}%
+ \declare@shorthand{polish}{"z}{\textormath{\'z}{\acute z}}%
+ \declare@shorthand{polish}{"Z}{\textormath{\'Z}{\acute Z}}%
+ \declare@shorthand{polish}{"x}{\dq x}%
+ \declare@shorthand{polish}{"X}{\dq X}%
+ }
+\polishrz
+% \end{macrocode}
+% The command |\polishzx| switches to a different set of
+% shorthands, |"z|, |"x| and |"r| to produce pointed z, accented z
+% and |"r|; a different shorthand notation also in use.
+% \changes{polish-1.2k}{2003/10/12}{Fixed a typo}
+% \begin{macrocode}
+\newcommand*{\polishzx}{%
+ \declare@shorthand{polish}{"z}{\textormath{\zkb}{\ddot z}}%
+ \declare@shorthand{polish}{"Z}{\textormath{\Zkb}{\ddot Z}}%
+ \declare@shorthand{polish}{"x}{\textormath{\'z}{\acute x}}%
+ \declare@shorthand{polish}{"X}{\textormath{\'Z}{\acute X}}%
+ \declare@shorthand{polish}{"r}{\dq r}%
+ \declare@shorthand{polish}{"R}{\dq R}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Then we define access to two forms of quotation marks, similar
+% to the german and french quotation marks.
+% \changes{polish-1.2e}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \changes{polish-1.2l}{2004/02/18}{Changed closing quote}
+% \begin{macrocode}
+\declare@shorthand{polish}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{polish}{"'}{%
+ \textormath{\textquotedblright}{\mbox{\textquotedblright}}}
+\declare@shorthand{polish}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{polish}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behavew a little different from |\-|.
+% \begin{macrocode}
+\declare@shorthand{polish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{polish}{""}{\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{polish}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+%
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% All that's left to do now is to define a couple of commands
+% for reasons of compatibility with \file{polish.tex}.
+% \changes{polish-1.2f}{1998/06/07}{Now use \cs{shorthandon} and
+% \cs{shorthandoff}}
+% \begin{macrocode}
+\def\mdqon{\shorthandon{"}}
+\def\mdqoff{\shorthandoff{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{polish-1.2d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{polish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/polish.ins b/Master/texmf-dist/source/generic/babel/polish.ins
new file mode 100644
index 00000000000..00a5e50a92b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/polish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{polish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{polish.ldf}{\from{polish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/portuges.dtx b/Master/texmf-dist/source/generic/babel/portuges.dtx
new file mode 100644
index 00000000000..8c4fbf1d6f3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/portuges.dtx
@@ -0,0 +1,473 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{319}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{portuges.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{portuges}
+%\fi
+%\ProvidesFile{portuges.dtx}
+ [2005/03/31 v1.2p Portuguese support from the babel system]
+%\iffalse
+%% File `portuges.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Portuguese Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Portuguese language definition file. The Portuguese
+% words were contributed by Jose Pedro Ramalhete, (JRAMALHE@CERNVM
+% or Jose-Pedro_Ramalhete@MACMAIL).
+%
+% Arnaldo Viegas de Lima <arnaldo@VNET.IBM.COM> contributed
+% brasilian translations and suggestions for enhancements.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{portuges.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{portuges.dtx}
+%
+% \changes{portuges-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{portuges-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{portuges-1.2}{1994/02/26}{Update for \LaTeXe}
+% \changes{portuges-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{portuges-1.2g}{1995/06/04}{Enhanced support for brasilian}
+% \changes{portuges-1.2j}{1996/07/11}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{portuges-1.2j}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Portuguese language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Jose Pedro Ramalhete
+% (\texttt{JRAMALHE@CERNVM} or
+% \texttt{Jose-Pedro\_Ramalhete@MACMAIL}) and Arnaldo Viegas de
+% Lima \texttt{arnaldo@VNET.IBM.COM}.} defines all the
+% language-specific macros for the Portuguese language as well as
+% for the Brasilian version of this language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:port-quote} an overview is given of its purpose.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |""| & like \verb="-=, but producing no hyphen sign (for
+% words that should break at some sign such as
+% ``entrada/salida.''\\
+% |"<| & for French left double quotes (similar to $<<$).\\
+% |">| & for French right double quotes (similar to $>>$).\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% \end{tabular}
+% \caption{The extra definitions made by \file{portuges.ldf}}
+% \label{tab:port-quote}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{portuges-1.2j}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{portuges} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@portuges| to see whether we have to do something here. Since
+% it is possible to load this file with any of the following four
+% options to babel: \Lopt{portuges}, \Lopt{portuguese},
+% \Lopt{brazil} and \Lopt{brazilian} we also allow that the
+% hyphenation patterns are loaded under any of these four names. We
+% just have to find out which one was used.
+%
+% \changes{portuges-1.0b}{1991/10/29}{Removed use of cs{@ifundefined}}
+% \changes{portuges-1.1}{1992/02/16}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{portuges-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@portuges\@undefined
+ \ifx\l@portuguese\@undefined
+ \ifx\l@brazil\@undefined
+ \ifx\l@brazilian\@undefined
+ \@nopatterns{Portuguese}
+ \adddialect\l@portuges0
+ \else
+ \let\l@portuges\l@brazilian
+ \fi
+ \else
+ \let\l@portuges\l@brazil
+ \fi
+ \else
+ \let\l@portuges\l@portuguese
+ \fi
+\fi
+% \end{macrocode}
+% By now |\l@portuges| is defined. When the language definition
+% file was loaded under a different name we make sure that the
+% hyphenation patterns can be found.
+% \begin{macrocode}
+\expandafter\ifx\csname l@\CurrentOption\endcsname\relax
+ \expandafter\let\csname l@\CurrentOption\endcsname\l@portuges
+\fi
+% \end{macrocode}
+%
+% Now we have to decide whether this language definition file was
+% loaded for Portuguese or Brasilian use. This can be done by
+% checking the contents of |\CurrentOption|. When it doesn't
+% contain either `portuges' or `portuguese' we make |\bbl@tempb|
+% empty.
+% \begin{macrocode}
+\def\bbl@tempa{portuguese}
+\ifx\CurrentOption\bbl@tempa
+ \let\bbl@tempb\@empty
+\else
+ \def\bbl@tempa{portuges}
+ \ifx\CurrentOption\bbl@tempa
+ \let\bbl@tempb\@empty
+ \else
+ \def\bbl@tempb{brazil}
+ \fi
+\fi
+\ifx\bbl@tempb\@empty
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and from)
+% the Portuguese language.
+%
+% \begin{macro}{\captionsportuges}
+% The macro |\captionsportuges| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{portuges-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{portuges-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{portuges-1.2e}{1994/11/09}{Added a few missing
+% translations}
+% \changes{portuges-1.2h}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{portuges-1.2i}{1995/11/25}{Substituted `Prova' for `Proof'}
+% \begin{macrocode}
+ \@namedef{captions\CurrentOption}{%
+ \def\prefacename{Pref\'acio}%
+ \def\refname{Refer\^encias}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Cap\'{\i}tulo}%
+ \def\appendixname{Ap\^endice}%
+% \end{macrocode}
+% Some discussion took place around the correct translations for
+% `Table of Contents' and `Index'. the translations differ for
+% Portuguese and Brasilian based the following history:
+% \begin{quote}
+% The whole issue is that some books without a real index at the
+% end misused the term `\'Indice' as table of contents. Then,
+% what happens is that some books apeared with `\'Indice' at the
+% begining and a `\'Indice Remissivo' at the end. Remissivo is a
+% redundant word in this case, but was introduced to make up the
+% difference. So in Brasil people started using `Sum\'ario' and
+% `\'Indice Remissivo'. In Portugal this seems not to be very
+% common, therefore we chose `\'Indice' instead of `\'Indice
+% Remissivo'.
+% \end{quote}
+% \begin{macrocode}
+ \def\contentsname{Conte\'udo}%
+ \def\listfigurename{Lista de Figuras}%
+ \def\listtablename{Lista de Tabelas}%
+ \def\indexname{\'Indice}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabela}%
+ \def\partname{Parte}%
+ \def\enclname{Anexo}%
+ \def\ccname{Com c\'opia a}%
+ \def\headtoname{Para}%
+ \def\pagename{P\'agina}%
+ \def\seename{ver}%
+ \def\alsoname{ver tamb\'em}%
+% \end{macrocode}
+% An alternate term for `Proof' could be `Prova'.
+% \changes{portuges-1.2m}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{portuges-1.2p}{2003/05/23}{Substituted `Gloss\'ario' for
+% `Glossary'}
+% \begin{macrocode}
+ \def\proofname{Demonstra\c{c}\~ao}%
+ \def\glossaryname{Gloss\'ario}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateportuges}
+% The macro |\dateportuges| redefines the command |\today| to
+% produce Portuguese dates.
+% \changes{portuges-1.2k}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{portuges-1.2k}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{portuges-1.2n}{2001/01/27}{Removed spurious space after
+% Dezembro}
+% \begin{macrocode}
+ \@namedef{date\CurrentOption}{%
+ \def\today{\number\day\space de\space\ifcase\month\or
+ Janeiro\or Fevereiro\or Mar\c{c}o\or Abril\or Maio\or Junho\or
+ Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro%
+ \fi
+ \space de\space\number\year}}
+\else
+% \end{macrocode}
+% \end{macro}
+%
+% For the Brasilian version of these definitions we just add a
+% ``dialect''.
+% \begin{macrocode}
+ \expandafter
+ \adddialect\csname l@\CurrentOption\endcsname\l@portuges
+% \end{macrocode}
+%
+% \begin{macro}{\captionsbrazil}
+% \changes{portuges-1.2g}{1995/06/04}{The captions for brasilian and
+% portuguese are different now}
+%
+% The ``captions'' are different for both versions of the language,
+% so we define the macro |\captionsbrazil| here.
+% \changes{portuges-1.2i}{1995/11/25}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{portuges-1.2m}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+ \@namedef{captions\CurrentOption}{%
+ \def\prefacename{Pref\'acio}%
+ \def\refname{Refer\^encias}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Refer\^encias Bibliogr\'aficas}%
+ \def\chaptername{Cap\'{\i}tulo}%
+ \def\appendixname{Ap\^endice}%
+ \def\contentsname{Sum\'ario}%
+ \def\listfigurename{Lista de Figuras}%
+ \def\listtablename{Lista de Tabelas}%
+ \def\indexname{\'Indice Remissivo}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabela}%
+ \def\partname{Parte}%
+ \def\enclname{Anexo}%
+ \def\ccname{C\'opia para}%
+ \def\headtoname{Para}%
+ \def\pagename{P\'agina}%
+ \def\seename{veja}%
+ \def\alsoname{veja tamb\'em}%
+ \def\proofname{Demonstra\c{c}\~ao}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebrazil}
+% The macro |\datebrazil| redefines the command
+% |\today| to produce Brasilian dates, for which the names
+% of the months are not capitalized.
+% \changes{portuges-1.2k}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{portuges-1.2k}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{portuges-1.2n}{2001/01/27}{Removed spurious space after
+% dezembro}
+% \begin{macrocode}
+ \@namedef{date\CurrentOption}{%
+ \def\today{\number\day\space de\space\ifcase\month\or
+ janeiro\or fevereiro\or mar\c{c}o\or abril\or maio\or junho\or
+ julho\or agosto\or setembro\or outubro\or novembro\or dezembro%
+ \fi
+ \space de\space\number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\portugeshyphenmins}
+% \changes{portuges-1.2g}{1995/06/04}{Added setting of hyphenmin
+% values}
+% Set correct values for |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{portuges-1.2m}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \changes{portuges-1.2o}{2001/02/16}{Set \cs{righthyphenmin} to 3 if
+% not provided by the pattern file.}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasportuges}
+% \changes{portuges-1.2g}{1995/06/04}{Added the definition of some
+% \texttt{"} shorthands}
+% \begin{macro}{\noextrasportuges}
+% The macro |\extrasportuges| will perform all the extra
+% definitions needed for the Portuguese language. The macro
+% |\noextrasportuges| is used to cancel the actions of
+% |\extrasportuges|.
+%
+% For Portuguese the \texttt{"} character is made active. This is
+% done once, later on its definition may vary. Other languages in
+% the same document may also use the \texttt{"} character for
+% shorthands; we specify that the portuguese group of shorthands
+% should be used.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\@namedef{extras\CurrentOption}{\languageshorthands{portuges}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{portuges-1.2m}{1999/12/17}{Deactivate shorthands ouside of
+% Basque}
+% \begin{macrocode}
+\addto\noextrasportuges{\bbl@deactivate{"}}
+% \end{macrocode}
+% First we define access to the guillemets for quotations,
+% \changes{portuges-1.2k}{1997/04/03}{Removed empty groups after
+% guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{portuges}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{portuges}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behave a little different from |\-|.
+% \begin{macrocode}
+\declare@shorthand{portuges}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{portuges}{""}{\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{portuges}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% very unfortunate for languages such as Dutch and German, where
+% long compound words are quite normal and all one needs is a means
+% to indicate an extra hyphenation position on top of the ones that
+% \TeX\ can generate from the hyphenation patterns.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\-}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\-{\allowhyphens\discretionary{-}{}{}\allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ord}
+% \changes{portuges-1.2g}{1995/06/04}{Added macro}
+% \begin{macro}{\ro}
+% \changes{portuges-1.2g}{1995/06/04}{Added macro}
+% \begin{macro}{\orda}
+% \changes{portuges-1.2g}{1995/06/04}{Added macro}
+% \begin{macro}{\ra}
+% \changes{portuges-1.2g}{1995/06/04}{Added macro}
+% We also provide an easy way to typeset ordinals, both in the male
+% (|\ord| or |\ro|) and the female (|orda| or |\ra|) form.
+% \begin{macrocode}
+\def\ord{$^{\rm o}$}
+\def\orda{$^{\rm a}$}
+\let\ro\ord\let\ra\orda
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{portuges-1.2j}{1996/11/03}{ow use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/portuges.ins b/Master/texmf-dist/source/generic/babel/portuges.ins
new file mode 100644
index 00000000000..3889bc8f8b2
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/portuges.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{portuges.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{portuges.ldf}{\from{portuges.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/romanian.dtx b/Master/texmf-dist/source/generic/babel/romanian.dtx
new file mode 100644
index 00000000000..88950570306
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/romanian.dtx
@@ -0,0 +1,232 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{89}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{romanian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{romanian}
+%\fi
+%\ProvidesFile{romanian.dtx}
+ [2005/03/31 v1.2l Romanian support from the babel system]
+%\iffalse
+%% File `romanian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Romanian Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Romanian language definition file. A contribution
+% was made by Umstatter Horst (hhu at cernvm.cern.ch) and Robert
+% Juhasz (robertj at uni-paderborn.de)
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{romanian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{romanian.dtx}
+%
+% \changes{romanian-1.0a}{1991/07/15}{Renamed babel.sty in babel.com}
+% \changes{romanian-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{romanian-1.2}{1994/02/27}{Update for LaTeX2e}
+% \changes{romanian-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of babel.def}
+% \changes{romanian-1.2e}{1995/05/25}{Updated for babel release 3.5}
+% \changes{romanian-1.2h}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Romanian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Umstatter Horst
+% (\texttt{hhu@cernvm.cern.ch}).} defines all the
+% language-specific macros for the Romanian language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{romanian-1.2h}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{romanian}\captionsromanian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{romanian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@romanian| to see whether we have to do something here.
+%
+% \changes{romanian-1.0b}{1991/10/29}{Removed use of
+% \cs{@ifundefined}}
+% \changes{romanian-1.1}{1992/02/16}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{romanian-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@romanian\@undefined
+ \@nopatterns{Romanian}
+ \adddialect\l@romanian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Romanian language.
+%
+% \begin{macro}{\captionsromanian}
+% The macro |\captionsromanian| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{romanian-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{romanian-1.1}{1992/02/17}{Translation errors found by
+% Robert Juhasz fixed}
+% \changes{romanian-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{romanian-1.2f}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{romanian-1.2g}{1995/11/10}{Added translation of `Proof'}
+% \changes{romanian-1.2k}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{romanian-1.2l}{2003/06/10}{Added translation for Glossary}
+% \begin{macrocode}ls
+\addto\captionsromanian{%
+ \def\prefacename{Prefa\c{t}\u{a}}%
+ \def\refname{Bibliografie}%
+ \def\abstractname{Rezumat}%
+ \def\bibname{Bibliografie}%
+ \def\chaptername{Capitolul}%
+ \def\appendixname{Anexa}%
+ \def\contentsname{Cuprins}%
+ \def\listfigurename{List\u{a} de figuri}%
+ \def\listtablename{List\u{a} de tabele}%
+ \def\indexname{Glosar}%
+ \def\figurename{Figura}% % sau Plan\c{s}a
+ \def\tablename{Tabela}%
+ \def\partname{Partea}%
+ \def\enclname{Anex\u{a}}% % sau Anexe
+ \def\ccname{Copie}%
+ \def\headtoname{Pentru}%
+ \def\pagename{Pagina}%
+ \def\seename{Vezi}%
+ \def\alsoname{Vezi de asemenea}%
+ \def\proofname{Demonstra\c{t}ie} %
+ \def\glossaryname{Glosar}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateromanian}
+% The macro |\dateromanian| redefines the command |\today| to
+% produce Romanian dates.
+% \changes{romanian-1.1}{1992/02/17}{Translation errors found by Robert
+% Juhasz fixed}
+% \changes{romanian-1.2i}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{romanian-1.2i}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\dateromanian{%
+ \def\today{\number\day~\ifcase\month\or
+ ianuarie\or februarie\or martie\or aprilie\or mai\or
+ iunie\or iulie\or august\or septembrie\or octombrie\or
+ noiembrie\or decembrie\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasromanian}
+% \begin{macro}{\noextrasromanian}
+% The macro |\extrasromanian| will perform all the extra
+% definitions needed for the Romanian language. The macro
+% |\noextrasromanian| is used to cancel the actions of
+% |\extrasromanian| For the moment these macros are empty but they
+% are defined for compatibility with the other language definition
+% files.
+%
+% \begin{macrocode}
+\addto\extrasromanian{}
+\addto\noextrasromanian{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{romanian-1.2h}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{romanian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/romanian.ins b/Master/texmf-dist/source/generic/babel/romanian.ins
new file mode 100644
index 00000000000..749b4561ea7
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/romanian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{romanian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{romanian.ldf}{\from{romanian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/russianb.dtx b/Master/texmf-dist/source/generic/babel/russianb.dtx
new file mode 100644
index 00000000000..0cb758441aa
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/russianb.dtx
@@ -0,0 +1,1238 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{1461}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{russianb.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{russianb}
+ [2005/03/29 v1.1r Russian support from the babel system]
+%
+%% File `russianb.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Russianb Language Definition File
+%% Copyright (C) 1995 - 2005
+%% by Olga Lapko cyrtug at mir.msk.su
+%% Johannes Braams, TeXniek
+%
+%% Adapted to the new T2 and X2 Cyrillic encodings
+%% by Vladimir Volovich TeX at vvv.vsu.ru
+%% Werner Lemberg wl at gnu.org
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand\TeXhax{\TeX hax}
+\newcommand\babel{\textsf{babel}}
+\newcommand\langvar{$\langle \it lang \rangle$}
+\newcommand\note[1]{}
+\newcommand\Lopt[1]{\textsf{#1}}
+\newcommand\file[1]{\texttt{#1}}
+\newcommand\pkg[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{russianb.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{russianb.dtx}
+%
+% \changes{russianb-1.1c}{1996/07/11}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{russianb-1.1d}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+% \changes{russianb-1.1k}{1999/08/19}{replaced all \cs{penalty}\cs{@M}
+% with \cs{nobreak}}
+%
+% \section{The Russian language}
+%
+% The file \file{\filename}\footnote{The file described in this section
+% has version number \fileversion\ and was last revised on \filedate.
+% This file was initially derived from the original version of
+% \file{german.sty}, which has some definitions for Russian. Later the
+% definitions from \file{russian.sty} version 1.0b (for \LaTeX\ 2.09),
+% \file{russian.sty} version v2.5c (for \LaTeXe) and \file{francais.sty}
+% version 4.5c and \file{germanb.sty} version 2.5c were added.} defines
+% all the language-specific macros for the Russian language. It needs the
+% file \file{cyrcod} for success documentation with Russian encodings
+% (see below).
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:russian-quote} an overview is given of its purpose.
+%
+% \changes{russianb-1.1f}{1998/06/26}{%
+% Added definitions of Cyrillic emdash stuff and thinspace}
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |"---| & Cyrillic emdash in plain text. \\
+% |"--~| & Cyrillic emdash in compound names (surnames). \\
+% |"--*| & Cyrillic emdash for denoting direct speech. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|
+% or some other signs as ``disable/enable''). \\
+% |"~| & for a compound word mark without a breakpoint. \\
+% |"=| & for a compound word mark with a breakpoint, allowing
+% hyphenation in the composing words. \\
+% |",| & thinspace for initials with a breakpoint
+% in following surname. \\
+% |"`| & for German left double quotes
+% (looks like ,\kern-0.08em,). \\
+% |"'| & for German right double quotes (looks like ``). \\%''
+% |"<| & for French left double quotes (looks like $<\!\!<$). \\
+% |">| & for French right double quotes (looks like $>\!\!>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{russianb}}\label{tab:russian-quote}
+% \end{center}
+% \end{table}
+%
+% The quotes in table~\ref{tab:russian-quote} can also be typeset by
+% using the commands in table~\ref{tab:rmore-quote}.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |\cdash---| & Cyrillic emdash in plain text. \\
+% |\cdash--~| & Cyrillic emdash in compound names (surnames). \\
+% |\cdash--*| & Cyrillic emdash for denoting direct speech. \\
+% |\glqq| & for German left double quotes
+% (looks like ,\kern-0.08em,). \\
+% |\grqq| & for German right double quotes (looks like ``). \\%''
+% |\flqq| & for French left double quotes (looks like $<\!\!<$). \\
+% |\frqq| & for French right double quotes (looks like $>\!\!>$). \\
+% |\dq| & the original quotes character (|"|). \\
+% \end{tabular}
+% \caption{More commands which produce quotes, defined
+% by \babel}\label{tab:rmore-quote}
+% \end{center}
+% \end{table}
+%
+% The French quotes are also available as ligatures `|<<|' and `|>>|' in
+% 8-bit Cyrillic font encodings (\texttt{LCY}, \texttt{X2}, \texttt{T2*})
+% and as `|<|' and `|>|' characters in 7-bit Cyrillic font encodings
+% (\texttt{OT2} and \texttt{LWN}).
+%
+% The quotation marks traditionally used in Russian were borrowed from
+% other languages (e.g., French and German) so they keep their original
+% names.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is loaded
+% more than once, checking the category code of the \texttt{@} sign, etc.
+%
+% \changes{russianb-1.1d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{russianb-1.1e}{1996/12/29}{Added closing brace to second
+% argument of \cs{LdfInit}}
+% \begin{macrocode}
+%<*code>
+\LdfInit{russian}{captionsrussian}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{russianb} will be an `unknown' language, in which case
+% we have to make it known. So we check for the existence of |\l@russian|
+% to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@russian\@undefined
+ \@nopatterns{Russian}
+ \adddialect\l@russian0
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\latinencoding}
+%
+% We need to know the encoding for text that is supposed to be which is
+% active at the end of the \babel\ package. If the \pkg{fontenc} package
+% is loaded later, then\ldots too bad!
+%
+% \begin{macrocode}
+\let\latinencoding\cf@encoding
+% \end{macrocode}
+%
+% \end{macro}
+%
+% The user may choose between different available Cyrillic
+% encodings---e.g., \texttt{X2}, \texttt{LCY}, or \texttt{LWN}.\@
+% Hopefully, \texttt{X2} will eventually replace the two latter encodings
+% (\texttt{LCY} and \texttt{LWN}).\@ If the user wants to use another
+% font encoding than the default (\texttt{T2A}), he has to load the
+% corresponding file \emph{before} \file{russianb.sty}. This may be done
+% in the following way:
+%
+% \begin{verbatim}
+% % override the default X2 encoding used in Babel
+% \usepackage[LCY,OT1]{fontenc}
+% \usepackage[english,russian]{babel}
+% \end{verbatim}
+% \unskip
+%
+% Note: for the Russian language, the \texttt{T2A} encoding is better than
+% \texttt{X2}, because \texttt{X2} does not contain Latin letters, and
+% users should be very careful to switch the language every time they
+% want to typeset a Latin word inside a Russian phrase or vice versa.
+%
+% We parse the |\cdp@list| containing the encodings known to \LaTeX\ in
+% the order they were loaded. We set the |\cyrillicencoding| to the
+% \emph{last} loaded encoding in the list of supported Cyrillic
+% encodings: \texttt{OT2}, \texttt{LWN}, \texttt{LCY}, \texttt{X2},
+% \texttt{T2C}, \texttt{T2B}, \texttt{T2A}, if any.
+%
+% \begin{macrocode}
+\def\reserved@a#1#2{%
+ \edef\reserved@b{#1}%
+ \edef\reserved@c{#2}%
+ \ifx\reserved@b\reserved@c
+ \let\cyrillicencoding\reserved@c
+ \fi}
+\def\cdp@elt#1#2#3#4{%
+ \reserved@a{#1}{OT2}%
+ \reserved@a{#1}{LWN}%
+ \reserved@a{#1}{LCY}%
+ \reserved@a{#1}{X2}%
+ \reserved@a{#1}{T2C}%
+ \reserved@a{#1}{T2B}%
+ \reserved@a{#1}{T2A}}
+\cdp@list
+% \end{macrocode}
+%
+% Now, if |\cyrillicencoding| is undefined, then the user did not load
+% any of supported encodings. So, we have to set |\cyrillicencoding| to
+% some default value. We test the presence of the encoding definition
+% files in the order from less preferable to more preferable encodings.
+% We use the lowercase names (i.e., \file{lcyenc.def} instead of
+% \file{LCYenc.def}).
+%
+% \begin{macrocode}
+\ifx\cyrillicencoding\undefined
+ \IfFileExists{ot2enc.def}{\def\cyrillicencoding{OT2}}\relax
+ \IfFileExists{lwnenc.def}{\def\cyrillicencoding{LWN}}\relax
+ \IfFileExists{lcyenc.def}{\def\cyrillicencoding{LCY}}\relax
+ \IfFileExists{x2enc.def}{\def\cyrillicencoding{X2}}\relax
+ \IfFileExists{t2cenc.def}{\def\cyrillicencoding{T2C}}\relax
+ \IfFileExists{t2benc.def}{\def\cyrillicencoding{T2B}}\relax
+ \IfFileExists{t2aenc.def}{\def\cyrillicencoding{T2A}}\relax
+% \end{macrocode}
+%
+% If |\cyrillicencoding| is still undefined, then the user seems not to
+% have a properly installed distribution. A fatal error.
+%
+% \begin{macrocode}
+ \ifx\cyrillicencoding\undefined
+ \PackageError{babel}%
+ {No Cyrillic encoding definition files were found}%
+ {Your installation is incomplete.\MessageBreak
+ You need at least one of the following files:\MessageBreak
+ \space\space
+ x2enc.def, t2aenc.def, t2benc.def, t2cenc.def,\MessageBreak
+ \space\space
+ lcyenc.def, lwnenc.def, ot2enc.def.}%
+ \else
+% \end{macrocode}
+%
+% We avoid |\usepackage[\cyrillicencoding]{fontenc}| because we don't
+% want to force the switch of |\encodingdefault|.
+%
+% \begin{macrocode}
+ \lowercase
+ \expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{verbatim}
+% \PackageInfo{babel}
+% {Using `\cyrillicencoding' as a default Cyrillic encoding}%
+% \end{verbatim}
+% \unskip
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\Russian}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\russianhyphenmins
+ \language\l@russian}%
+\DeclareRobustCommand{\English}{%
+ \fontencoding\latinencoding\selectfont
+ \let\encodingdefault\latinencoding
+ \expandafter\set@hyphenmins\englishhyphenmins
+ \language\l@english}%
+\let\Rus\Russian
+\let\Eng\English
+\let\cyrillictext\Russian
+\let\cyr\Russian
+% \end{macrocode}
+%
+% Since the \texttt{X2} encoding does not contain Latin letters, we
+% should make some redefinitions of \LaTeX\ macros which implicitly
+% produce Latin letters.
+%
+% \begin{macrocode}
+\expandafter\ifx\csname T@X2\endcsname\relax\else
+% \end{macrocode}
+%
+% We put |\latinencoding| in braces to avoid problems with
+% |\@alph| inside minipages (e.g., footnotes inside minipages) where
+% |\@alph| is expanded and we get for example `|\fontencoding OT1|'
+% (|\fontencoding| is robust).
+%
+% \begin{macrocode}
+ \def\@alph#1{{\fontencoding{\latinencoding}\selectfont
+ \ifcase#1\or
+ a\or b\or c\or d\or e\or f\or g\or h\or
+ i\or j\or k\or l\or m\or n\or o\or p\or
+ q\or r\or s\or t\or u\or v\or w\or x\or
+ y\or z\else\@ctrerr\fi}}%
+ \def\@Alph#1{{\fontencoding{\latinencoding}\selectfont
+ \ifcase#1\or
+ A\or B\or C\or D\or E\or F\or G\or H\or
+ I\or J\or K\or L\or M\or N\or O\or P\or
+ Q\or R\or S\or T\or U\or V\or W\or X\or
+ Y\or Z\else\@ctrerr\fi}}%
+% \end{macrocode}
+%
+% Unfortunately, the commands |\AA| and |\aa| are not encoding dependent
+% in \LaTeX\ (unlike e.g., |\oe| or |\DH|). They are defined as |\r{A}| and
+% |\r{a}|. This leads to unpredictable results when the font encoding
+% does not contain the Latin letters `A' and `a' (like \texttt{X2}).
+%
+% \begin{macrocode}
+ \DeclareTextSymbolDefault{\AA}{OT1}
+ \DeclareTextSymbolDefault{\aa}{OT1}
+ \DeclareTextCommand{\aa}{OT1}{\r a}
+ \DeclareTextCommand{\AA}{OT1}{\r A}
+\fi
+% \end{macrocode}
+%
+% The following block redefines the character class of uppercase Greek
+% letters and some accents, if it is equal to 7 (variable family), to
+% avoid incorrect results if the font encoding in some math family does
+% not contain these characters in places of OT1 encoding. The code was
+% taken from |amsmath.dtx|. See comments and further explanation there.
+%
+% \changes{russianb-1.1n}{2001/02/21}{As this code generates a
+% textfont 7 error it is commented out for now.}
+% \begin{macrocode}
+% \begingroup\catcode`\"=12
+% % uppercase greek letters:
+% \def\@tempa#1{\expandafter\@tempb\meaning#1\relax\relax\relax\relax
+% "0000\@nil#1}
+% \def\@tempb#1"#2#3#4#5#6\@nil#7{%
+% \ifnum"#2=7 \count@"1#3#4#5\relax
+% \ifnum\count@<"1000 \else \global\mathchardef#7="0#3#4#5\relax \fi
+% \fi}
+% \@tempa\Gamma\@tempa\Delta\@tempa\Theta\@tempa\Lambda\@tempa\Xi
+% \@tempa\Pi\@tempa\Sigma\@tempa\Upsilon\@tempa\Phi\@tempa\Psi
+% \@tempa\Omega
+% % some accents:
+% \def\@tempa#1#2\@nil{\def\@tempc{#1}}\def\@tempb{\mathaccent}
+% \expandafter\@tempa\hat\relax\relax\@nil
+% \ifx\@tempb\@tempc
+% \def\@tempa#1\@nil{#1}%
+% \def\@tempb#1{\afterassignment\@tempa\mathchardef\@tempc=}%
+% \def\do#1"#2{}
+% \def\@tempd#1{\expandafter\@tempb#1\@nil
+% \ifnum\@tempc>"FFF
+% \xdef#1{\mathaccent"\expandafter\do\meaning\@tempc\space}%
+% \fi}
+% \@tempd\hat\@tempd\check\@tempd\tilde\@tempd\acute\@tempd\grave
+% \@tempd\dot\@tempd\ddot\@tempd\breve\@tempd\bar
+% \fi
+% \endgroup
+% \end{macrocode}
+%
+% The user should use the \pkg{inputenc} package when any 8-bit Cyrillic
+% font encoding is used, selecting one of the Cyrillic input encodings.
+% We do not assume any default input encoding, so the user should
+% explicitly call the \pkg{inputenc} package by |\usepackage{inputenc}|.
+% We also removed |\AtBeginDocument|, so \pkg{inputenc} should be used
+% before \babel.
+%
+% \changes{russianb-1.1l}{1999/08/27}{Made not using inputenc a
+% warning instead of an error}
+% \begin{macrocode}
+\@ifpackageloaded{inputenc}{}{%
+ \def\reserved@a{LWN}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{OT2}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \PackageWarning{babel}%
+ {No input encoding specified for Russian language}
+ \fi\fi}
+% \end{macrocode}
+%
+% Now we define two commands that offer the possibility to switch between
+% Cyrillic and Roman encodings.
+%
+% \begin{macro}{\cyrillictext}
+% \begin{macro}{\latintext}
+%
+% The command |\cyrillictext| will switch from Latin font encoding to the
+% Cyrillic font encoding, the command |\latintext| switches back. This
+% assumes that the `normal' font encoding is a Latin one. These commands
+% are \emph{declarations}, for shorter peaces of text the commands
+% |\textlatin| and |\textcyrillic| can be used.
+%
+% \changes{russianb-1.1o}{2003/10/12}{\cs{latintext} is already
+% defined by the core of \babel}
+% \begin{macrocode}
+%\DeclareRobustCommand{\latintext}{%
+% \fontencoding{\latinencoding}\selectfont
+% \def\encodingdefault{\latinencoding}}
+\let\lat\latintext
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\textcyrillic}
+% \begin{macro}{\textlatin}
+%
+% These commands take an argument which is then typeset using the
+% requested font encoding.
+% \changes{russianb-1.1o}{2003/10/12}{\cs{textlatin} already defined
+% by the core of \babel}
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+%\DeclareTextFontCommand{\textlatin}{\latintext}
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% We make the \TeX
+% \begin{macrocode}
+%\ifx\ltxTeX\undefined\let\ltxTeX\TeX\fi
+%\ProvideTextCommandDefault{\TeX}{\textlatin{\ltxTeX}}
+% \end{macrocode}
+% and \LaTeX\ logos encoding independent.
+% \begin{macrocode}
+%\ifx\ltxLaTeX\undefined\let\ltxLaTeX\LaTeX\fi
+%\ProvideTextCommandDefault{\LaTeX}{\textlatin{\ltxLaTeX}}
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Russian language.
+%
+% \begin{macro}{\captionsrussian}
+%
+% The macro |\captionsrussian| defines all strings used in the four
+% standard document classes provided with \LaTeX. The two commands |\cyr|
+% and |\lat| activate Cyrillic resp.\ Latin encoding.
+%
+% \begin{macrocode}
+\addto\captionsrussian{%
+% FIXME: Where is the \prefacename used?
+ \def\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyri\cyrs\cyrl\cyro\cyrv\cyri\cyre}}%
+% {\cyr\CYRV\cyrv\cyre\cyrd\cyre\cyrn\cyri\cyre}}%
+ \def\refname{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+ \ \cyrl\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyrery}}%
+% \def\refname{%
+% {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \def\abstractname{%
+ {\cyr\CYRA\cyrn\cyrn\cyro\cyrt\cyra\cyrc\cyri\cyrya}}%
+ \def\bibname{%
+ {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+% \def\bibname{%
+% {\cyr\CYRB\cyri\cyrb\cyrl\cyri\cyro
+% \cyrg\cyrr\cyra\cyrf\cyri\cyrya}}%
+% for reports according to GOST:
+% \def\bibname{%
+% {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+% \ \cyri\cyrs\cyrp\cyro\cyrl\cyrsftsn\cyrz\cyro\cyrv\cyra\cyrn
+% \cyrn\cyrery\cyrh\ \cyri\cyrs\cyrt\cyro\cyrch\cyrn\cyri
+% \cyrk\cyro\cyrv}}%
+ \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+% \@ifundefined{chapter}{}{%
+% \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}}%
+ \def\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre}}%
+% \end{macrocode}
+%
+% There are two names for the Table of Contents that are used in Russian
+% publications. For books (and reports) the second variant is
+% appropriate, but for proceedings the first variant is preferred:
+%
+% \begin{macrocode}
+ \@ifundefined{thechapter}%
+ {\def\contentsname{%
+ {\cyr\CYRS\cyro\cyrd\cyre\cyrr\cyrzh\cyra\cyrn\cyri\cyre}}}%
+ {\def\contentsname{%
+ {\cyr\CYRO\cyrg\cyrl\cyra\cyrv\cyrl\cyre\cyrn\cyri\cyre}}}%
+ \def\listfigurename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+ \ \cyri\cyrl\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyri\cyrishrt}}%
+% \def\listfigurename{%
+% {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+% \ \cyrr\cyri\cyrs\cyru\cyrn\cyrk\cyro\cyrv}}%
+ \def\listtablename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+ \ \cyrt\cyra\cyrb\cyrl\cyri\cyrc}}%
+ \def\indexname{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrm\cyre\cyrt\cyrn\cyrery\cyrishrt
+ \ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\authorname{%
+ {\cyr\CYRI\cyrm\cyre\cyrn\cyrn\cyro\cyrishrt
+ \ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\figurename{{\cyr\CYRR\cyri\cyrs.}}%
+ \def\tablename{{\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
+ \def\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyrsftsn}}%
+ \def\enclname{{\cyr\cyrv\cyrk\cyrl.}}%
+ \def\ccname{{\cyr\cyri\cyrs\cyrh.}}%
+% \def\ccname{{\cyr\cyri\cyrz}}%
+ \def\headtoname{{\cyr\cyrv\cyrh.}}%
+% \def\headtoname{{\cyr\cyrv}}%
+ \def\pagename{{\cyr\cyrs.}}%
+% \def\pagename{{\cyr\cyrs\cyrt\cyrr.}}%
+ \def\seename{{\cyr\cyrs\cyrm.}}%
+ \def\alsoname{{\cyr\cyrs\cyrm.\ \cyrt\cyra\cyrk\cyrzh\cyre}}%
+% \end{macrocode}
+% \changes{russianb-1.1m}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+ \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt
+ \cyre\cyrl\cyrsftsn\cyrs\cyrt\cyrv\cyro}}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\daterussian}
+%
+% The macro |\daterussian| redefines the command |\today| to produce
+% Russian dates.
+%
+% \begin{macrocode}
+\def\daterussian{%
+ \def\today{\number\day~\ifcase\month\or
+ \cyrya\cyrn\cyrv\cyra\cyrr\cyrya\or
+ \cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya\or
+ \cyrm\cyra\cyrr\cyrt\cyra\or
+ \cyra\cyrp\cyrr\cyre\cyrl\cyrya\or
+ \cyrm\cyra\cyrya\or
+ \cyri\cyryu\cyrn\cyrya\or
+ \cyri\cyryu\cyrl\cyrya\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra\or
+ \cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyrn\cyro\cyrya\cyrb\cyrr\cyrya\or
+ \cyrd\cyre\cyrk\cyra\cyrb\cyrr\cyrya\fi
+ \ \number\year~\cyrg.}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\extrasrussian}
+%
+% The macro |\extrasrussian| will perform all the extra definitions
+% needed for the Russian language. The macro |\noextrasrussian| is used
+% to cancel the actions of |\extrasrussian|.
+%
+% \changes{russianb-1.1b}{1996/02/20}{Added switch to \texttt{LWN}
+% encoding}
+%
+% The first action we define is to switch on the selected Cyrillic
+% encoding whenever we enter `russian'.
+%
+% \begin{macrocode}
+\addto\extrasrussian{\cyrillictext}
+% \end{macrocode}
+%
+% When the encoding definition file was processed by \LaTeX\ the current
+% font encoding is stored in |\latinencoding|, assuming that \LaTeX\ uses
+% \texttt{T1} or \texttt{OT1} as default. Therefore we switch back to
+% |\latinencoding| whenever the Russian language is no longer `active'.
+%
+% \begin{macrocode}
+\addto\noextrasrussian{\latintext}
+% \end{macrocode}
+%
+% \begin{macro}{\verbatim@font}
+%
+% \changes{russianb-1.1b}{1996/02/20}{Added changing of
+% \cs{verbatim@font}}
+%
+% In order to get both Latin and Cyrillic letters in verbatim text we
+% need to change the definition of an internal \LaTeX\ command somewhat:
+%
+% \begin{macrocode}
+%\def\verbatim@font{%
+% \let\encodingdefault\latinencoding
+% \normalfont\ttfamily
+% \expandafter\def\csname\cyrillicencoding-cmd\endcsname##1##2{%
+% \ifx\protect\@typeset@protect
+% \begingroup\UseTextSymbol\cyrillicencoding##1\endgroup
+% \else\noexpand##1\fi}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% The category code of the characters `\texttt{:}', `\texttt{;}',
+% `\texttt{!}', and `\texttt{?}' is made |\active| to insert a little
+% white space.
+%
+% For Russian (as well as for German) the \texttt{"} character also is
+% made active.
+%
+% Note: It is \emph{very} questionable whether the Russian typesetting
+% tradition requires additional spacing before those punctuation signs.
+% Therefore, we make the corresponding code optional. If you need it,
+% then define the \texttt{frenchpunct} docstrip option in
+% \file{babel.ins}.
+%
+% \changes{russianb-1.1f}{1998/06/26}{%
+% Added a hook to insert space
+% or not before `double punctuation' (from frenchb).}
+%
+% Borrowed from french.
+% Some users dislike automatic insertion of a space before
+% `double punctuation', and prefer to decide themselves whether a
+% space should be added or not; so a hook |\NoAutoSpaceBeforeFDP|
+% is provided: if this command is added (in file |russianb.cfg|, or
+% anywhere in a document) |russianb| will respect your typing, and
+% introduce a suitable space before `double punctuation' \emph{if
+% and only if} a space is typed in the source file before those
+% signs.
+%
+% The command |\AutoSpaceBeforeFDP| switches back to the
+% default behavior of |russianb|.
+%
+% \changes{russianb-1.1a}{1995/03/07}{Use the new mechanism for dealing
+% with active characters}
+%
+% \begin{macrocode}
+%<*frenchpunct>
+\initiate@active@char{:}
+\initiate@active@char{;}
+%</frenchpunct>
+%<*frenchpunct|spanishligs>
+\initiate@active@char{!}
+\initiate@active@char{?}
+%</frenchpunct|spanishligs>
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% The code above is necessary because we need extra active characters.
+% The character |"| is used as indicated in
+% table~\ref{tab:russian-quote}.
+%
+% We specify that the Russian group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasrussian{\languageshorthands{russian}}
+% \end{macrocode}
+%
+% These characters are `turned on' once, later their definition may
+% vary.
+%
+% \begin{macrocode}
+\addto\extrasrussian{%
+%<frenchpunct> \bbl@activate{:}\bbl@activate{;}%
+%<frenchpunct|spanishligs> \bbl@activate{!}\bbl@activate{?}%
+ \bbl@activate{"}}
+\addto\noextrasrussian{%
+%<frenchpunct> \bbl@deactivate{:}\bbl@deactivate{;}%
+%<frenchpunct|spanishligs> \bbl@deactivate{!}\bbl@deactivate{?}%
+ \bbl@deactivate{"}}
+% \end{macrocode}
+%
+% The \texttt{X2} and \texttt{T2*} encodings do not contain
+% |spanish_shriek| and |spanish_query| symbols; as a consequence, the
+% ligatures `|?`|' and `|!`|' do not work with them (these characters are
+% useless for Cyrillic texts anyway). But we define the shorthands to
+% emulate these ligatures (optionally).
+%
+% We do not use |\latinencoding| here (but instead explicitly use
+% \texttt{OT1}) because the user may choose \texttt{T2A} to be the primary
+% encoding, but it does not contain these characters.
+%
+% \begin{macrocode}
+%<*spanishligs>
+\declare@shorthand{russian}{?`}{\UseTextSymbol{OT1}\textquestiondown}
+\declare@shorthand{russian}{!`}{\UseTextSymbol{OT1}\textexclamdown}
+%</spanishligs>
+% \end{macrocode}
+%
+% \begin{macro}{\russian@sh@;@}
+% \begin{macro}{\russian@sh@:@}
+% \begin{macro}{\russian@sh@!@}
+% \begin{macro}{\russian@sh@?@}
+%
+% We have to reduce the amount of white space before \texttt{;},
+% \texttt{:} and \texttt{!}. This should only happen in horizontal mode,
+% hence the test with |\ifhmode|.
+%
+% \changes{russianb-1.1a}{1995/07/04}{Use new \cs{DefineActiveNoArg}}
+% \changes{russianb-1.1a}{1995/07/04}{Use the more general mechanism of
+% \cs{declare@shorthand}}
+% \changes{russianb-1.1b}{1996/02/08}{Updated to reflect the latest
+% french definitions}
+%
+% \begin{macrocode}
+%<*frenchpunct>
+\declare@shorthand{russian}{;}{%
+ \ifhmode
+% \end{macrocode}
+%
+% \changes{russianb-1.1f}{1998/06/26}{%
+% \thinspace changed to kern.1em (space bit thinner)}
+% \changes{russianb-1.1f}{1998/06/26}{%
+% Added a hook to insert space
+% or not before `double punctuation' (from frenchb).}
+%
+% In horizontal mode we check for the presence of a `space', `unskip' if
+% it exists and place a |0.1em| kerning.
+%
+% \begin{macrocode}
+ \ifdim\lastskip>\z@
+ \unskip\nobreak\kern.1em
+ \else
+% \end{macrocode}
+% If no space has been typed, we add |\FDP@thinspace|
+% which will be
+% defined, up to the user's wishes, as an automatic added
+% thinspace, or as |\@empty|.
+%
+% \begin{macrocode}
+ \FDP@thinspace
+ \fi
+ \fi
+% \end{macrocode}
+%
+% Now we can insert a `|;|' character.
+%
+% \begin{macrocode}
+ \string;}
+% \end{macrocode}
+%
+% The other definitions are very similar.
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{:}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\nobreak\kern.1em
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string:}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{!}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\nobreak\kern.1em
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string!}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{?}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\nobreak\kern.1em
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string?}
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \changes{russianb-1.1f}{1998/06/26}{%
+% Added a hook to insert space
+% or not before `double punctuation' (from frenchb).}
+% \begin{macro}{\AutoSpaceBeforeFDP}
+% \begin{macro}{\NoAutoSpaceBeforeFDP}
+% \begin{macro}{\FDP@thinspace}
+% |\FDP@thinspace| is defined as unbreakable
+% spaces if |\AutoSpaceBeforeFDP| is activated or as |\@empty| if
+% |\NoAutoSpaceBeforeFDP| is in use.
+% The default is |\AutoSpaceBeforeFDP|.
+% \begin{macrocode}
+\def\AutoSpaceBeforeFDP{%
+ \def\FDP@thinspace{\nobreak\kern.1em}}
+\def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty}
+\AutoSpaceBeforeFDP
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\FDPon}
+% \begin{macro}{\FDPoff}
+% \changes{russianb-1.1f}{1998/06/26}{One more chance to avoid
+% spaces before double punctuation}
+%
+% The next macros allow to switch on/off activeness of double
+% punctuation signs.
+%
+% \begin{macrocode}
+\def\FDPon{\bbl@activate{:}%
+ \bbl@activate{;}%
+ \bbl@activate{?}%
+ \bbl@activate{!}}
+\def\FDPoff{\bbl@deactivate{:}%
+ \bbl@deactivate{;}%
+ \bbl@deactivate{?}%
+ \bbl@deactivate{!}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\system@sh@:@}
+% \begin{macro}{\system@sh@!@}
+% \begin{macro}{\system@sh@?@}
+% \begin{macro}{\system@sh@;@}
+%
+% \changes{russianb-1.1a}{1995/07/04}{Added system level shorthands}
+%
+% When the active characters appear in an environment where their
+% Russian behaviour is not wanted they should give an `expected'
+% result. Therefore we define shorthands at system level as well.
+%
+% \begin{macrocode}
+\declare@shorthand{system}{:}{\string:}
+\declare@shorthand{system}{;}{\string;}
+%</frenchpunct>
+%<*frenchpunct&!spanishligs>
+\declare@shorthand{system}{!}{\string!}
+\declare@shorthand{system}{?}{\string?}
+%</frenchpunct&!spanishligs>
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% To be able to define the function of `|"|', we first define a couple of
+% `support' macros.
+%
+% \begin{macro}{\dq}
+%
+% We save the original double quote character in |\dq| to keep it
+% available, the math accent |\"| can now be typed as `|"|'.
+%
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \changes{russianb-1.1a}{1995/07/04}{Use \cs{ddot} instead of
+% \cs{@MATHUMLAUT}}
+%
+% Now we can define the doublequote macros: german and french quotes.
+% We use definitions of these quotes made in babel.sty.
+% The french quotes are contained in the \texttt{T2*} encodings.
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{"`}{\glqq}
+\declare@shorthand{russian}{"'}{\grqq}
+\declare@shorthand{russian}{"<}{\flqq}
+\declare@shorthand{russian}{">}{\frqq}
+% \end{macrocode}
+%
+% Some additional commands:
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{""}{\hskip\z@skip}
+\declare@shorthand{russian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{russian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{russian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+% \end{macrocode}
+%
+% The next two macros for |"-| and |"---| are somewhat different.
+% We must check whether the second token is a hyphen character:
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{"-}{%
+% \end{macrocode}
+%
+% If the next token is `|-|', we typeset an emdash, otherwise a hyphen
+% sign:
+%
+% \begin{macrocode}
+ \def\russian@sh@tmp{%
+ \if\russian@sh@next-\expandafter\russian@sh@emdash
+ \else\expandafter\russian@sh@hyphen\fi
+ }%
+% \end{macrocode}
+%
+% \TeX\ looks for the next token after the first `|-|': the meaning of
+% this token is written to |\russian@sh@next| and |\russian@sh@tmp| is
+% called.
+%
+% \begin{macrocode}
+ \futurelet\russian@sh@next\russian@sh@tmp}
+% \end{macrocode}
+%
+% Here are the definitions of hyphen and emdash. First the hyphen:
+%
+% \begin{macrocode}
+\def\russian@sh@hyphen{%
+ \nobreak\-\bbl@allowhyphens}
+% \end{macrocode}
+%
+% \changes{russianb-1.1f}{1998/06/26}{%
+% Rearranging of cyrillic emdash stuff}
+%
+% For the emdash definition, there are the two parameters: we must `eat'
+% two last hyphen signs of our emdash\dots :
+% \begin{macrocode}
+\def\russian@sh@emdash#1#2{\cdash-#1#2}
+% \end{macrocode}
+% \begin{macro}{\cdash}
+% \dots\ these two parameters are useful for another macro:
+% |\cdash|:
+% \begin{macrocode}
+%\ifx\cdash\undefined % should be defined earlier
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+% \end{macrocode}
+% second parameter (or third for |\cdash|) shows what kind of emdash
+% to create in next step
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"---| & ordinary (plain) Cyrillic emdash inside text:
+% an unbreakable thinspace will be inserted before only in case of
+% a \textit{space} before the dash (it is necessary for dashes after
+% display maths formulae: there could be lists, enumerations etc.\
+% started with ``--- where $a$ is ...'' i.e., the dash starts a line).
+% (Firstly there were planned rather soft rules for user: he may put
+% a space before the dash or not. But it is difficult to place this
+% thinspace automatically, i.e., by checking modes because after
+% display formulae \TeX{} uses horizontal mode. Maybe there is a
+% misunderstanding? Maybe there is another way?) After a dash
+% a breakable thinspace is always placed; \\
+% \end{tabular}
+% \end{center}
+% \begin{macrocode}
+% What is more grammatically: .2em or .2\fontdimen6\font ?
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+ \cyrdash\hskip.2em\ignorespaces}%
+% \end{macrocode}
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--~| & emdash in compound names or surnames
+% (like Mendeleev--Klapeiron); this dash has no space characters
+% around; after the dash some space is added
+% |\exhyphenalty| \\
+% \end{tabular}
+% \end{center}
+% \begin{macrocode}
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+% \end{macrocode}
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--*| & for denoting direct speech (a space like |\enskip|
+% must follow the emdash); \\
+% \end{tabular}
+% \end{center}
+% \begin{macrocode}
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+%\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cyrdash}
+% Finally the macro for ``body'' of the Cyrillic emdash.
+% The |\cyrdash| macro will be defined in case this macro hasn't been
+% defined in a fontenc file. For T2* fonts, cyrdash will be placed in
+% the code of the English emdash thus it uses ligature |---|.
+% \begin{macrocode}
+% Is there an IF necessary?
+\ifx\cyrdash\undefined
+ \def\cyrdash{\hbox to.8em{--\hss--}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{russianb-1.1f}{1998/06/26}{%
+% Add macro for thinspace between initials}
+%
+% Here a really new macro---to place thinspace between initials.
+% This macro used instead of |\,| allows hyphenation in the following
+% surname.
+%
+% \changes{russianb-1.1r}{2004/11/21}{Removed the commanet character
+% before the next code line, see R3669}
+% \begin{macrocode}
+\declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}
+% \end{macrocode}
+%
+% \changes{russianb-1.1f}{1998/06/26}{%
+% Add commands for switch on/off
+% doublequote activeness. Borrowed from german.}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% All that's left to do now is to define a couple of commands
+% for |"|.
+% \begin{macrocode}
+\def\mdqon{\bbl@activate{"}}
+\def\mdqoff{\bbl@deactivate{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The Russian hyphenation patterns can be used with |\lefthyphenmin|
+% and |\righthyphenmin| set to~2.
+%
+% \changes{russianb-1.1a}{1995/07/04}{use \cs{russianhyphenmins} to
+% store the correct values}
+% \changes{russianb-1.1m}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% temporary hack:
+\ifx\englishhyphenmins\undefined
+ \def\englishhyphenmins{\tw@\thr@@}
+\fi
+% \end{macrocode}
+%
+% Now the action |\extrasrussian| has to execute is to make sure that the
+% command |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasrussian| will switch it off again.
+%
+% \begin{macrocode}
+\addto\extrasrussian{\bbl@frenchspacing}
+\addto\noextrasrussian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Next we add a new enumeration style for Russian manuscripts with
+% Cyrillic letters, and later on we define some math operator names in
+% accordance with Russian typesetting traditions.
+%
+% \begin{macro}{\Asbuk}
+%
+% We begin by defining |\Asbuk| which works like |\Alph|, but produces
+% (uppercase) Cyrillic letters intead of Latin ones. The letters YO,
+% ISHRT, HRDSN, ERY, and SFTSN are skipped, as usual for such
+% enumeration.
+%
+% \begin{macrocode}
+\def\Asbuk#1{\expandafter\@Asbuk\csname c@#1\endcsname}
+\def\@Asbuk#1{\ifcase#1\or
+ \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRE\or\CYRZH\or
+ \CYRZ\or\CYRI\or\CYRK\or\CYRL\or\CYRM\or\CYRN\or\CYRO\or
+ \CYRP\or\CYRR\or\CYRS\or\CYRT\or\CYRU\or\CYRF\or\CYRH\or
+ \CYRC\or\CYRCH\or\CYRSH\or\CYRSHCH\or\CYREREV\or\CYRYU\or
+ \CYRYA\else\@ctrerr\fi}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\asbuk}
+%
+% The macro |\asbuk| is similar to |\alph|; it produces lowercase
+% Russian letters.
+%
+% \begin{macrocode}
+\def\asbuk#1{\expandafter\@asbuk\csname c@#1\endcsname}
+\def\@asbuk#1{\ifcase#1\or
+ \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyre\or\cyrzh\or
+ \cyrz\or\cyri\or\cyrk\or\cyrl\or\cyrm\or\cyrn\or\cyro\or
+ \cyrp\or\cyrr\or\cyrs\or\cyrt\or\cyru\or\cyrf\or\cyrh\or
+ \cyrc\or\cyrch\or\cyrsh\or\cyrshch\or\cyrerev\or\cyryu\or
+ \cyrya\else\@ctrerr\fi}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Set up default Cyrillic math alphabets. To use Cyrillic letters in
+% math mode user should load the |textmath| package \emph{before}
+% loading fontenc package (or \babel). Note, that by default Cyrillic
+% letters are taken from upright font in math mode (unlike Latin
+% letters).
+% \begin{macrocode}
+%\RequirePackage{textmath}
+\@ifundefined{sym\cyrillicencoding letters}{}{%
+\SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
+ \rmdefault\bfdefault\updefault
+\DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}
+% \end{macrocode}
+% And we need a few commands to be able to switch to different variants.
+% \begin{macrocode}
+\DeclareMathAlphabet\cyrmathbf\cyrillicencoding
+ \rmdefault\bfdefault\updefault
+\DeclareMathAlphabet\cyrmathsf\cyrillicencoding
+ \sfdefault\mddefault\updefault
+\DeclareMathAlphabet\cyrmathit\cyrillicencoding
+ \rmdefault\mddefault\itdefault
+\DeclareMathAlphabet\cyrmathtt\cyrillicencoding
+ \ttdefault\mddefault\updefault
+%
+\SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
+ \sfdefault\bfdefault\updefault
+\SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
+ \rmdefault\bfdefault\itdefault
+}
+% \end{macrocode}
+%
+% Some math functions in Russian math books have other names: e.g.,
+% \texttt{sinh} in Russian is written as \texttt{sh} etc. So we define a
+% number of new math operators.
+%
+% |\sinh|:
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+% \end{macrocode}
+% |\cosh|:
+% \begin{macrocode}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+% \end{macrocode}
+% |\tan|:
+% \begin{macrocode}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+% \end{macrocode}
+% |\arctan|:
+% \begin{macrocode}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+% \end{macrocode}
+% arcctg:
+% \begin{macrocode}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+% \end{macrocode}
+% The following macro conflicts with |\th| defined in Latin~1 encoding:
+%
+% |\tanh|:
+% \changes{russianb-1.1q}{2004/05/21}{Change definition of \cs{th}
+% only for this language}
+% \begin{macrocode}
+\addto\extrasrussian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+% \end{macrocode}
+% |\cot|:
+% \begin{macrocode}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+% \end{macrocode}
+% |\coth|:
+% \begin{macrocode}
+\def\cth{\mathop{\operator@font cth}\nolimits}
+% \end{macrocode}
+% |\csc|:
+% \begin{macrocode}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+% \end{macrocode}
+%
+% And finally some other Russian mathematical symbols:
+% \begin{macrocode}
+\def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
+\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
+\def\nod{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrd.}}\nolimits}
+\def\nok{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrk.}}\nolimits}
+\def\NOD{\mathop{\cyrmathrm{\CYRN\CYRO\CYRD}}\nolimits}
+\def\NOK{\mathop{\cyrmathrm{\CYRN\CYRO\CYRK}}\nolimits}
+\def\Proj{\mathop{\cyrmathrm{\CYRP\cyrr}}\nolimits}
+% \end{macrocode}
+%
+% This is for compatibility with older Russian packages.
+% \begin{macrocode}
+\DeclareRobustCommand{\No}{%
+ \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a configuration file,
+% setting the main language to be switched on at |\begin{document}| and
+% resetting the category code of \texttt{@} to its original value.
+%
+% \changes{russianb-1.1d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+%
+% \begin{macrocode}
+\ldf@finish{russian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/russianb.ins b/Master/texmf-dist/source/generic/babel/russianb.ins
new file mode 100644
index 00000000000..607d861173f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/russianb.ins
@@ -0,0 +1,147 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/03/13}
+\def\batchfile{russianb.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\usedir{tex/generic/babel}
+\keepsilent
+
+\usepreamble\mainpreamble
+
+\generate{\file{russianb.ldf}{\from{russianb.dtx}{code}}}
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.fd}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/samin.dtx b/Master/texmf-dist/source/generic/babel/samin.dtx
new file mode 100644
index 00000000000..b3d951204c7
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/samin.dtx
@@ -0,0 +1,232 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{120}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{samin.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{samin}
+%\fi
+%\ProvidesFile{samin.dtx}
+ [2004/02/20 v1.0c North Sami support from the babel system]
+%\iffalse
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2004
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source code for
+% the North Sami language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{samin.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{samin.dtx}
+%
+% \section{The North Sami language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was written by Regnor Jernsletten,
+% (\texttt{Regnor.Jernsletten@sami.uit.no}) or
+% (\texttt{Regnor.Jernsletten@eunet.no}).}
+% defines all the language definition macros for the North Sami language.
+%
+% Several Sami dialects/languages are spoken in Finland, Norway, Sweden
+% and on the Kola Peninsula (Russia). The alphabets differ, so there
+% will eventually be a need for more \texttt{.dtx} files for e.g. Lule
+% and South Sami. Hence the name \file{samin.dtx} (and not
+% \file{sami.dtx} or the like) in the North Sami case.
+%
+% There are currently no hyphenation patterns available for the North
+% Sami language, but you might consider using the patterns for Finnish
+% (\file{fi8hyph.tex}), Norwegian (\file{nohyph.tex}) or Swedish
+% (\file{sehyph.tex}). Add a line for the \texttt{samin} language to
+% the \file{language.dat} file, and rebuild the \LaTeX\ format file.
+% See the documentation for your \LaTeX\ distribution.
+%
+% A note on writing North Sami in \LaTeX: The TI encoding and EC fonts
+% do not include the T WITH STROKE letter, which you will need a
+% workaround for. My suggestion is to place the lines\\
+% |\newcommand{\tx}{\mbox{t\hspace{-.35em}-}}|\\
+% |\newcommand{\txx}{\mbox{T\hspace{-.5em}-}}|\\
+% in the preamble of your documents. They define the commands\\
+% |\txx{}| for LATIN CAPITAL LETTER T WITH STROKE and \\
+% |\tx{}| for LATIN SMALL LETTER T WITH STROKE.
+%
+% \subsection{The code of \file{samin.dtx}}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{samin}{captionssamin}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{samin} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@samin| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\undefined\l@samin
+ \@nopatterns{Samin}
+ \adddialect\l@samin0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the North Sami language.
+%
+% \begin{macro}{\saminhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{samin-1.0b}{2000/09/26}{use \cs{providehyphenmins}}
+% \begin{macrocode}
+\providehyphenmins{samin}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionssamin}
+% The macro |\captionssamin| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{samin-1.0b}{2000/09/26}{Added \cs{glossaryname}}
+% \changes{samin-1.0c}{2000/10/04}{Provided the translation for
+% glossary}
+% \begin{macrocode}
+\def\captionssamin{%
+ \def\prefacename{Ovdas\'atni}%
+ \def\refname{\v Cujuhusat}%
+ \def\abstractname{\v Coahkk\'aigeassu}%
+ \def\bibname{Girjj\'ala\v svuohta}%
+ \def\chaptername{Kapihttal}%
+ \def\appendixname{\v Cuovus}%
+ \def\contentsname{Sisdoallu}%
+ \def\listfigurename{Govvosat}%
+ \def\listtablename{Tabeallat}%
+ \def\indexname{Registtar}%
+ \def\figurename{Govus}%
+ \def\tablename{Tabealla}%
+ \def\partname{Oassi}%
+ \def\enclname{Mielddus}%
+ \def\ccname{Kopia s\'addejuvvon}%
+ \def\headtoname{Vuost\'aiv\'aldi}%
+ \def\pagename{Siidu}%
+ \def\seename{geah\v ca}%
+ \def\alsoname{geah\v ca maidd\'ai}%
+ \def\proofname{Duo\dj{}a\v stus}%
+ \def\glossaryname{S\'atnelistu}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datesamin}
+% The macro |\datesamin| redefines the command |\today| to
+% produce North Sami dates.
+% \begin{macrocode}
+\def\datesamin{%
+ \def\today{\ifcase\month\or
+ o\dj{}\dj{}ajagem\'anu\or
+ guovvam\'anu\or
+ njuk\v cam\'anu\or
+ cuo\ng{}om\'anu\or
+ miessem\'anu\or
+ geassem\'anu\or
+ suoidnem\'anu\or
+ borgem\'anu\or
+ \v cak\v cam\'anu\or
+ golggotm\'anu\or
+ sk\'abmam\'anu\or
+ juovlam\'anu\fi
+ \space\number\day.~b.\space\number\year}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\extrassamin}
+% \begin{macro}{\noextrassamin}
+% The macro |\extrassamin| will perform all the extra
+% definitions needed for the North Sami language. The macro
+% |\noextrassamin| is used to cancel the actions of
+% |\extrassamin|. For the moment these macros are empty but
+% they are defined for compatibility with the other
+% language definition files.
+%
+% \begin{macrocode}
+\addto\extrassamin{}
+\addto\noextrassamin{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{samin}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/Master/texmf-dist/source/generic/babel/samin.ins b/Master/texmf-dist/source/generic/babel/samin.ins
new file mode 100644
index 00000000000..e94cf6f90ab
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/samin.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2000/09/26}
+\def\batchfile{samin.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{samin.ldf}{\from{samin.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/babel/scottish.dtx b/Master/texmf-dist/source/generic/babel/scottish.dtx
new file mode 100644
index 00000000000..82613e5cd0b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/scottish.dtx
@@ -0,0 +1,209 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{95}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{scottish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{scottish}
+%\fi
+%\ProvidesFile{scottish.dtx}
+ [2005/03/31 v1.0g Scottish support from the babel system]
+%\iffalse
+%% File `scottish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Scottish language definition file.
+%
+% The Gaidhlig or Scottish Gaelic terms were provided by Fraser
+% Grant \texttt{FRASER@CERNVM}.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{scottish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{scottish.dtx}
+%
+% \changes{scottish-1.0b}{1995/06/14}{Corrected typos (PR1652)}
+% \changes{scottish-1.0d}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Scottish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Fraser Grant
+% (\texttt{FRASER@CERNVM}).} defines all the language definition
+% macros for the Scottish language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{scottish-1.0d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{scottish}\captionsscottish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{scottish} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@scottish| to see whether we have to do something
+% here.
+%
+% \begin{macrocode}
+\ifx\l@scottish\@undefined
+ \@nopatterns{scottish}
+ \adddialect\l@scottish0\fi
+% \end{macrocode}
+% The next step consists of defining commands to switch to (and
+% from) the Scottish language.
+%
+% \begin{macro}{\captionsscottish}
+% The macro |\captionsscottish| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{scottish-1.0c}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{scottish-1.0g}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsscottish{%
+ \def\prefacename{Preface}% <-- needs translation
+ \def\refname{Iomraidh}%
+ \def\abstractname{Br\`{\i}gh}%
+ \def\bibname{Leabhraichean}%
+ \def\chaptername{Caibideil}%
+ \def\appendixname{Ath-sgr`{\i}obhadh}%
+ \def\contentsname{Cl\`ar-obrach}%
+ \def\listfigurename{Liosta Dhealbh }%
+ \def\listtablename{Liosta Chl\`ar}%
+ \def\indexname{Cl\`ar-innse}%
+ \def\figurename{Dealbh}%
+ \def\tablename{Cl\`ar}%
+ \def\partname{Cuid}%
+ \def\enclname{a-staigh}%
+ \def\ccname{lethbhreac gu}%
+ \def\headtoname{gu}%
+ \def\pagename{t.d.}% abrv. `taobh duilleag'
+ \def\seename{see}% <-- needs translation
+ \def\alsoname{see also}% <-- needs translation
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datescottish}
+% The macro |\datescottish| redefines the command |\today| to
+% produce Scottish dates.
+% \changes{scottish-1.0e}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{scottish-1.0e}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\datescottish{%
+ \def\today{%
+ \number\day\space \ifcase\month\or
+ am Faoilteach\or an Gearran\or am M\`art\or an Giblean\or
+ an C\`eitean\or an t-\`Og mhios\or an t-Iuchar\or
+ L\`unasdal\or an Sultuine\or an D\`amhar\or
+ an t-Samhainn\or an Dubhlachd\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasscottish}
+% \begin{macro}{\noextrasscottish}
+% The macro |\extrasscottish| will perform all the extra
+% definitions needed for the Scottish language. The macro
+% |\noextrasscottish| is used to cancel the actions of
+% |\extrasscottish|. For the moment these macros are empty but
+% they are defined for compatibility with the other language
+% definition files.
+%
+% \begin{macrocode}
+\addto\extrasscottish{}
+\addto\noextrasscottish{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{scottish-1.0d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{scottish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/Master/texmf-dist/source/generic/babel/scottish.ins b/Master/texmf-dist/source/generic/babel/scottish.ins
new file mode 100644
index 00000000000..5937bb1c446
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/scottish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{scottish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{scottish.ldf}{\from{scottish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/serbian.dtx b/Master/texmf-dist/source/generic/babel/serbian.dtx
new file mode 100644
index 00000000000..60179088835
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/serbian.dtx
@@ -0,0 +1,312 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{263}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{serbian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{serbian}
+%\fi
+%\ProvidesFile{serbian.dtx}
+ [2005/03/31 v1.0d Serbocroatian support from the babel system]
+%\iffalse
+% Babel package for LaTeX version 2e
+% Copyright (C) 1989 - 2005
+% by Johannes Braams, TeXniek
+%
+% Please report errors to: J.L. Braams
+% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Serbocroatian language definition file. A contribution
+% was made by Dejan Muhamedagi\'{c} (dejan@yunix.com) and Jankovic
+% Slobodan <slobodan@archimed.filfak.ac.ni.yu>
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{serbian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{serbian.dtx}
+% \changes{serbian-1.0b}{1998/06/16}{Added suggestions for shorthands
+% and so on from Jankovic Slobodan}
+%
+% \section{The Serbocroatian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Dejan Muhamedagi\'{c}
+% (\texttt{dejan@yunix.com}).} defines all the language definition
+% macros for the Serbian language, typeset in a latin script. In a
+% future version support for typesetting in a cyrillic script may
+% be added.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:serbian-quote} an overview is given of its
+% purpose. One of the reasons for this is that in the Serbian
+% language some special characters are used.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"c| & |\"c|, also implemented for the
+% lowercase and uppercase s and z. \\
+% |"d| & |\dj|, also implemented for |"D| \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% \verb="|= & disable ligature at this position \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"`| & for Serbian left double quotes (looks like ,,). \\
+% |"'| & for Serbian right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{serbian.ldf}}\label{tab:serbian-quote}
+% \end{center}
+% \end{table}
+%
+% Apart from defining shorthands we need to make sure taht the
+% first paragraph of each section is intended. Furthermore the
+% following new math operators are defined (|\tg|, |\ctg|,
+% |\arctg|, |\arcctg|, |\sh|, |\ch|, |\th|, |\cth|, |\arsh|,
+% |\arch|, |\arth|, |\arcth|, |\Prob|, |\Expect|, |\Variance|).
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{serbian}\captionsserbian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{serbian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@serbian| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@serbian\@undefined
+ \@nopatterns{Serbian}
+ \adddialect\l@serbian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Serbocroatian language.
+%
+% \begin{macro}{\captionsserbian}
+% The macro |\captionsserbian| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{serbian-1.0d}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsserbian{%
+ \def\prefacename{Predgovor}%
+ \def\refname{Literatura}%
+ \def\abstractname{Sa\v{z}etak}%
+ \def\bibname{Bibliografija}%
+ \def\chaptername{Glava}%
+ \def\appendixname{Dodatak}%
+ \def\contentsname{Sadr\v{z}aj}%
+ \def\listfigurename{Slike}%
+ \def\listtablename{Tabele}%
+ \def\indexname{Indeks}%
+ \def\figurename{Slika}%
+ \def\tablename{Tabela}%
+ \def\partname{Deo}%
+ \def\enclname{Prilozi}%
+ \def\ccname{Kopije}%
+ \def\headtoname{Prima}%
+ \def\pagename{Strana}%
+ \def\seename{Vidi}%
+ \def\alsoname{Vidi tako\dj e}%
+ \def\proofname{Dokaz}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateserbian}
+% The macro |\dateserbian| redefines the command |\today| to
+% produce Serbocroatian dates.
+% \begin{macrocode}
+\def\dateserbian{%
+ \def\today{\number\day .~\ifcase\month\or
+ januar\or februar\or mart\or april\or maj\or
+ juni\or juli\or avgust\or septembar\or oktobar\or novembar\or
+ decembar\fi \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasserbian}
+% \begin{macro}{\noextrasserbian}
+% The macro |\extrasserbian| will perform all the extra
+% definitions needed for the Serbocroatian language. The macro
+% |\noextrasserbian| is used to cancel the actions of
+% |\extrasserbian|.
+%
+% For Serbian the \texttt{"} character is made active. This is done
+% once, later on its definition may vary. Other languages in the
+% same document may also use the \texttt{"} character for
+% shorthands; we specify that the serbian group of shorthands
+% should be used.
+%
+% \changes{serbian-1.0b}{1998/06/16}{Introduced the active \texttt{"}}
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasserbian{\languageshorthands{serbian}}
+\addto\extrasserbian{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{serbian-1.0c}{1999/12/17}{Deactivate shorthands ouside of
+% Serbian}
+% \begin{macrocode}
+\addto\noextrasserbian{\bbl@deactivate{"}}
+% \end{macrocode}
+% First we define shorthands to facilitate the occurence of letters
+% such as \v{c}.
+% \begin{macrocode}
+\declare@shorthand{serbian}{"c}{\textormath{\v c}{\check c}}
+\declare@shorthand{serbian}{"d}{\textormath{\dj}{\dj}}%%
+\declare@shorthand{serbian}{"s}{\textormath{\v s}{\check s}}
+\declare@shorthand{serbian}{"z}{\textormath{\v z}{\check z}}
+\declare@shorthand{serbian}{"C}{\textormath{\v C}{\check C}}
+\declare@shorthand{serbian}{"D}{\textormath{\DJ}{\DJ}}%%
+\declare@shorthand{serbian}{"S}{\textormath{\v S}{\check S}}
+\declare@shorthand{serbian}{"Z}{\textormath{\v Z}{\check Z}}
+% \end{macrocode}
+%
+% Then we define access to two forms of quotation marks, similar
+% to the german and french quotation marks.
+% \begin{macrocode}
+\declare@shorthand{serbian}{"`}{%
+ \textormath{\quotedblbase{}}{\mbox{\quotedblbase}}}
+\declare@shorthand{serbian}{"'}{%
+ \textormath{\textquotedblleft{}}{\mbox{\textquotedblleft}}}
+\declare@shorthand{serbian}{"<}{%
+ \textormath{\guillemotleft{}}{\mbox{\guillemotleft}}}
+\declare@shorthand{serbian}{">}{%
+ \textormath{\guillemotright{}}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behave a little different from |\-|.
+% \changes{serbian-1.0d}{2000/09/20}{Changed definition of \texttt{"-}
+% to be the same as for other languages}
+% \begin{macrocode}
+\declare@shorthand{serbian}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{serbian}{""}{\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{serbian}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bbl@frenchindent}
+% \begin{macro}{\bbl@nonfrenchindent}
+% In Serbian the first paragraph of each section should be indented.
+% Add this code only in \LaTeX.
+% \begin{macrocode}
+\ifx\fmtname plain \else
+ \let\@aifORI\@afterindentfalse
+ \def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue}
+ \def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
+ \@afterindentfalse}
+ \addto\extrasserbian{\bbl@frenchindent}
+ \addto\noextrasserbian{\bbl@nonfrenchindent}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\mathserbian}
+% Some math functions in Serbian math books have other names:
+% e.g. |sinh| in Serbian is written as |sh| etc. So we define a
+% number of new math operators.
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits} % same as \sinh
+\def\ch{\mathop{\operator@font ch}\nolimits} % same as \cosh
+\def\th{\mathop{\operator@font th}\nolimits} % same as \tanh
+\def\cth{\mathop{\operator@font cth}\nolimits} % same as \coth
+\def\arsh{\mathop{\operator@font arsh}\nolimits}
+\def\arch{\mathop{\operator@font arch}\nolimits}
+\def\arth{\mathop{\operator@font arth}\nolimits}
+\def\arcth{\mathop{\operator@font arcth}\nolimits}
+\def\tg{\mathop{\operator@font tg}\nolimits} % same as \tan
+\def\ctg{\mathop{\operator@font ctg}\nolimits} % same as \cot
+\def\arctg{\mathop{\operator@font arctg}\nolimits} % same as \arctan
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\def\Prob{\mathop{\mathsf P\hskip0pt}\nolimits}
+\def\Expect{\mathop{\mathsf E\hskip0pt}\nolimits}
+\def\Variance{\mathop{\mathsf D\hskip0pt}\nolimits}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{serbian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/serbian.ins b/Master/texmf-dist/source/generic/babel/serbian.ins
new file mode 100644
index 00000000000..137084466d2
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/serbian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/03/13}
+\def\batchfile{serbian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\usedir{tex/generic/babel}
+\keepsilent
+
+\usepreamble\mainpreamble
+
+\generate{\file{serbian.ldf}{\from{serbian.dtx}{code}}}
+
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.fd}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/slovak.dtx b/Master/texmf-dist/source/generic/babel/slovak.dtx
new file mode 100644
index 00000000000..8b47f53b86e
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/slovak.dtx
@@ -0,0 +1,417 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{402}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{slovak.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{slovak}
+%\fi
+%\ProvidesFile{slovak.dtx}
+ [2005/03/31 v1.3a Slovak support from the babel system]
+%\iffalse
+%% File `slovak.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Slovak Language Definition File
+%% Copyright (C) 1989 - 2001
+%% by Jana Chlebikova
+% Department of Artificial Intelligence
+% Faculty of Mathematics and Physics
+% Mlynska dolina
+% 84215 Bratislava
+% Slovakia
+% (42)(7) 720003 l. 835
+% (42)(7) 725882
+% chlebikj at mff.uniba.cs (Internet)
+% and Johannes Braams, TeXniek
+%
+%% Copyright (C) 2002-2005
+%% by Tobias Schlemmer
+% Braunsdorfer Stra\ss e 101
+% 01159 Dresden
+% Deutschland
+% Tobias.Schlemmer at web.de
+%
+%% Please report errors to: J.L. Braams babel at braams.cistron.nl
+%% Tobias Schlemmer Tobias.Schlemmer at web.de
+%
+% This file is part of the babel system, it provides the source
+% code for the Slovak language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{slovak.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{slovak.dtx}
+%
+% \changes{slovak-1.0}{1992/07/15}{First version}
+% \changes{slovak-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{slovak-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{slovak-1.2i}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{slovak-1.3a}{2004/02/20}{Added contributed shorthand
+% definitions}
+%
+% \section{The Slovak language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was written by Jana Chlebikova
+% (\texttt{chlebik@euromath.dk}) and modified by Tobias Schlemmer
+% (\texttt{Tobias.Schlemmer@web.de}).} defines all the
+% language-specific macros for the Slovak language.
+%
+% For this language the macro |\q| is defined. It was used with the
+% letters (\texttt{t}, \texttt{d}, \texttt{l}, and \texttt{L}) and
+% adds a \texttt{'} to them to simulate a `hook' that should be
+% there. The result looks like t\kern-2pt\char'47. Since the the T1
+% font encoding has the corresponding characters it is mapped to |\v|.
+% Therefore we recommend using T1 font encoding. If you don't want to
+% use this encoding, please, feel free to redefine |\q| in your file.
+% I think babel will honour this |;-)|.
+%
+% For this language the characters |"|, |'| and |^| are ade
+% active. In table~\ref{tab:slovak-quote} an overview is given of
+% its purpose. Also the vertical placement of the
+% umlaut can be controlled this way.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"a| & |\"a|, also implemented for the other
+% lowercase and uppercase vowels. \\
+% |^d| & |\q d|, also implemented for l, t and L. \\
+% |^c| & |\v c|, also implemented for C, D, N, n, T, Z and z. \\
+% |^o| & |\^o|, also implemented for O. \\
+% |'a| & |\'a|, also implemented for the other lowercase and
+% uppercase l, r, y and vowels. \\
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"~| & for a compound word mark without a breakpoint. \\
+% |"=| & for a compound word mark with a breakpoint, allowing
+% hyphenation in the composing words. \\
+% |"`| & for German left double quotes (looks like ,,). \\
+% |"'| & for German right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{slovak.ldf}}\label{tab:slovak-quote}
+% \end{center}
+% \end{table}
+%
+% The quotes in table~\ref{tab:slovak-quote} can also be typeset by
+% using the commands in table~\ref{tab:smore-quote}.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |\glqq| & for German left double quotes (looks like ,,). \\
+% |\grqq| & for German right double quotes (looks like ``). \\
+% |\glq| & for German left single quotes (looks like ,). \\
+% |\grq| & for German right single quotes (looks like `). \\
+% |\flqq| & for French left double quotes (similar to $<<$). \\
+% |\frqq| & for French right double quotes (similar to $>>$).\\
+% |\flq| & for (French) left single quotes (similar to $<$). \\
+% |\frq| & for (French) right single quotes (similar to $>$). \\
+% |\dq| & the original quotes character (|"|). \\
+% |\sq| & the original single quote (|'|). \\
+% \end{tabular}
+% \caption{More commands which produce quotes, defined
+% by \file{slovak.ldf}}\label{tab:smore-quote}
+% \end{center}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{slovak-1.2i}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{slovak}\captionsslovak
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{slovak} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@slovak| to see whether we have to do something here.
+%
+% \changes{slovak-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@slovak\@undefined
+ \@nopatterns{Slovak}
+ \adddialect\l@slovak0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Slovak language.
+%
+% \begin{macro}{\captionsslovak}
+% The macro |\captionsslovak| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{slovak-1.2g}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{slovak-1.2k}{1999/02/28}{Repaired a few spelling mistakes}
+% \changes{slovak-1.2l}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsslovak{%
+ \def\prefacename{\'Uvod}%
+ \def\refname{Referencie}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literat\'ura}%
+ \def\chaptername{Kapitola}%
+ \def\appendixname{Dodatok}%
+ \def\contentsname{Obsah}%
+ \def\listfigurename{Zoznam obr\'azkov}%
+ \def\listtablename{Zoznam tabuliek}%
+ \def\indexname{Index}%
+ \def\figurename{Obr\'azok}%
+ \def\tablename{Tabu\q lka}%%% special letter l with hook
+ \def\partname{\v{C}as\q t}%%% special letter t with hook
+ \def\enclname{Pr\'{\i}lohy}%
+ \def\ccname{CC}%
+ \def\headtoname{Komu}%
+ \def\pagename{Strana}%
+ \def\seename{vi\q d}%%% Special letter d with hook
+ \def\alsoname{vi\q d tie\v z}%%% Special letter d with hook
+ \def\proofname{D\^okaz}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateslovak}
+% The macro |\dateslovak| redefines the command |\today| to produce
+% Slovak dates.
+% \changes{slovak-1.2j}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{slovak-1.2j}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \changes{slovak-1.2k}{1999/02/28}{Repaired a spelling mistake}
+% \begin{macrocode}
+\def\dateslovak{%
+ \def\today{\number\day.~\ifcase\month\or
+ janu\'ara\or febru\'ara\or marca\or apr\'{\i}la\or m\'aja\or
+ j\'una\or j\'ula\or augusta\or septembra\or okt\'obra\or
+ novembra\or decembra\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasslovak}
+% \begin{macro}{\noextrasslovak}
+% The macro |\extrasslovak| will perform all the extra definitions
+% needed for the Slovak language. The macro |\noextrasslovak| is
+% used to cancel the actions of |\extrasslovak|.
+% For Slovak three characters are used to define shorthands, they
+% need to be made active.
+% \changes{slovak-1.3a}{2004/02/20}{Make three characters available
+% for shorthands}
+%
+% \begin{macrocode}
+\addto\extrasslovak{\languageshorthands{slovak}}
+\initiate@active@char{^}
+\addto\extrasslovak{\bbl@activate{^}}
+\addto\noextrasslovak{\bbl@deactivate{^}}
+\initiate@active@char{"}
+\addto\extrasslovak{\bbl@activate{"}\umlautlow}
+\addto\noextrasslovak{\bbl@deactivate{"}\umlauthigh}
+\initiate@active@char{'}
+\@ifpackagewith{babel}{activeacute}{%
+ \addto\extrasslovak{\bbl@activate{'}}
+ \addto\noextrasslovak{\bbl@deactivate{'}}%
+ }{}
+% \end{macrocode}
+%
+%
+% \changes{slovak-1.2e}{1995/05/28}{Use \LaTeX's \cs{v} accent
+% command}
+% \begin{macrocode}
+\addto\extrasslovak{\babel@save\q\let\q\v}
+% \end{macrocode}
+%
+% \changes{slovak-1.2b}{1994/06/04}{Added setting of left- and
+% righthyphenmin}
+%
+% The slovak hyphenation patterns should be used with
+% |\lefthyphenmin| set to~2 and |\righthyphenmin| set to~2.
+% \changes{slovak-1.2e}{1995/05/28}{Now use \cs{slovakhyphenmins}}
+% \changes{slovak-1.2l}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\sq{'}
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% In order to prevent problems with the active |^| we add a
+% shorthand on system level which expands to a `normal |^|.
+% \begin{macrocode}
+\declare@shorthand{system}{^}{\csname normal@char\string^\endcsname}
+% \end{macrocode}
+%
+% Now we can define the doublequote macros: the umlauts,
+% \begin{macrocode}
+\declare@shorthand{slovak}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
+\declare@shorthand{slovak}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
+\declare@shorthand{slovak}{"u}{\textormath{\"{u}\allowhyphens}{\ddot u}}
+\declare@shorthand{slovak}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
+\declare@shorthand{slovak}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
+\declare@shorthand{slovak}{"U}{\textormath{\"{U}\allowhyphens}{\ddot U}}
+% \end{macrocode}
+% tremas,
+% \begin{macrocode}
+\declare@shorthand{slovak}{"e}{\textormath{\"{e}\allowhyphens}{\ddot e}}
+\declare@shorthand{slovak}{"E}{\textormath{\"{E}\allowhyphens}{\ddot E}}
+\declare@shorthand{slovak}{"i}{\textormath{\"{\i}\allowhyphens}%
+ {\ddot\imath}}
+\declare@shorthand{slovak}{"I}{\textormath{\"{I}\allowhyphens}{\ddot I}}
+% \end{macrocode}
+% other slovak characters
+% \begin{macrocode}
+\declare@shorthand{slovak}{^c}{\textormath{\v{c}\allowhyphens}{\check{c}}}
+\declare@shorthand{slovak}{^d}{\textormath{\q{d}\allowhyphens}{\check{d}}}
+\declare@shorthand{slovak}{^l}{\textormath{\q{l}\allowhyphens}{\check{l}}}
+\declare@shorthand{slovak}{^n}{\textormath{\v{n}\allowhyphens}{\check{n}}}
+\declare@shorthand{slovak}{^o}{\textormath{\^{o}\allowhyphens}{\hat{o}}}
+\declare@shorthand{slovak}{^s}{\textormath{\v{s}\allowhyphens}{\check{s}}}
+\declare@shorthand{slovak}{^t}{\textormath{\q{t}\allowhyphens}{\check{t}}}
+\declare@shorthand{slovak}{^z}{\textormath{\v{z}\allowhyphens}{\check{z}}}
+\declare@shorthand{slovak}{^C}{\textormath{\v{C}\allowhyphens}{\check{C}}}
+\declare@shorthand{slovak}{^D}{\textormath{\v{D}\allowhyphens}{\check{D}}}
+\declare@shorthand{slovak}{^L}{\textormath{\q{L}\allowhyphens}{\check{L}}}
+\declare@shorthand{slovak}{^N}{\textormath{\v{N}\allowhyphens}{\check{N}}}
+\declare@shorthand{slovak}{^O}{\textormath{\^{O}\allowhyphens}{\hat{O}}}
+\declare@shorthand{slovak}{^S}{\textormath{\v{S}\allowhyphens}{\check{S}}}
+\declare@shorthand{slovak}{^T}{\textormath{\v{T}\allowhyphens}{\check{T}}}
+\declare@shorthand{slovak}{^Z}{\textormath{\v{Z}\allowhyphens}{\check{Z}}}
+% \end{macrocode}
+% acute accents,
+% \begin{macrocode}
+\@ifpackagewith{babel}{activeacute}{%
+ \declare@shorthand{slovak}{'a}{\textormath{\'a\allowhyphens}{^{\prime}a}}
+ \declare@shorthand{slovak}{'e}{\textormath{\'e\allowhyphens}{^{\prime}e}}
+ \declare@shorthand{slovak}{'i}{\textormath{\'\i{}\allowhyphens}{^{\prime}i}}
+ \declare@shorthand{slovak}{'l}{\textormath{\'l\allowhyphens}{^{\prime}l}}
+ \declare@shorthand{slovak}{'o}{\textormath{\'o\allowhyphens}{^{\prime}o}}
+ \declare@shorthand{slovak}{'r}{\textormath{\'r\allowhyphens}{^{\prime}r}}
+ \declare@shorthand{slovak}{'u}{\textormath{\'u\allowhyphens}{^{\prime}u}}
+ \declare@shorthand{slovak}{'y}{\textormath{\'y\allowhyphens}{^{\prime}y}}
+ \declare@shorthand{slovak}{'A}{\textormath{\'A\allowhyphens}{^{\prime}A}}
+ \declare@shorthand{slovak}{'E}{\textormath{\'E\allowhyphens}{^{\prime}E}}
+ \declare@shorthand{slovak}{'I}{\textormath{\'I\allowhyphens}{^{\prime}I}}
+ \declare@shorthand{slovak}{'L}{\textormath{\'L\allowhyphens}{^{\prime}l}}
+ \declare@shorthand{slovak}{'O}{\textormath{\'O\allowhyphens}{^{\prime}O}}
+ \declare@shorthand{slovak}{'R}{\textormath{\'R\allowhyphens}{^{\prime}R}}
+ \declare@shorthand{slovak}{'U}{\textormath{\'U\allowhyphens}{^{\prime}U}}
+ \declare@shorthand{slovak}{'Y}{\textormath{\'Y\allowhyphens}{^{\prime}Y}}
+ \declare@shorthand{slovak}{''}{%
+ \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
+ }{}
+% \end{macrocode}
+% german and french quotes,
+% \begin{macrocode}
+\declare@shorthand{slovak}{"`}{\glqq}
+\declare@shorthand{slovak}{"'}{\grqq}
+\declare@shorthand{slovak}{"<}{\flqq}
+\declare@shorthand{slovak}{">}{\frqq}
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{slovak}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{slovak}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}}
+\declare@shorthand{slovak}{""}{\hskip\z@skip}
+\declare@shorthand{slovak}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{slovak}{"=}{\nobreak-\hskip\z@skip}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{slovak-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{slovak}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/slovak.ins b/Master/texmf-dist/source/generic/babel/slovak.ins
new file mode 100644
index 00000000000..3a007b7c3c7
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/slovak.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{slovak.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{slovak.ldf}{\from{slovak.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/slovene.dtx b/Master/texmf-dist/source/generic/babel/slovene.dtx
new file mode 100644
index 00000000000..391f39e7f9d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/slovene.dtx
@@ -0,0 +1,302 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{142}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{slovene.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{slovene}
+%\fi
+%\ProvidesFile{slovene.dtx}
+ [2005/03/31 v1.2m Slovene support from the babel system]
+%\iffalse
+%% File `slovene.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Slovenian language definition file. The Slovenian
+% words were contributed by Danilo Zavrtanik, University of
+% Ljubljana (Slovenia, former Yugoslavia).
+% The usage of the active " was introduced by
+% Leon \v{Z}lajpah
+% Jo\v{z}ef Stefan Institute,
+% Jamova 39, Ljubljana,
+% Slovenia
+% e-mail: leon.zlajpah at ijs.si
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{{textsf \1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{slovene.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{slovene.dtx}
+%
+% \changes{slovene-1.0a}{1991/07/15}{Renamed babel.sty in babel.com}
+% \changes{slovene-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{slovene-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{slovene-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{slovene-1.2i}{1995/11/03}{Replaced `Slovanian' with correct
+% `Slovenian'}
+% \changes{slovene-1.2i}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Slovenian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Danilo Zavrtanik,
+% University of Ljubljana (YU) and Leon \v{Z}lajpah
+% (\texttt{leon.zlajpah@ijs.si}).} defines all the
+% language-specific macros for the Slovenian language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:slovene-quote} an overview is given of its
+% purpose. One of the reasons for this is that in the Slovene
+% language some special characters are used.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"c| & |\"c|, also implemented for the
+% lowercase and uppercase s and z. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"`| & for Slovene left double quotes (looks like ,,). \\
+% |"'| & for Slovene right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$).\\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{slovene.ldf}}\label{tab:slovene-quote}
+% \end{center}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{slovene-1.2i}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{slovene}\captionsslovene
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{slovene} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@slovene| to see whether we have to do something here.
+%
+% \changes{slovene-1.0b}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{slovene-1.1}{1992/02/16}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{slovene-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@slovene\@undefined
+ \@nopatterns{Slovene}
+ \adddialect\l@slovene0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the
+% Slovenian language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsslovene}
+% The macro |\captionsslovene| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{slovene-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{slovene-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{slovene-1.2b}{1994/06/04}{Added extra translations from
+% Josef Leydold, \texttt{leydold@statrix2.wu-wien.ac.at}}
+% \changes{slovene-1.2g}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{slovene-1.2h}{1995/07/25}{Added translation of `Proof'}
+% \changes{slovene-1.2m}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsslovene{%
+ \def\prefacename{Predgovor}%
+ \def\refname{Literatura}%
+ \def\abstractname{Povzetek}%
+ \def\bibname{Literatura}%
+ \def\chaptername{Poglavje}%
+ \def\appendixname{Dodatek}%
+ \def\contentsname{Kazalo}%
+ \def\listfigurename{Slike}%
+ \def\listtablename{Tabele}%
+ \def\indexname{Stvarno kazalo}% used to be Indeks
+ \def\figurename{Slika}%
+ \def\tablename{Tabela}%
+ \def\partname{Del}%
+ \def\enclname{Priloge}%
+ \def\ccname{Kopije}%
+ \def\headtoname{Prejme}%
+ \def\pagename{Stran}%
+ \def\seename{glej}%
+ \def\alsoname{glej tudi}%
+ \def\proofname{Dokaz}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateslovene}
+% The macro |\dateslovene| redefines the command |\today| to
+% produce Slovenian dates.
+% \changes{slovene-1.2j}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{slovene-1.2j}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\dateslovene{%
+ \def\today{\number\day.~\ifcase\month\or
+ januar\or februar\or marec\or april\or maj\or junij\or
+ julij\or avgust\or september\or oktober\or november\or december\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasslovene}
+% \begin{macro}{\noextrasslovene}
+% The macro |\extrasslovene| performs all the extra definitions
+% needed for the Slovenian language. The macro |\noextrasslovene|
+% is used to cancel the actions of |\extrasslovene|.
+%
+% For Slovene the \texttt{"} character is made active. This is done
+% once, later on its definition may vary. Other languages in the
+% same document may also use the \texttt{"} character for
+% shorthands; we specify that the slovenian group of shorthands
+% should be used.
+%
+% \changes{slovene-1.2f}{1995/06/04}{Introduced the active \texttt{"}}
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasslovene{\languageshorthands{slovene}}
+\addto\extrasslovene{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{slovene-1.2l}{1999/12/17}{Deactivate shorthands ouside of
+% Slovene}
+% \begin{macrocode}
+\addto\noextrasslovene{\bbl@deactivate{"}}
+% \end{macrocode}
+% First we define shorthands to facilitate the occurence of letters
+% such as \v{c}.
+% \changes{slovene-1.2i}{1996/09/21}{removed shorthand for \texttt{"L}
+% as it is not needed for slovenian}
+% \begin{macrocode}
+\declare@shorthand{slovene}{"c}{\textormath{\v c}{\check c}}
+\declare@shorthand{slovene}{"s}{\textormath{\v s}{\check s}}
+\declare@shorthand{slovene}{"z}{\textormath{\v z}{\check z}}
+\declare@shorthand{slovene}{"C}{\textormath{\v C}{\check C}}
+\declare@shorthand{slovene}{"S}{\textormath{\v S}{\check S}}
+\declare@shorthand{slovene}{"Z}{\textormath{\v Z}{\check Z}}
+% \end{macrocode}
+%
+% Then we define access to two forms of quotation marks, similar
+% to the german and french quotation marks.
+% \changes{slovene-1.2j}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{slovene}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{slovene}{"'}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\declare@shorthand{slovene}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{slovene}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behavew a little different from |\-|.
+% \begin{macrocode}
+\declare@shorthand{slovene}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{slovene}{""}{\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{slovene}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{slovene-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{slovene}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/slovene.ins b/Master/texmf-dist/source/generic/babel/slovene.ins
new file mode 100644
index 00000000000..86760a5e13f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/slovene.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{slovene.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{slovene.ldf}{\from{slovene.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/sorbian.ins b/Master/texmf-dist/source/generic/babel/sorbian.ins
new file mode 100644
index 00000000000..c329cad27b2
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/sorbian.ins
@@ -0,0 +1,149 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{sorbian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{lsorbian.ldf}{\from{lsorbian.dtx}{code}}
+ \file{usorbian.ldf}{\from{usorbian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/spanish.dtx b/Master/texmf-dist/source/generic/babel/spanish.dtx
new file mode 100644
index 00000000000..232c2436479
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/spanish.dtx
@@ -0,0 +1,2638 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{2195}
+% \ProvidesFile{spanish.dtx}
+% [2004/02/20 v4.2b Spanish support from the babel system]
+%\iffalse
+%% File `spanish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2004
+%% by Johannes Braams, TeXniek
+%
+%% Spanish Language Definition File
+%% Copyright (C) 1997 - 2005
+%% by Javier Bezos (jbezos at wanadoo.es)
+%% Apartado 116.035
+%% E-28080 Madrid
+%% Espa\~na / Espagne
+%% and
+%% by CervanTeX (www.cervantex.org)
+%
+%% Please report errors to: Javier Bezos (preferably)
+%% jbezos at wanadoo.es
+%% J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Spanish language definition file.
+% The original version of this file was written by Javier Bezos.
+%
+%<*filedriver>
+\documentclass[spanish,a4paper]{ltxdoc}
+\usepackage[activeacute]{babel}
+
+%\usepackage{ps}
+
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+
+\setlength{\arrayrulewidth}{2\arrayrulewidth}
+\newcommand\toprule{\cline{1-2}\\[-2ex]}
+\newcommand\botrule{\\[.6ex]\cline{1-2}}
+\newcommand\hmk{$\string|$}
+
+\newcommand\New[1]{%
+ \leavevmode\marginpar{\raggedleft\sffamily Nuevo en #1}}
+
+\newcommand\nm[1]{\unskip\,$^{#1}$}
+\newcommand\nt[1]{\quad$^{#1}$\,\ignorespaces}
+
+\makeatletter
+ \renewcommand\@biblabel{}
+\makeatother
+
+\newcommand\DOT[1]{\lsc{DOT},~#1}
+\newcommand\DTL[1]{\lsc{DTL},~#1}
+\newcommand\MEA[1]{\lsc{MEA},~#1}
+
+\raggedright
+\setlength{\parindent}{1em}
+
+\addtolength{\oddsidemargin}{-2pc}
+\addtolength{\textwidth}{4pc}
+
+\OnlyDescription
+\begin{document}
+ \DocInput{spanish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \begingroup
+%
+% \catcode`\{=11
+% \catcode`\[=1
+%
+% \gdef\ignoringuser[^^A
+% \bgroup
+% \let\end{userdtx\fi
+% \let\end{userdrv\fi
+% \aftergroup\endgroup
+% \catcode`\{=11
+% \catcode`f=14 ^^A kills \if... and \fi
+% \catcode`l=14 ^^A kills \else
+% \catcode`o=14 ^^A kills \or
+% \catcode`p=14 ^^A kills \repeat
+% \iffalse}
+%
+% \endgroup
+%
+% \newenvironment{userdtx}
+% {\ifx\langdeffile\undefined
+% \else\expandafter\ignoringuser
+% \fi}{}
+%
+% \newenvironment{userdrv}
+% {\ifx\langdeffile\undefined
+% \expandafter\ignoringuser
+% \else\fi}{}
+%
+% \begin{userdtx}
+%^^A ======= Beginning of text as typeset by spanish.dtx =========
+%
+% \title{Estilo \textsf{spanish}\\
+% para el sistema \babel.\footnote{Este
+% archivo est\'a actualmente en la versi\'on
+% 4.2b con fecha 12 de septiembre del 2003. ^^A@#
+% Esta copia del manual se compuso el~\today.}}
+%
+% \author{Javier Bezos\footnote{Por favor, env\'{\i}en
+% comentarios y sugerencias a \texttt{jbezos@wanadoo.es}
+% o a mi direcci\'on postal: Apartado 116.035, E-28080 Madrid,
+% Espa'na / Espagne. Han colaborado de una u otra forma muchas
+% personas, a las cuales agradezco sus comentarios y sugerencias.
+% Para m'as informaci'on sobre los criterios seguidos, v'ease la
+% referencia: Javier Bezos, \textit{Tipograf'ia espa'nola con
+% \TeX.} Para informaci'on sobre actualizaciones:
+% http://www.cervantex.org/}}
+%
+% \date{12 de septiembre del 2003} ^^A@#
+%
+% \maketitle
+%
+% {\small\tableofcontents}
+%
+%% \section{\textsf{spanish} como lengua principal}
+%
+% En \babel{} se considera que la 'ultima lengua citada en |\usepackage| y
+% |\documentclass|, por este orden, es la lengua principal. Si la
+% lengua principal es |spanish|, \New{4.1} se activa el grupo
+% |\layoutspanish| que adapta varios elementos
+% a los usos tipogr'aficos espa'noles del siguiente modo:
+%
+% \begin{itemize}
+%
+% \item[$\diamond$]
+% |enumerate| e |itemize|\\[1ex]
+%
+% El primero usa la siguiente secuencia:\,\footnote{No hay raz'on
+% concreta para ella. Es tan s'olo una f'ormula de compromiso.}\\
+% \quad 1.\\
+% \qquad \emph{a})\\
+% \quad\qquad 1)\\
+% \qquad\qquad \emph{a$'$})\\
+% El segundo la siguiente:\\
+% \quad\leavevmode\hbox to 1.2ex
+% {\hss\vrule height .95ex width .8ex depth -.15ex\hss}\\
+% \qquad\textbullet\\
+% \quad\qquad $\circ$\\
+% \qquad\qquad $\diamond$
+%
+% \New{4.2}Dos 'ordenes permiten otros estilos en
+% |itemize|: con |\spanishdashitems| se cambia a rayas en todos los
+% niveles, y con |\spanishsignitems|, a \textbullet{} $\circ$
+% $\diamond$ $\triangleright$.
+%
+% \item[$\diamond$]
+% |\alph| y |\Alph|\\[1ex]
+%
+% Incluyen la e'ne.
+%
+% \item[$\diamond$]
+% |\fnsymbol|\\[1ex]
+%
+% Se emplean uno, dos, tres... asteriscos (*, **, ***, etc.),
+% en lugar de la sucesi'on angloamericana de cruces, barras,
+% etc.\footnote{\DOT{162}.}
+%
+% \item[$\diamond$]
+% |\guillemotleft| y |\guillemotright|\\[1ex]
+%
+% Las comillas latinas para |OT1| son menos angulosas y se generan
+% con unas puntas de flecha de |lasy|.
+%
+% \item[$\diamond$]
+% |\roman|\\[1ex]
+%
+% Como en castellano no se usan n'umeros romanos
+% en min'uscula, |\roman| se redefine para que los d'e en
+% versalitas.\footnote{\DTL{197}. Los n'umeros romanos con
+% versalitas son desconocidos en ingl'es, donde se prefiere
+% la min'uscula. En la Europa continental, la situaci'on es
+% justamente la opuesta.}
+%
+% \begin{quote}\small
+% \textbf{Nota.} MakeIndex no puede entender la forma en que
+% |\roman| escribe el n'umero de p'agina, por lo
+% que elimina las l'ineas afectadas. Por ello el archivo |.idx|
+% ha de ser convertido antes de procesarlo con MakeIndex.
+% Con este paquete se proporciona la utilidad |romanidx.tex| que se
+% encarga de ello. Simplemente se compone ese archivo con \LaTeX{}
+% y a continuaci'on se responde a las preguntas que se formulan.
+% Este proceso no es necesario si no se introdujo ninguna
+% entrada de 'indice en p'aginas numeradas con |\roman| (lo cual ser'a
+% lo m'as normal). Si un s'imbolo propio de \emph{MakeIndex} generara
+% problemas, debe encerrarse entre llaves: \verb={"|}=.
+% \end{quote}
+%
+% \item[$\diamond$]
+% |\section|, |\subsection|, etc.\\[1ex]
+%
+% Los n'umeros en los t'itulos est'an seguidos de un punto
+% tanto en el texto como en el 'indice. Adem'as,
+% el primer p'arrafo tras el t'itulo no elimina la sangr'ia
+% (de nuevo, una costumbre angloamericana).
+%
+% \end{itemize}
+%
+% Estos cambios funcionan con las clases est'andar ~---con otras
+% tal vez alguno de ellos no tenga efecto--- y persisten durante
+% todo el documento (no se pueden desactivar). Ninguno de ellos
+% es necesario para componer el documento, aunque naturalmente el
+% resultado ser'a distinto.
+%
+% \begin{itemize}
+%
+% \item[$\diamond$]
+% |\selectspanish*|\\[1ex]
+%
+% \New{4.1}Si no se desean estos cambios, basta con usar en el
+% pre'ambulo |\selectspanish*| (con asterisco) o <<borrarlos>> con:
+%\begin{verbatim}
+% \let\layoutspanish\relax
+%\end{verbatim}
+%
+% \end{itemize}
+%
+% \section{Descripci'on}
+%
+% \subsection{Traducciones}
+%
+% Ciertas 'ordenes se definen para
+% proporcionar traducciones al castellano de algunos t'erminos, tal
+% y como se describe en el cuadro 1.
+%
+% \begin{table}
+% \center\small
+% \caption{Traducciones}
+% \vspace{1.5ex}
+% \begin{tabular}{l@{\hspace{3em}}l}
+% \toprule
+% |\refname| & Referencias\\
+% |\abstractname| & Resumen\\
+% |\bibname| & Bibliograf'ia\\
+% |\chaptername| & Cap'itulo\\
+% |\appendixname| & Ap'endice\\
+% |\contentsname| & 'Indice general\nm{a}\\
+% |\listfigurename| & 'Indice de figuras\\
+% |\listtablename| & 'Indice de cuadros\\
+% |\indexname| & 'Indice alfab'etico\\
+% |\figurename| & Figura\\
+% |\tablename| & Cuadro\\
+% |\partname| & Parte\\
+% |\enclname| & Adjunto\\
+% |\ccname| & Copia a\\
+% |\headtoname| & A\\
+% |\pagename| & P'agina\\
+% |\seename| & v'ease\\
+% |\alsoname| & v'ease tambi'en\\
+% |\proofname| & Demostraci'on
+% \botrule
+% \end{tabular}
+%
+% \vspace{1.5ex}
+%
+% \begin{minipage}{6cm}\footnotesize
+% \nt{a} Pero s'olo <<'Indice>> en \textsf{article}.
+% \end{minipage}
+% \end{table}
+%
+% No existe una terminolog'ia unificada.
+% Tal vez \emph{'Indice general} es lo
+% que m'as se usa para el 'indice de los cap'itulos, as'i que a
+% ello me atengo salvo en |article|, donde se compone como secci'on
+% y por tanto resulta algo ostentoso.\footnote{Al contrario que en
+% ingl'es, en castellano el 'indice por antonomasia es el general.}
+%
+% Para el 'indice alfab'etico se ha propuesto \emph{'Indice de
+% materias} o \emph{'Indice anal'itico}, aunque
+% estos 'indices no solamente suelen incluir
+% materias, sino tambi'en nombres; \emph{'Indice alfab'etico} es
+% m'as preciso.\footnote{Es la usada en \DOT{300} as'i
+% como en la mayor'ia de los libros que consult'e al azar en una
+% biblioteca.}
+%
+% En cuanto a los de cuadros y figuras, tambi'en es posible decir
+% \emph{lista}, pero me parece preferible \emph{'indice}, que
+% implica la correspondencia con las p'aginas.
+%
+% Para traducir \emph{table} es mejor \emph{cuadro}, ya que
+% \emph{tabla} es un \emph{falso amigo};\,\footnote{V'eanse las
+% definiciones del \lsc{DRAE} y \DTL{67 ss.}} esa es la pr'actica
+% tradicional. (Por ejemplo, <<cuadro de estados medievales>>
+% frente a <<tabla de logaritmos>>.)
+%
+% Las traducciones se escriben de min'usculas, salvo la inicial.
+% Se evita el anglicismo de comenzar en
+% may'usculas los sustantivos.\footnote{\DOT{197}.}
+%
+% La orden |\today| da la fecha actual. \New{4.2}Aunque al citar
+% a'nos posteriores a 1999 la Academia s'olo admite la supresi'on del
+% art'iculo en cartas y documentos, en la pr'actica se ha extendido
+% esta construcci'on agramatical y as'i se hace aqu'i. Con
+% |\spanishdatedel| y |\spanishdatede| se opta por \textit{del}
+% (recomendado) o \textit{de} (predeterminado).
+%
+% \subsection{Abreviaciones}
+%
+% (Lo que en \babel{} se denomina `shorthands'.) La
+% lista completa se puede encontrar en el cuadro 2. En los
+% siguientes apartados se dar'an m'as detalles sobre algunas de
+% ellas.
+%
+% \begin{table}[!t]
+% \center\small
+% \caption{Abreviaciones}
+% \vspace{1.5ex}
+% \begin{tabular}{l@{\hspace{3em}}l}
+% \toprule
+% |'a 'e 'i 'o 'u| & 'a 'e 'i 'o 'u\\
+% |'A 'E 'I 'O 'U| & 'A 'E 'I 'O 'U\\
+% |'n 'N| & 'n 'N\nm{a}\\
+% |"u "U| & "u "U\\
+% |"a "A "o "O| & Ordinales: 1"a, 1"A, 1"o, 1"O\\
+%\llap{\textsf{Nuevo en 4.2 }}\relax
+% |"er "ER| & Ordinales: 1"er, 1"ER\\
+% |"c "C| & "c "C\nm{b}\\
+% |"rr "RR| & rr, pero -r cuando se divide\\
+% |"y| & El antiguo signo para <<y>>\\
+% |"-| & Como |\-|, pero permite m'as divisiones\\
+% |"=| & Como |-|, pero permite mas divisiones\nm{c}\\
+% |"~| & Gui'on estil'istico\nm{d}\\
+% |~- ~-- ~---| & Como |-|, |--| y |---|, pero sin divisi'on\\
+% |""| & Permite mas divisiones antes y despu'es\nm{e}\\
+% |"/| & Una barra algo m'as baja\\
+% \verb+"|+ & Divide un logotipo\nm{f}\\
+% |"< ">| & "< ">\\
+% |<< >>| & |\begin{quoting}| |\end{quoting}|\nm{g}\\
+% |?` !`| & ?` !`\nm{h}\\
+%\llap{\textsf{Nuevo en 4.2 }}\relax
+%|"? "!| & "? "! alineados con la linea base\nm{i}
+% \botrule
+% \end{tabular}
+%
+% \vspace{1.5ex}
+%
+% \begin{minipage}{11cm}
+% \footnotesize
+% \nt{a} La forma |~n| debe considerarse en extinci'on.
+% \nt{b} La cedilla ya no se usa, pero se us'o anta'no.
+% \nt{c} |"=| viene a ser lo mismo que |""-""|.
+% \nt{d} Esta abreviaci'on tiene un uso distinto
+% en otras lenguas. \nt{e} Como en <<entrada/salida>>.
+% \nt{f} Carece de uso en castellano. \nt{g} V'ease sec.~2.7.
+% \nt{h} No proporcionadas por este paquete, sino por cada tipo;
+% figuran aqu'i como simple recordatorio. \nt{i} 'Utiles en
+% r'otulos en may'usculas.
+% \end{minipage}
+% \end{table}
+%
+% Para poder usar ap'ostrofos como abreviaciones de acentos
+% es necesaria la opci'on |activeacute| en |\usepackage|.
+% Puede cambiarse este comportamiento con
+% la orden |\es@acuteactive| en el archivo de configuraci'on
+% |spanish.cfg|; en ese caso los ap'ostrofos se activan siempre.
+%
+% \New{4.1} La conjunci'on \textit{y} es de por s'i bastante breve,
+% por lo que en espa'nol no se han usado signos sustitutorios
+% desde hace varios siglos. Sin
+% embargo, existe un signo parecido a un dos dado la vuelta, que
+% desapareci'o tras el Renacimento y que se emplea hoy en ediciones
+% paleogr'aficas. Se puede <<imitar>> con |"y|, siempre que se
+% haya cargado el paquete |graphics|; de no ser as'i, se usa la letra
+% $\tau$, aunque la variante normal de \TeX{} no es demasiado
+% apropiada.
+%
+% Los caracteres usados como abreviaciones se comportan
+% como otras 'ordenes de \TeX{} y por tanto se hace caso
+% omiso de los espacios que le puedan seguir: \verb*|' a| es lo mismo
+% que |'a|. Eso tambi'en implica que tras esos caracteres no
+% puede ir una llave de cierre y que deber'a escribirse
+% |{... '{}}| en lugar de |{... '}|; en modo matem'atico no hay
+% problema y |$x^{a'}$| ($x^{a'}$) es v'alido. \New{4.1}
+%
+% \begin{itemize}
+%
+% \item[$\diamond$]
+% |\deactivatetilden|\\[1ex]
+%
+% Esta orden desactiva las abreviaciones |~n| y |~N| debido a
+% los problemas que presentan. Puede usarse en el archivo
+% de configuraci'on (v'ease m'as abajo).
+%
+% % \item[$\diamond$]
+% |\spanishdeactivate{<caracteres>}|\\[1ex]
+%
+% \New{4.1}Permite desactivar las abreviaciones correspondientes a los
+% caracteres dados. Para evitar entrar en conflicto con otras lenguas,
+% al salir de |spanish| se reactivan,\footnote{El punto para
+% los decimales no es estrictamente una abreviaci'on y no se
+% reactiva.} por lo que si se desea que
+% persista hay que a'nadir la orden a |\shorthandsspanish| con
+%|\addto|. La orden |\renewcommand\shorthandsspanish{}| es una
+% variante optimizada de
+%\begin{verbatim}
+% \addto\shorthandsspanish{\spanishdeactivate{.'"~<>}}
+%\end{verbatim}
+% y es lo recomendado si se desea
+% prescindir del mecanismo de abreviaciones.
+% \end{itemize}
+%
+% \subsection{Coma decimal}
+%
+% Tanto el ingl'es como el castellano y otras lenguas tienen sus
+% formas tradicionales de representar la coma decimal. En ingl'es
+% es algo como $12{\cdot}34$, mientras que en castellano
+% es $12$'$34$. Adem'as, los millares se pueden separar por coma en
+% ingl'es y punto en castellano.\footnote{Excepto en a'nos, donde
+% siempre se escriben las cifras juntas: \emph{1978, 1998}.}
+% Tales formas deben ser descartadas, pues se ha llegado a
+% una normalizaci'on internacional donde los millares se
+% separan por un espacio fino y los decimales con coma.\footnote{%
+% La ISO admite el punto en pa'ises donde haya sido esa
+% la tradici'on, aunque recomienda que se adapten a la coma.}
+%
+% Ya que \TeX\ usa la coma como separador en intervalos o expresiones
+% similares, lo que a'nade un espacio fino, \textsf{spanish}
+% convierte todo punto en modo matem'atico en
+% una coma siempre que est'e seguido de una cifra, pero no en otras
+% circunstancias:
+% \begin{quote}\small\begin{tabbing}
+% |$1\,234.567\,890$| \quad \= $1\,234.567\,890$\\
+% |$f(1,2)=12.34.$| \> $f(1,2)=12.34.$\\
+% |$1{.}000$| \> $1{.}000$, pero\\
+% |1.000| \> 1.000, pues no es modo matem'atico.
+% \end{tabbing}\end{quote}
+%
+% Las 'ordenes |\decimalcomma| y |\decimalpoint|
+% establecen si se usa una coma, que es el valor predeterminado,
+% o un punto, mientras que |\spanishdecimal{<math>}| permite darle
+% una definici'on arbitraria.\footnote{Internamente el mecanismo es
+% de una abreviaci'on, y se puede desactivar como las otras.
+% \textsf{Nuevo 4.2}}
+%
+% \subsection{Divisi'on de palabras}
+%
+% \textsf{Spanish} comprueba la
+% codificaci'on en el momento en que se usa un acento: si la
+% codificaci'on es |OT1| se toman medidas para facilitar
+% la divisi'on, que pese a todo nunca ser'a perfecta, mientras que con
+% |T1| se accede directamente al car'acter correspondiente.
+%
+% Para matizar la divisi'on de palabras hay cuatro posibilidades, dos
+% de ellas con el m'etodo de abreviaciones:
+% \begin{itemize}
+% \item la orden |\-| es un gui'on opcional que no permite
+% m'as divisiones,
+%
+% \item |"-| es similar pero permite m'as divisiones,
+%
+% \item un |-| es un gui'on que no permite m'as divisiones ni
+% antes ni despu'es, y
+%
+% \item |"=| es el equivalente que s'i las permite,\footnote{No
+% es una buena idea usar esta orden, pero en
+% medidas muy cortas puede resultar necesario.}
+%
+% \end{itemize}
+% Por ejemplo (con las posibles divisiones marcadas con \hmk):
+% \begin{quote}\small\begin{tabbing}
+% |Zaragoza-Barcelona|\qquad \= Zaragoza-\hmk Barcelona\\
+% |Zaragoza"=Barcelona| \>
+% Za\hmk ra\hmk go\hmk za-\hmk Bar\hmk ce\hmk lo\hmk na\\
+% |semi\-abierto| \> semi\hmk abierto\\
+% |semi"-abierto| \> se\hmk mi\hmk abier\hmk to.\footnotemark
+% \end{tabbing}\footnotetext{Justo antes y despu'es de
+% {\ttfamily\string"\string-} y {\ttfamily\string"\string=} se
+% aplican los correspondientes
+% valores de {\ttfamily\string\...hyphenmin} lo que implica que la
+% divis'on semia\hmk bierto no es posible.
+% 'Este es un comportamiento correcto.}
+% \end{quote}
+%
+% Adem'as. hay abreviaciones que evitan
+% divisiones: |~-|, que resulta 'util para expresar una serie de
+% n'umeros sin que el gui'on los divida (12~-14, |12~-14|), y |~---|,
+% que es la forma que debe usarse para abrir incisos con rayas, ya que
+% de lo contrario puede haber una divisi'on entre la raya de abrir y
+% la palabra que le sigue:
+% \begin{quote}\small\begin{tabbing}
+% |Los conciertos ~---o academias--- que organiz'o...|
+% \end{tabbing}\end{quote}
+% Mientras que este gui'on evita toda posible divisi'on en los
+% elementos que une, la raya (---) y la semirraya (--) las permiten
+% en las palabras que le precedan o le sigan.
+%
+% La abreviaci'on |"~| se usa cuando se quiere que el gui'on
+% tambi'en aparezca al comienzo de la siguiente l'inea. Por ejemplo:
+% \begin{quote}\small\begin{tabbing}
+% |infra"~rojo| \quad \= in\hmk fra-ro\hmk jo, pero infra-\hmk-rojo.
+% \end{tabbing}\end{quote}
+%
+% Otra abreviaci'on es |"rr| que sirve para el
+% 'unico cambio de escritura del castellano en caso de haber divisi'on.
+% La \lsc{RAE} indica que al a'nadir un prefijo que termina en vocal a
+% una palabra que comienza con \emph{r}, 'esta 'ultima debe
+% doblarse a menos que se unan por un gui'on. Por ejemplo:
+% \begin{quote}\small\begin{tabbing}
+% |extra"rradio| \quad \= ex\hmk trarra\hmk dio, pero extra-\hmk
+% radio.
+% \end{tabbing}\end{quote}
+% No hay acuerdo sobre si esta regla y otras similares han de
+% aplicarse o no, aunque la opini'on mayoritaria actual est'a en
+% contra.
+%
+% \subsection{Ordinales}
+%
+% Las abreviaturas siempre llevan punto, salvo algunas en que
+% se sustituye por una barra (y salvo las siglas y s'imbolos,
+% naturalmente), que precede a las letras voladitas.\footnote{Puede
+% comprobarse en \DTL{196}. V'ease tambi'en \DOT{222 y 227}.}
+% Por ello, \textsf{spanish} proporciona la orden
+% |\sptext| que facilita la creaci'on de estas abreviaturas. Por
+% ejemplo: |adm\sptext{'on}| que da adm\sptext{'on}. Hay seis abreviaciones
+% asociadas a ordinales: |"a|, |"A|, |"o|, |"O|, |"er| y |"ER| que equivalen a
+% |\sptext{a}|, etc.\footnote{Muchos tipos a'naden
+% un peque'no subrayado que debe evitarse, y por tanto no se debe
+% escribir los ordinales con \textsf{inputenc}.}
+%
+% Para ajustar el tama'no lo mejor posible, se usa el de
+% 'indices en curso. Esto funciona bien salvo para tama'nos muy
+% grandes o muy peque'nos, donde los resultados son meramente
+% aceptables.
+%
+% \New{4.1}En Plain \TeX{} se ejecuta la orden |\sptextfont| para la
+% letra voladita, de forma que |{\bf\let\sptextfont\bf 1"o}| da el
+% resultado correcto (|\mit| si es para cursiva). Para usar un tipo
+% nuevo con |\sptext| hay que definir tambi'en las variantes
+% matem'aticas con |\newfam|.
+%
+% \subsection{Funciones matem'aticas}
+%
+% Tradicionalmente, se han formado las abreviaciones
+% de lo que en \TeX\ se conocen como operadores a partir
+% del nombre castellano, lo que implica la presencia del
+% acento en l'im (en sus tres formas |\lim|, |\limsup| y |\liminf|),
+% m'ax, m'in, 'inf y m'od (en sus dos
+% formas |\bmod| y |\pmod|).
+%
+% Con |spanish| pueden seguirse varias convenciones con ayuda
+% de las siguientes 'ordenes:
+% \begin{itemize}
+% \item[$\diamond$] |\accentedoperators| |\unaccentedoperators|\\[1ex]
+% Activa o desactiva los acentos.
+% Por omisi'on se acent'uan, como por ejemplo: $\lim_{x\to 0}(1/x)$
+% (|$\lim_{x\to 0}(1/x)$|).
+%
+% \item[$\diamond$] |\spacedoperators| |\unspacedoperators|\\[1ex]
+% Activa o desactiva el espacio entre "<arc"> y la funci'on.
+% Lo habitual ha sido con espacio; as'i pues, por omisi'on
+% se espacia.
+% \end{itemize}
+%
+% La i sin punto tambi'en es accesible directamente en modo
+% matem'atico con la orden |\dotlessi|, de forma que se puede escribir
+% |\acute{\dotlessi}|. Por ejemplo,
+% |$V_{\mathbf{cr\acute{\dotlessi}t}}$| da
+% $V_{\mathbf{cr\acute{\dotlessi}t}}$.
+%
+% Tambi'en se a'naden |\sen|, |\arcsen|, |\tg| y |\arctg|,
+% que dan las funciones respectivas. Otras funciones trigonom'etricas
+% se encuentran almacenadas en el par'ametro |\spanishoperators|, que
+% inicialmente incluye cotg, cosec, senh y tgh. La raz'on por la que
+% estas funciones se han separado es porque ~---al contrario que sen
+% y tg~--- su forma est'a lejos de estar normalizada en el 'ambito
+% hispanohablante. De esta
+% forma se puede cambiar por otras con, por ejemplo:
+%\begin{verbatim}
+% \renewcommand{\spanishoperators}{ctg arc\,ctg sh ch th}
+%\end{verbatim}
+% (separadas con espacio). Cuando se selecciona |spanish| se crean
+% 'ordenes con esos nombres
+% y que dan esas funciones (siempre con |\nolimits|). Adem'as de
+% las letras sin acentuar se aceptan las 'ordenes |\,| y |\acute|, que
+% se pasan por alto para formar el nombre. \New{4.2}Por ejemplo, |arc\,ctg|
+% se escribe en el documento con
+% |\arcctg|, |M\acute{a}x| como |\Max| y |cr\acute{i}t| como |\crit|
+% (hay que usar |i| y no |\dotlessi|).
+% La orden |\,| responde a |\|(|un|)|spacedoperators|, y |\acute|
+% a |\|(|un|)|accentedoperators|.
+%
+% Conviene que |\spanishoperators| est'e en el pre'ambulo del
+% documento en s'i, antes de |\selectspanish| o de
+% |\begin{document}|.
+%
+% \subsection{Entrecomillados}
+%
+% El entorno |quoting| entrecomilla un
+% texto, a'nadiendo comillas de seguir al comienzo de
+% cada p'arrafo en su interior.\footnote{Se puede encontrar
+% una detallada exposici'on de las comillas en \DTL{44 ss.} De ah'i
+% se ha tomado alg'un ejemplo.}
+% Tambi'en se pueden emplear las
+% abreviaciones |<<| y |>>| que se limitan a llamar a |quoting|, que
+% por ser entorno considera sus cambios internos como locales. (Es
+% decir, |<< ... >>| implica |{<< ... >>}|.)
+% Las abreviaciones |"<| y |">| contin'uan dando sin m'as los
+% caracteres de comillas de abrir y cerrar, respectivamente.
+%
+% Por ejemplo:
+%\begin{verbatim}
+% <<Se llaman <<comillas de seguir>> a las que son de cierre,
+% pero se colocan al comienzo de cada p'arrafo cuando se transcribe
+% un texto entrecomillado con m'as de un p'arrafo.
+%
+% En su interior, como de costumbre, se usan inglesas.>>
+%\end{verbatim}
+% cuyo resultado es:
+% \begin{quotation}\small
+% <<Se llaman <<comillas de seguir>> a las que son de cierre,
+% pero se colocan al comienzo de cada p'arrafo cuando se transcribe
+% un texto entrecomillado con m'as de un p'arrafo.
+%
+% En su interior, como de costumbre, se usan inglesas.>>
+% \end{quotation}
+%
+% Este entorno se puede redefinir, como por ejemplo:
+%\begin{verbatim}
+% \renewenvironment{quoting}{\itshape}{}
+%\end{verbatim}
+% pero en principio no implica un nuevo p'arrafo, ya que
+% est'a pensado para ser usado tambi'en en el texto.
+%
+% En caso de anidar entornos |quoting|, se modifican las comillas
+% de los niveles interiores, que tambi'en se a'naden a las de seguir:
+%\begin{verbatim}
+% <<El di'alogo se desarroll'o de esta forma:
+%
+% <<---Yo no he sido ---grit'o Antonio.
+%
+% ---Pero has colaborado ---asegur'o Rafael>>.
+%
+% Pero all'i no se aclar'o nadie.>>
+%\end{verbatim}
+%
+% \begin{quotation}\small
+% <<El di'alogo se desarroll'o de esta forma:
+%
+% <<---Yo no he sido ---grit'o Antonio.
+%
+% ---Pero has colaborado ---asegur'o Rafael>>.
+%
+% Pero all'i no se aclar'o nadie.>>
+% \end{quotation}
+%
+% \begin{itemize}
+% \item[$\diamond$]
+% |\lquoti| |\rquoti| |\lquotii| |\rquotii| |\lquotiii|
+% |\rquotiii|\\[1ex]
+%
+% Controlan las comillas en |quoting|, seg'un el
+% nivel en que nos encontremos. |\lquoti| son las comillas de abrir
+% m'as exteriores, |\lquotii| las de segundo nivel, etc., y lo mismo
+% para las de cerrar con |\rquoti|... Para las de seguir siempre se
+% usan las de cerrar. Los valores predefinidos est'an en el cuadro 3.
+% \begin{table}
+% \center\small
+% \caption{Entrecomillados}
+% \vspace{1.5ex}
+% \begin{tabular}{l@{\hspace{5em}}l}
+% \toprule
+% |\lquoti| &|"<|\\
+% |\rquoti| &|">|\\
+% |\lquotii| &|``|\\
+% |\rquotii| &|''|\\
+% |\lquotiii| &|`|\\
+% |\rquotiii| &|'|
+% \botrule
+% \end{tabular}
+% \end{table}
+%
+% \newenvironment{dialog}
+% {\def\lquoti{}\begin{quoting}---\ignorespaces}
+% {\def\rquoti{}\end{quoting}}
+%
+% Las comillas de seguir tambi'en se emplean en di'alogos, incluso
+% si no las hay de abrir y cerrar. Con la ayuda del siguiente
+% entorno,
+%\begin{verbatim}
+% \newenvironment{dialog}
+% {\def\lquoti{}\begin{quoting}---\ignorespaces}
+% {\def\rquoti{}\end{quoting}}
+%\end{verbatim}
+% podemos obtener
+% \begin{quotation}\small
+% \begin{dialog}%
+% El di'alogo se desarroll'o de esta forma:
+%
+% <<---Yo no he sido ---grit'o Antonio.
+%
+% ---Pero has colaborado ---asegur'o Rafael>>.
+%
+% Pero all'i no se aclar'o nadie.
+% \end{dialog}
+% \end{quotation}
+%
+% \item[$\diamond$]
+% |\activatequoting \deactivatequoting|\\[1ex]
+%
+% Las incompatibilidades potenciales de estas abreviaciones son
+% enormes. Por ejemplo, en \textsf{ifthen} se cancelan las
+% comparaciones entre n'umeros;\,\footnote{Y en |\string\ifnum|,
+% etc. usado por los desarrolladores en los paquetes.} tambi'en
+% resultan inoperantes |@>>>| y |@<<<| de
+% \textsf{amstex}.\footnote{Aunque en
+% este caso cabe usar los sin'onimos |@)))| y |@(((|.}
+% Por ello, se da posibilidad de cancelarlas y reactivarlas con
+% estas 'ordenes, \New{4.2}aunque si se est'a usando con
+% \textsf{xmltex} ya se
+% desactivan por completo de forma autom'atica. El entorno
+% |quoting| siempre permanece disponible.\footnote{Algunos tipos
+% disponen de esta ligadura de forma interna para
+% generar los caracteres de comillas, por lo que en ellos tambi'en
+% podemos usarlos siempre, aunque los ajustes proporcionados por
+% \textsf{spanish} se pueden perder; por otra parte, tampoco se
+% usan demasiado a menudo.}
+%
+% \end{itemize}
+%
+% \subsection{Selecci'on}
+%
+% Por omisi'on, \babel{} deja <<dormidas>> las lenguas hasta que se
+% llega a |\begin{document}| con el fin de evitar conflictos por
+% las abreviaciones; a cambio,
+% se priva de la posibilidad de usar las lenguas en el pre'ambulo
+% en 'ordenes como |\savebox|, |\title|, |\newtheorem|, etc.
+%
+% La orden |\selectspanish| permite activar |spanish| con sus
+% extensiones y abreviaciones antes de
+% |\begin{document}|.\footnote{Algunos detalles, que
+% apenas afectan a \texttt{spanish}, siguen sin activarse hasta el
+% comienzo del documento.}
+% De esta forma, podr'iamos decir
+%\begin{verbatim}
+% \documentclass{book}
+% \usepackage[T1]{fontenc}
+% \usepackage[spanish]{babel}
+% \usepackage[latin1]{inputenc}
+% \usepackage[centerlast]{caption2}
+% ... % Mas paquetes
+%
+% \selectspanish
+%
+% \title{T'itulo}
+% \author{Autor}
+% \newcommand{\pste}{para"-psicol'ogicamente}
+% \newsavebox{\mybox}
+% \savebox{\mybox}{m'as cosas}
+% ... % Mas definiciones
+%
+% \begin{document}
+%\end{verbatim}
+%
+% \subsection{Espaciado}
+%
+% El espaciado espa'nol difiere relativamente poco del ingl'es;
+% sin embargo, el espacio tras los signos de
+% puntuaci'on debe ser mismo que el que hay entre palabras. O dicho en
+% t'erminos de \TeX, |\frenchspacing| est'a activo.
+%
+% Tambi'en en otros dos sitios hay diferencias. El primero son los
+% puntos suspensivos, para los que se define una nueva orden |\...|
+% que los da menos espaciados; con ella \TeX{} preserva
+% el espacio siguiente. Por ejemplo:
+% \begin{quote}\small\begin{tabbing}
+% |\... y solo estaba\... ella.|\quad\=\... y solo estaba\... ella.
+% \end{tabbing}\end{quote}
+% Tambi'en podr'ian escribirse los tres puntos sin m'as |...|, y en
+% la pr'actica no hay diferencia, a menos que se cambie el
+% valor del espacio tras punto; en ese caso, la forma con barra
+% da los valores apropiados \emph{dentro} de una sentencia, y
+% los tres puntos \emph{al final} de ella. Esta orden no
+% interfiere con el valor original de |\.| (un punto suprascrito).
+%
+% El segundo sitio es un espacio fino antes del signo |\%| (que
+% m'as exactamente es |\,|, con lo cual se puede "<recuperar"> con
+% su opuesto |\!|, si |\%| no sigue a una cifra).
+%
+% \subsection{Miscel'anea}
+%
+% \begin{itemize}
+%
+% \item[$\bullet$] La orden |\lsc| se puede usar para siglas
+% en versalitas.
+% Por ejemplo:
+% \begin{quote}\small\begin{tabbing}
+% |\lsc{RAE}| \quad \= \lsc{RAE}\\
+% |\lsc{ReNFe}| \quad \= \lsc{ReNFe}.
+% \end{tabbing}\end{quote}
+% Tambi'en puede ser 'util para algunos usos de los n'umeros
+% romanos:
+% \begin{quote}\small\begin{tabbing}
+% |siglo \lsc{XVII}| \quad \= siglo \lsc{XVII}\\
+% |cap'itulo \lsc{II}| \quad \= cap'itulo \lsc{II}.
+% \end{tabbing}\end{quote}
+%
+% Para evitar que con un tipo que carece de versalitas acabe
+% apareciendo (por substituci'on) un texto de min'usculas se
+% intenta usar en estos casos las versales \emph{reales}
+% de un tama'no menor. Queda simplemente aceptable, pero es mejor que
+% nada. (\LaTeX\ tiende a sustituir versalitas por versalitas,
+% pero hay excepciones, como con las negritas.)
+%
+% \item[$\bullet$] Se puede escribir |\'i| para |\'{\i}|.
+%
+% \item[$\bullet$] Hay una abreviaci'on adicional como utilidad
+% tipogr'afica m'as que espec'ificamente espa'nola. En ciertos
+% tipos, como Times, el extremo inferior de la barra est'a en la
+% l'inea de base y expresiones como <<am/pm>> resultan poco
+% est'eticas. |"/| produce una barra que, de ser necesario,
+% se baja ligeramente. Computer Modern tiene una barra bien
+% dise'nada y no es posible ilustrar aqu'i este punto
+% pero en todo caso se escribir'ia |am"/pm|.\footnote{En \MEA{141}
+% se recurre a una soluci'on que es la 'unica sencilla en
+% programas de maquetaci'on: usar un cuerpo menor. Pero con \TeX{}
+% es mucho m'as f'acil automatizar las tareas.}
+%
+% \end{itemize}
+%
+% \section{Adaptaci'on}
+% \subsection{Configuraci'on}
+%
+% En sus 'ultimas versiones, \babel{} proporciona la posibilidad
+% de cargar autom'aticamente un archivo con el mismo nombre que
+% el principal, pero con extensi'on |.cfg|. \textsf{Spanish}
+% proporciona unas pocas 'ordenes para ser usadas en este archivo:
+% \begin{itemize}
+% \item[$\diamond$] |\es@activeacute|\\[1ex]
+% Activa las abreviaciones con ap'ostrofos, sin que sea
+% necesario incluir |activeacute| como opci'on en |\usepackage|.
+%
+% \item[$\diamond$] |\es@enumerate{<leveli>}|%
+% |{<levelii>}{<leveliii>}{<leveliv>}|\\[1ex]
+% Cambia los valores preestablecidos por |spanish| para
+% |enumerate|. \textit{leveln} consiste en una letra, que
+% indica qu'e formato tendr'a el n'umero, seguida
+% de cualquier texto. La letra tiene que ser: |1| (ar'abigo),
+% |a| (min'uscula \emph{cursiva}\,\footnote{La letra es cursiva
+% pero no los signos que le puedan seguir. M'as bien deber'ia
+% decirse destacada, ya que se usa |\string\emph|.
+% V'ease \DTL{11}.}), |A| (versal),
+% |i| (romano \emph{versalita}), |I| (romano versal) o
+% finalmente |o| (ordinal\,\footnote{Lo normal es no a'nadir ning'un
+% signo tras ordinal.}).
+%
+% Esta orden no est'a pensada para hacer cambios elaborados, sino
+% s—lo meros reajustes. Los valores preestablecidos
+% equivalen a
+%\begin{verbatim}
+% \es@enumerate{1.}{a)}{1)}{a$'$)}
+%\end{verbatim}
+%
+% \item[$\diamond$] |\es@itemize{<leveli>}|%
+% |{<levelii>}{<leveliii>}{<leveliv>}|\\[1ex]
+% Lo mismo para |itemize|, s'olo que los argumentos se
+% usan de forma literal. Los valores originales de \LaTeX{} son
+% similares a
+%\begin{verbatim}
+% \es@itemize{\textbullet}{\normalfont\bfseries\textendash}
+% {\textasteriskcentered}{\textperiodcentered}
+%\end{verbatim}
+%
+% \item[$\diamond$] |\es@operators|\\[1ex]
+% Todo lo relativo a operadores se cancela con
+%\begin{verbatim}
+% \let\es@operators\relax
+%\end{verbatim}
+% Es buena idea incluirlo si no se van a usar, ya que ahorra memoria.
+%
+% \end{itemize}
+%
+% Otros ajustes 'utiles en este contexto son |\spanishoperators|,
+% |\selectspanish| y |\deactivatequoting|.
+%
+%
+% Recordemos que todos los cambios
+% operados desde este archivo restan compatibilidad al
+% documento, por lo que si se distribuye conviene adjuntarlo
+% con el entorno |filecontents|.
+%
+% \subsection{Otros cambios}
+%
+% \begin{itemize}
+%
+% \item La orden |\addto| permite
+% cambiar alguna de las convenciones internas. Esto resulta
+% interesante con las traducciones, ya que las
+% formas proporcionadas pueden no ser las deseadas.
+% Para ello es necesario que |spanish| no est'e seleccionado.
+% Por ejemplo, para cambiar \emph{'Indice de figuras} por
+% \emph{Lista de figuras}:
+%\begin{verbatim}
+% \addto\captionsspanish{%
+% \def\listfigurename{Lista de figuras}}
+%\end{verbatim}
+%
+% \item Para volver a eliminar la sangr'ia tras secci'on:
+%\begin{verbatim}
+% \def\@afterindentfalse{\let\if@afterindent\iffalse}
+% \@afterindentfalse
+%\end{verbatim}
+%
+% \item Para que |\roman| proporcione n'umeros romanos en
+% min'uscula, seg'un la forma inglesa:
+%\begin{verbatim}
+% \def\@roman#1{\romannumeral #1}
+%\end{verbatim}
+%
+% \item
+% Los extras se encuentran organizados en varios grupos:
+% |\textspanish|, |\mathspanish|,
+% |\shorthandsspanish| y |\layoutspanish|. Pueden
+% cancelarse con:
+%\begin{verbatim}
+% \renewcommand\textspanish{}
+%\end{verbatim}
+%
+% \end{itemize}
+%
+% \section{Formatos distintos a \LaTeXe}
+%
+% El estilo |spanish| funciona con
+% otros formatos, aunque con un subconjunto de las funciones
+% disponibles en \LaTeXe{}. Con Plain hay que hacer
+%\begin{verbatim}
+% \input spanish.sty
+%\end{verbatim}
+% y con \LaTeX2.09, incluir |spanish| entre las opciones de estilo.
+%
+% Se incluyen: traducciones, casi todas las abreviaciones, coma
+% decimal, utilidades para divisi'on de palabras, ordinales en una
+% versi'on simplificada (y no muy elegante), funciones matem'aticas,
+% entrecomillados en \LaTeX2.09, |\'i| y espaciado.
+% La selecci'on de la lengua es inmediata al cargar el archivo.
+%
+% En cambio no est'an disponibles: entrecomillados en Plain,
+% |\lsc| ni las adaptaciones proporcionadas por |\layoutspanish|.
+%
+% A partir de esta versi'on, el archivo de configuraci'on
+% se lee siempre, por lo que aquellos que ya est'an escritos
+% espec'ificamante para \LaTeXe{} pueden presentar problemas si se usan
+% con otros formatos. Si las versiones que se usan no son muy antiguas,
+% se puede comprobar el formato con la variable |\fmtname| que vale
+% |LaTeX2e| o |plain|. Por ejemplo
+%\begin{verbatim}
+% \def\temp{LaTeX2e}
+% \ifx\temp\fmtname
+% ...
+% \fi
+%\end{verbatim}
+%
+% \section{Bibliograf'ias}
+%
+% El archivo |esbst.tex| que se genera con \textsf{spanish}
+% sirve para que la utilidad \textsf{custom-bib} trabaje en
+% conjunci'on con \babel. Define una serie de 'ordenes, que pueden
+% consultarse en el propio archivo, que se utilizan para las
+% traducciones si se selecciona |babel| como lengua al generar un
+% estilo bibliogr'afico.
+%
+% \section{Incompatibilidades con versiones anteriores}
+%
+% \begin{itemize}
+%
+% \item En versiones de cierta antig"uedad, el actual |activeacute|
+% estaba siempre impl'icito, por lo que ahora la abreviaci'on no se
+% reconoce y en su lugar aparecen ap'ostrofos.
+%
+% \item El t'ermino correspondiente a |\tablename| estaba traducido
+% incorrectamente como <<Tabla>>. Como quiera que <<tabla>> es la
+% palabra con que puede aparecer en el propio texto, o bien puede
+% haber un art'iculo femenino ante |\tablename|, puede reponerse el
+% valor antiguo con:
+%\begin{verbatim}
+% \addto\captionsspanish{%
+% \def\tablename{Tabla}%
+% \def\listtablename{\'Indice de tablas}}
+%\end{verbatim}
+%
+% \end{itemize}
+%
+% \section*{Referencias}
+% \addcontentsline{toc}{section}{Referencias}
+%
+% \begingroup
+% \small
+% \leftskip1.5cm \parindent-1.5cm
+%
+% \makebox[1.5cm][l]{\lsc{DRAE}}\textit{Diccionario de la Academia
+% Espa'nola}, Madrid, Espasa-Calpe, 21"a ed., 1992.
+%
+% \makebox[1.5cm][l]{\lsc{DOT}}Jos'e Mart'inez de Sousa,
+% \textit{Diccionario de ortograf'ia t'ecnica},
+% Madrid, Germ'an S'anchez Ruip'erez/Pir'amide, 1987.
+% (Biblioteca del libro.)
+%
+% \makebox[1.5cm][l]{\lsc{DTL}}Jos'e Mart'inez de Sousa,
+% \textit{Diccionario de tipograf'ia y del libro},
+% Madrid, Paraninfo, 3"a ed., 1992.
+%
+% \makebox[1.5cm][l]{\lsc{MEA}}Jos'e Mart'inez de Sousa,
+% \textit{Manual de edici'on y autoedici'on},
+% Madrid, Pir'amide, 1994.
+%
+% \leftskip0pt \parindent0pt \vspace{6pt}
+%
+% {\itshape
+% Como normalmente el primer contacto con \TeX{} es por una tesis,
+% cito libros que
+% est'an relacionados con el tema a los que he tenido acceso.
+% Est'an por orden de preferencia; en particular, los dos 'ultimos me
+% parecen poco recomendables.}
+%
+% \parindent-1.5pc \leftskip1.5pc \vspace{3pt}
+%
+% Umberto Eco,
+% \textit{C'omo se hace una tesis},
+% Barcelona, Gedisa, 1982.
+%
+% Antonia Rigo Arnavat y Gabriel Genesc\`a Due'nas,
+% \textit{C'omo presentar una tesis y trabajos de investigaci'on},
+% Barcelona, Eumo-Octaedro, 2002.
+%
+% Prudenci Comes,
+% \textit{Gu'ia para la redacci'on y presentaci'on de trabajos
+% cient'ificos, informes t'ecnicos y tesinas},
+% Barcelona, Oikos-Tau, 1971.
+%
+% Javier Lasso de la Vega,
+% \textit{C'omo se hace una tesis doctoral},
+% Madrid, Fundacion Universitaria Espa~nola, 1977.
+%
+% Jos'e Romera Castillo y otros,
+% \textit{Manual de estilo},
+% Madrid, Universidad Nacional de Educaci'on a Distancia, 1996.
+%
+% Restituto Sierra Bravo,
+% \textit{Tesis doctorales y trabajos de investigaci'on cient'ifica},
+% Madrid, Paraninfo, 1986.
+%
+% \parindent0pc \leftskip0pc \vspace{6pt}
+%
+% {\itshape
+% Para otras cuestiones tipogr'aficas, las referencias
+% usadas son, entre otras:}
+%
+% \parindent-1.5pc \leftskip1.5pc \vspace{3pt}
+%
+% Javier Bezos,
+% \textit{Tipograf'ia espa'nola con \TeX}, documento electr'onico
+% disponible en
+% \textsf{http://perso.wanadoo.es/jbezos/tipografia.html}.
+%
+% Ra'ul Cabanes Mart'inez,
+% <<El sistema internacional de unidades: ese desconocido>>,
+% \textit{Mundo Electr'onico}, n"o 142, 1984, p'ags.~119~-125.
+%
+% \textit{The Chicago Manual of Style}, Chicago, University of
+% Chicago Press, 14"a~ed., 1993, esp.~p'ags.~333~-335.
+%
+% Jos'e Fern'andez Castillo,
+% \textit{Normas para correctores y compositores tip'ografos},
+% Madrid, Espasa-Calpe, 1959.
+%
+% IRANOR [AENOR], Normas \lsc{UNE} n'umeros 5010 (<<Signos
+% matem'aticos>>), 5028 (<<S'imbolos
+% geom'etricos>>) y 5029 (<<Impresi'on de los
+% s'imbolos de magnitudes y unidades y de los n'umeros>>).
+% [Obsoletas.]
+%
+% Real Academia Espa'nola,
+% \textit{Esbozo de una nueva gram'atica de la
+% lengua espa'nola}, Madrid, Espasa-Calpe, 1973.
+%
+% V.\ Mart'inez Sicluna,
+% \textit{Teor'ia y pr'actica de la tipograf'ia},
+% Barcelona, Gustavo Gili, 1945.
+%
+% Jos'e Mart'inez de Sousa,
+% \textit{Diccionario de ortograf'ia de la lengua espa'nola},
+% Madrid, Paraninfo, 1996.
+%
+% Juan Mart'inez Val, \textit{Tipograf'ia pr'actica}, Madrid,
+% Laberinto, 2002.
+%
+% Juan Jos'e Morato, \textit{Gu'ia pr'actica del compositor
+% tipogr'afico}, Madrid, Hernando, 2"a ed., 1908 (1"a ed., 1900,
+% 3"a ed., 1933).
+%
+% Marion Neubauer,
+% <<Feinheiten bei wissenschaftlichen Publikationen>>,
+% \textit{Die \TeX nisches Kom\"odie}, parte I, vol. 8, n"o 4, 1996,
+% p'ags. 23-40; parte II, vol. 9, n"o 1, 1997, p'ags.~25~-44.
+%
+% Jos'e Polo,
+% \textit{Ortograf'ia y ciencia del lenguaje}, Madrid, Paraninfo,
+% 1974.
+%
+% Pedro Valle,
+% \textit{C'omo corregir sin ofender}, Buenos Aires, Lumen, 1998.
+%
+% Hugh C. Wolfe, <<S'imbolos, unidades y nomenclatura>>,
+% \textit{Enciclopedia de F'isica}, dir. Rita G. Lerner y George L.
+% Trigg, Madrid, Alianza, 1987, t.~2, p'ags.~1423~-1451.
+%
+% \endgroup
+%
+% \end{userdtx}
+%
+% \begin{userdrv}
+%^^A ======= Beginning of text as typeset by user.drv =========
+%
+% \GetFileInfo{spanish.dtx}
+%
+% \section{The Spanish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author from v4.0 on is Javier
+% Bezos. Previous versions were by Julio S\'anchez.} defines all the
+% language-specific macros for the Spanish language.
+%
+% Custumization is made following mainly the
+% books on the subject by Jos\'e Mart\'\i nez de Sousa.
+% By typesetting |spanish.dtx| directly you will get the full
+% documentation (regrettably is in Spanish only, but it is
+% pretty long). References in this part refers to that document.
+% There are several aditional features documented in the Spanish
+% version only.
+%
+% This style provides:
+% \begin{itemize}
+% \item Translations following the International \LaTeX{}
+% conventions, as well as |\today|.
+%
+% \item Shorthands listed in Table~\ref{tab:spanish-quote-def}.
+% Examples in subsection~3.4 are illustrative. Note that
+% |"~| has a special meaning in \textsf{spanish}
+% different to other languages, and is used mainly in linguistic
+% contexts.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |'a| & acute accented a. Also for: e, i, o, u (both
+% lowercase and uppercase).\\
+% |'n| & \~n (also uppercase).\\
+% |~n| & \~n (also uppercase). Deprecated.\\
+% |"u| & \"u (also uppercase).\\
+% |"a| & Ordinal numbers (also |"A|, |"o|, |"O|).\\
+% |"c| & \c{c} (also uppercase).\\
+% |"rr| & rr, but -r when hyphenated\\
+% |"-| & Like |\-|, but allowing hyphenation in the rest
+% the word.\\
+% |"=| & Like |-|, but allowing hyphenation in the rest
+% the word.\\
+% |"~| & The hyphen is repeated at the very beginning of
+% the next line if the word is hyphenated at this
+% point.\\
+% |""| & Like |"-| but producing no hyphen sign.\\
+% |~-| & Like |-| but with no break after the hyphen. Also for:
+% en-dashes (|~--|) and em-dashes (|~---|). \\
+% |"/| & A slash slightly lowered, if necessary.\\
+% \verb+"|+ & disable ligatures at this point.\\
+% |"<| & Left guillemets.\\
+% |">| & Right guillemets.\\
+% |<<| & |\begin{quoting}|. (See text.)\\
+% |>>| & |\end{quoting}|. (See text.)
+% \end{tabular}
+% \caption{Extra definitions made by file \file{spanish.ldf}}
+% \label{tab:spanish-quote-def}
+% \end{table}
+%
+% \item |\deactivatetilden| deactivates the |~n| and |~N| shorthands.
+%
+% \item \emph{In math mode} a dot followed by a digit is replaced
+% by a decimal comma.
+%
+% \item Spanish ordinals and abbeviations with |\sptext|
+% as, for instance, |1\sptext{er}|. The
+% preceptive dot is included.
+%
+% \item Accented functions: l\'\i m, m\'ax, m\'\i n, m\'od. You may
+% globally omit the accents with |\unaccentedoperators|. Spaced
+% functions: arc\,cos, etc. You may globally kill that space with
+% |\unspacedoperators|. |\dotlessi| is provided for use in math mode.
+%
+% \item A |quoting| environment and a related pair of shorthands |<<|
+% and |>>|. The command
+% |\deactivatequoting| deactivates these shorthand in case
+% you want to use |<| and |>| in some AMS commands and numerical
+% comparisons.
+%
+% \item The command |\selectspanish| selects the |spanish| language
+% \emph{and} its shorthands. (Intended for the preamble.)
+%
+% \item |\frenchspacing| is used.
+%
+% \item Ellipsis are best typed |...| or, within a sentence, |\...|
+%
+% \item There is a small space before |\%|.
+%
+% \item |\lsc| provides lowercase small caps. (See subsection~3.10.)
+% \end{itemize}
+%
+% Just in case |spanish| is the main language, the group
+% |\layoutspanish| is activated, which modifies the standard
+% classes through the whole document (it cannot be deactivated)
+% in the following way:
+% \begin{itemize}
+% \item Both |enumerate| and |itemize| are adapted to Spanish rules.
+%
+% \item Both |\alph| and |\Alph| include \textit{\~n} after \textit{n}.
+%
+% \item Symbol footmarks are one, two, three, etc., asteriscs.
+%
+% \item |OT1| guillemets are generated with two |lasy| symbols instead
+% of small |\ll| and |\gg|.
+%
+% \item |\roman| is redefined to write small caps roman numerals, since
+% lowercase roman numerals are not allowed. However, \textit{MakeIndex}
+% rejects entries containing pages in that format. The |.idx| file must
+% be preprocessed if the document has this kind of entries with
+% the provided |romanidx.tex| tool---just \TeX{} it and follow the
+% instructions.
+%
+% \item There is a dot after section numbers in titles and toc.
+% \end{itemize}
+% This group is ignored if you write |\selectspanish*| in the
+% preamble.
+%
+% Some additional commands are provided to be used in the
+% |spanish.cfg| file:
+% \begin{itemize}
+% \item With |\es@activeacute| acute accents are always active,
+% overriding the default \textsf{babel} behaviour.
+%
+% \item |\es@enumerate| sets the labels to be used by |enumerate|. The
+% same applies to |\es@itemize| and |itemize|.
+%
+% \item |\es@operators| stores the operator commands.
+% All of them are canceled with
+%\begin{verbatim}
+% \let\es@operators\relax
+%\end{verbatim}
+% \end{itemize}
+% The commands |\deactivatequoting|, |\deactivatetilden| and
+% |\selectspanish| may be used in this file, too.
+%
+% A subset of these commands is provided for
+% use in Plain \TeX{} (with |\input spanish.sty|).
+%
+% \end{userdrv}
+%
+%\StopEventually{}
+%
+%^^A ========== End of manual ===============
+%
+% \begin{userdtx}
+%
+% \section{The Code}
+%
+% \end{userdtx}
+%
+% \begin{userdrv}
+%
+% \subsection{The Code}
+%
+% \end{userdrv}
+%
+% \changes{spanish~4.0f}{99/04/12}{Beginning of changes to follow the
+% doc conventions}
+% \changes{spanish~4.0d}{99/03/26}{Changed some parts for babel.ins
+% to generate the files}
+% \changes{spanish~4.0e}{99/04/10}{Adapted to 3.6k with some minor
+% changes, since most of features intended for 3.7 are included
+% now}
+% \changes{spanish~4.0d}{99/03/26}{Restored the test for \cs{LdfInit}.
+% It is redundant for LaTeX209 but not for plain}
+% \changes{spanish~4.0d}{99/03/29}{With a shoddy piece of work, the
+% plain variant works (at last). Instead of inputting
+% \file{babel.def} we input \file{switch.def}. To be changed, I
+% think, since now \file{plain.def} is read twice}
+% \changes{spanish~4.0e}{99/04/10}{Replaced all instances of
+% allowhyphens by \cs{bbl@allowhyphens}}
+% \changes{spanish~4.0g}{99/05/05}{The code introduced the 99/03/29
+% (see above) has been removed}
+% \changes{spanish~4.1a}{99/12/26}{Added \cs{spanishdecimal}.}
+% \changes{spanish~4.1b}{00/06/16}{Added the Spanish et sign.}
+% \changes{spanish~4.1a}{99/12/29}{Modified \cs{@marginparreset}
+% in order to kill the continuing guillemets.}
+% \changes{spanish~4.1a}{00/01/09}{\cs{sptext} protected.}
+%
+% This file provides definition for both \LaTeXe{} and non
+% \LaTeXe{} formats.
+%
+% Identify the |ldf| file.
+%
+% \changes{spanish~4.0g}{99/05/05}{Replaced \cs{ProvidesFile}
+% by \cs{ProvidesLanguage}}
+% \changes{spanish~4.0j}{99/09/18}{Renamed spanish.tex as spanish.lpf}
+%
+% \begin{macrocode}
+%<*code>
+\ProvidesLanguage{spanish.ldf}
+ [2005/03/31 v4.2b Spanish support from the babel system]
+% \end{macrocode}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{spanish} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@spanish| to see whether we have to do something here.
+%
+% \changes{spanish~4.0a}{98/09/23}{All files renamed from spanishb
+% to spanish as requested by the Spanish TeX list, since this
+% style should replace the current Spanish option. Julio
+% Sanchez gave up supporting his files and he has withdrawn
+% from his TeX activities. The last distributed version as
+% spanishb was 1.1.}
+% \changes{spanish~4.0a}{98/09/12}{Introduced \cs{LdfInit} setup}
+% \begin{macrocode}
+\LdfInit{spanish}\captionsspanish
+\ifx\undefined\l@spanish
+ \@nopatterns{Spanish}
+ \adddialect\l@spanish0
+\fi
+% \end{macrocode}
+%
+% We define some tools which will be used in that style file:
+% (1) we make sure that |~| is active, (2) |\es@delayed| delays
+% the expansion of the code in conditionals (in fact, quite similar
+% to |\bbl@afterfi|).
+%
+% \changes{spanish~4.0a}{98/09/12}{Test for 209 moved from sty}
+% \changes{spanish~4.1a}{99/12/01}{Introduced the \cs{es@delayed}
+% mechanism for ``conflictive'' conditionals.}
+% \begin{macrocode}
+\edef\es@savedcatcodes{%
+ \catcode`\noexpand\~=\the\catcode`\~
+ \catcode`\noexpand\"=\the\catcode`\"}
+\catcode`\~=\active
+\catcode`\"=12
+\long\def\es@delayed#1\then#2\else#3\fi{%
+ #1%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {#2}{#3}}
+% \end{macrocode}
+%
+% Two tests are introduced. The first one tells us if the format is
+% \LaTeXe{}, and the second one if the format is plain or any other.
+% If both are false, the format is \LaTeX2.09{}.
+%
+% \begin{macrocode}
+\es@delayed
+\expandafter\ifx\csname documentclass\endcsname\relax\then
+ \let\ifes@LaTeXe\iffalse
+\else
+ \let\ifes@LaTeXe\iftrue
+\fi
+\es@delayed
+\expandafter\ifx\csname newenvironment\endcsname\relax\then
+ \let\ifes@plain\iftrue
+\else
+ \let\ifes@plain\iffalse
+\fi
+% \end{macrocode}
+%
+% Translations for captions.
+%
+% \changes{spanishb~1.1}{98/03/17}{Corrected \cs{indexname} to the
+% promised text}
+% \changes{spanish~4.1c}{00/10/04}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsspanish{%
+ \def\prefacename{Prefacio}%
+ \def\refname{Referencias}%
+ \def\abstractname{Resumen}%
+ \def\bibname{Bibliograf\'{\i}a}%
+ \def\chaptername{Cap\'{\i}tulo}%
+ \def\appendixname{Ap\'endice}%
+ \def\listfigurename{\'Indice de figuras}%
+ \def\listtablename{\'Indice de cuadros}%
+ \def\indexname{\'Indice alfab\'etico}%
+ \def\figurename{Figura}%
+ \def\tablename{Cuadro}%
+ \def\partname{Parte}%
+ \def\enclname{Adjunto}%
+ \def\ccname{Copia a}%
+ \def\headtoname{A}%
+ \def\pagename{P\'agina}%
+ \def\seename{v\'ease}%
+ \def\alsoname{v\'ease tambi\'en}%
+ \def\proofname{Demostraci\'on}%
+ \def\glossaryname{Glosario}}
+
+\expandafter\ifx\csname chapter\endcsname\relax
+ \addto\captionsspanish{\def\contentsname{\'Indice}}
+\else
+ \addto\captionsspanish{\def\contentsname{\'Indice general}}
+\fi
+% \end{macrocode}
+%
+% And the date.
+% \changes{spanish~4.2a}{03/08/08}{Added the mechanism to
+% select \textit{del} or \textit{de}}
+% \begin{macrocode}
+\def\datespanish{%
+ \def\today{\the\day~de \ifcase\month\or enero\or febrero\or
+ marzo\or abril\or mayo\or junio\or julio\or agosto\or
+ septiembre\or octubre\or noviembre\or diciembre\fi
+ \ de\ifnum\year>1999\es@yearl\fi~\the\year}}
+\def\spanishdatedel{\def\es@yearl{l}}
+\def\spanishdatede{\let\es@yearl\@empty}
+\spanishdatede
+% \end{macrocode}
+%
+% The basic macros to select the language, in the preamble or the
+% config file. Use of |\selectlanguage| should be avoided at this
+% early stage because the active chars are not yet
+% active. |\selectspanish| makes them active.
+%
+% \begin{macrocode}
+\def\selectspanish{%
+ \def\selectspanish{%
+ \def\selectspanish{%
+ \PackageWarning{spanish}{Extra \string\selectspanish ignored}}%
+ \es@select}}
+
+\@onlypreamble\selectspanish
+
+\def\es@select{%
+ \let\es@select\@undefined
+ \selectlanguage{spanish}%
+ \catcode`\"\active\catcode`\~=\active}
+% \end{macrocode}
+%
+% Instead of joining all the extras directly in |\extrasspanish|,
+% we subdivide them in three further groups.
+% \changes{spanish~4.0a}{99/11/30}{The extras subdivided into three
+% further groups.}
+% \changes{spanish~4.2a}{03/08/08}{The dot is deactitated, too}
+% \begin{macrocode}
+\def\extrasspanish{%
+ \textspanish
+ \mathspanish
+ \ifx\shorthandsspanish\@empty
+ \spanishdeactivate{."'~<>}%
+ \languageshorthands{none}%
+ \else
+ \shorthandsspanish
+ \fi}
+\def\noextrasspanish{%
+ \ifx\textspanish\@empty\else
+ \notextspanish
+ \fi
+ \ifx\mathspanish\@empty\else
+ \nomathspanish
+ \fi
+ \ifx\shorthandsspanish\@empty\else
+ \noshorthandsspanish
+ \fi
+ \es@reviveshorthands}
+% \end{macrocode}
+%
+% And the first of these sub-groups is defined.
+%
+% \begin{macrocode}
+\addto\textspanish{%
+ \babel@save\sptext
+ \def\sptext{\protect\es@sptext}}
+% \end{macrocode}
+%
+% The definition of |\sptext| is more elaborated than that of
+% |\textsuperscript|. With uppercase superscript text
+% the scriptscriptsize is used. The mandatory dot is already
+% included. There are two versions, depending on the
+% format.
+%
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+ \newcommand\es@sptext[1]{%
+ {.\setbox\z@\hbox{8}\dimen@\ht\z@
+ \csname S@\f@size\endcsname
+ \edef\@tempa{\def\noexpand\@tempc{#1}%
+ \lowercase{\def\noexpand\@tempb{#1}}}\@tempa
+ \ifx\@tempb\@tempc
+ \fontsize\sf@size\z@
+ \selectfont
+ \advance\dimen@-1.15ex
+ \else
+ \fontsize\ssf@size\z@
+ \selectfont
+ \advance\dimen@-1.5ex
+ \fi
+ \math@fontsfalse\raise\dimen@\hbox{#1}}}
+\else %<<<<<<
+ \let\sptextfont\rm
+ \newcommand\es@sptext[1]{%
+ {.\setbox\z@\hbox{8}\dimen@\ht\z@
+ \edef\@tempa{\def\noexpand\@tempc{#1}%
+ \lowercase{\def\noexpand\@tempb{#1}}}\@tempa
+ \ifx\@tempb\@tempc
+ \advance\dimen@-0.75ex
+ \raise\dimen@\hbox{$\scriptstyle\sptextfont#1$}%
+ \else
+ \advance\dimen@-0.8ex
+ \raise\dimen@\hbox{$\scriptscriptstyle\sptextfont#1$}%
+ \fi}}
+\fi %<<<<<<
+% \end{macrocode}
+%
+% Now, lowercase small caps. First, we test if there are actual
+% small caps for the current font. If not, faked small caps are
+% used. The \cs{selectfont} in \cs{es@lsc} could seem redundant,
+% but it's not.
+%
+% \changes{spanishb~1.1}{98/05/11}{\cs{es@lsc} rewritten to
+% incorporate the procedure so far available in
+% \cs{roman} only}
+% \changes{spanish~4.0e}{99/04/10}{Added \cs{leavevmode}}
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+ \addto\textspanish{%
+ \babel@save\lsc
+ \def\lsc{\protect\es@lsc}}
+
+ \def\es@lsc#1{%
+ \leavevmode
+ \hbox{\scshape\selectfont
+ \expandafter\ifx\csname\f@encoding/\f@family/\f@series
+ /n/\f@size\expandafter\endcsname
+ \csname\curr@fontshape/\f@size\endcsname
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@\selectfont
+ \PackageInfo{spanish}{Replacing undefined sc font\MessageBreak
+ shape by faked small caps}%
+ \MakeUppercase{#1}%
+ \else
+ \MakeLowercase{#1}%
+ \fi}}
+\fi %<<<<<<
+% \end{macrocode}
+%
+% The |quoting| environment. This part is not available
+% in Plain, hence the test. Overriding the default |\everypar| is
+% a bit tricky.
+%
+% \begin{macrocode}
+\newif\ifes@listquot
+
+\ifes@plain\else %<<<<<<
+ \csname newtoks\endcsname\es@quottoks
+ \csname newcount\endcsname\es@quotdepth
+
+ \newenvironment{quoting}
+ {\leavevmode
+ \advance\es@quotdepth1
+ \csname lquot\romannumeral\es@quotdepth\endcsname%
+ \ifnum\es@quotdepth=\@ne
+ \es@listquotfalse
+ \let\es@quotpar\everypar
+ \let\everypar\es@quottoks
+ \everypar\expandafter{\the\es@quotpar}%
+ \es@quotpar{\the\everypar
+ \ifes@listquot\global\es@listquotfalse\else\es@quotcont\fi}%
+ \fi
+ \toks@\expandafter{\es@quotcont}%
+ \edef\es@quotcont{\the\toks@
+ \expandafter\noexpand
+ \csname rquot\romannumeral\es@quotdepth\endcsname}}
+ {\csname rquot\romannumeral\es@quotdepth\endcsname}
+
+ \def\lquoti{\guillemotleft{}}
+ \def\rquoti{\guillemotright{}}
+ \def\lquotii{``}
+ \def\rquotii{''}
+ \def\lquotiii{`}
+ \def\rquotiii{'}
+
+ \let\es@quotcont\@empty
+% \end{macrocode}
+%
+% If there is a margin par inside quoting, we don't add the
+% quotes. |\es@listqout| stores the quotes to be used before
+% item labels; otherwise they could appear after the labels.
+%
+% \begin{macrocode}
+ \addto\@marginparreset{\let\es@quotcont\@empty}
+
+ \def\es@listquot{%
+ \csname rquot\romannumeral\es@quotdepth\endcsname
+ \global\es@listquottrue}
+\fi %<<<<<<
+% \end{macrocode}
+%
+% Now, the |\frenchspacing|, followed by |\...| and |\%|
+%
+% \changes{spanish~4.0e}{99/04/10}{Added ignorespaces to \cs{es@dots}}
+% \changes{spanish~4.1d}{01/09/12}{Now there are two versions of
+% percent sign}
+% \begin{macrocode}
+\addto\textspanish{\bbl@frenchspacing}
+\addto\notextspanish{\bbl@nonfrenchspacing}
+
+\addto\textspanish{%
+ \let\es@save@dot\.%
+ \babel@save\.%
+ \def\.{\@ifnextchar.{\es@dots}{\es@save@dot}}}
+
+\def\es@dots..{\leavevmode\hbox{...}\spacefactor\@M}
+
+\ifes@LaTeXe %<<<<<<
+ \addto\textspanish{%
+ \let\percentsign\%%
+ \babel@save\%%
+ \def\%{\unskip\,\percentsign{}}}
+\else
+ \addto\textspanish{%
+ \let\percentsign\%%
+ \babel@save\%%
+ \def\%{\unskip\ifmmode\,\else$\m@th\,$\fi\percentsign{}}}
+\fi
+% \end{macrocode}
+%
+% We follow with the math group.
+% It's not easy to add an accent in an operator.
+% The difficulty is that we must avoid using text (that is,
+% |\mbox|) because we have no control on font and size, and
+% at time we should access |\i|, which is a text
+% command forbidden in math mode. |\dotlessi| must be
+% converted to uppercase if necessary in \LaTeXe. There are
+% two versions, depending on the format.
+%
+% \changes{spanishb~1.1}{98/04/01}{dotless math i handling
+% rewritten}
+% \changes{spanishb~1.1}{98/05/13}{Again rewriten in full. Now
+% that character is accesible as \cs{dotlessi}}
+% \changes{spanish~4.0c}{98/12/07}{Moved from its original place below.
+% Decimal values replaced by hex ones.}
+% \changes{spanish~4.0k}{99/10/12}{Minor improvementes in
+% \cs{es@dotlessi}. Now it behaves like the dotlessi.sty package}
+% \changes{spanish~4.1f}{02/05/17}{\cs{i} not used directly in
+% the upper/lowercase list}
+% \begin{macrocode}
+\addto\mathspanish{%
+ \babel@save\dotlessi
+ \def\dotlessi{\protect\es@dotlessi}}
+
+\let\nomathspanish\relax %% Unused, but called
+
+\ifes@LaTeXe %<<<<<<
+ \def\es@texti{\i}
+ \addto\@uclclist{\dotlessi\es@texti}
+\fi %<<<<<<
+
+\ifes@LaTeXe %<<<<<<
+ \def\es@dotlessi{%
+ \ifmmode
+ {\ifnum\mathgroup=\m@ne
+ \imath
+ \else
+ \count@\escapechar \escapechar=\m@ne
+ \expandafter\expandafter\expandafter
+ \split@name\expandafter\string\the\textfont\mathgroup\@nil
+ \escapechar=\count@
+ \@ifundefined{\f@encoding\string\i}%
+ {\edef\f@encoding{\string?}}{}%
+ \expandafter\count@\the\csname\f@encoding\string\i\endcsname
+ \advance\count@"7000
+ \mathchar\count@
+ \fi}%
+ \else
+ \i
+ \fi}
+\else %<<<<<<
+ \def\es@dotlessi{%
+ \ifmmode
+ \mathchar"7010
+ \else
+ \i
+ \fi}
+\fi %<<<<<<
+% \end{macrocode}
+%
+% The switches for accents and spaces in math.
+%
+%\changes{spanish~4.0b}{98/11/10}{Added missing \cs{nolimits}}
+%\changes{spanish~4.0c}{98/11/30}{Merged \cs{es@op@i} and
+% \cs{es@op@a} into a single command. The (re)defided commands
+% have been changed as suggested by JoseRa Portillo and Juan Luis
+% Varona. Now it conforms the UNE 5010 norm. Code is no
+% longer duplicated--\cs{operator@font} is defined for lplain
+% instead}
+%\changes{spanish~4.0c}{98/12/10}{Removed the explicit
+% trigonometric declaration. While some functions are
+% preceptive (sen, tg) some other are optional and
+% defined in \cs{spanishoperators}. This is because there
+% is no norm in Spanish and there is quite a chaos in their
+% form. Restored the forms of v 1.1}
+%\changes{spanish~4.0k}{99/10/13}{Restored the \cs{es@op@i}
+% command, because we have to discriminate \cs{dotlessi} and i}
+%
+% \begin{macrocode}
+\def\accentedoperators{%
+ \def\es@op@ac##1{\acute{##1}}%
+ \def\es@op@i{\acute{\dotlessi}}}
+\def\unaccentedoperators{%
+ \def\es@op@ac##1{##1}%
+ \def\es@op@i{i}}
+\accentedoperators
+
+\def\spacedoperators{\let\es@op@sp\,}
+\def\unspacedoperators{\let\es@op@sp\@empty}
+\spacedoperators
+% \end{macrocode}
+%
+% The operators are stored in |\es@operators|, which in turn is
+% included in the math group. Since |\operator@font| is
+% defined in \LaTeXe{} only, we defined in the plain variant.
+%
+% \changes{spanish~4.0g}{99/05/05}{Restored the assignment of
+% \cs{operator@font} which was misteriously missing}
+% \changes{spanish~4.0i}{99/06/21}{Replaced wrong \cs{spanishoperators}
+% by \cs{es@b}}
+% \changes{spanish~4.0j}{99/09/17}{Removed an extra line in the lplain
+% option}
+% \changes{spanish~4.2a}{03/08/08}{Names including \cs{acute} can be
+% formed}
+%
+% \begin{macrocode}
+\addto\mathspanish{\es@operators}
+
+\ifes@LaTeXe\else %<<<<<<
+ \let\operator@font\rm
+ \def\@empty{}
+\fi %<<<<<<
+
+\def\es@operators{%
+ \babel@save\lim
+ \def\lim{\mathop{\operator@font l\protect\es@op@i m}}%
+ \babel@save\limsup
+ \def\limsup{\mathop{\operator@font l\es@op@i m\,sup}}%
+ \babel@save\liminf
+ \def\liminf{\mathop{\operator@font l\es@op@i m\,inf}}%
+ \babel@save\max
+ \def\max{\mathop{\operator@font m\es@op@ac ax}}%
+ \babel@save\inf
+ \def\inf{\mathop{\operator@font \protect\es@op@i nf}}%
+ \babel@save\min
+ \def\min{\mathop{\operator@font m\protect\es@op@i n}}%
+ \babel@save\bmod
+ \def\bmod{%
+ \nonscript\mskip-\medmuskip\mkern5mu%
+ \mathbin{\operator@font m\es@op@ac od}\penalty900\mkern5mu%
+ \nonscript\mskip-\medmuskip}%
+ \babel@save\pmod
+ \def\pmod##1{%
+ \allowbreak\mkern18mu({\operator@font m\es@op@ac od}\,\,##1)}%
+ \def\es@a##1 {%
+ \es@delayed
+ \if^##1^\then % is it empty? do nothing and continue
+ \es@a
+ \else
+ \es@delayed
+ \if&##1\then % is it &? do nothing and finish
+ \else
+ \begingroup
+ \let\,\@empty % \, is ignored when def'ing the macro name
+ \let\acute\@firstofone % same
+ \edef\es@b{\expandafter\noexpand\csname##1\endcsname}%
+ \def\,{\noexpand\es@op@sp}%
+ \def\acute####1{%
+ \if i####1%
+ \noexpand\es@op@i
+ \else
+ \noexpand\es@op@ac####1%
+ \fi}%
+ \edef\es@a{\endgroup
+ \noexpand\babel@save\expandafter\noexpand\es@b
+ \def\expandafter\noexpand\es@b{%
+ \mathop{\noexpand\operator@font##1}\nolimits}}%
+ \es@a % It restores itself
+ \es@a
+ \fi
+ \fi}%
+ \let\es@b\spanishoperators
+ \addto\es@b{ }%
+ \expandafter\es@a\es@b sen tg arc\,sen arc\,cos arc\,tg & }
+
+\def\spanishoperators{cotg cosec senh tgh}
+% \end{macrocode}
+%
+% Now comes the text shorthands. They are grouped in
+% |\shorthandsspanish| and this style performs some
+% operations before the babel shortands are called.
+% The goals are to allow espression like |$a^{x'}$|
+% and to deactivate the shorthands making them of
+% category `other.' After providing a |\'i| shorthand,
+% the new macros are defined.
+%
+% \changes{spanish~4.1a}{99/11/30}{Added basic code for
+% spanish shorthands.}
+% \changes{spanish~4.1a}{99/12/01}{Debugged and added support
+% for the babel groups.}
+% \changes{spanish~4.1c}{00/10/04}{Revised so that it
+% now uses the babel shorthands}
+% \changes{spanish~4.2a}{03/08/08}{Deactivation of dot as
+% a special case}
+% \begin{macrocode}
+\DeclareTextCompositeCommand{\'}{OT1}{i}{\@tabacckludge'{\i}}
+
+\def\es@set@shorthand#1{%
+ \expandafter\edef\csname es@savecat\string#1\endcsname
+ {\the\catcode`#1}%
+ \initiate@active@char{#1}%
+ \catcode`#1=\csname es@savecat\string#1\endcsname\relax
+ \expandafter\let\csname es@math\string#1\expandafter\endcsname
+ \csname normal@char\string#1\endcsname}
+
+\def\es@use@shorthand{%
+ \es@delayed
+ \ifx\thepage\relax\then
+ \string
+ \else{%
+ \es@delayed
+ \ifx\protect\@unexpandable@protect\then
+ \noexpand
+ \else
+ \es@use@sh
+ \fi}%
+ \fi}
+
+\def\es@text@sh#1{\csname active@char\string#1\endcsname}
+\def\es@math@sh#1{\csname es@math\string#1\endcsname}
+
+\def\es@use@sh{%
+ \es@delayed
+ \if@safe@actives\then
+ \string
+ \else{%
+ \es@delayed
+ \ifmmode\then
+ \es@math@sh
+ \else
+ \es@text@sh
+ \fi}%
+ \fi}
+
+\gdef\es@activate#1{%
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \def~{\es@use@shorthand~}}}
+
+\def\spanishdeactivate#1{%
+ \@tfor\@tempa:=#1\do{\expandafter\es@spdeactivate\@tempa}}
+
+\def\es@spdeactivate#1{%
+ \if.#1%
+ \mathcode`\.=\es@period@code
+ \else
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \expandafter\let\expandafter~%
+ \csname normal@char\string#1\endcsname}%
+ \catcode`#1\csname es@savecat\string#1\endcsname\relax
+ \fi}
+
+\def\es@reviveshorthands{%
+ \es@restore{"}\es@restore{~}%
+ \es@restore{<}\es@restore{>}%
+ \es@quoting}
+
+\def\es@restore#1{%
+ \catcode`#1=\active
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \bbl@deactivate{~}}}
+% \end{macrocode}
+%
+% But \textsf{spanish} allows two category codes for |'|,
+% so both should be taken into account in \cs{bbl@pr@m@s}.
+%
+% \changes{spanish~4.1c}{00/10/03}{Added support for primes
+% which are either `active' or `other'}
+% \begin{macrocode}
+\begingroup
+\catcode`\'=12
+\lccode`~=`' \lccode`'=`'
+\lowercase{%
+\gdef\bbl@pr@m@s{%
+ \es@delayed
+ \ifx~\@let@token\then
+ \pr@@@s
+ \else
+ {\es@delayed
+ \ifx'\@let@token\then
+ \pr@@@s
+ \else
+ {\es@delayed
+ \ifx^\@let@token\then
+ \pr@@@t
+ \else
+ \egroup
+ \fi}%
+ \fi}%
+ \fi}}
+\endgroup
+% \end{macrocode}
+%
+% \changes{spanishb~1.1}{98/05/15}{Rewritten part}
+% \changes{spanish~4.0c}{98/12/07}{Optimized a bit}
+%
+% \begin{macrocode}
+\expandafter\ifx\csname @tabacckludge\endcsname\relax
+ \let\es@tak\a
+\else
+ \let\es@tak\@tabacckludge
+\fi
+
+\ifes@LaTeXe %<<<<<<
+ \def\@tabacckludge#1{\expandafter\es@tak\string#1}
+ \let\a\@tabacckludge
+\else\ifes@plain %<<<<<<
+ \def\@tabacckludge#1{\csname\string#1\endcsname}
+\else %<<<<<<
+ \def\@tabacckludge#1{\csname a\string#1\endcsname}
+\fi\fi %<<<<<<
+
+\expandafter\ifx\csname add@accent\endcsname\relax
+ \def\add@accent#1#2{\accent#1 #2}
+\fi
+% \end{macrocode}
+%
+% Instead of redefining |\'|, we redefine the internal
+% macro for the OT1 encoding.
+% \changes{spanish~4.1f}{02/05/17}{The spacefactor is restored
+% with the method used in LaTeX2e}
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+ \def\es@accent#1#2#3{%
+ \expandafter\@text@composite
+ \csname OT1\string#1\endcsname#3\@empty\@text@composite
+ {\bbl@allowhyphens\add@accent{#2}{#3}\bbl@allowhyphens
+ \setbox\@tempboxa\hbox{#3%
+ \global\mathchardef\accent@spacefactor\spacefactor}%
+ \spacefactor\accent@spacefactor}}
+\else %<<<<<<
+ \def\es@accent#1#2#3{%
+ \bbl@allowhyphens\add@accent{#2}{#3}\bbl@allowhyphens
+ \spacefactor\sfcode`#3 }
+\fi %<<<<<<
+% \end{macrocode}
+%
+% The shorthands are activated in the aux file. Now, we begin
+% the shorthands group.
+%
+% \changes{spanish~4.0j}{99/09/15}{Added shorthands for \cs{protect}
+% following active chars. This way, they work in headers}
+% \changes{spanish~4.0l}{99/11/13}{Added the \cs{es@activate}
+% command, which makes the shorthands more robust in math mode.
+% In particular, any of them may be followed by a closing brace}
+% \begin{macrocode}
+\addto\shorthandsspanish{\languageshorthands{spanish}}
+\let\noshorthandsspanish\relax
+% \end{macrocode}
+%
+% First, decimal comma.
+%
+% \changes{spanish~4.1c}{00/10/03}{Removed an unnecessary macro.}
+% \begin{macrocode}
+\def\spanishdecimal#1{\def\es@decimal{{#1}}}
+\def\decimalcomma{\spanishdecimal{,}}
+\def\decimalpoint{\spanishdecimal{.}}
+\decimalcomma
+
+\es@set@shorthand{.}
+
+\@namedef{es@math\string.}{%
+ \@ifnextchar\egroup
+ {\mathchar\es@period@code\relax}%
+ {\es@text@sh.}}
+
+\declare@shorthand{system}{.}{\mathchar\es@period@code\relax}
+% \end{macrocode}
+%
+% \changes{spanish~4.0a}{98/09/10}{After the . is activated, it is
+% redefined to avoid errors if followed by a closing brace.
+% Changed \cs{edef} by \cs{mathchardef}. Use
+% \cs{babel@savevariable}instead of \cs{noextrasspanish}.}
+% \changes{spanish~4.0e}{99/04/10}{The catcode is restored in
+% the aux file, too}
+% \begin{macrocode}
+\addto\shorthandsspanish{%
+ \mathchardef\es@period@code\the\mathcode`\.%
+ \babel@savevariable{\mathcode`\.}%
+ \mathcode`\.="8000 %
+ \es@activate{.}}
+
+\AtBeginDocument{%
+ \catcode`\.=12
+ \if@filesw
+ \immediate\write\@mainaux{%
+ \string\catcode`\string\.=12}%
+ \fi}
+
+\declare@shorthand{spanish}{.1}{\es@decimal1}
+\declare@shorthand{spanish}{.2}{\es@decimal2}
+\declare@shorthand{spanish}{.3}{\es@decimal3}
+\declare@shorthand{spanish}{.4}{\es@decimal4}
+\declare@shorthand{spanish}{.5}{\es@decimal5}
+\declare@shorthand{spanish}{.6}{\es@decimal6}
+\declare@shorthand{spanish}{.7}{\es@decimal7}
+\declare@shorthand{spanish}{.8}{\es@decimal8}
+\declare@shorthand{spanish}{.9}{\es@decimal9}
+\declare@shorthand{spanish}{.0}{\es@decimal0}
+% \end{macrocode}
+%
+% Now accents and tools
+%
+% \changes{spanish~4.0d}{99/03/26}{Removed the tilde settings
+% because they are included in babel.def}
+% \changes{spanish~4.0b}{98/10/02}{Introduced \cs{es@umlaut} to allow
+% further division in words containing g\"u}
+% \changes{spanish~4.0c}{98/12/02}{Added missing space at the end
+% of \cs{es@umlaut}}
+% \begin{macrocode}
+\es@set@shorthand{"}
+\def\es@umlaut#1{%
+ \bbl@allowhyphens\add@accent{127}#1\bbl@allowhyphens
+ \spacefactor\sfcode`#1 }
+% \end{macrocode}
+%
+% We override the default |"| of babel, intended for german.
+%
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+ \addto\shorthandsspanish{%
+ \es@activate{"}%
+ \es@activate{~}%
+ \babel@save\bbl@umlauta
+ \let\bbl@umlauta\es@umlaut
+ \expandafter\babel@save\csname OT1\string\~\endcsname
+ \expandafter\def\csname OT1\string\~\endcsname{\es@accent\~{126}}%
+ \expandafter\babel@save\csname OT1\string\'\endcsname
+ \expandafter\def\csname OT1\string\'\endcsname{\es@accent\'{19}}}
+\else %<<<<<<
+ \addto\shorthandsspanish{%
+ \es@activate{"}%
+ \es@activate{~}%
+ \babel@save\bbl@umlauta
+ \let\bbl@umlauta\es@umlaut
+ \babel@save\~%
+ \def\~{\es@accent\~{126}}%
+ \babel@save\'%
+ \def\'#1{\if#1i\es@accent\'{19}\i\else\es@accent\'{19}{#1}\fi}}
+\fi %<<<<<<
+% \end{macrocode}
+% \changes{spanish~4.0c}{98/11/19}{Subtituted
+% \cs{char}\cs{hyphenchar}\cs{font} for some instances of -}
+% \changes{spanish~4.0h}{98/06/06}{Added \cs{deactivatetilden}}
+% \changes{spanish~4.2a}{03/08/08}{Added raised ?` and !`}
+% \changes{spanish~4.2b}{03/09/12}{Added er and ER}
+% \begin{macrocode}
+\declare@shorthand{spanish}{"a}{\protect\es@sptext{a}}
+\declare@shorthand{spanish}{"A}{\protect\es@sptext{A}}
+\declare@shorthand{spanish}{"o}{\protect\es@sptext{o}}
+\declare@shorthand{spanish}{"O}{\protect\es@sptext{O}}
+\declare@shorthand{spanish}{"e}{\protect\es@sptext@r{e}}
+\declare@shorthand{spanish}{"E}{\protect\es@sptext@r{E}}
+
+\def\es@sptext@r#1#2{\es@sptext{#1#2}}
+
+\declare@shorthand{spanish}{"u}{\"u}
+\declare@shorthand{spanish}{"U}{\"U}
+
+\declare@shorthand{spanish}{"c}{\c{c}}
+\declare@shorthand{spanish}{"C}{\c{C}}
+
+\declare@shorthand{spanish}{"<}{\guillemotleft{}}
+\declare@shorthand{spanish}{">}{\guillemotright{}}
+\declare@shorthand{spanish}{"-}{\bbl@allowhyphens\-\bbl@allowhyphens}
+\declare@shorthand{spanish}{"=}%
+ {\bbl@allowhyphens\char\hyphenchar\font\hskip\z@skip}
+\declare@shorthand{spanish}{"~}
+ {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
+ {\char\hyphenchar\font}{\char\hyphenchar\font}\bbl@allowhyphens}
+\declare@shorthand{spanish}{"r}
+ {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
+ {}{r}\bbl@allowhyphens}
+\declare@shorthand{spanish}{"R}
+ {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
+ {}{R}\bbl@allowhyphens}
+\declare@shorthand{spanish}{"y}
+ {\@ifundefined{scalebox}%
+ {\ensuremath{\tau}}%
+ {\raisebox{1ex}{\scalebox{-1}{\resizebox{.45em}{1ex}{2}}}}}
+\declare@shorthand{spanish}{""}{\hskip\z@skip}
+\declare@shorthand{spanish}{"/}
+ {\setbox\z@\hbox{/}%
+ \dimen@\ht\z@
+ \advance\dimen@-1ex
+ \advance\dimen@\dp\z@
+ \dimen@.31\dimen@
+ \advance\dimen@-\dp\z@
+ \ifdim\dimen@>0pt
+ \kern.01em\lower\dimen@\box\z@\kern.03em
+ \else
+ \box\z@
+ \fi}
+\declare@shorthand{spanish}{"?}
+ {\setbox\z@\hbox{?`}%
+ \leavevmode\raise\dp\z@\box\z@}
+\declare@shorthand{spanish}{"!}
+ {\setbox\z@\hbox{!`}%
+ \leavevmode\raise\dp\z@\box\z@}
+
+\es@set@shorthand{~}
+\declare@shorthand{spanish}{~n}{\~n}
+\declare@shorthand{spanish}{~N}{\~N}
+\declare@shorthand{spanish}{~-}{%
+ \leavevmode
+ \bgroup
+ \let\@sptoken\es@dashes % This assignation changes the
+ \@ifnextchar-% \@ifnextchar behaviour
+ {\es@dashes}%
+ {\hbox{\char\hyphenchar\font}\egroup}}
+\def\es@dashes-{%
+ \@ifnextchar-%
+ {\bbl@allowhyphens\hbox{---}\bbl@allowhyphens\egroup\@gobble}%
+ {\bbl@allowhyphens\hbox{--}\bbl@allowhyphens\egroup}}
+
+\def\deactivatetilden{%
+ \expandafter\let\csname spanish@sh@\string~@n@\endcsname\relax
+ \expandafter\let\csname spanish@sh@\string~@N@\endcsname\relax}
+% \end{macrocode}
+%
+% The shorthands for |quoting|.
+%
+% \changes{spanish~4.1d}{01/09/10}{Disabled if in xmltex}
+% \begin{macrocode}
+\expandafter\ifx\csname XML@catcodes\endcsname\relax
+ \addto\es@select{%
+ \catcode`\<\active\catcode`\>=\active
+ \es@quoting}
+
+ \es@set@shorthand{<}
+ \es@set@shorthand{>}
+
+ \declare@shorthand{system}{<}{\csname normal@char\string<\endcsname}
+ \declare@shorthand{system}{>}{\csname normal@char\string>\endcsname}
+
+ \addto\shorthandsspanish{%
+ \es@activate{<}%
+ \es@activate{>}}
+% \end{macrocode}
+%
+% \changes{spanish~4.0e}{99/04/10}{\cs{es@quoting} is written to the
+% aux file, too}
+% \begin{macrocode}
+ \ifes@LaTeXe %<<<<<<
+ \AtBeginDocument{%
+ \es@quoting
+ \if@filesw
+ \immediate\write\@mainaux{\string\es@quoting}%
+ \fi}%
+ \fi %<<<<<<
+
+ \def\activatequoting{%
+ \catcode`>=\active \catcode`<=\active
+ \let\es@quoting\activatequoting}
+ \def\deactivatequoting{%
+ \catcode`>=12 \catcode`<=12
+ \let\es@quoting\deactivatequoting}
+
+ \declare@shorthand{spanish}{<<}{\begin{quoting}}
+ \declare@shorthand{spanish}{>>}{\end{quoting}}
+\fi
+
+\let\es@quoting\relax
+\let\deactivatequoting\relax
+\let\activatequoting\relax
+% \end{macrocode}
+%
+% The acute accents are stored in a macro. If |activeacute| was set
+% as an option it's executed. If not is not deleted for a possible
+% later use in the |cfg| file. In non \LaTeXe{} formats is always
+% executed.
+%
+% \changes{spanish~4.0l}{99/11/12}{We make a preevaluation of acute;
+% in math mode, the shorthand mechanism is bypassed. That's done
+% *after* the test of the protection status.}
+% \begin{macrocode}
+\def\es@activeacute{%
+ \es@set@shorthand{'}%
+ \addto\shorthandsspanish{\es@activate{'}}%
+ \addto\es@reviveshorthands{\es@restore{'}}%
+ \addto\es@select{\catcode`'=\active}%
+ \declare@shorthand{spanish}{'a}{\@tabacckludge'a}%
+ \declare@shorthand{spanish}{'A}{\@tabacckludge'A}%
+ \declare@shorthand{spanish}{'e}{\@tabacckludge'e}%
+ \declare@shorthand{spanish}{'E}{\@tabacckludge'E}%
+ \declare@shorthand{spanish}{'i}{\@tabacckludge'i}%
+ \declare@shorthand{spanish}{'I}{\@tabacckludge'I}%
+ \declare@shorthand{spanish}{'o}{\@tabacckludge'o}%
+ \declare@shorthand{spanish}{'O}{\@tabacckludge'O}%
+ \declare@shorthand{spanish}{'u}{\@tabacckludge'u}%
+ \declare@shorthand{spanish}{'U}{\@tabacckludge'U}%
+ \declare@shorthand{spanish}{'n}{\~n}%
+ \declare@shorthand{spanish}{'N}{\~N}%
+ \declare@shorthand{spanish}{''}{\textquotedblright}%
+ \let\es@activeacute\relax}
+
+\ifes@LaTeXe %<<<<<<
+ \@ifpackagewith{babel}{activeacute}{\es@activeacute}{}
+\else %<<<<<<
+ \es@activeacute
+\fi %<<<<<<%
+% \end{macrocode}
+%
+% And the customization. By default these macros only
+% store the values and do nothing.
+%
+% \begin{macrocode}
+\def\es@enumerate#1#2#3#4{%
+ \def\es@enum{{#1}{#2}{#3}{#4}}}
+
+\def\es@itemize#1#2#3#4{%
+ \def\es@item{{#1}{#2}{#3}{#4}}}
+% \end{macrocode}
+%
+% The part formerly in the |.lld| file comes here. It performs
+% layout adaptation of \LaTeX{} to ``orthodox'' Spanish rules.
+% \changes{spanish~4.1c}{00/09/30}{The box used in itemize made
+% slightly smaller (.1ex).}
+% \changes{spanish~4.1d}{02/01/25}{Removed extra \cs{enspace}
+% which formatted differently \cs{item} with brackets.}
+% \changes{spanish~4.2a}{03/08/08}{Added \cs{spanishsignitems}}
+% \changes{spanish~4.2a}{03/08/08}{Mispaced \cs{es@enumerate}
+% and \cs{es@itemize} moved into \cs{layoutspanish}}
+% \changes{spanish~4.2b}{03/09/12}{If an entry toc has an
+% empty \cs{numberline} the dot is not printed}
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+
+\es@enumerate{1.}{a)}{1)}{a$'$}
+\def\spanishdashitems{\es@itemize{---}{---}{---}{---}}
+\def\spanishsymbitems{%
+ \es@itemize
+ {\leavevmode\hbox to 1.2ex
+ {\hss\vrule height .9ex width .7ex depth -.2ex\hss}}%
+ {\textbullet}%
+ {$\m@th\circ$}%
+ {$\m@th\diamond$}}
+\def\spanishsignitems{%
+ \es@itemize
+ {\textbullet}%
+ {$\m@th\circ$}%
+ {$\m@th\diamond$}%
+ {$\m@th\triangleright$}}
+\spanishsymbitems
+
+\def\es@enumdef#1#2#3\@@{%
+ \if#21%
+ \@namedef{theenum#1}{\arabic{enum#1}}%
+ \else\if#2a%
+ \@namedef{theenum#1}{\emph{\alph{enum#1}}}%
+ \else\if#2A%
+ \@namedef{theenum#1}{\Alph{enum#1}}%
+ \else\if#2i%
+ \@namedef{theenum#1}{\roman{enum#1}}%
+ \else\if#2I%
+ \@namedef{theenum#1}{\Roman{enum#1}}%
+ \else\if#2o%
+ \@namedef{theenum#1}{\arabic{enum#1}\protect\es@sptext{o}}%
+ \fi\fi\fi\fi\fi\fi
+ \toks@\expandafter{\csname theenum#1\endcsname}
+ \expandafter\edef\csname labelenum#1\endcsname
+ {\noexpand\es@listquot\the\toks@#3}}
+
+\addto\layoutspanish{%
+ \def\es@enumerate##1##2##3##4{%
+ \es@enumdef{i}##1\@empty\@empty\@@
+ \es@enumdef{ii}##2\@empty\@empty\@@
+ \es@enumdef{iii}##3\@empty\@empty\@@
+ \es@enumdef{iv}##4\@empty\@empty\@@}%
+ \def\es@itemize##1##2##3##4{%
+ \def\labelitemi{\es@listquot##1}%
+ \def\labelitemii{\es@listquot##2}%
+ \def\labelitemiii{\es@listquot##3}%
+ \def\labelitemiv{\es@listquot##4}}%
+ \def\p@enumii{\theenumi}%
+ \def\p@enumiii{\theenumi\theenumii}%
+ \def\p@enumiv{\p@enumiii\theenumiii}%
+ \expandafter\es@enumerate\es@enum
+ \expandafter\es@itemize\es@item
+ \DeclareTextCommand{\guillemotleft}{OT1}{%
+ \ifmmode\ll
+ \else
+ \save@sf@q{\penalty\@M
+ \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
+ \char40 \kern-0.19em\char40 }}%
+ \fi}%
+ \DeclareTextCommand{\guillemotright}{OT1}{%
+ \ifmmode\gg
+ \else
+ \save@sf@q{\penalty\@M
+ \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
+ \char41 \kern-0.19em\char41 }}%
+ \fi}%
+ \def\@fnsymbol##1%
+ {\ifcase##1\or*\or**\or***\or****\or
+ *****\or******\else\@ctrerr\fi}%
+ \def\@alph##1%
+ {\ifcase##1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
+ k\or l\or m\or n\or \~n\or o\or p\or q\or r\or s\or t\or u\or v\or
+ w\or x\or y\or z\else\@ctrerr\fi}%
+ \def\@Alph##1%
+ {\ifcase##1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
+ K\or L\or M\or N\or \~N\or O\or P\or Q\or R\or S\or T\or U\or V\or
+ W\or X\or Y\or Z\else\@ctrerr\fi}%
+ \let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue
+ \def\@seccntformat##1{\csname the##1\endcsname.\quad}%
+ \def\numberline##1{\hb@xt@\@tempdima{##1\if&##1&\else.\fi\hfil}}%
+ \def\@roman##1{\protect\es@roman{\number##1}}%
+ \def\es@roman##1{\protect\es@lsc{\romannumeral##1}}%
+ \def\esromanindex##1##2{##1{\protect\es@lsc{##2}}}}
+% \end{macrocode}
+%
+% We need to execute the following code when babel has been
+% run, in order to see if |spanish| is the main language.
+%
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \let\es@activeacute\@undefined
+ \def\bbl@tempa{spanish}%
+ \ifx\bbl@main@language\bbl@tempa
+ \AtBeginDocument{\layoutspanish}%
+ \addto\es@select{%
+ \@ifstar{\let\layoutspanish\relax}%
+ {\layoutspanish\let\layoutspanish\relax}}%
+ \fi
+ \selectspanish}
+
+\fi %<<<<<<
+% \end{macrocode}
+%
+% After restoring the catcode of |~| and setting the minimal
+% values for hyphenation, the |.ldf| is finished.
+%
+% \changes{spanish~4.0e}{99/04/11}{Removed duplicated \cs{loadlocalcfg}}
+% \changes{spanish~4.0a}{98/09/14}{Moved
+% \cs{let}\cs{es@activeacute}\cs{@undefined}
+% to \cs{AtEndOfPackage}}
+% \changes{spanish~4.0a}{98/09/12}{Introduced \cs{ldf@finish}}
+% \changes{spanish~4.1d}{01/06/06}{Removed extra \cs{endinput}}
+% \begin{macrocode}
+\es@savedcatcodes
+
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+
+\ifes@LaTeXe %<<<<<<
+ \ldf@finish{spanish}
+\else %<<<<<<
+ \es@select
+ \ldf@finish{spanish}
+ \csname activatequoting\endcsname
+\fi %<<<<<<
+
+%</code>
+% \end{macrocode}
+% That's all in the main file. Now the file with
+% \textsf{custom-bib} macros.
+%
+% \changes{spanish~4.0b}{98/11/09}{Added support for custom-bib}
+% \changes{spanish~4.0i}{99/06/21}{the mthesis and phdthesis text
+% were reverted. Fixed}
+% \changes{spanish~4.0i}{99/06/21}{Added \cs{bbletal}}
+% \begin{macrocode}
+%<*bblbst>
+\def\bbland{y}
+\def\bbleditors{directores} \def\bbleds{dirs.\@}
+\def\bbleditor{director} \def\bbled{dir.\@}
+\def\bbledby{dirigido por}
+\def\bbledition{edici\'on} \def\bbledn{ed.\@}
+\def\bbletal{y otros}
+\def\bblvolume{vol\'umen} \def\bblvol{vol.\@}
+\def\bblof{de}
+\def\bblnumber{n\'umero} \def\bblno{n\sptext{o}}
+\def\bblin{en}
+\def\bblpages{p\'aginas} \def\bblpp{p\'ags.\@}
+\def\bblpage{p\'gina} \def\bblp{p\'ag.\@}
+\def\bblchapter{cap\'itulo} \def\bblchap{cap.\@}
+\def\bbltechreport{informe t\'ecnico}
+\def\bbltechrep{inf.\@ t\'ec.\@}
+\def\bblmthesis{proyecto de fin de carrera}
+\def\bblphdthesis{tesis doctoral}
+\def\bblfirst {primera} \def\bblfirsto {1\sptext{a}}
+\def\bblsecond{segunda} \def\bblsecondo{2\sptext{a}}
+\def\bblthird {tercera} \def\bblthirdo {3\sptext{a}}
+\def\bblfourth{cuarta} \def\bblfourtho{4\sptext{a}}
+\def\bblfifth {quinta} \def\bblfiftho {5\sptext{a}}
+\def\bblth{\sptext{a}}
+\let\bblst\bblth \let\bblnd\bblth \let\bblrd\bblth
+\def\bbljan{enero} \def\bblfeb{febrero} \def\bblmar{marzo}
+\def\bblapr{abril} \def\bblmay{mayo} \def\bbljun{junio}
+\def\bbljul{julio} \def\bblaug{agosto} \def\bblsep{septiembre}
+\def\bbloct{octubre}\def\bblnov{noviembre}\def\bbldec{diciembre}
+%</bblbst>
+% \end{macrocode}
+%
+% The |spanish| option writes a macro in the page field of
+% \textit{MakeIndex} in entries with small caps number, and they
+% are rejected. This program is a preprocessor which moves this
+% macro to the entry field.
+%
+% \begin{macrocode}
+%<*indexes>
+\makeatletter
+
+\newcount\es@converted
+\newcount\es@processed
+
+\def\es@encap{`\|}
+\def\es@openrange{`\(}
+\def\es@closerange{`\)}
+
+\def\es@split@file#1.#2\@@{#1}
+\def\es@split@ext#1.#2\@@{#2}
+
+\typein[\answer]{^^JArchivo que convertir^^J%
+ (extension por omision .idx):}
+
+\@expandtwoargs\in@{.}{\answer}
+\ifin@
+ \edef\es@input@file{\expandafter\es@split@file\answer\@@}
+ \edef\es@input@ext{\expandafter\es@split@ext\answer\@@}
+\else
+ \edef\es@input@file{\answer}
+ \def\es@input@ext{idx}
+\fi
+
+\typein[\answer]{^^JArchivo de destino^^J%
+ (archivo por omision: \es@input@file.eix,^^J%
+ extension por omision .eix):}
+\ifx\answer\@empty
+ \edef\es@output{\es@input@file.eix}
+\else
+ \@expandtwoargs\in@{.}{\answer}
+ \ifin@
+ \edef\es@output{\answer}
+ \else
+ \edef\es@output{\answer.eix}
+ \fi
+\fi
+
+\typein[\answer]{%
+ ^^J?Se ha usado algun esquema especial de controles^^J%
+ de MakeIndex para encap, open_range o close_range?^^J%
+ [s/n] (n por omision)}
+
+\if s\answer
+ \typein[\answer]{^^JCaracter para 'encap'^^J%
+ (\string| por omision)}
+ \ifx\answer\@empty\else
+ \edef\es@encap{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+ \typein[\answer]{^^JCaracter para 'open_range'^^J%
+ (\string( por omision)}
+ \ifx\answer\@empty\else
+ \edef\es@openrange{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+ \typein[\answer]{^^JCaracter para 'close_range'^^J%
+ (\string) por omision)}
+ \ifx\answer\@empty\else
+ \edef\es@closerange{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+\fi
+
+\newwrite\es@indexfile
+\immediate\openout\es@indexfile=\es@output
+
+\newif\ifes@encapsulated
+
+\def\es@roman#1{\romannumeral#1 }
+\edef\es@slash{\expandafter\@gobble\string\\}
+
+\def\indexentry{%
+ \begingroup
+ \@sanitize
+ \es@indexentry}
+
+\begingroup
+
+\catcode`\|=12 \lccode`\|=\es@encap\relax
+\catcode`\(=12 \lccode`\(=\es@openrange\relax
+\catcode`\)=12 \lccode`\)=\es@closerange\relax
+
+\lowercase{
+\gdef\es@indexentry#1{%
+ \endgroup
+ \advance\es@processed\@ne
+ \es@encapsulatedfalse
+ \es@bar@idx#1|\@@
+ \es@idxentry}%
+}
+
+\lowercase{
+\gdef\es@idxentry#1{%
+ \in@{\es@roman}{#1}%
+ \ifin@
+ \advance\es@converted\@ne
+ \immediate\write\es@indexfile{%
+ \string\indexentry{\es@b|\ifes@encapsulated\es@p\fi esromanindex%
+ {\ifx\es@a\@empty\else\es@slash\es@a\fi}}{#1}}%
+ \else
+ \immediate\write\es@indexfile{%
+ \string\indexentry{\es@b\ifes@encapsulated|\es@p\es@a\fi}{#1}}%
+ \fi}
+}
+
+\lowercase{
+\gdef\es@bar@idx#1|#2\@@{%
+ \def\es@b{#1}\def\es@a{#2}%
+ \ifx\es@a\@empty\else\es@encapsulatedtrue\es@bar@eat#2\fi}
+}
+
+\lowercase{
+\gdef\es@bar@eat#1#2|{\def\es@p{#1}\def\es@a{#2}%
+ \edef\es@t{(}\ifx\es@t\es@p
+ \else\edef\es@t{)}\ifx\es@t\es@p
+ \else
+ \edef\es@a{\es@p\es@a}\let\es@p\@empty%
+ \fi\fi}
+}
+
+\endgroup
+
+\input \es@input@file.\es@input@ext
+
+\immediate\closeout\es@indexfile
+
+\typeout{*****************}
+\typeout{Se ha procesado: \es@input@file.\es@input@ext }
+\typeout{Lineas leidas: \the\es@processed}
+\typeout{Lineas convertidas: \the\es@converted}
+\typeout{Resultado en: \es@output}
+\ifnum\es@converted>\z@
+ \typeout{Genere el indice a partir de ese archivo}
+\else
+ \typeout{No se ha realizado ningun tipo de conversion}
+ \typeout{Se puede generar el archivo directamente^^J%
+ de \es@input@file.\es@input@ext}
+\fi
+\typeout{*****************}
+\@@end
+%</indexes>
+% \end{macrocode}
+%
+% \Finale
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
+
+
+
+
+
diff --git a/Master/texmf-dist/source/generic/babel/spanish.ins b/Master/texmf-dist/source/generic/babel/spanish.ins
new file mode 100644
index 00000000000..025a0f1c792
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/spanish.ins
@@ -0,0 +1,151 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{spanish.ins}
+\def\filedate{2000/10/13}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.3c or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\keepsilent
+
+\usepreamble\mainpreamble
+\generate{\file{spanish.ldf}{\from{spanish.dtx}{code}}%
+ \file{esbst.tex}{\from{spanish.dtx}{bblbst}}%
+ \file{romanidx.tex}{\from{spanish.dtx}{indexes}}}
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/swedish.dtx b/Master/texmf-dist/source/generic/babel/swedish.dtx
new file mode 100644
index 00000000000..6beb68787b5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/swedish.dtx
@@ -0,0 +1,442 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{272}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{swedish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{swedish}
+%\fi
+%\ProvidesFile{swedish.dtx}
+ [2005/03/31 v2.3d Swedish support from the babel system]
+%\iffalse
+%% File `swedish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Swedish language definition file. A contribution
+% was made by Sten Hellman HELLMAN@CERNVM.CERN.CH
+%
+% Further enhancements for version 2.0 were provided by
+% Erik "Osthols <erik\_osthols@yahoo.com>
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{swedish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{swedish.dtx}
+%
+% \changes{swedish-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{swedish-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{swedish-1.2}{1994/02/27}{Update for LaTeX2e}
+% \changes{swedish-1.3d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{swedish-1.3e}{1995/05/28}{Update for release 3.5}
+% \changes{swedish-2.0}{1996/01/24}{Introduced active double quote}
+% \changes{swedish-2.1}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{swedish-2.3d}{2001/11/16}{Fixed a \cs{changes} entry}
+%
+% \section{The Swedish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Sten Hellman
+% (\texttt{HELLMAN@CERNVM.CERN.CH}) and Erik \"Osthols
+% (\texttt{erik\_osthols@yahoo.com}).} defines all the
+% language-specific macros for the Swedish language. This
+% file has borrowed heavily from |finnish.dtx| and |germanb.dtx|.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:swedish-quote} an overview is given of its
+% purpose. The vertical placement of the "umlaut" in some letters
+% can be controlled this way.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"a| & Gives \"a, also implemented for |"A|, |"o| and |"O|. \\
+% |"w|, |"W| & gives {\aa} and {\AA}. \\
+% |"ff| & for |ff| to be hyphenated as |ff-f|. Used for compound
+% words, such as \texttt{stra|"|ff{\aa}nge}, which
+% should be hyphenated as \texttt{straff-f{\aa}nge}.
+% This is also implemented for b, d, f, g, l, m, n,
+% p, r, s, and t. \\
+% \verb="|= & disable ligature at this position. This should be
+% used for compound words, such as
+% ``\texttt{stra|"|ffinr\"attning}'',
+% which should not have the ligature ``ffi''. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word, such as e. g. in
+% ``x|"-|axeln''. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for words that should break at some sign such as
+% \texttt{och/|""|eller}). \\
+% |"~| & for an explicit hyphen without a breakpoint; useful for
+% expressions such as ``2|"~|3 veckor'' where no linebreak
+% is desirable. \\
+% |"=| & an explicit hyphen sign allowing subsequent hyphenation,
+% for expressions such as ``studiebidrag och \newline
+% -l{\aa}n''. \\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{swedish.sty}}\label{tab:swedish-quote}
+% \end{center}
+% \end{table}
+%
+% Two variations for formatting of dates are added. \cs{datesymd}
+% makes \cs{today} output dates formatted as YYYY-MM-DD, which is
+% commonly used in Sweden today. \cs{datesdmy} formats the date as
+% D/M YYYY, which is also very common in Sweden. These commands
+% should be issued after \cs{begin{document}}.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{swedish-2.1}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{swedish}\captionsswedish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{swedish} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@swedish| to see whether we have to do something here.
+%
+% \changes{swedish-1.0c}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{swedish-1.1}{1992/02/16}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{swedish-1.3d}{1994/06/26}{Now use \cs{@nopatterns} to
+% producew the warning}
+% \begin{macrocode}
+\ifx\l@swedish\@undefined
+ \@nopatterns{Swedish}
+ \adddialect\l@swedish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the
+% Swedish language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsswedish}
+% The macro |\captionsswedish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{swedish-1.0b}{1991/08/21}{removed type in definition of
+% \cs{contentsname}}
+% \changes{swedish-1.0b}{1991/08/21}{added definition for \cs{enclname}}
+% \changes{swedish-1.0b}{1991/08/21}{made definition of \cs{refname}
+% pluralis}
+% \changes{swedish-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{swedish-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{swedish-1.1b}{1993/09/16}{Added translations}
+% \changes{swedish-1.3d}{1994/07/27}{Changed \cs{aa} to
+% \cs{csname}\texttt{ aa}\cs{endcsname}, to make \cs{uppercase} do
+% the right thing}
+% \changes{swedish-1.3f}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \begin{macrocode}
+\addto\captionsswedish{%
+ \def\prefacename{F\"orord}%
+ \def\refname{Referenser}%
+ \def\abstractname{Sammanfattning}%
+ \def\bibname{Litteraturf\"orteckning}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Bilaga}%
+ \def\contentsname{Inneh\csname aa\endcsname ll}%
+ \def\listfigurename{Figurer}%
+ \def\listtablename{Tabeller}%
+ \def\indexname{Sakregister}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabell}%
+ \def\partname{Del}%
+% \end{macrocode}
+% \changes{swedish-2.3a}{2000/01/19}{Added full stop after ``Bil''}
+% \begin{macrocode}
+ \def\enclname{Bil.}%
+ \def\ccname{Kopia f\"or k\"annedom}%
+ \def\headtoname{Till}% in letter
+ \def\pagename{Sida}%
+ \def\seename{se}%
+% \end{macrocode}
+% \changes{swedish-1.3e}{1995/05/29}{Changed \cs{alsoname} from
+% `\texttt{se ocks\aa}'}
+% \begin{macrocode}
+ \def\alsoname{se \"aven}%
+% \end{macrocode}
+% \changes{swedish-1.3g}{1995/11/03}{Replaced `Proof' by its
+% translation}
+% \changes{swedish-2.3b}{2000/09/26}{Added \cs{glossaryname}}
+% \changes{swedish-2.3c}{2001/03/12}{Provided translation for
+% Glossary}
+% \begin{macrocode}
+ \def\proofname{Bevis}%
+ \def\glossaryname{Ordlista}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateswedish}
+% The macro |\dateswedish| redefines the command |\today| to
+% produce Swedish dates.
+% \changes{swedish-2.2}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{swedish-2.2}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\dateswedish{%
+ \def\today{%
+ \number\day~\ifcase\month\or
+ januari\or februari\or mars\or april\or maj\or juni\or
+ juli\or augusti\or september\or oktober\or november\or
+ december\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datesymd}
+% \changes{swedish-2.3a}{2000/01/20}{Command added}
+% The macro |\datesymd| redefines the command |\today| to
+% produce dates in the format YYYY-MM-DD, common in Sweden.
+% \begin{macrocode}
+\def\datesymd{%
+ \def\today{\number\year-\two@digits\month-\two@digits\day}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datesdmy}
+% \changes{swedish-2.3a}{2000/01/20}{Command added}
+% The macro |\datesdmy| redefines the command |\today| to
+% produce Swedish dates in the format DD/MM YYYY, also common in
+% Sweden.
+% \begin{macrocode}
+\def\datesdmy{%
+ \def\today{\number\day/\number\month\space\number\year}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\swedishhyphenmins}
+% The swedish hyphenation patterns can be used with |\lefthyphenmin|
+% set to~2 and |\righthyphenmin| set to~2.
+% \changes{swedish-1.3e}{1995/06/02}{use \cs{swedishhyphenmins} to
+% store the correct values}
+% \begin{macrocode}
+\providehyphenmins{swedish}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasswedish}
+% \changes{swedish-1.3e}{1995/05/29}{Added \cs{bbl@frenchspacing}}
+% \begin{macro}{\noextrasswedish}
+% \changes{swedish-1.3e}{1995/05/29}{Added \cs{bbl@nonfrenchspacing}}
+% The macro |\extrasswedish| performs all the extra definitions
+% needed for the Swedish language. The macro |\noextrasswedish| is
+% used to cancel the actions of |\extrasswedish|.
+%
+% For Swedish texts |\frenchspacing| should be in effect. We make
+% sure this is the case and reset it if necessary.
+%
+% \begin{macrocode}
+\addto\extrasswedish{\bbl@frenchspacing}
+\addto\noextrasswedish{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% For Swedish the \texttt{"} character is made active. This is done
+% once, later on its definition may vary.
+% \changes{swedish-2.0}{1996/01/24}{Added active double quote
+% character}
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasswedish{\languageshorthands{swedish}}
+\addto\extrasswedish{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{swedish-2.2b}{1999/12/17}{Deactivate shorthands ouside of
+% Swedish}
+% \begin{macrocode}
+\addto\noextrasswedish{\bbl@deactivate{"}}
+% \end{macrocode}
+% The ``umlaut'' accent macro |\"| is changed to lower the
+% ``umlaut'' dots. The redefinition is done with the help of
+% |\umlautlow|.
+%^^A PROBLEM:
+%^^A What happens to ``umlaut''
+%^^A characters entered using e. g. latin input encoding? They should
+%^^A be lowered as well.
+% \begin{macrocode}
+\addto\extrasswedish{\babel@save\"\umlautlow}
+\addto\noextrasswedish{\umlauthigh}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The code above is necessary because we need an extra active
+% character. This character is then used as indicated in
+% table~\ref{tab:swedish-quote}.
+%
+% To be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the doublequote macros: the umlauts and {\aa}.
+% \changes{swedish-2.3a}{2000/01/20}{added \cs{allowhyphens}}
+% \begin{macrocode}
+\declare@shorthand{swedish}{"w}{\textormath{{\aa}\allowhyphens}{\ddot w}}
+\declare@shorthand{swedish}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
+\declare@shorthand{swedish}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
+\declare@shorthand{swedish}{"W}{\textormath{{\AA}\allowhyphens}{\ddot W}}
+\declare@shorthand{swedish}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
+\declare@shorthand{swedish}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
+% \end{macrocode}
+% discretionary commands
+%^^A PROBLEM:
+%^^A Will these allow subsequent hyphenation? Perhaps we need to
+%^^A add \cs{allowhyphens} here as well?
+% \begin{macrocode}
+\declare@shorthand{swedish}{"b}{\textormath{\bbl@disc b{bb}}{b}}
+\declare@shorthand{swedish}{"B}{\textormath{\bbl@disc B{BB}}{B}}
+\declare@shorthand{swedish}{"d}{\textormath{\bbl@disc d{dd}}{d}}
+\declare@shorthand{swedish}{"D}{\textormath{\bbl@disc D{DD}}{D}}
+\declare@shorthand{swedish}{"f}{\textormath{\bbl@disc f{ff}}{f}}
+\declare@shorthand{swedish}{"F}{\textormath{\bbl@disc F{FF}}{F}}
+\declare@shorthand{swedish}{"g}{\textormath{\bbl@disc g{gg}}{g}}
+\declare@shorthand{swedish}{"G}{\textormath{\bbl@disc G{GG}}{G}}
+\declare@shorthand{swedish}{"l}{\textormath{\bbl@disc l{ll}}{l}}
+\declare@shorthand{swedish}{"L}{\textormath{\bbl@disc L{LL}}{L}}
+\declare@shorthand{swedish}{"m}{\textormath{\bbl@disc m{mm}}{m}}
+\declare@shorthand{swedish}{"M}{\textormath{\bbl@disc M{MM}}{M}}
+\declare@shorthand{swedish}{"n}{\textormath{\bbl@disc n{nn}}{n}}
+\declare@shorthand{swedish}{"N}{\textormath{\bbl@disc N{NN}}{N}}
+\declare@shorthand{swedish}{"p}{\textormath{\bbl@disc p{pp}}{p}}
+\declare@shorthand{swedish}{"P}{\textormath{\bbl@disc P{PP}}{P}}
+\declare@shorthand{swedish}{"r}{\textormath{\bbl@disc r{rr}}{r}}
+\declare@shorthand{swedish}{"R}{\textormath{\bbl@disc R{RR}}{R}}
+\declare@shorthand{swedish}{"s}{\textormath{\bbl@disc s{ss}}{s}}
+\declare@shorthand{swedish}{"S}{\textormath{\bbl@disc S{SS}}{S}}
+\declare@shorthand{swedish}{"t}{\textormath{\bbl@disc t{tt}}{t}}
+\declare@shorthand{swedish}{"T}{\textormath{\bbl@disc T{TT}}{T}}
+% \end{macrocode}
+% and some additional commands:
+% \def\indexeqs{=}
+% \changes{swedish-2.3a}{2000/01/28}{changed definition of
+% \texttt{"\protect\indexeqs}, \cs{-} and \texttt{"~}}
+% \begin{macrocode}
+\declare@shorthand{swedish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{swedish}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}}
+\declare@shorthand{swedish}{""}{\hskip\z@skip}
+\declare@shorthand{swedish}{"~}{%
+ \textormath{\leavevmode\hbox{-}\bbl@allowhyphens}{-}}
+\declare@shorthand{swedish}{"=}{\hbox{-}\allowhyphens}
+% \end{macrocode}
+%
+% \begin{macro}{\-}
+% Redefinition of |\-|. The new version of |\-| should indicate an
+% extra hyphenation position, while allowing other hyphenation
+% positions to be generated automatically. The standard behaviour
+% of \TeX\ in this respect is very unfortunate for languages such
+% as Dutch, Finnish, German and Swedish, where long compound words
+% are quite normal and all one needs is a means to indicate an
+% extra hyphenation position on top of the ones that \TeX\ can
+% generate from the hyphenation patterns.
+% \begin{macrocode}
+\addto\extrasswedish{\babel@save\-}
+\addto\extrasswedish{\def\-{\allowhyphens
+ \discretionary{-}{}{}\allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{swedish-2.1}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{swedish}
+%</code>
+% \end{macrocode}
+%
+%\Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/swedish.ins b/Master/texmf-dist/source/generic/babel/swedish.ins
new file mode 100644
index 00000000000..34916c0021f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/swedish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{swedish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{swedish.ldf}{\from{swedish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/turkish.dtx b/Master/texmf-dist/source/generic/babel/turkish.dtx
new file mode 100644
index 00000000000..2ec69bc6bee
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/turkish.dtx
@@ -0,0 +1,309 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{179}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{turkish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{turkish}
+%\fi
+%\ProvidesFile{turkish.dtx}
+ [2005/03/31 v1.2m Turkish support from the babel system]
+%\iffalse
+%% File `turkish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+%% Turkish Language Definition File
+%% Copyright (C) 1994 - 2005
+%% by Mustafa Burc
+%% rz6001@rziris01.rrz.uni-hamburg.de
+%% (40) 2503476
+%
+% This file is part of the babel system, it provides the source
+% code for the Turkish language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{turkish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{turkish.dtx}
+%
+% \changes{turkish-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{turkish-1.2c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{turkish-1.2h}{1996/07/13}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{turkish-1.2i}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Turkish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Turkish language\footnote{Mustafa Burc,
+% \texttt{z6001@rziris01.rrz.uni-hamburg.de} provided the code for
+% this file. It is based on the work by Pierre Mackay; Turgut Uyar,
+% \texttt{uyar@cs.itu.edu.tr} supplied additional translations in
+% version 1.2j and later}.
+%
+% Turkish typographic rules specify that a little `white space'
+% should be added before the characters `\texttt{:}', `\texttt{!}'
+% and `\texttt{=}'. In order to insert this white space
+% automatically these characters are made `active'. Also
+% |\frenhspacing| is set.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{turkish-1.2i}{1996/11/03}{ow use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{turkish}\captionsturkish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{turkish} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@turkish| to see whether we have to do something here.
+%
+% \changes{turkish-1.2c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@turkish\@undefined
+ \@nopatterns{Turkish}
+ \adddialect\l@turkish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Turkish language.
+%
+% \begin{macro}{\captionsturkish}
+% The macro |\captionsturkish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{turkish-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{turkish-1.2b}{1994/06/04}{Added braces behind \cs{i} in
+% strings}
+% \changes{turkish-1.2f}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{turkish-1.2j}{1997/09/29}{Added and modified translations}
+% \changes{turkish-1.2k}{1999/04/18}{Incorporated some more
+% corrections}
+% \changes{turkish-1.2m}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsturkish{%
+ \def\prefacename{\"Ons\"oz}%
+ \def\refname{Kaynaklar}%
+ \def\abstractname{\"Ozet}%
+ \def\bibname{Kaynak\c ca}%
+ \def\chaptername{B\"ol\"um}%
+ \def\appendixname{Ek}%
+ \def\contentsname{\.I\c cindekiler}%
+ \def\listfigurename{\c Sekil Listesi}%
+ \def\listtablename{Tablo Listesi}%
+ \def\indexname{Dizin}%
+ \def\figurename{\c Sekil}%
+ \def\tablename{Tablo}%
+ \def\partname{K\i s\i m}%
+ \def\enclname{\.Ili\c sik}%
+ \def\ccname{Di\u ger Al\i c\i lar}%
+ \def\headtoname{Al\i c\i}%
+ \def\pagename{Sayfa}%
+ \def\subjectname{\.Ilgili}%
+ \def\seename{bkz.}%
+ \def\alsoname{ayr\i ca bkz.}%
+ \def\proofname{Kan\i t}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateturkish}
+% The macro |\dateturkish| redefines the command |\today| to
+% produce Turkish dates.
+% \changes{turkish-1.2b}{1994/06/04}{Added braces behind \cs{i} in
+% strings}
+% \changes{turkish-1.2d}{1995/01/31}{removed extra closing brace,
+% \cs{mont} should be \cs{month}}
+% \changes{turkish-1.2j}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{turkish-1.2j}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{turkish-1.2l}{1999/05/17}{removed dot from the date format}
+% \begin{macrocode}
+\def\dateturkish{%
+ \def\today{\number\day~\ifcase\month\or
+ Ocak\or \c Subat\or Mart\or Nisan\or May\i{}s\or Haziran\or
+ Temmuz\or A\u gustos\or Eyl\"ul\or Ekim\or Kas\i{}m\or
+ Aral\i{}k\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasturkish}
+% \changes{turkish-1.2e}{1995/05/15}{Completely rewrote macro}
+% \begin{macro}{\noextrasturkish}
+% The macro |\extrasturkish| will perform all the extra definitions
+% needed for the Turkish language. The macro |\noextrasturkish| is
+% used to cancel the actions of |\extrasturkish|.
+%
+% Turkish typographic rules specify that a little `white space'
+% should be added before the characters `\texttt{:}', `\texttt{!}'
+% and `\texttt{=}'. In order to insert this white space
+% automatically these characters are made |\active|, so they have
+% to be treated in a special way.
+% \begin{macrocode}
+\initiate@active@char{:}
+\initiate@active@char{!}
+\initiate@active@char{=}
+% \end{macrocode}
+% We specify that the turkish group of shorthands should be used.
+% \begin{macrocode}
+\addto\extrasturkish{\languageshorthands{turkish}}
+% \end{macrocode}
+% These characters are `turned on' once, later their definition may
+% vary.
+% \begin{macrocode}
+\addto\extrasturkish{%
+ \bbl@activate{:}\bbl@activate{!}\bbl@activate{=}}
+% \end{macrocode}
+%
+% For Turkish texts |\frenchspacing| should be in effect. We
+% make sure this is the case and reset it if necessary.
+% \changes{turkish-1.2e}{1995/05/15}{now use \cs{bbl@frenchspacing}
+% and \cs{bbl@nonfrenchspacing}}
+% \begin{macrocode}
+\addto\extrasturkish{\bbl@frenchspacing}
+\addto\noextrasturkish{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\turkish@sh@!@}
+% \begin{macro}{\turkish@sh@=@}
+% \begin{macro}{\turkish@sh@:@}
+% The definitions for the three active characters were made using
+% intermediate macros. These are defined now. The insertion of
+% extra `white space' should only happen outside math mode, hence
+% the check |\ifmmode| in the macros.
+% \changes{turkish-1.2d}{1995/01/31}{Added missing \cs{def}}
+% \changes{turkish-1.2e}{1995/05/15}{Use the new mechanism of
+% \cs{declare@shorthand}}
+%%^^A JLB:: this code breaks during \begin{document}
+%%^^A JLB: Needs fixing!!
+% \begin{macrocode}
+\declare@shorthand{turkish}{:}{%
+ \ifmmode
+ \string:%
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \fi
+ \fi
+ \string:%
+ \fi}
+\declare@shorthand{turkish}{!}{%
+ \ifmmode
+ \string!%
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \fi
+ \fi
+ \string!%
+ \fi}
+\declare@shorthand{turkish}{=}{%
+ \ifmmode
+ \string=%
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\kern\fontdimen2\font
+ \kern-1.4\fontdimen3\font
+ \fi
+ \fi
+ \string=%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{turkish-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{turkish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/turkish.ins b/Master/texmf-dist/source/generic/babel/turkish.ins
new file mode 100644
index 00000000000..9e7af81a31a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/turkish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{turkish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{turkish.ldf}{\from{turkish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/ukraineb.dtx b/Master/texmf-dist/source/generic/babel/ukraineb.dtx
new file mode 100644
index 00000000000..7f118d5934c
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/ukraineb.dtx
@@ -0,0 +1,1158 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{1472}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{ukraineb.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{ukraineb}
+ [2005/03/30 v1.1k Ukrainian support from the babel system]
+%
+%% File `ukraineb.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% ukraineb Language Definition File
+%% Copyright (C) 1997 - 2005
+%% by Andrij Shvaika ashv at icmp.lviv.ua
+%
+%% derived from the Russianb Language Definition File
+%% Copyright (C) 1995 - 2005
+%% by Olga Lapko cyrtug at mir.msk.su
+%% Johannes Braams, TeXniek
+% adapted to the new T2 and X2 Cyrillic encodings
+% by Vladimir Volovich TeX at vvv.vsu.ru
+% Werner Lemberg wl at gnu.org
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand\TeXhax{\TeX hax}
+\newcommand\babel{\textsf{babel}}
+\newcommand\langvar{$\langle \it lang \rangle$}
+\newcommand\note[1]{}
+\newcommand\Lopt[1]{\textsf{#1}}
+\newcommand\file[1]{\texttt{#1}}
+\newcommand\pkg[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{ukraineb.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{ukraineb.dtx}
+%
+% \changes{ukraineb-1.1e}{1999/08/19}{replaced all \cs{penalty}\cs{@M}
+% with \cs{nobreak}}
+%
+% \section{The Ukrainian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion.
+% This file was derived from the \file{russianb.dtx} version 1.1g.}
+% defines all the language-specific macros for the Ukrainian
+% language. It needs the file \file{cyrcod} for success documentation
+% with Ukrainian encodings (see below).
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:ukrainian-quote} an overview is given of its
+% purpose.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |"---| & Cyrillic emdash in plain text. \\
+% |"--~| & Cyrillic emdash in compound names (surnames). \\
+% |"--*| & Cyrillic emdash for denoting direct speech. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|
+% or some other signs as ``disable/enable''). \\
+% |"~| & for a compound word mark without a breakpoint. \\
+% |"=| & for a compound word mark with a breakpoint, allowing
+% hyphenation in the composing words. \\
+% |",| & thinspace for initials with a breakpoint
+% in following surname. \\
+% |"`| & for German left double quotes
+% (looks like ,\kern-0.08em,). \\
+% |"'| & for German right double quotes (looks like ``). \\%''
+% |"<| & for French left double quotes (looks like $<\!\!<$). \\
+% |">| & for French right double quotes (looks like $>\!\!>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{ukraineb}}\label{tab:ukrainian-quote}
+% \end{center}
+% \end{table}
+%
+% The quotes in table~\ref{tab:ukrainian-quote} (see, also
+% table~\ref{tab:russian-quote}) can also be typeset by using the commands
+% in table~\ref{tab:umore-quote} (see, also table~\ref{tab:rmore-quote}).
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |\cdash---| & Cyrillic emdash in plain text. \\
+% |\cdash--~| & Cyrillic emdash in compound names (surnames). \\
+% |\cdash--*| & Cyrillic emdash for denoting direct speech. \\
+% |\glqq| & for German left double quotes
+% (looks like ,\kern-0.08em,). \\
+% |\grqq| & for German right double quotes (looks like ``). \\%''
+% |\flqq| & for French left double quotes (looks like $<\!\!<$). \\
+% |\frqq| & for French right double quotes (looks like $>\!\!>$). \\
+% |\dq| & the original quotes character (|"|). \\
+% \end{tabular}
+% \caption{More commands which produce quotes, defined
+% by \babel}\label{tab:umore-quote}
+% \end{center}
+% \end{table}
+%
+% The French quotes are also available as ligatures `|<<|' and `|>>|' in
+% 8-bit Cyrillic font encodings (\texttt{LCY}, \texttt{X2}, \texttt{T2*})
+% and as `|<|' and `|>|' characters in 7-bit Cyrillic font encodings
+% (\texttt{OT2} and \texttt{LWN}).
+%
+% The quotation marks traditionally used in Ukrainian and Russian
+% languages were borrowed from other languages (e.g. French and German)
+% so they keep their original names.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is loaded
+% more than once, checking the category code of the \texttt{@} sign, etc.
+%
+% \begin{macrocode}
+%<*code>
+\LdfInit{ukrainian}{captionsukrainian}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{ukraineb} will be an `unknown' language, in which case
+% we have to make it known. So we check for the existence of |\l@ukrainian|
+% to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@ukrainian\@undefined
+ \@nopatterns{Ukrainian}
+ \adddialect\l@ukrainian0
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\latinencoding}
+%
+% We need to know the encoding for text that is supposed to be which is
+% active at the end of the \babel\ package. If the \pkg{fontenc} package
+% is loaded later, then\ldots too bad!
+%
+% \begin{macrocode}
+\let\latinencoding\cf@encoding
+% \end{macrocode}
+%
+% \end{macro}
+%
+% The user may choose between different available Cyrillic
+% encodings---e.g., \texttt{X2}, \texttt{LCY}, or \texttt{LWN}.\@
+% Hopefully, \texttt{X2} will eventually replace the two latter encodings
+% (\texttt{LCY} and \texttt{LWN}).\@ If the user wants to use another
+% font encoding than the default (\texttt{T2A}), he has to load the
+% corresponding file \emph{before} \file{ukraineb.sty}. This may be done
+% in the following way:
+%
+% \begin{verbatim}
+% % override the default X2 encoding used in Babel
+% \usepackage[LCY,OT1]{fontenc}
+% \usepackage[english,ukrainian]{babel}
+% \end{verbatim}
+% \unskip
+%
+% Note: for the Ukrainian language, the \texttt{T2A} encoding is better than
+% \texttt{X2}, because \texttt{X2} does not contain Latin letters, and
+% users should be very careful to switch the language every time they
+% want to typeset a Latin word inside a Ukrainian phrase or vice versa.
+%
+% We parse the |\cdp@list| containing the encodings known to \LaTeX\ in
+% the order they were loaded. We set the |\cyrillicencoding| to the
+% \emph{last} loaded encoding in the list of supported Cyrillic
+% encodings: \texttt{OT2}, \texttt{LWN}, \texttt{LCY}, \texttt{X2},
+% \texttt{T2C}, \texttt{T2B}, \texttt{T2A}, if any.
+%
+% \begin{macrocode}
+\def\reserved@a#1#2{%
+ \edef\reserved@b{#1}%
+ \edef\reserved@c{#2}%
+ \ifx\reserved@b\reserved@c
+ \let\cyrillicencoding\reserved@c
+ \fi}
+\def\cdp@elt#1#2#3#4{%
+ \reserved@a{#1}{OT2}%
+ \reserved@a{#1}{LWN}%
+ \reserved@a{#1}{LCY}%
+ \reserved@a{#1}{X2}%
+ \reserved@a{#1}{T2C}%
+ \reserved@a{#1}{T2B}%
+ \reserved@a{#1}{T2A}}
+\cdp@list
+% \end{macrocode}
+%
+% Now, if |\cyrillicencoding| is undefined, then the user did not load
+% any of supported encodings. So, we have to set |\cyrillicencoding| to
+% some default value. We test the presence of the encoding definition
+% files in the order from less preferable to more preferable encodings.
+% We use the lowercase names (i.e., \file{lcyenc.def} instead of
+% \file{LCYenc.def}).
+%
+% \begin{macrocode}
+\ifx\cyrillicencoding\undefined
+ \IfFileExists{ot2enc.def}{\def\cyrillicencoding{OT2}}\relax
+ \IfFileExists{lwnenc.def}{\def\cyrillicencoding{LWN}}\relax
+ \IfFileExists{lcyenc.def}{\def\cyrillicencoding{LCY}}\relax
+ \IfFileExists{x2enc.def}{\def\cyrillicencoding{X2}}\relax
+ \IfFileExists{t2cenc.def}{\def\cyrillicencoding{T2C}}\relax
+ \IfFileExists{t2benc.def}{\def\cyrillicencoding{T2B}}\relax
+ \IfFileExists{t2aenc.def}{\def\cyrillicencoding{T2A}}\relax
+% \end{macrocode}
+%
+% If |\cyrillicencoding| is still undefined, then the user seems not to
+% have a properly installed distribution. A fatal error.
+%
+% \begin{macrocode}
+ \ifx\cyrillicencoding\undefined
+ \PackageError{babel}%
+ {No Cyrillic encoding definition files were found}%
+ {Your installation is incomplete.\MessageBreak
+ You need at least one of the following files:\MessageBreak
+ \space\space
+ x2enc.def, t2aenc.def, t2benc.def, t2cenc.def,\MessageBreak
+ \space\space
+ lcyenc.def, lwnenc.def, ot2enc.def.}%
+ \else
+% \end{macrocode}
+%
+% We avoid |\usepackage[\cyrillicencoding]{fontenc}| because we don't
+% want to force the switch of |\encodingdefault|.
+%
+% \begin{macrocode}
+ \lowercase
+ \expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{verbatim}
+% \PackageInfo{babel}
+% {Using `\cyrillicencoding' as a default Cyrillic encoding}%
+% \end{verbatim}
+% \unskip
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\Ukrainian}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\ukrainianhyphenmins
+ \language\l@ukrainian}%
+\DeclareRobustCommand{\English}{%
+ \fontencoding\latinencoding\selectfont
+ \let\encodingdefault\latinencoding
+ \expandafter\set@hyphenmins\englishhyphenmins
+ \language\l@english}%
+\let\Ukr\Ukrainian
+\let\Eng\English
+\let\cyrillictext\Ukrainian
+\let\cyr\Ukrainian
+% \end{macrocode}
+%
+% Since the \texttt{X2} encoding does not contain Latin letters, we
+% should make some redefinitions of \LaTeX\ macros which implicitly
+% produce Latin letters.
+%
+% \begin{macrocode}
+\expandafter\ifx\csname T@X2\endcsname\relax\else
+% \end{macrocode}
+%
+% We put |\latinencoding| in braces to avoid problems with
+% |\@alph| inside minipages (e.g., footnotes inside minipages) where
+% |\@alph| is expanded and we get for example `|\fontencoding OT1|'
+% (|\fontencoding| is robust).
+%
+% \begin{macrocode}
+ \def\@alph#1{{\fontencoding{\latinencoding}\selectfont
+ \ifcase#1\or
+ a\or b\or c\or d\or e\or f\or g\or h\or
+ i\or j\or k\or l\or m\or n\or o\or p\or
+ q\or r\or s\or t\or u\or v\or w\or x\or
+ y\or z\else\@ctrerr\fi}}%
+ \def\@Alph#1{{\fontencoding{\latinencoding}\selectfont
+ \ifcase#1\or
+ A\or B\or C\or D\or E\or F\or G\or H\or
+ I\or J\or K\or L\or M\or N\or O\or P\or
+ Q\or R\or S\or T\or U\or V\or W\or X\or
+ Y\or Z\else\@ctrerr\fi}}%
+% \end{macrocode}
+%
+% Unfortunately, the commands |\AA| and |\aa| are not encoding dependent
+% in \LaTeX\ (unlike e.g., |\oe| or |\DH|). They are defined as |\r{A}| and
+% |\r{a}|. This leads to unpredictable results when the font encoding
+% does not contain the Latin letters `A' and `a' (like \texttt{X2}).
+%
+% \begin{macrocode}
+ \DeclareTextSymbolDefault{\AA}{OT1}
+ \DeclareTextSymbolDefault{\aa}{OT1}
+ \DeclareTextCommand{\aa}{OT1}{\r a}
+ \DeclareTextCommand{\AA}{OT1}{\r A}
+\fi
+% \end{macrocode}
+%
+% The following block redefines the character class of uppercase Greek
+% letters and some accents, if it is equal to 7 (variable family), to
+% avoid incorrect results if the font encoding in some math family does
+% not contain these characters in places of OT1 encoding. The code was
+% taken from |amsmath.dtx|. See comments and further explanation there.
+%
+% \changes{ukraineb-1.1i}{2001/02/21}{As this code generates a
+% textfont 7 error it is commented out for now.}
+% \begin{macrocode}
+% \begingroup\catcode`\"=12
+% % uppercase greek letters:
+% \def\@tempa#1{\expandafter\@tempb\meaning#1\relax\relax\relax\relax
+% "0000\@nil#1}
+% \def\@tempb#1"#2#3#4#5#6\@nil#7{%
+% \ifnum"#2=7 \count@"1#3#4#5\relax
+% \ifnum\count@<"1000 \else \global\mathchardef#7="0#3#4#5\relax \fi
+% \fi}
+% \@tempa\Gamma\@tempa\Delta\@tempa\Theta\@tempa\Lambda\@tempa\Xi
+% \@tempa\Pi\@tempa\Sigma\@tempa\Upsilon\@tempa\Phi\@tempa\Psi
+% \@tempa\Omega
+% % some accents:
+% \def\@tempa#1#2\@nil{\def\@tempc{#1}}\def\@tempb{\mathaccent}
+% \expandafter\@tempa\hat\relax\relax\@nil
+% \ifx\@tempb\@tempc
+% \def\@tempa#1\@nil{#1}%
+% \def\@tempb#1{\afterassignment\@tempa\mathchardef\@tempc=}%
+% \def\do#1"#2{}
+% \def\@tempd#1{\expandafter\@tempb#1\@nil
+% \ifnum\@tempc>"FFF
+% \xdef#1{\mathaccent"\expandafter\do\meaning\@tempc\space}%
+% \fi}
+% \@tempd\hat\@tempd\check\@tempd\tilde\@tempd\acute\@tempd\grave
+% \@tempd\dot\@tempd\ddot\@tempd\breve\@tempd\bar
+% \fi
+% \endgroup
+% \end{macrocode}
+%
+% The user must use the \pkg{inputenc} package when any 8-bit Cyrillic
+% font encoding is used, selecting one of the Cyrillic input encodings.
+% We do not assume any default input encoding, so the user should
+% explicitly call the \pkg{inputenc} package by |\usepackage{inputenc}|.
+% We also removed |\AtBeginDocument|, so \pkg{inputenc} should be used
+% before \babel.
+%
+% \changes{ukraineb-1.1f}{1999/08/27}{Made not using inputenc a
+% warning instead of an error}
+% \begin{macrocode}
+\@ifpackageloaded{inputenc}{}{%
+ \def\reserved@a{LWN}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{OT2}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \PackageWarning{babel}%
+ {No input encoding specified for Ukrainian language}
+ \fi\fi}
+% \end{macrocode}
+%
+% Now we define two commands that offer the possibility to switch between
+% Cyrillic and Roman encodings.
+%
+% \begin{macro}{\cyrillictext}
+% \begin{macro}{\latintext}
+%
+% The command |\cyrillictext| will switch from Latin font encoding to the
+% Cyrillic font encoding, the command |\latintext| switches back. This
+% assumes that the `normal' font encoding is a Latin one. These commands
+% are \emph{declarations}, for shorter peaces of text the commands
+% |\textlatin| and |\textcyrillic| can be used.
+%
+% \changes{ukraineb-1.1j}{2003/10/12}{\cs{latintext} is already
+% defined by the core of \babel}
+% \begin{macrocode}
+%\DeclareRobustCommand{\latintext}{%
+% \fontencoding{\latinencoding}\selectfont
+% \def\encodingdefault{\latinencoding}}
+\let\lat\latintext
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\textcyrillic}
+% \begin{macro}{\textlatin}
+%
+% These commands take an argument which is then typeset using the
+% requested font encoding.
+% \changes{ukraineb-1.1j}{2003/10/12}{\cs{latintext} is already
+% defined by the core of \babel}
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+%\DeclareTextFontCommand{\textlatin}{\latintext}
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% We make the \TeX
+% \begin{macrocode}
+%\ifx\ltxTeX\undefined\let\ltxTeX\TeX\fi
+%\ProvideTextCommandDefault{\TeX}{\textlatin{\ltxTeX}}
+% \end{macrocode}
+% and \LaTeX\ logos encoding independent.
+% \begin{macrocode}
+%\ifx\ltxLaTeX\undefined\let\ltxLaTeX\LaTeX\fi
+%\ProvideTextCommandDefault{\LaTeX}{\textlatin{\ltxLaTeX}}
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Ukrainian language.
+%
+% \begin{macro}{\captionsukrainian}
+%
+% The macro |\captionsukrainian| defines all strings used in the four
+% standard document classes provided with \LaTeX. The two commands |\cyr|
+% and |\lat| activate Cyrillic resp.\ Latin encoding.
+% \changes{ukraineb-1.1d}{1999/04/03}{replace \cs{CYRUKRI} with
+% \cs{CYRII} in \cs{authorname} }
+% \changes{ukraineb-1.1g}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{ukraineb-1.1h}{2001/02/13}{Added translation for
+% `Glossary'}
+% \begin{macrocode}
+\addto\captionsukrainian{%
+ \def\prefacename{{\cyr\CYRV\cyrs\cyrt\cyru\cyrp}}%
+% \def\prefacename{{\cyr\CYRP\cyre\cyrr\cyre\cyrd\cyrm\cyro\cyrv\cyra}}%
+ \def\refname{%
+ {\cyr\CYRL\cyrii\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+% \def\refname{%
+% {\cyr\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk
+% \ \cyrp\cyro\cyrs\cyri\cyrl\cyra\cyrn\cyrsftsn}}%
+ \def\abstractname{%
+ {\cyr\CYRA\cyrn\cyro\cyrt\cyra\cyrc\cyrii\cyrya}}%
+% \def\abstractname{{\cyr\CYRR\cyre\cyrf\cyre\cyrr\cyra\cyrt}}%
+ \def\bibname{%
+ {\cyr\CYRB\cyrii\cyrb\cyrl\cyrii\cyro\cyrgup\cyrr\cyra\cyrf\cyrii\cyrya}}%
+% \def\bibname{{\cyr\CYRL\cyrii\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \def\chaptername{{\cyr\CYRR\cyro\cyrz\cyrd\cyrii\cyrl}}%
+% \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{{\cyr\CYRD\cyro\cyrd\cyra\cyrt\cyro\cyrk}}%
+ \def\contentsname{{\cyr\CYRZ\cyrm\cyrii\cyrs\cyrt}}%
+ \def\listfigurename{{\cyr\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk
+ \ \cyrii\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyrii\cyrishrt}}%
+ \def\listtablename{{\cyr\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk
+ \ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyrsftsn}}%
+ \def\indexname{{\cyr\CYRP\cyro\cyrk\cyra\cyrzh\cyrch\cyri\cyrk}}%
+ \def\authorname{{\cyr\CYRII\cyrm\cyre\cyrn\cyrn\cyri\cyrishrt
+ \ \cyrp\cyro\cyrk\cyra\cyrzh\cyrch\cyri\cyrk}}%
+ \def\figurename{{\cyr\CYRR\cyri\cyrs.}}%
+% \def\figurename{\cyr\CYRR\cyri\cyrs\cyru\cyrn\cyro\cyrk}}%
+ \def\tablename{{\cyr\CYRT\cyra\cyrb\cyrl.}}%
+% \def\tablename{\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyrya}}%
+ \def\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyri\cyrn\cyra}}%
+ \def\enclname{{\cyr\cyrv\cyrk\cyrl\cyra\cyrd\cyrk\cyra}}%
+ \def\ccname{{\cyr\cyrk\cyro\cyrp\cyrii\cyrya}}%
+ \def\headtoname{{\cyr\CYRD\cyro}}%
+ \def\pagename{{\cyr\cyrs.}}%
+% \def\pagename{{\cyr\cyrs\cyrt\cyro\cyrr\cyrii\cyrn\cyrk\cyra}}%
+ \def\seename{{\cyr\cyrd\cyri\cyrv.}}%
+ \def\alsoname{{\cyr\cyrd\cyri\cyrv.\ \cyrt\cyra\cyrk\cyro\cyrzh}}
+ \def\proofname{{\cyr\CYRD\cyro\cyrv\cyre\cyrd\cyre\cyrn\cyrn\cyrya}}%
+ \def\glossaryname{{\cyr\CYRS\cyrl\cyro\cyrv\cyrn\cyri\cyrk\ %
+ \cyrt\cyre\cyrr\cyrm\cyrii\cyrn\cyrii\cyrv}}%
+ }
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\dateukrainian}
+%
+% The macro |\dateukrainian| redefines the command |\today| to produce
+% Ukrainian dates.
+%
+% \begin{macrocode}
+\def\dateukrainian{%
+ \def\today{\number\day~\ifcase\month\or
+ \cyrs\cyrii\cyrch\cyrn\cyrya\or
+ \cyrl\cyryu\cyrt\cyro\cyrg\cyro\or
+ \cyrb\cyre\cyrr\cyre\cyrz\cyrn\cyrya\or
+ \cyrk\cyrv\cyrii\cyrt\cyrn\cyrya\or
+ \cyrt\cyrr\cyra\cyrv\cyrn\cyrya\or
+ \cyrch\cyre\cyrr\cyrv\cyrn\cyrya\or
+ \cyrl\cyri\cyrp\cyrn\cyrya\or
+ \cyrs\cyre\cyrr\cyrp\cyrn\cyrya\or
+ \cyrv\cyre\cyrr\cyre\cyrs\cyrn\cyrya\or
+ \cyrzh\cyro\cyrv\cyrt\cyrn\cyrya\or
+ \cyrl\cyri\cyrs\cyrt\cyro\cyrp\cyra\cyrd\cyra\or
+ \cyrg\cyrr\cyru\cyrd\cyrn\cyrya\fi
+ \space\number\year~\cyrr.}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\extrasukrainian}
+%
+% The macro |\extrasukrainian| will perform all the extra definitions
+% needed for the Ukrainian language. The macro |\noextrasukrainian|
+% is used to cancel the actions of |\extrasukrainian|.
+%
+% The first action we define is to switch on the selected Cyrillic
+% encoding whenever we enter `ukrainian'.
+%
+% \begin{macrocode}
+\addto\extrasukrainian{\cyrillictext}
+% \end{macrocode}
+%
+% When the encoding definition file was processed by \LaTeX\ the current
+% font encoding is stored in |\latinencoding|, assuming that \LaTeX\ uses
+% \texttt{T1} or \texttt{OT1} as default. Therefore we switch back to
+% |\latinencoding| whenever the Ukrainian language is no longer `active'.
+%
+% \begin{macrocode}
+\addto\noextrasukrainian{\latintext}
+% \end{macrocode}
+%
+% Next we must allow hyphenation in the Ukrainian words with apostrophe
+% whenever we enter `ukrainian'. This solution was proposed by
+% Vladimir Volovich <vvv@vvv.vsu.ru>
+%
+% \begin{macrocode}
+\addto\extrasukrainian{\lccode`\'=`\'}
+\addto\noextrasukrainian{\lccode`\'=0}
+% \end{macrocode}
+%
+% \begin{macro}{\verbatim@font}
+%
+% In order to get both Latin and Cyrillic letters in verbatim text we
+% need to change the definition of an internal \LaTeX\ command somewhat:
+%
+% \begin{macrocode}
+%\def\verbatim@font{%
+% \let\encodingdefault\latinencoding
+% \normalfont\ttfamily
+% \expandafter\def\csname\cyrillicencoding-cmd\endcsname##1##2{%
+% \ifx\protect\@typeset@protect
+% \begingroup\UseTextSymbol\cyrillicencoding##1\endgroup
+% \else\noexpand##1\fi}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% The category code of the characters `\texttt{:}', `\texttt{;}',
+% `\texttt{!}', and `\texttt{?}' is made |\active| to insert a little
+% white space.
+%
+% For Ukrainian (as well as for Russian and German) the \texttt{"}
+% character also is made active.
+%
+% Note: It is \emph{very} questionable whether the Russian typesetting
+% tradition requires additional spacing before those punctuation signs.
+% Therefore, we make the corresponding code optional. If you need it,
+% then define the \texttt{frenchpunct} docstrip option in
+% \file{babel.ins}.
+%
+% Borrowed from french.
+% Some users dislike automatic insertion of a space before
+% `double punctuation', and prefer to decide themselves whether a
+% space should be added or not; so a hook |\NoAutoSpaceBeforeFDP|
+% is provided: if this command is added (in file |ukraineb.cfg|, or
+% anywhere in a document) |ukraineb| will respect your typing, and
+% introduce a suitable space before `double punctuation' \emph{if
+% and only if} a space is typed in the source file before those
+% signs.
+%
+% The command |\AutoSpaceBeforeFDP| switches back to the
+% default behavior of |ukraineb|.
+%
+% \begin{macrocode}
+%<*frenchpunct>
+\initiate@active@char{:}
+\initiate@active@char{;}
+%</frenchpunct>
+%<*frenchpunct|spanishligs>
+\initiate@active@char{!}
+\initiate@active@char{?}
+%</frenchpunct|spanishligs>
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% The code above is necessary because we need extra active characters.
+% The character |"| is used as indicated in
+% table~\ref{tab:ukrainian-quote}.
+%
+% We specify that the Ukrainian group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasukrainian{\languageshorthands{ukrainian}}
+% \end{macrocode}
+%
+% These characters are `turned on' once, later their definition may
+% vary.
+%
+% \begin{macrocode}
+\addto\extrasukrainian{%
+%<frenchpunct> \bbl@activate{:}\bbl@activate{;}%
+%<frenchpunct|spanishligs> \bbl@activate{!}\bbl@activate{?}%
+ \bbl@activate{"}}
+\addto\noextrasukrainian{%
+%<frenchpunct> \bbl@deactivate{:}\bbl@deactivate{;}%
+%<frenchpunct|spanishligs> \bbl@deactivate{!}\bbl@deactivate{?}%
+ \bbl@deactivate{"}}
+% \end{macrocode}
+%
+% The \texttt{X2} and \texttt{T2*} encodings do not contain
+% |spanish_shriek| and |spanish_query| symbols; as a consequence, the
+% ligatures `|?`|' and `|!`|' do not work with them (these characters are
+% useless for Cyrillic texts anyway). But we define the shorthands to
+% emulate these ligatures (optionally).
+%
+% We do not use |\latinencoding| here (but instead explicitly use
+% \texttt{OT1}) because the user may choose \texttt{T2A} to be the primary
+% encoding, but it does not contain these characters.
+%
+% \begin{macrocode}
+%<*spanishligs>
+\declare@shorthand{ukrainian}{?`}{\UseTextSymbol{OT1}\textquestiondown}
+\declare@shorthand{ukrainian}{!`}{\UseTextSymbol{OT1}\textexclamdown}
+%</spanishligs>
+% \end{macrocode}
+%
+% \begin{macro}{\ukrainian@sh@;@}
+% \begin{macro}{\ukrainian@sh@:@}
+% \begin{macro}{\ukrainian@sh@!@}
+% \begin{macro}{\ukrainian@sh@?@}
+%
+% We have to reduce the amount of white space before \texttt{;},
+% \texttt{:} and \texttt{!}. This should only happen in horizontal mode,
+% hence the test with |\ifhmode|.
+%
+% \begin{macrocode}
+%<*frenchpunct>
+\declare@shorthand{ukrainian}{;}{%
+ \ifhmode
+% \end{macrocode}
+%
+% In horizontal mode we check for the presence of a `space', `unskip' if
+% it exists and place a |0.1em| kerning.
+%
+% \begin{macrocode}
+ \ifdim\lastskip>\z@
+ \unskip\nobreak\kern.1em
+ \else
+% \end{macrocode}
+% If no space has been typed, we add |\FDP@thinspace|
+% which will be
+% defined, up to the user's wishes, as an automatic added
+% thinspace, or as |\@empty|.
+%
+% \begin{macrocode}
+ \FDP@thinspace
+ \fi
+ \fi
+% \end{macrocode}
+%
+% Now we can insert a `|;|' character.
+%
+% \begin{macrocode}
+ \string;}
+% \end{macrocode}
+%
+% The other definitions are very similar.
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{:}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\nobreak\kern.1em
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string:}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{!}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\nobreak\kern.1em
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string!}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{?}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\nobreak\kern.1em
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string?}
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{macro}{\AutoSpaceBeforeFDP}
+% \begin{macro}{\NoAutoSpaceBeforeFDP}
+% \begin{macro}{\FDP@thinspace}
+% |\FDP@thinspace| is defined as unbreakable
+% spaces if |\AutoSpaceBeforeFDP| is activated or as |\@empty| if
+% |\NoAutoSpaceBeforeFDP| is in use.
+% The default is |\AutoSpaceBeforeFDP|.
+% \begin{macrocode}
+\def\AutoSpaceBeforeFDP{%
+ \def\FDP@thinspace{\nobreak\kern.1em}}
+\def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty}
+\AutoSpaceBeforeFDP
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\FDPon}
+% \begin{macro}{\FDPoff}
+%
+% The next macros allow to switch on/off activeness of double
+% punctuation signs.
+%
+% \begin{macrocode}
+\def\FDPon{\bbl@activate{:}%
+ \bbl@activate{;}%
+ \bbl@activate{?}%
+ \bbl@activate{!}}
+\def\FDPoff{\bbl@deactivate{:}%
+ \bbl@deactivate{;}%
+ \bbl@deactivate{?}%
+ \bbl@deactivate{!}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\system@sh@:@}
+% \begin{macro}{\system@sh@!@}
+% \begin{macro}{\system@sh@?@}
+% \begin{macro}{\system@sh@;@}
+%
+% When the active characters appear in an environment where their
+% Ukrainian behaviour is not wanted they should give an `expected'
+% result. Therefore we define shorthands at system level as well.
+%
+% \begin{macrocode}
+\declare@shorthand{system}{:}{\string:}
+\declare@shorthand{system}{;}{\string;}
+%</frenchpunct>
+%<*frenchpunct&!spanishligs>
+\declare@shorthand{system}{!}{\string!}
+\declare@shorthand{system}{?}{\string?}
+%</frenchpunct&!spanishligs>
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% To be able to define the function of `|"|', we first define a couple of
+% `support' macros.
+%
+% \begin{macro}{\dq}
+%
+% We save the original double quote character in |\dq| to keep it
+% available, the math accent |\"| can now be typed as `|"|'.
+%
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Now we can define the doublequote macros: german and french quotes.
+% We use definitions of these quotes made in babel.sty.
+% The french quotes are contained in the \texttt{T2*} encodings.
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{"`}{\glqq}
+\declare@shorthand{ukrainian}{"'}{\grqq}
+\declare@shorthand{ukrainian}{"<}{\flqq}
+\declare@shorthand{ukrainian}{">}{\frqq}
+% \end{macrocode}
+%
+% Some additional commands:
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{""}{\hskip\z@skip}
+\declare@shorthand{ukrainian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{ukrainian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{ukrainian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+% \end{macrocode}
+%
+% The next two macros for |"-| and |"---| are somewhat different.
+% We must check whether the second token is a hyphen character:
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{"-}{%
+% \end{macrocode}
+%
+% If the next token is `|-|', we typeset an emdash, otherwise a hyphen
+% sign:
+%
+% \begin{macrocode}
+ \def\ukrainian@sh@tmp{%
+ \if\ukrainian@sh@next-\expandafter\ukrainian@sh@emdash
+ \else\expandafter\ukrainian@sh@hyphen\fi
+ }%
+% \end{macrocode}
+%
+% \TeX\ looks for the next token after the first `|-|': the meaning of
+% this token is written to |\ukrainian@sh@next| and |\ukrainian@sh@tmp| is
+% called.
+%
+% \begin{macrocode}
+ \futurelet\ukrainian@sh@next\ukrainian@sh@tmp}
+% \end{macrocode}
+%
+% Here are the definitions of hyphen and emdash. First the hyphen:
+%
+% \begin{macrocode}
+\def\ukrainian@sh@hyphen{%
+ \nobreak\-\bbl@allowhyphens}
+% \end{macrocode}
+%
+% For the emdash definition, there are the two parameters: we must `eat'
+% two last hyphen signs of our emdash\dots :
+% \begin{macrocode}
+\def\ukrainian@sh@emdash#1#2{\cdash-#1#2}
+% \end{macrocode}
+% \begin{macro}{\cdash}
+% \dots\ these two parameters are useful for another macro:
+% |\cdash|:
+% \begin{macrocode}
+%\ifx\cdash\undefined % should be defined earlier
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+% \end{macrocode}
+% second parameter (or third for |\cdash|) shows what kind of emdash
+% to create in next step
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"---| & ordinary (plain) Cyrillic emdash inside text:
+% an unbreakable thinspace will be inserted before only in case of
+% a \textit{space} before the dash (it is necessary for dashes after
+% display maths formulae: there could be lists, enumerations etc.\
+% started with ``--- where $a$ is ...'' i.e., the dash starts a line).
+% (Firstly there were planned rather soft rules for user: he may put
+% a space before the dash or not. But it is difficult to place this
+% thinspace automatically, i.e., by checking modes because after
+% display formulae \TeX{} uses horizontal mode. Maybe there is a
+% misunderstanding? Maybe there is another way?) After a dash
+% a breakable thinspace is always placed; \\
+% \end{tabular}
+% \end{center}
+% \begin{macrocode}
+% What is more grammatically: .2em or .2\fontdimen6\font ?
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+ \cyrdash\hskip.2em\ignorespaces}%
+% \end{macrocode}
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--~| & emdash in compound names or surnames
+% (like Mendeleev--Klapeiron); this dash has no space characters
+% around; after the dash some space is added
+% |\exhyphenalty| \\
+% \end{tabular}
+% \end{center}
+% \begin{macrocode}
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+% \end{macrocode}
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--*| & for denoting direct speech (a space like |\enskip|
+% must follow the emdash); \\
+% \end{tabular}
+% \end{center}
+% \begin{macrocode}
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+%\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cyrdash}
+% Finally the macro for ``body'' of the Cyrillic emdash.
+% The |\cyrdash| macro will be defined in case this macro hasn't been
+% defined in a fontenc file. For T2* fonts, cyrdash will be placed in
+% the code of the English emdash thus it uses ligature |---|.
+% \begin{macrocode}
+% Is there an IF necessary?
+\ifx\cyrdash\undefined
+ \def\cyrdash{\hbox to.8em{--\hss--}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% Here a really new macro---to place thinspace between initials.
+% This macro used instead of |\,| allows hyphenation in the following
+% surname.
+%
+% \begin{macrocode}
+%\declare@shorthand{ukrainian}{",}{\nobreak\hskip.2em\ignorespaces}
+% \end{macrocode}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% All that's left to do now is to define a couple of commands
+% for |"|.
+% \begin{macrocode}
+\def\mdqon{\bbl@activate{"}}
+\def\mdqoff{\bbl@deactivate{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The Ukrainian hyphenation patterns can be used with |\lefthyphenmin|
+% and |\righthyphenmin| set to~2.
+% \changes{ukraineb-1.1g}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% temporary hack:
+\ifx\englishhyphenmins\undefined
+ \def\englishhyphenmins{\tw@\thr@@}
+\fi
+% \end{macrocode}
+%
+% Now the action |\extrasukrainian| has to execute is to make sure that the
+% command |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasukrainian| will switch it off again.
+%
+% \begin{macrocode}
+\addto\extrasukrainian{\bbl@frenchspacing}
+\addto\noextrasukrainian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Next we add a new enumeration style for Ukrainian manuscripts with
+% Cyrillic letters, and later on we define some math operator names in
+% accordance with Ukrainian and Russian typesetting traditions.
+%
+% \begin{macro}{\Asbuk}
+%
+% We begin by defining |\Asbuk| which works like |\Alph|, but produces
+% (uppercase) Cyrillic letters intead of Latin ones. The letters CYRGUP,
+% and SFTSN are skipped, as usual for such enumeration.
+%
+% \begin{macrocode}
+\def\Asbuk#1{\expandafter\@Asbuk\csname c@#1\endcsname}
+\def\@Asbuk#1{\ifcase#1\or
+ \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRE\or\CYRIE\or
+ \CYRZH\or\CYRZ\or\CYRI\or\CYRII\or\CYRYI\or\CYRISHRT\or
+ \CYRK\or\CYRL\or\CYRM\or\CYRN\or\CYRO\or\CYRP\or\CYRR\or
+ \CYRS\or\CYRT\or\CYRU\or\CYRF\or\CYRH\or\CYRC\or\CYRCH\or
+ \CYRSH\or\CYRSHCH\or\CYRYU\or\CYRYA\else\@ctrerr\fi}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\asbuk}
+%
+% The macro |\asbuk| is similar to |\alph|; it produces lowercase
+% Ukrainian letters.
+%
+% \begin{macrocode}
+\def\asbuk#1{\expandafter\@asbuk\csname c@#1\endcsname}
+\def\@asbuk#1{\ifcase#1\or
+ \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyre\or\cyrie\or
+ \cyrzh\or\cyrz\or\cyri\or\cyrii\or\cyryi\or\cyrishrt\or
+ \cyrk\or\cyrl\or\cyrm\or\cyrn\or\cyro\or\cyrp\or\cyrr\or
+ \cyrs\or\cyrt\or\cyru\or\cyrf\or\cyrh\or\cyrc\or\cyrch\or
+ \cyrsh\or\cyrshch\or\cyryu\or\cyrya\else\@ctrerr\fi}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Set up default Cyrillic math alphabets. The math groups for cyrillic
+% letters are defined in the encoding definition files. First, declare
+% a new alphabet for symbols, |\cyrmathrm|, based on the symbol font
+% for Cyrillic letters defined in the encoding definition file. Note,
+% that by default Cyrillic letters are taken from upright font in math
+% mode (unlike Latin letters).
+% \begin{macrocode}
+%\RequirePackage{textmath}
+\@ifundefined{sym\cyrillicencoding letters}{}{%
+\SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
+ \rmdefault\bfdefault\updefault
+\DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}
+% \end{macrocode}
+% And we need a few commands to be able to switch to different variants.
+% \begin{macrocode}
+\DeclareMathAlphabet\cyrmathbf\cyrillicencoding
+ \rmdefault\bfdefault\updefault
+\DeclareMathAlphabet\cyrmathsf\cyrillicencoding
+ \sfdefault\mddefault\updefault
+\DeclareMathAlphabet\cyrmathit\cyrillicencoding
+ \rmdefault\mddefault\itdefault
+\DeclareMathAlphabet\cyrmathtt\cyrillicencoding
+ \ttdefault\mddefault\updefault
+%
+\SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
+ \sfdefault\bfdefault\updefault
+\SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
+ \rmdefault\bfdefault\itdefault
+}
+% \end{macrocode}
+%
+% Some math functions in Ukrainian and Russian math books have other
+% names: e.g., \texttt{sinh} in Russian is written as \texttt{sh} etc.
+% So we define a number of new math operators.
+%
+% |\sinh|:
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+% \end{macrocode}
+% |\cosh|:
+% \begin{macrocode}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+% \end{macrocode}
+% |\tan|:
+% \begin{macrocode}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+% \end{macrocode}
+% |\arctan|:
+% \begin{macrocode}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+% \end{macrocode}
+% arcctg:
+% \begin{macrocode}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+% \end{macrocode}
+% The following macro conflicts with |\th| defined in Latin~1 encoding:
+%
+% |\tanh|:
+% \changes{ukraineb-1.1k}{2004/05/21}{Change definition of \cs{th}
+% only for this language}
+% \begin{macrocode}
+\addto\extrasrussian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+% \end{macrocode}
+% |\cot|:
+% \begin{macrocode}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+% \end{macrocode}
+% |\coth|:
+% \begin{macrocode}
+\def\cth{\mathop{\operator@font cth}\nolimits}
+% \end{macrocode}
+% |\csc|:
+% \begin{macrocode}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+% \end{macrocode}
+%
+% And finally some other Ukrainian and Russian mathematical symbols:
+% \begin{macrocode}
+\def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
+\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
+\def\nsd{\mathop{\cyrmathrm{\cyrn.\cyrs.\cyrd.}}\nolimits}
+\def\nsk{\mathop{\cyrmathrm{\cyrn.\cyrs.\cyrk.}}\nolimits}
+\def\NSD{\mathop{\cyrmathrm{\CYRN\CYRS\CYRD}}\nolimits}
+\def\NSK{\mathop{\cyrmathrm{\CYRN\CYRS\CYRK}}\nolimits}
+ \def\nod{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrd.}}\nolimits} % ??????
+ \def\nok{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrk.}}\nolimits} % ??????
+ \def\NOD{\mathop{\cyrmathrm{\CYRN\CYRO\CYRD}}\nolimits} % ??????
+ \def\NOK{\mathop{\cyrmathrm{\CYRN\CYRO\CYRK}}\nolimits} % ??????
+\def\Proj{\mathop{\cyrmathrm{\CYRP\cyrr}}\nolimits}
+% \end{macrocode}
+%
+% This is for compatibility with older Ukrainian packages.
+% \begin{macrocode}
+\DeclareRobustCommand{\No}{%
+ \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a configuration file,
+% setting the main language to be switched on at |\begin{document}| and
+% resetting the category code of \texttt{@} to its original value.
+%
+% \begin{macrocode}
+\ldf@finish{ukrainian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/ukraineb.ins b/Master/texmf-dist/source/generic/babel/ukraineb.ins
new file mode 100644
index 00000000000..73b35f110d3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/ukraineb.ins
@@ -0,0 +1,147 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/03/13}
+\def\batchfile{ukraineb.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\usedir{tex/generic/babel}
+\keepsilent
+
+\usepreamble\mainpreamble
+
+\generate{\file{ukraineb.ldf}{\from{ukraineb.dtx}{code}}}
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.fd}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/user.drv b/Master/texmf-dist/source/generic/babel/user.drv
new file mode 100644
index 00000000000..9b45647aa69
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/user.drv
@@ -0,0 +1,170 @@
+%%
+%% This is file `user.drv',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% babel.dtx (with options: `driver,user')
+%%
+%% This file was generated from file(s) of the Babel system.
+%% ---------------------------------------------------------
+%%
+%% Copyright (C) 2004 Johannes Braams. All rights reserved.
+%%
+%% To produce the documentation in the way you like you are allowed
+%% to change this driver file.
+%%
+%%
+%% File 'babel.dtx'
+%%\ProvidesFile{babel.dtx}[2005/05/21 v3.8g The Babel package]
+%% Babel package for LaTeX2e.
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% all rights reserved.
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+\ifx\ProvidesFile\@undefined
+ \def\ProvidesFile#1[#2 #3 #4]{%
+ \wlog{File: #1 #4 #3 <#2>}%
+ \let\ProvidesFile\@undefined
+ }
+\fi
+\ProvidesFile{user.drv}
+ [2005/05/21 v3.8g %
+]
+\documentclass{ltxdoc}
+\usepackage{url,t1enc,supertabular}
+\usepackage[icelandic,english]{babel}
+\DoNotIndex{\!,\',\,,\.,\-,\:,\;,\?,\/,\^,\`,\@M}
+\DoNotIndex{\@,\@ne,\@m,\@afterheading,\@date,\@endpart}
+\DoNotIndex{\@hangfrom,\@idxitem,\@makeschapterhead,\@mkboth}
+\DoNotIndex{\@oddfoot,\@oddhead,\@restonecolfalse,\@restonecoltrue}
+\DoNotIndex{\@starttoc,\@unused}
+\DoNotIndex{\accent,\active}
+\DoNotIndex{\addcontentsline,\advance,\Alph,\arabic}
+\DoNotIndex{\baselineskip,\begin,\begingroup,\bf,\box,\c@secnumdepth}
+\DoNotIndex{\catcode,\centering,\char,\chardef,\clubpenalty}
+\DoNotIndex{\columnsep,\columnseprule,\crcr,\csname}
+\DoNotIndex{\day,\def,\dimen,\discretionary,\divide,\dp,\do}
+\DoNotIndex{\edef,\else,\@empty,\end,\endgroup,\endcsname,\endinput}
+\DoNotIndex{\errhelp,\errmessage,\expandafter,\fi,\filedate}
+\DoNotIndex{\fileversion,\fmtname,\fnum@figure,\fnum@table,\fontdimen}
+\DoNotIndex{\gdef,\global}
+\DoNotIndex{\hbox,\hidewidth,\hfil,\hskip,\hspace,\ht,\Huge,\huge}
+\DoNotIndex{\ialign,\if@twocolumn,\ifcase,\ifcat,\ifhmode,\ifmmode}
+\DoNotIndex{\ifnum,\ifx,\immediate,\ignorespaces,\input,\item}
+\DoNotIndex{\kern}
+\DoNotIndex{\labelsep,\Large,\large,\labelwidth,\lccode,\leftmargin}
+\DoNotIndex{\lineskip,\leavevmode,\let,\list,\ll,\long,\lower}
+\DoNotIndex{\m@ne,\mathchar,\mathaccent,\markboth,\month,\multiply}
+\DoNotIndex{\newblock,\newbox,\newcount,\newdimen,\newif,\newwrite}
+\DoNotIndex{\nobreak,\noexpand,\noindent,\null,\number}
+\DoNotIndex{\onecolumn,\or}
+\DoNotIndex{\p@,par, \parbox,\parindent,\parskip,\penalty}
+\DoNotIndex{\protect,\ps@headings}
+\DoNotIndex{\quotation}
+\DoNotIndex{\raggedright,\raise,\refstepcounter,\relax,\rm,\setbox}
+\DoNotIndex{\section,\setcounter,\settowidth,\scriptscriptstyle}
+\DoNotIndex{\sfcode,\sl,\sloppy,\small,\space,\spacefactor,\strut}
+\DoNotIndex{\string}
+\DoNotIndex{\textwidth,\the,\thechapter,\thefigure,\thepage,\thepart}
+\DoNotIndex{\thetable,\thispagestyle,\titlepage,\tracingmacros}
+\DoNotIndex{\tw@,\twocolumn,\typeout,\uppercase,\usecounter}
+\DoNotIndex{\vbox,\vfil,\vskip,\vspace,\vss}
+\DoNotIndex{\widowpenalty,\write,\xdef,\year,\z@,\z@skip}
+\makeatletter
+\gdef\dlqq{{\setbox\tw@=\hbox{,}\setbox\z@=\hbox{''}%
+ \dimen\z@=\ht\z@ \advance\dimen\z@-\ht\tw@
+ \setbox\z@=\hbox{\lower\dimen\z@\box\z@}\ht\z@=\ht\tw@
+ \dp\z@=\dp\tw@ \box\z@\kern-.04em}}
+\makeatother
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\m[1]{\mbox{$\langle$\it#1\/$\rangle$}}
+\newcommand*\langvar{\m{lang}}
+\newcommand*\note[1]{}
+\newcommand*\bsl{\protect\bslash}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+\newcommand*\langdeffile[1]{%
+ \DocInput{#1}}
+\DisableCrossrefs
+\setcounter{StandardModuleDepth}{1}
+\OnlyDescription
+\begin{document}
+\DocInput{babel.dtx}
+^^A% \changes{babel~3.6i}{1997/02/22}{Added kannada}
+\clearpage
+\langdeffile{esperanto.dtx}
+\langdeffile{interlingua.dtx}
+\langdeffile{dutch.dtx}
+\langdeffile{english.dtx}
+\langdeffile{germanb.dtx}
+\langdeffile{ngermanb.dtx}
+\langdeffile{breton.dtx}
+\langdeffile{welsh.dtx}
+\langdeffile{irish.dtx}
+\langdeffile{scottish.dtx}
+\langdeffile{greek.dtx}
+\langdeffile{frenchb.dtx}
+\langdeffile{italian.dtx}
+\langdeffile{latin.dtx}
+\langdeffile{portuges.dtx}
+\langdeffile{spanish.dtx}
+\langdeffile{catalan.dtx}
+\langdeffile{galician.dtx}
+\langdeffile{basque.dtx}
+\langdeffile{romanian.dtx}
+\langdeffile{danish.dtx}
+\langdeffile{icelandic.dtx}
+\langdeffile{norsk.dtx}
+\langdeffile{swedish.dtx}
+\langdeffile{samin.dtx}
+\langdeffile{finnish.dtx}
+\langdeffile{magyar.dtx}
+\langdeffile{estonian.dtx}
+\langdeffile{croatian.dtx}
+\langdeffile{czech.dtx}
+\langdeffile{polish.dtx}
+\langdeffile{serbian.dtx}
+\langdeffile{slovak.dtx}
+\langdeffile{slovene.dtx}
+\langdeffile{russianb.dtx}
+\langdeffile{bulgarian.dtx}
+\langdeffile{ukraineb.dtx}
+\langdeffile{lsorbian.dtx}
+\langdeffile{usorbian.dtx}
+\langdeffile{turkish.dtx}
+\langdeffile{hebrew.dtx}
+\DocInput{hebinp.dtx}
+\DocInput{hebrew.fdd}
+\DocInput{heb209.dtx}
+\langdeffile{bahasa.dtx}
+\clearpage
+\DocInput{bbplain.dtx}
+\end{document}
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
+%%
+%% End of file `user.drv'.
diff --git a/Master/texmf-dist/source/generic/babel/usorbian.dtx b/Master/texmf-dist/source/generic/babel/usorbian.dtx
new file mode 100644
index 00000000000..e4a9ebe26df
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/usorbian.dtx
@@ -0,0 +1,360 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{298}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{usorbian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{usorbian}
+%\fi
+%\ProvidesFile{usorbian.dtx}
+ [2005/03/31 v1.0i Upper Sorbian support from the babel system]
+%\iffalse
+%% File `usorbian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Upper Sorbian Language Definition File
+%% Copyright (C) 1994 - 2004
+%% by Eduard Werner
+% Werner, Eduard",
+% Serbski institut z. t.,
+% Dw\'orni\v{s}\'cowa 6
+% 02625 Budy\v{s}in/Bautzen
+% Germany",
+% (??)3591 497223",
+% edi at kaihh.hanse.de",
+%
+%% Please report errors to: Eduard Werner edi at kaihh.hanse.de
+%%
+% This file is part of the babel system, it provides the source
+% code for the Upper Sorbian definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newfont{\logo}{logo10}
+\newcommand*\MF{{\logo METAFONT}}
+\begin{document}
+ \DocInput{usorbian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{usorbian.dtx}
+%
+% \changes{usorbian-0.1}{1994/10/10}{First version}
+% \changes{usorbian-0.1b}{1994/10/18}{Made it possible to run through
+% \LaTeX; added \cs{MF} and removed extra \cs{end{macro}}}
+% \changes{usorbian-1.0d}{1996/07/13}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{usorbian-1.0e}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Upper Sorbian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was written by Eduard Werner
+% (\texttt{edi@kaihh.hanse.de}).} It defines all the
+% language-specific macros for Upper Sorbian.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{usorbian-1.0e}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{usorbian}\captionsusorbian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{usorbian} will be an `unknown' languagein which
+% case we have to make it known. So we check for the existence of
+% |\l@usorbian| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@usorbian\@undefined
+ \@nopatterns{Usorbian}
+ \adddialect\l@usorbian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Upper Sorbian language.
+%
+% \begin{macro}{\captionsusorbian}
+% The macro |\captionsusorbian| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{usorbian-0.1c}{1994/11/27}{Removed two typos (Kapitel and
+% Dodatki)}
+% \changes{usorbian-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{usorbian-1.0i}{2000/09/22}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsusorbian{%
+ \def\prefacename{Zawod}%
+ \def\refname{Referency}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literatura}%
+ \def\chaptername{Kapitl}%
+ \def\appendixname{Dodawki}%
+ \def\contentsname{Wobsah}%
+ \def\listfigurename{Zapis wobrazow}%
+ \def\listtablename{Zapis tabulkow}%
+ \def\indexname{Indeks}%
+ \def\figurename{Wobraz}%
+ \def\tablename{Tabulka}%
+ \def\partname{D\'z\v el}%
+ \def\enclname{P\v r\l oha}%
+ \def\ccname{CC}%
+ \def\headtoname{Komu}%
+ \def\pagename{Strona}%
+ \def\seename{hl.}%
+ \def\alsoname{hl.~te\v z}
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newdateusorbian}
+% The macro |\newdateusorbian| redefines the command |\today| to
+% produce Upper Sorbian dates.
+% \changes{usorbian-1.0g}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{usorbian-1.0g}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\newdateusorbian{%
+ \def\today{\number\day.~\ifcase\month\or
+ januara\or februara\or m\v erca\or apryla\or meje\or junija\or
+ julija\or awgusta\or septembra\or oktobra\or
+ nowembra\or decembra\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\olddateusorbian}
+% The macro |\olddateusorbian| redefines the command |\today| to
+% produce old-style Upper Sorbian dates.
+% \changes{usorbian-1.0g}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{usorbian-1.0g}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\olddateusorbian{%
+ \def\today{\number\day.~\ifcase\month\or
+ wulkeho r\'o\v zka\or ma\l eho r\'o\v zka\or nal\v etnika\or
+ jutrownika\or r\'o\v zownika\or sma\v znika\or pra\v znika\or
+ \v znjenca\or po\v znjenca\or winowca\or nazymnika\or
+ hodownika\fi \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% The default will be the new-style dates.
+% \begin{macrocode}
+\let\dateusorbian\newdateusorbian
+% \end{macrocode}
+%
+% \begin{macro}{\extrasusorbian}
+% The macro |\extrasusorbian| will perform all the extra
+% definitions needed for the Upper Sorbian language. It's pirated
+% from |germanb.sty|. The macro |\noextrasusorbian| is used to
+% cancel the actions of |\extrasusorbian|.
+%
+% Because for Upper Sorbian (as well as for Dutch) the \texttt{"}
+% character is made active. This is done once, later on its
+% definition may vary.
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasusorbian{\languageshorthands{usorbian}}
+\addto\extrasusorbian{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{usorbian-1.0h}{1999/12/17}{Deactivate shorthands ouside of
+% Upper Sorbian}
+% \begin{macrocode}
+\addto\noextrasusorbian{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% In order for \TeX\ to be able to hyphenate German Upper Sorbian
+% words which contain `\ss' we have to give the character a nonzero
+% |\lccode| (see Appendix H, the \TeX book).
+% \begin{macrocode}
+\addto\extrasusorbian{\babel@savevariable{\lccode`\^^Y}%
+ \lccode`\^^Y`\^^Y}
+% \end{macrocode}
+% The umlaut accent macro |\"| is changed to lower the umlaut dots.
+% The redefinition is done with the help of |\umlautlow|.
+% \begin{macrocode}
+\addto\extrasusorbian{\babel@save\"\umlautlow}
+\addto\noextrasusorbian{\umlauthigh}
+% \end{macrocode}
+% The Upper Sorbian hyphenation patterns can be used with
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{usorbian-1.0i}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{usorbian-1.0a}{1995/05/27}{Removed stuff that has been
+% moved to \file{babel.def}}
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep it
+% available, the math accent |\"| can now be typed as |"|. Also we
+% store the original meaning of the command |\"| for future use.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the doublequote macros: the umlauts,
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"a}{\textormath{\"{a}}{\ddot a}}
+\declare@shorthand{usorbian}{"o}{\textormath{\"{o}}{\ddot o}}
+\declare@shorthand{usorbian}{"u}{\textormath{\"{u}}{\ddot u}}
+\declare@shorthand{usorbian}{"A}{\textormath{\"{A}}{\ddot A}}
+\declare@shorthand{usorbian}{"O}{\textormath{\"{O}}{\ddot O}}
+\declare@shorthand{usorbian}{"U}{\textormath{\"{U}}{\ddot U}}
+% \end{macrocode}
+% tremas,
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"e}{\textormath{\"{e}}{\ddot e}}
+\declare@shorthand{usorbian}{"E}{\textormath{\"{E}}{\ddot E}}
+\declare@shorthand{usorbian}{"i}{\textormath{\"{\i}}{\ddot\imath}}
+\declare@shorthand{usorbian}{"I}{\textormath{\"{I}}{\ddot I}}
+% \end{macrocode}
+% usorbian es-zet (sharp s),
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"s}{\textormath{\ss{}}{\@SS{}}}
+\declare@shorthand{usorbian}{"S}{SS}
+% \end{macrocode}
+% german and french quotes,
+% \changes{usorbian-1.0f}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{usorbian}{"'}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\declare@shorthand{usorbian}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{usorbian}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% discretionary commands
+% \changes{usorbian-1.0c}{1996/01/24}{Now use \cs{bbl@disc}}
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"c}{\textormath{\bbl@disc ck}{c}}
+\declare@shorthand{usorbian}{"C}{\textormath{\bbl@disc CK}{C}}
+\declare@shorthand{usorbian}{"f}{\textormath{\bbl@disc f{ff}}{f}}
+\declare@shorthand{usorbian}{"F}{\textormath{\bbl@disc F{FF}}{F}}
+\declare@shorthand{usorbian}{"l}{\textormath{\bbl@disc l{ll}}{l}}
+\declare@shorthand{usorbian}{"L}{\textormath{\bbl@disc L{LL}}{L}}
+\declare@shorthand{usorbian}{"m}{\textormath{\bbl@disc m{mm}}{m}}
+\declare@shorthand{usorbian}{"M}{\textormath{\bbl@disc M{MM}}{M}}
+\declare@shorthand{usorbian}{"n}{\textormath{\bbl@disc n{nn}}{n}}
+\declare@shorthand{usorbian}{"N}{\textormath{\bbl@disc N{NN}}{N}}
+\declare@shorthand{usorbian}{"p}{\textormath{\bbl@disc p{pp}}{p}}
+\declare@shorthand{usorbian}{"P}{\textormath{\bbl@disc P{PP}}{P}}
+\declare@shorthand{usorbian}{"t}{\textormath{\bbl@disc t{tt}}{t}}
+\declare@shorthand{usorbian}{"T}{\textormath{\bbl@disc T{TT}}{T}}
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{usorbian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{usorbian}{""}{\hskip\z@skip}
+% \end{macrocode}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% \begin{macro}{\ck}
+% All that's left to do now is to define a couple of commands
+% for reasons of compatibility with \file{german.sty}.
+% \changes{usorbian-1.0g}{1998/06/07}{Now use \cs{shorthandon} and
+% \cs{shorthandoff}}
+% \begin{macrocode}
+\def\mdqon{\shorthandon{"}}
+\def\mdqoff{\shorthandoff{"}}
+\def\ck{\allowhyphens\discretionary{k-}{k}{ck}\allowhyphens}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{usorbian-1.0e}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{usorbian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/Master/texmf-dist/source/generic/babel/welsh.dtx b/Master/texmf-dist/source/generic/babel/welsh.dtx
new file mode 100644
index 00000000000..95965fcfaed
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/welsh.dtx
@@ -0,0 +1,207 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{97}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{welsh.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{welsh}
+%\fi
+%\ProvidesFile{welsh.dtx}
+ [2005/03/31 v1.0d Welsh support from the babel system]
+%\iffalse
+%% File `welsh.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Welsh language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{welsh.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{welsh.dtx}
+%
+% \section{The Welsh language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Welsh language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\ldf@init| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{welsh}{captionswelsh}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{welsh} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@welsh| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\undefined\l@welsh
+ \@nopatterns{welsh}
+ \adddialect\l@welsh0\fi
+% \end{macrocode}
+% The next step consists of defining commands to switch to (and
+% from) the Welsh language.
+%
+% \begin{macro}{\welshhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{welsh-1.0c}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionswelsh}
+% The macro |\captionswelsh| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{welsh-1.0c}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{welsh-1.0d}{2005/03/31}{Provided the translation for
+% Glossary}
+% \begin{macrocode}
+\def\captionswelsh{%
+ \def\prefacename{Rhagair}%
+ \def\refname{Cyfeiriadau}%
+ \def\abstractname{Crynodeb}%
+ \def\bibname{Llyfryddiaeth}%
+ \def\chaptername{Pennod}%
+ \def\appendixname{Atodiad}%
+ \def\contentsname{Cynnwys}%
+ \def\listfigurename{Rhestr Ddarluniau}%
+ \def\listtablename{Rhestr Dablau}%
+ \def\indexname{Mynegai}%
+ \def\figurename{Darlun}%
+ \def\tablename{Taflen}%
+ \def\partname{Rhan}%
+ \def\enclname{amgae\"edig}%
+ \def\ccname{cop\"\i au}%
+ \def\headtoname{At}% % `at' on letters meaning `to ( a person)'
+ % `to (a place)' is `i' in Welsh
+ \def\pagename{tudalen}%
+ \def\seename{gweler}%
+ \def\alsoname{gweler hefyd}%
+ \def\proofname{Prawf}%
+ \def\glossaryname{Rhestr termau}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datewelsh}
+% The macro |\datewelsh| redefines the command |\today| to
+% produce welsh dates.
+% \changes{welsh-1.0b}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{welsh-1.0b}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{welsh-1.0d}{2005/03/31}{removed `a viz' from the definition
+% of \cs{today}}
+% \begin{macrocode}
+\def\datewelsh{%
+ \def\today{\ifnum\day=1\relax 1\/$^{\mathrm{a\tilde{n}}}$\else
+ \number\day\fi\space\ifcase\month\or
+ Ionawr\or Chwefror\or Mawrth\or Ebrill\or
+ Mai\or Mehefin\or Gorffennaf\or Awst\or
+ Medi\or Hydref\or Tachwedd\or Rhagfyr\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extraswelsh}
+% \begin{macro}{\noextraswelsh}
+% The macro |\extraswelsh| will perform all the extra
+% definitions needed for the welsh language. The macro
+% |\noextraswelsh| is used to cancel the actions of
+% |\extraswelsh|. For the moment these macros are empty but
+% they are defined for compatibility with the other
+% language definition files.
+%
+% \begin{macrocode}
+\addto\extraswelsh{}
+\addto\noextraswelsh{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{welsh}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/Master/texmf-dist/source/generic/babel/welsh.ins b/Master/texmf-dist/source/generic/babel/welsh.ins
new file mode 100644
index 00000000000..a807ec6272b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/babel/welsh.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{welsh.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{welsh.ldf}{\from{welsh.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/borceux/compatibility/OldDiagram b/Master/texmf-dist/source/generic/borceux/compatibility/OldDiagram
new file mode 100644
index 00000000000..5b10a593c38
--- /dev/null
+++ b/Master/texmf-dist/source/generic/borceux/compatibility/OldDiagram
@@ -0,0 +1,291 @@
+\catcode`\@=11
+
+\newcommand{\earv}[1]{\ear[#1]}
+\newcommand{\Earv}[2]{\Ear[#2]{#1}}
+\newcommand{\eaRv}[2]{\eaR[#2]{#1}}
+\newcommand{\edotarv}[1]{\edotar[#1]}
+\newcommand{\Edotarv}[2]{\Edotar[#2]{#1}}
+\newcommand{\edotaRv}[2]{\edotaR[#2]{#1}}
+\newcommand{\emonov}[1]{\emono[#1]}
+\newcommand{\Emonov}[2]{\Emono[#2]{#1}}
+\newcommand{\emonOv}[2]{\emonO[#2]{#1}}
+\newcommand{\eepiv}[1]{\eepi[#1]}
+\newcommand{\Eepiv}[2]{\Eepi[#2]{#1}}
+\newcommand{\eepIv}[2]{\eepI[#2]{#1}}
+\newcommand{\ebimov}[1]{\ebimo[#1]}
+\newcommand{\Ebimov}[2]{\Ebimo[#2]{#1}}
+\newcommand{\ebimOv}[2]{\ebimO[#2]{#1}}
+\newcommand{\eisov}[1]{\eiso[#1]}
+\newcommand{\Eisov}[2]{\Eiso[#2]{#1}}
+\newcommand{\eisOv}[2]{\eisO[#2]{#1}}
+\newcommand{\eeqlrv}[1]{\eeql[#1]}
+\newcommand{\ebiarv}[1]{\ebiar[#1]}
+\newcommand{\Ebiarv}[3]{\Ear[#3]{#1}{#2}}
+\newcommand{\eadjarv}[1]{\eadjar[#1]}
+\newcommand{\Eadjarv}[3]{\Ear[#3]{#1}{#2}}
+
+\newcommand{\warv}[1]{\war[#1]}
+\newcommand{\Warv}[2]{\War[#2]{#1}}
+\newcommand{\waRv}[2]{\waR[#2]{#1}}
+\newcommand{\wdotarv}[1]{\wdotar[#1]}
+\newcommand{\Wdotarv}[2]{\Wdotar[#2]{#1}}
+\newcommand{\wdotaRv}[2]{\wdotaR[#2]{#1}}
+\newcommand{\wmonov}[1]{\wmono[#1]}
+\newcommand{\Wmonov}[2]{\Wmono[#2]{#1}}
+\newcommand{\wmonOv}[2]{\wmonO[#2]{#1}}
+\newcommand{\wepiv}[1]{\wepi[#1]}
+\newcommand{\Wepiv}[2]{\Wepi[#2]{#1}}
+\newcommand{\wepIv}[2]{\wepI[#2]{#1}}
+\newcommand{\wbimov}[1]{\wbimo[#1]}
+\newcommand{\Wbimov}[2]{\Wbimo[#2]{#1}}
+\newcommand{\wbimOv}[2]{\wbimO[#2]{#1}}
+\newcommand{\wisov}[1]{\wiso[#1]}
+\newcommand{\Wisov}[2]{\Wiso[#2]{#1}}
+\newcommand{\wisOv}[2]{\wisO[#2]{#1}}
+\newcommand{\weqlrv}[1]{\weql[#1]}
+\newcommand{\wbiarv}[1]{\wbiar[#1]}
+\newcommand{\Wbiarv}[3]{\War[#3]{#1}{#2}}
+\newcommand{\wadjarv}[1]{\wadjar[#1]}
+\newcommand{\Wadjarv}[3]{\War[#3]{#1}{#2}}
+
+\newcommand{\narv}[1]{\nar[#1]}
+\newcommand{\Narv}[2]{\Nar[#2]{#1}}
+\newcommand{\naRv}[2]{\naR[#2]{#1}}
+\newcommand{\ndotarv}[1]{\ndotar[#1]}
+\newcommand{\Ndotarv}[2]{\Ndotar[#2]{#1}}
+\newcommand{\ndotaRv}[2]{\ndotaR[#2]{#1}}
+\newcommand{\nmonov}[1]{\nmono[#1]}
+\newcommand{\Nmonov}[2]{\Nmono[#2]{#1}}
+\newcommand{\nmonOv}[2]{\nmonO[#2]{#1}}
+\newcommand{\nepiv}[1]{\nepi[#1]}
+\newcommand{\Nepiv}[2]{\Nepi[#2]{#1}}
+\newcommand{\nepIv}[2]{\nepI[#2]{#1}}
+\newcommand{\nbimov}[1]{\nbimo[#1]}
+\newcommand{\Nbimov}[2]{\Nbimo[#2]{#1}}
+\newcommand{\nbimOv}[2]{\nbimO[#2]{#1}}
+\newcommand{\nisov}[1]{\niso[#1]}
+\newcommand{\Nisov}[2]{\Niso[#2]{#1}}
+\newcommand{\nisOv}[2]{\nisO[#2]{#1}}
+\newcommand{\neqlrv}[1]{\neql[#1]}
+\newcommand{\nbiarv}[1]{\nbiar[#1]}
+\newcommand{\Nbiarv}[3]{\Nar[#3]{#1}{#2}}
+\newcommand{\nadjarv}[1]{\nadjar[#1]}
+\newcommand{\Nadjarv}[3]{\Nar[#3]{#1}{#2}}
+
+\newcommand{\sarv}[1]{\sar[#1]}
+\newcommand{\Sarv}[2]{\Sar[#2]{#1}}
+\newcommand{\saRv}[2]{\saR[#2]{#1}}
+\newcommand{\sdotarv}[1]{\sdotar[#1]}
+\newcommand{\Sdotarv}[2]{\Sdotar[#2]{#1}}
+\newcommand{\sdotaRv}[2]{\sdotaR[#2]{#1}}
+\newcommand{\smonov}[1]{\smono[#1]}
+\newcommand{\Smonov}[2]{\Smono[#2]{#1}}
+\newcommand{\smonOv}[2]{\smonO[#2]{#1}}
+\newcommand{\sepiv}[1]{\sepi[#1]}
+\newcommand{\Sepiv}[2]{\Sepi[#2]{#1}}
+\newcommand{\sepIv}[2]{\sepI[#2]{#1}}
+\newcommand{\sbimov}[1]{\sbimo[#1]}
+\newcommand{\Sbimov}[2]{\Sbimo[#2]{#1}}
+\newcommand{\sbimOv}[2]{\sbimO[#2]{#1}}
+\newcommand{\sisov}[1]{\siso[#1]}
+\newcommand{\Sisov}[2]{\Siso[#2]{#1}}
+\newcommand{\sisOv}[2]{\sisO[#2]{#1}}
+\newcommand{\seqlrv}[1]{\seql[#1]}
+\newcommand{\sbiarv}[1]{\sbiar[#1]}
+\newcommand{\Sbiarv}[3]{\Sar[#3]{#1}{#2}}
+\newcommand{\sadjarv}[1]{\sadjar[#1]}
+\newcommand{\Sadjarv}[3]{\Sar[#3]{#1}{#2}}
+
+\newcommand{\searv}[1]{\sear[#1]}
+\newcommand{\Searv}[2]{\Sear[#2]{#1}}
+\newcommand{\seaRv}[2]{\seaR[#2]{#1}}
+
+\newcommand{\nearv}[1]{\near[#1]}
+\newcommand{\Nearv}[2]{\Near[#2]{#1}}
+\newcommand{\neaRv}[2]{\neaR[#2]{#1}}
+
+\newcommand{\swarv}[1]{\swar[#1]}
+\newcommand{\Swarv}[2]{\Swar[#2]{#1}}
+\newcommand{\swaRv}[2]{\swaR[#2]{#1}}
+
+\newcommand{\nwarv}[1]{\nwar[#1]}
+\newcommand{\Nwarv}[2]{\Nwar[#2]{#1}}
+\newcommand{\nwaRv}[2]{\nwaR[#2]{#1}}
+
+\newcommand{\necurve}[1]{\necurvar[#1]}
+\newcommand{\nwcurve}[1]{\nwcurvar[#1]}
+\newcommand{\securve}[1]{\securvar[#1]}
+\newcommand{\swcurve}[1]{\swcurvar[#1]}
+\newcommand{\encurve}[1]{\encurvar[#1]}
+\newcommand{\escurve}[1]{\escurvar[#1]}
+\newcommand{\wncurve}[1]{\wncurvar[#1]}
+\newcommand{\wscurve}[1]{\wscurvar[#1]}
+
+\newcommand{\Freear}[8]{\begin{picture}(0,0)%
+\put(#400,#500){\vector(#6,#7){#800}}%
+\truex{#200}\truey{#300}%
+\put(\value{x},\value{y}){$#1$}\end{picture}}%
+\newcommand{\freear}[5]{\Freear{}{0}{0}{#1}{#2}{#3}{#4}{#5}}%
+
+\newcommand{\DIAG}[1]{%
+\diagramtrue%
+\SCALE=\defaultscale%
+\setlength{\unitlength}{655sp}%
+\initialize{\mbox{$#1$}}}%
+
+\newcommand{\N}[1]%
+{\raisebox{0pt}[7pt][0pt]{$#1$}}%
+
+\let\B=\bold
+
+\def\newmovename(#1,#2)#3{\hspace{#1pt}%
+\raisebox{#2pt}[5pt][2pt]{\raisebox{#2pt}{$#3$}}%
+\hspace{-#1pt}}%
+\def\newmovearrow(#1,#2)#3{\makebox[0pt]{%
+\hspace{#1pt}\hspace{#1pt}%
+\raisebox{#2pt}[0pt][0pt]{\raisebox{#2pt}{$#3$}}}}%
+\def\newmovevertex(#1,#2)#3{%
+\mbox{\hspace{#1pt}%
+\raisebox{#2pt}{\raisebox{#2pt}{$#3$}}%
+\hspace{-#1pt}}}%
+\newcommand{\oldmovename}[3]{\newmovename(#2,#3){#1}}
+\newcommand{\oldmovearrow}[3]{\newmovearrow(#2,#3){#1}}
+\newcommand{\oldmovevertex}[3]{\newmovevertex(#2,#3){#1}}
+\renewcommand{\movename}{\@ifnextchar({\newmovename}{\oldmovename}}
+\renewcommand{\movearrow}{\@ifnextchar({\newmovearrow}{\oldmovearrow}}
+\renewcommand{\movevertex}{\@ifnextchar({\newmovevertex}{\oldmovevertex}}
+
+\newcount\A\newcount\B
+\newcommand{\Diag}[2]{\A=0\B=0\DIAG{#2}}
+\newcommand{\Diagv}[4]{\A=#2\B=#3\DIAG{#4}}
+\newcommand{\diaGv}[2]{\advance\B by -#1\diagv{\A}{\B}{#2}}
+\newcommand{\diaG}{\diagv{\A}{\B}{0}}
+\newcommand{\move}[3]{\movename(#2,#3){#1}}
+
+% SPECIAL SYMBOLS
+
+% adjoint symbol
+\newcommand{\adj}{\begin{picture}(9,6)%
+\put(1,3){\line(1,0){6}}\put(7,0){\line(0,1){6}}%
+\end{picture}}%
+
+% commutative diagram symbol
+\newcommand{\com}{\begin{picture}(12,8)%
+\put(6,4){\oval(8,8)[b]}\put(6,4){\oval(8,8)[r]}%
+\put(6,8){\line(-1,0){2}}\end{picture}}%
+
+% natural transformation with names [1],[2],[3]
+\newcommand{\Nat}[3]{\raisebox{-2pt}%
+{\begin{picture}(34,15)%
+\put(2,10){\line(1,0){30}}%
+\put(32,10){\ehead}%
+\put(2,0){\line(1,0){30}}%
+\put(32,0){\ehead}%
+\put(13,2){$\Downarrow$}%
+\put(20,3){$\scriptstyle{#2}$}%
+\put(4,11){$\scriptstyle{#1}$}%
+\put(4,1){$\scriptstyle{#3}$}%
+\end{picture}}}%
+
+% natural transformation
+\newcommand{\nat}{\raisebox{-2pt}%
+{\begin{picture}(34,10)%
+\put(2,10){\line(1,0){30}}%
+\put(32,10){\ehead}%
+\put(2,0){\line(1,0){30}}%
+\put(32,0){\ehead}%
+\put(13,2){$\Downarrow$}%
+\end{picture}}}%
+
+% pair of natural transformations with names [1],[2],[3],[4],[5]
+\newcommand{\Binat}[5]{\raisebox{-7.5pt}%
+{\begin{picture}(34,25)%
+\put(2,20){\line(1,0){30}}%
+\put(32,20){\ehead}%
+\put(2,10){\line(1,0){30}}%
+\put(32,10){\ehead}%
+\put(2,0){\line(1,0){30}}%
+\put(32,0){\ehead}%
+\put(13,12){$\Downarrow$}%
+\put(13,2){$\Downarrow$}%
+\put(20,13){$\scriptstyle{#2}$}%
+\put(20,3){$\scriptstyle{#4}$}%
+\put(4,21){$\scriptstyle{#1}$}%
+\put(4,11){$\scriptstyle{#3}$}%
+\put(4,1){$\scriptstyle{#5}$}%
+\end{picture}}}%
+
+% pair of natural transformations
+\newcommand{\binat}{\raisebox{-7.5pt}%
+{\begin{picture}(34,20)%
+\put(2,20){\line(1,0){30}}%
+\put(32,20){\ehead}%
+\put(2,10){\line(1,0){30}}%
+\put(32,10){\ehead}%
+\put(2,0){\line(1,0){30}}%
+\put(32,0){\ehead}%
+\put(13,12){$\Downarrow$}%
+\put(13,2){$\Downarrow$}%
+\end{picture}}}%
+
+% display natural transformation with names [1],[2],[3]
+\newcommand{\Dnat}[3]{\raisebox{-2pt}%
+{\begin{picture}(54,15)%
+\put(2,10){\line(1,0){50}}%
+\put(52,10){\ehead}%
+\put(2,0){\line(1,0){50}}%
+\put(52,0){\ehead}%
+\put(23,2){$\Downarrow$}%
+\put(30,1){$\textstyle{#2}$}%
+\put(4,11){$\textstyle{#1}$}%
+\put(4,1){$\textstyle{#3}$}%
+\end{picture}}}%
+
+% display natural transformation
+\newcommand{\dnat}{\raisebox{-2pt}%
+{\begin{picture}(54,10)%
+\put(2,10){\line(1,0){50}}%
+\put(52,10){\ehead}%
+\put(2,0){\line(1,0){50}}%
+\put(52,0){\ehead}%
+\put(23,2){$\Downarrow$}%
+\end{picture}}}%
+
+% display pair of natural transformations with names [1],[2],[3],[4],[5]
+\newcommand{\Dbinat}[5]{\raisebox{-7.5pt}%
+{\begin{picture}(54,25)%
+\put(2,20){\line(1,0){50}}%
+\put(52,20){\ehead}%
+\put(2,10){\line(1,0){50}}%
+\put(52,10){\ehead}%
+\put(2,0){\line(1,0){50}}%
+\put(52,0){\ehead}%
+\put(23,12){$\Downarrow$}%
+\put(23,2){$\Downarrow$}%
+\put(30,11){$\textstyle{#2}$}%
+\put(30,1){$\textstyle{#4}$}%
+\put(4,21){$\textstyle{#1}$}%
+\put(4,11){$\textstyle{#3}$}%
+\put(4,1){$\textstyle{#5}$}%
+\end{picture}}}%
+
+% display pair of natural transformations
+\newcommand{\dbinat}{\raisebox{-7.5pt}%
+{\begin{picture}(54,20)%
+\put(2,20){\line(1,0){50}}%
+\put(52,20){\ehead}%
+\put(2,10){\line(1,0){50}}%
+\put(52,10){\ehead}%
+\put(2,0){\line(1,0){50}}%
+\put(52,0){\ehead}%
+\put(23,12){$\Downarrow$}%
+\put(23,2){$\Downarrow$}%
+\end{picture}}}%
+
+\setdisplayarrowlength{20}
+
+\typeout{\string\displayarrowlength has been put to value 20
+by the file OldDiagram}
+
+
+\catcode`\@=12 \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/borceux/compatibility/OldMaxiDiagram b/Master/texmf-dist/source/generic/borceux/compatibility/OldMaxiDiagram
new file mode 100644
index 00000000000..a1fc33b66a7
--- /dev/null
+++ b/Master/texmf-dist/source/generic/borceux/compatibility/OldMaxiDiagram
@@ -0,0 +1,209 @@
+\catcode`\@=11
+
+\newcommand{\earv}[1]{\ear[#1]}
+\newcommand{\Earv}[2]{\Ear[#2]{#1}}
+\newcommand{\eaRv}[2]{\eaR[#2]{#1}}
+\newcommand{\edotarv}[1]{\edotar[#1]}
+\newcommand{\Edotarv}[2]{\Edotar[#2]{#1}}
+\newcommand{\edotaRv}[2]{\edotaR[#2]{#1}}
+\newcommand{\emonov}[1]{\emono[#1]}
+\newcommand{\Emonov}[2]{\Emono[#2]{#1}}
+\newcommand{\emonOv}[2]{\emonO[#2]{#1}}
+\newcommand{\eepiv}[1]{\eepi[#1]}
+\newcommand{\Eepiv}[2]{\Eepi[#2]{#1}}
+\newcommand{\eepIv}[2]{\eepI[#2]{#1}}
+\newcommand{\ebimov}[1]{\ebimo[#1]}
+\newcommand{\Ebimov}[2]{\Ebimo[#2]{#1}}
+\newcommand{\ebimOv}[2]{\ebimO[#2]{#1}}
+\newcommand{\eisov}[1]{\eiso[#1]}
+\newcommand{\Eisov}[2]{\Eiso[#2]{#1}}
+\newcommand{\eisOv}[2]{\eisO[#2]{#1}}
+\newcommand{\eeqlrv}[1]{\eeql[#1]}
+\newcommand{\ebiarv}[1]{\ebiar[#1]}
+\newcommand{\Ebiarv}[3]{\Ear[#3]{#1}{#2}}
+\newcommand{\eadjarv}[1]{\eadjar[#1]}
+\newcommand{\Eadjarv}[3]{\Ear[#3]{#1}{#2}}
+\newcommand{\etriarv}[1]{\etriar[#1]}
+\newcommand{\Etriarv}[4]{\Etriar[#4]{#1}{#2}{#3}}
+\newcommand{\etriaRv}[4]{\etriaR[#4]{#1}{#2}{#3}}
+\newcommand{\etriadjarv}[1]{\etriadjar[#1]}
+\newcommand{\Etriadjarv}[4]{\Etriadjar[#4]{#1}{#2}{#3}}
+\newcommand{\etriadjaRv}[4]{\etriadjaR[#4]{#1}{#2}{#3}}
+\newcommand{\equadriarv}[1]{\equadriar[#1]}
+\newcommand{\equadriadjarv}[1]{\equadriadjar[#1]}
+\newcommand{\equintiarv}[1]{\equintiar[#1]}
+\newcommand{\equintiadjarv}[1]{\equintiadjar[#1]}
+
+\newcommand{\warv}[1]{\war[#1]}
+\newcommand{\Warv}[2]{\War[#2]{#1}}
+\newcommand{\waRv}[2]{\waR[#2]{#1}}
+\newcommand{\wdotarv}[1]{\wdotar[#1]}
+\newcommand{\Wdotarv}[2]{\Wdotar[#2]{#1}}
+\newcommand{\wdotaRv}[2]{\wdotaR[#2]{#1}}
+\newcommand{\wmonov}[1]{\wmono[#1]}
+\newcommand{\Wmonov}[2]{\Wmono[#2]{#1}}
+\newcommand{\wmonOv}[2]{\wmonO[#2]{#1}}
+\newcommand{\wepiv}[1]{\wepi[#1]}
+\newcommand{\Wepiv}[2]{\Wepi[#2]{#1}}
+\newcommand{\wepIv}[2]{\wepI[#2]{#1}}
+\newcommand{\wbimov}[1]{\wbimo[#1]}
+\newcommand{\Wbimov}[2]{\Wbimo[#2]{#1}}
+\newcommand{\wbimOv}[2]{\wbimO[#2]{#1}}
+\newcommand{\wisov}[1]{\wiso[#1]}
+\newcommand{\Wisov}[2]{\Wiso[#2]{#1}}
+\newcommand{\wisOv}[2]{\wisO[#2]{#1}}
+\newcommand{\weqlrv}[1]{\weql[#1]}
+\newcommand{\wbiarv}[1]{\wbiar[#1]}
+\newcommand{\Wbiarv}[3]{\War[#3]{#1}{#2}}
+\newcommand{\wadjarv}[1]{\wadjar[#1]}
+\newcommand{\Wadjarv}[3]{\War[#3]{#1}{#2}}
+\newcommand{\wtriarv}[1]{\wtriar[#1]}
+\newcommand{\Wtriarv}[4]{\Wtriar[#4]{#1}{#2}{#3}}
+\newcommand{\wtriaRv}[4]{\wtriaR[#4]{#1}{#2}{#3}}
+\newcommand{\wtriadjarv}[1]{\wtriadjar[#1]}
+\newcommand{\Wtriadjarv}[4]{\Wtriadjar[#4]{#1}{#2}{#3}}
+\newcommand{\wtriadjaRv}[4]{\wtriadjaR[#4]{#1}{#2}{#3}}
+\newcommand{\wquadriarv}[1]{\wquadriar[#1]}
+\newcommand{\wquadriadjarv}[1]{\wquadriadjar[#1]}
+\newcommand{\wquintiarv}[1]{\wquintiar[#1]}
+\newcommand{\wquintiadjarv}[1]{\wquintiadjar[#1]}
+
+\newcommand{\narv}[1]{\nar[#1]}
+\newcommand{\Narv}[2]{\Nar[#2]{#1}}
+\newcommand{\naRv}[2]{\naR[#2]{#1}}
+\newcommand{\ndotarv}[1]{\ndotar[#1]}
+\newcommand{\Ndotarv}[2]{\Ndotar[#2]{#1}}
+\newcommand{\ndotaRv}[2]{\ndotaR[#2]{#1}}
+\newcommand{\nmonov}[1]{\nmono[#1]}
+\newcommand{\Nmonov}[2]{\Nmono[#2]{#1}}
+\newcommand{\nmonOv}[2]{\nmonO[#2]{#1}}
+\newcommand{\nepiv}[1]{\nepi[#1]}
+\newcommand{\Nepiv}[2]{\Nepi[#2]{#1}}
+\newcommand{\nepIv}[2]{\nepI[#2]{#1}}
+\newcommand{\nbimov}[1]{\nbimo[#1]}
+\newcommand{\Nbimov}[2]{\Nbimo[#2]{#1}}
+\newcommand{\nbimOv}[2]{\nbimO[#2]{#1}}
+\newcommand{\nisov}[1]{\niso[#1]}
+\newcommand{\Nisov}[2]{\Niso[#2]{#1}}
+\newcommand{\nisOv}[2]{\nisO[#2]{#1}}
+\newcommand{\neqlrv}[1]{\neql[#1]}
+\newcommand{\nbiarv}[1]{\nbiar[#1]}
+\newcommand{\Nbiarv}[3]{\Nar[#3]{#1}{#2}}
+\newcommand{\nadjarv}[1]{\nadjar[#1]}
+\newcommand{\Nadjarv}[3]{\Nar[#3]{#1}{#2}}
+\newcommand{\ntriarv}[1]{\ntriar[#1]}
+\newcommand{\Ntriarv}[4]{\Ntriar[#4]{#1}{#2}{#3}}
+\newcommand{\ntriaRv}[4]{\ntriaR[#4]{#1}{#2}{#3}}
+\newcommand{\ntriadjarv}[1]{\ntriadjar[#1]}
+\newcommand{\Ntriadjarv}[4]{\Ntriadjar[#4]{#1}{#2}{#3}}
+\newcommand{\ntriadjaRv}[4]{\ntriadjaR[#4]{#1}{#2}{#3}}
+\newcommand{\nquadriarv}[1]{\nquadriar[#1]}
+\newcommand{\nquadriadjarv}[1]{\nquadriadjar[#1]}
+\newcommand{\nquintiarv}[1]{\nquintiar[#1]}
+\newcommand{\nquintiadjarv}[1]{\nquintiadjar[#1]}
+
+\newcommand{\sarv}[1]{\sar[#1]}
+\newcommand{\Sarv}[2]{\Sar[#2]{#1}}
+\newcommand{\saRv}[2]{\saR[#2]{#1}}
+\newcommand{\sdotarv}[1]{\sdotar[#1]}
+\newcommand{\Sdotarv}[2]{\Sdotar[#2]{#1}}
+\newcommand{\sdotaRv}[2]{\sdotaR[#2]{#1}}
+\newcommand{\smonov}[1]{\smono[#1]}
+\newcommand{\Smonov}[2]{\Smono[#2]{#1}}
+\newcommand{\smonOv}[2]{\smonO[#2]{#1}}
+\newcommand{\sepiv}[1]{\sepi[#1]}
+\newcommand{\Sepiv}[2]{\Sepi[#2]{#1}}
+\newcommand{\sepIv}[2]{\sepI[#2]{#1}}
+\newcommand{\sbimov}[1]{\sbimo[#1]}
+\newcommand{\Sbimov}[2]{\Sbimo[#2]{#1}}
+\newcommand{\sbimOv}[2]{\sbimO[#2]{#1}}
+\newcommand{\sisov}[1]{\siso[#1]}
+\newcommand{\Sisov}[2]{\Siso[#2]{#1}}
+\newcommand{\sisOv}[2]{\sisO[#2]{#1}}
+\newcommand{\seqlrv}[1]{\seql[#1]}
+\newcommand{\sbiarv}[1]{\sbiar[#1]}
+\newcommand{\Sbiarv}[3]{\Sar[#3]{#1}{#2}}
+\newcommand{\sadjarv}[1]{\sadjar[#1]}
+\newcommand{\Sadjarv}[3]{\Sar[#3]{#1}{#2}}
+\newcommand{\Striarv}[4]{\Striar[#4]{#1}{#2}{#3}}
+\newcommand{\striaRv}[4]{\striaR[#4]{#1}{#2}{#3}}
+\newcommand{\striadjarv}[1]{\striadjar[#1]}
+\newcommand{\Striadjarv}[4]{\Striadjar[#4]{#1}{#2}{#3}}
+\newcommand{\striadjaRv}[4]{\striadjaR[#4]{#1}{#2}{#3}}
+\newcommand{\squadriarv}[1]{\squadriar[#1]}
+\newcommand{\squadriadjarv}[1]{\squadriadjar[#1]}
+\newcommand{\squintiarv}[1]{\squintiar[#1]}
+\newcommand{\squintiadjarv}[1]{\nquintiadjar[#1]}
+
+\newcommand{\searv}[1]{\sear[#1]}
+\newcommand{\Searv}[2]{\Sear[#2]{#1}}
+\newcommand{\seaRv}[2]{\seaR[#2]{#1}}
+
+\newcommand{\nearv}[1]{\near[#1]}
+\newcommand{\Nearv}[2]{\Near[#2]{#1}}
+\newcommand{\neaRv}[2]{\neaR[#2]{#1}}
+
+\newcommand{\swarv}[1]{\swar[#1]}
+\newcommand{\Swarv}[2]{\Swar[#2]{#1}}
+\newcommand{\swaRv}[2]{\swaR[#2]{#1}}
+
+\newcommand{\nwarv}[1]{\nwar[#1]}
+\newcommand{\Nwarv}[2]{\Nwar[#2]{#1}}
+\newcommand{\nwaRv}[2]{\nwaR[#2]{#1}}
+
+\newcommand{\necurve}[1]{\necurvar[#1]}
+\newcommand{\nwcurve}[1]{\nwcurvar[#1]}
+\newcommand{\securve}[1]{\securvar[#1]}
+\newcommand{\swcurve}[1]{\swcurvar[#1]}
+\newcommand{\encurve}[1]{\encurvar[#1]}
+\newcommand{\escurve}[1]{\escurvar[#1]}
+\newcommand{\wncurve}[1]{\wncurvar[#1]}
+\newcommand{\wscurve}[1]{\wscurvar[#1]}
+
+\newcommand{\Freear}[8]{\begin{picture}(0,0)%
+\put(#400,#500){\vector(#6,#7){#800}}%
+\truex{#200}\truey{#300}%
+\put(\value{x},\value{y}){$#1$}\end{picture}}%
+\newcommand{\freear}[5]{\Freear{}{0}{0}{#1}{#2}{#3}{#4}{#5}}%
+
+\newcommand{\DIAG}[1]{%
+\diagramtrue%
+\SCALE=\defaultscale%
+\setlength{\unitlength}{655sp}%
+\initialize{\mbox{$#1$}}}%
+
+\newcommand{\N}[1]%
+{\raisebox{0pt}[7pt][0pt]{$#1$}}%
+
+\let\B=\bold
+
+\def\newmovename(#1,#2)#3{\hspace{#1pt}%
+\raisebox{#2pt}[5pt][2pt]{\raisebox{#2pt}{$#3$}}%
+\hspace{-#1pt}}%
+\def\newmovearrow(#1,#2)#3{\makebox[0pt]{%
+\hspace{#1pt}\hspace{#1pt}%
+\raisebox{#2pt}[0pt][0pt]{\raisebox{#2pt}{$#3$}}}}%
+\def\newmovevertex(#1,#2)#3{%
+\mbox{\hspace{#1pt}%
+\raisebox{#2pt}{\raisebox{#2pt}{$#3$}}%
+\hspace{-#1pt}}}%
+\newcommand{\oldmovename}[3]{\newmovename(#2,#3){#1}}
+\newcommand{\oldmovearrow}[3]{\newmovearrow(#2,#3){#1}}
+\newcommand{\oldmovevertex}[3]{\newmovevertex(#2,#3){#1}}
+\renewcommand{\movename}{\@ifnextchar({\newmovename}{\oldmovename}}
+\renewcommand{\movearrow}{\@ifnextchar({\newmovearrow}{\oldmovearrow}}
+\renewcommand{\movevertex}{\@ifnextchar({\newmovevertex}{\oldmovevertex}}
+
+\newcount\A\newcount\B
+\newcommand{\Diag}[2]{\A=0\B=0\DIAG{#2}}
+\newcommand{\Diagv}[4]{\A=#2\B=#3\DIAG{#4}}
+\newcommand{\diaGv}[2]{\advance\B by -#1\diagv{\A}{\B}{#2}}
+\newcommand{\diaG}{\diagv{\A}{\B}{0}}
+\newcommand{\move}[3]{\movename(#2,#3){#1}}
+
+\setdisplayarrowlength{20}
+
+\typeout{\string\displayarrowlength has been put to value 20
+by the file OldMaxiDiagram}
+
+\catcode`\@=12 \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/borceux/compatibility/OldMicroDiagram b/Master/texmf-dist/source/generic/borceux/compatibility/OldMicroDiagram
new file mode 100644
index 00000000000..26bd21b6920
--- /dev/null
+++ b/Master/texmf-dist/source/generic/borceux/compatibility/OldMicroDiagram
@@ -0,0 +1,90 @@
+\catcode`\@=11
+
+\newcommand{\earv}[1]{\ear[#1]}
+\newcommand{\Earv}[2]{\Ear[#2]{#1}}
+\newcommand{\eaRv}[2]{\eaR[#2]{#1}}
+
+\newcommand{\warv}[1]{\war[#1]}
+\newcommand{\Warv}[2]{\War[#2]{#1}}
+\newcommand{\waRv}[2]{\waR[#2]{#1}}
+
+\newcommand{\narv}[1]{\nar[#1]}
+\newcommand{\Narv}[2]{\Nar[#2]{#1}}
+\newcommand{\naRv}[2]{\naR[#2]{#1}}
+
+\newcommand{\sarv}[1]{\sar[#1]}
+\newcommand{\Sarv}[2]{\Sar[#2]{#1}}
+\newcommand{\saRv}[2]{\saR[#2]{#1}}
+
+\newcommand{\searv}[1]{\sear[#1]}
+\newcommand{\Searv}[2]{\Sear[#2]{#1}}
+\newcommand{\seaRv}[2]{\seaR[#2]{#1}}
+
+\newcommand{\nearv}[1]{\near[#1]}
+\newcommand{\Nearv}[2]{\Near[#2]{#1}}
+\newcommand{\neaRv}[2]{\neaR[#2]{#1}}
+
+\newcommand{\swarv}[1]{\swar[#1]}
+\newcommand{\Swarv}[2]{\Swar[#2]{#1}}
+\newcommand{\swaRv}[2]{\swaR[#2]{#1}}
+
+\newcommand{\nwarv}[1]{\nwar[#1]}
+\newcommand{\Nwarv}[2]{\Nwar[#2]{#1}}
+\newcommand{\nwaRv}[2]{\nwaR[#2]{#1}}
+
+\newcommand{\necurve}[1]{\necurvar[#1]}
+\newcommand{\nwcurve}[1]{\nwcurvar[#1]}
+\newcommand{\securve}[1]{\securvar[#1]}
+\newcommand{\swcurve}[1]{\swcurvar[#1]}
+\newcommand{\encurve}[1]{\encurvar[#1]}
+\newcommand{\escurve}[1]{\escurvar[#1]}
+\newcommand{\wncurve}[1]{\wncurvar[#1]}
+\newcommand{\wscurve}[1]{\wscurvar[#1]}
+
+\newcommand{\Freear}[8]{\begin{picture}(0,0)%
+\put(#400,#500){\vector(#6,#7){#800}}%
+\truex{#200}\truey{#300}%
+\put(\value{x},\value{y}){$#1$}\end{picture}}%
+\newcommand{\freear}[5]{\Freear{}{0}{0}{#1}{#2}{#3}{#4}{#5}}%
+
+\newcommand{\DIAG}[1]{%
+\diagramtrue%
+\SCALE=\defaultscale%
+\setlength{\unitlength}{655sp}%
+\initialize{\mbox{$#1$}}}%
+
+\newcommand{\N}[1]%
+{\raisebox{0pt}[7pt][0pt]{$#1$}}%
+
+\let\B=\bold
+
+\def\newmovename(#1,#2)#3{\hspace{#1pt}%
+\raisebox{#2pt}[5pt][2pt]{\raisebox{#2pt}{$#3$}}%
+\hspace{-#1pt}}%
+\def\newmovearrow(#1,#2)#3{\makebox[0pt]{%
+\hspace{#1pt}\hspace{#1pt}%
+\raisebox{#2pt}[0pt][0pt]{\raisebox{#2pt}{$#3$}}}}%
+\def\newmovevertex(#1,#2)#3{%
+\mbox{\hspace{#1pt}%
+\raisebox{#2pt}{\raisebox{#2pt}{$#3$}}%
+\hspace{-#1pt}}}%
+\newcommand{\oldmovename}[3]{\newmovename(#2,#3){#1}}
+\newcommand{\oldmovearrow}[3]{\newmovearrow(#2,#3){#1}}
+\newcommand{\oldmovevertex}[3]{\newmovevertex(#2,#3){#1}}
+\renewcommand{\movename}{\@ifnextchar({\newmovename}{\oldmovename}}
+\renewcommand{\movearrow}{\@ifnextchar({\newmovearrow}{\oldmovearrow}}
+\renewcommand{\movevertex}{\@ifnextchar({\newmovevertex}{\oldmovevertex}}
+
+\newcount\A\newcount\B
+\newcommand{\Diag}[2]{\A=0\B=0\DIAG{#2}}
+\newcommand{\Diagv}[4]{\A=#2\B=#3\DIAG{#4}}
+\newcommand{\diaGv}[2]{\advance\B by -#1\diagv{\A}{\B}{#2}}
+\newcommand{\diaG}{\diagv{\A}{\B}{0}}
+\newcommand{\move}[3]{\movename(#2,#3){#1}}
+
+\setdisplayarrowlength{20}
+
+\typeout{\string\displayarrowlength has been put to value 20
+by the file OldMicroDiagram}
+
+\catcode`\@=12 \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/borceux/compatibility/OldMiniDiagram b/Master/texmf-dist/source/generic/borceux/compatibility/OldMiniDiagram
new file mode 100644
index 00000000000..af151407181
--- /dev/null
+++ b/Master/texmf-dist/source/generic/borceux/compatibility/OldMiniDiagram
@@ -0,0 +1,107 @@
+\catcode`\@=11
+
+\newcommand{\earv}[1]{\ear[#1]}
+\newcommand{\Earv}[2]{\Ear[#2]{#1}}
+\newcommand{\eaRv}[2]{\eaR[#2]{#1}}
+\newcommand{\ebiarv}[1]{\ebiar[#1]}
+\newcommand{\Ebiarv}[3]{\Ear[#3]{#1}{#2}}
+\newcommand{\eadjarv}[1]{\eadjar[#1]}
+\newcommand{\Eadjarv}[3]{\Ear[#3]{#1}{#2}}
+
+\newcommand{\warv}[1]{\war[#1]}
+\newcommand{\Warv}[2]{\War[#2]{#1}}
+\newcommand{\waRv}[2]{\waR[#2]{#1}}
+\newcommand{\wbiarv}[1]{\wbiar[#1]}
+\newcommand{\Wbiarv}[3]{\War[#3]{#1}{#2}}
+\newcommand{\wadjarv}[1]{\wadjar[#1]}
+\newcommand{\Wadjarv}[3]{\War[#3]{#1}{#2}}
+
+\newcommand{\narv}[1]{\nar[#1]}
+\newcommand{\Narv}[2]{\Nar[#2]{#1}}
+\newcommand{\naRv}[2]{\naR[#2]{#1}}
+\newcommand{\nbiarv}[1]{\nbiar[#1]}
+\newcommand{\Nbiarv}[3]{\Nar[#3]{#1}{#2}}
+\newcommand{\nadjarv}[1]{\nadjar[#1]}
+\newcommand{\Nadjarv}[3]{\Nar[#3]{#1}{#2}}
+
+\newcommand{\sarv}[1]{\sar[#1]}
+\newcommand{\Sarv}[2]{\Sar[#2]{#1}}
+\newcommand{\saRv}[2]{\saR[#2]{#1}}
+\newcommand{\sbiarv}[1]{\sbiar[#1]}
+\newcommand{\Sbiarv}[3]{\Sar[#3]{#1}{#2}}
+\newcommand{\sadjarv}[1]{\sadjar[#1]}
+\newcommand{\Sadjarv}[3]{\Sar[#3]{#1}{#2}}
+
+\newcommand{\searv}[1]{\sear[#1]}
+\newcommand{\Searv}[2]{\Sear[#2]{#1}}
+\newcommand{\seaRv}[2]{\seaR[#2]{#1}}
+
+\newcommand{\nearv}[1]{\near[#1]}
+\newcommand{\Nearv}[2]{\Near[#2]{#1}}
+\newcommand{\neaRv}[2]{\neaR[#2]{#1}}
+
+\newcommand{\swarv}[1]{\swar[#1]}
+\newcommand{\Swarv}[2]{\Swar[#2]{#1}}
+\newcommand{\swaRv}[2]{\swaR[#2]{#1}}
+
+\newcommand{\nwarv}[1]{\nwar[#1]}
+\newcommand{\Nwarv}[2]{\Nwar[#2]{#1}}
+\newcommand{\nwaRv}[2]{\nwaR[#2]{#1}}
+
+\newcommand{\necurve}[1]{\necurvar[#1]}
+\newcommand{\nwcurve}[1]{\nwcurvar[#1]}
+\newcommand{\securve}[1]{\securvar[#1]}
+\newcommand{\swcurve}[1]{\swcurvar[#1]}
+\newcommand{\encurve}[1]{\encurvar[#1]}
+\newcommand{\escurve}[1]{\escurvar[#1]}
+\newcommand{\wncurve}[1]{\wncurvar[#1]}
+\newcommand{\wscurve}[1]{\wscurvar[#1]}
+
+\newcommand{\Freear}[8]{\begin{picture}(0,0)%
+\put(#400,#500){\vector(#6,#7){#800}}%
+\truex{#200}\truey{#300}%
+\put(\value{x},\value{y}){$#1$}\end{picture}}%
+\newcommand{\freear}[5]{\Freear{}{0}{0}{#1}{#2}{#3}{#4}{#5}}%
+
+\newcommand{\DIAG}[1]{%
+\diagramtrue%
+\SCALE=\defaultscale%
+\setlength{\unitlength}{655sp}%
+\initialize{\mbox{$#1$}}}%
+
+\newcommand{\N}[1]%
+{\raisebox{0pt}[7pt][0pt]{$#1$}}%
+
+\let\B=\bold
+
+\def\newmovename(#1,#2)#3{\hspace{#1pt}%
+\raisebox{#2pt}[5pt][2pt]{\raisebox{#2pt}{$#3$}}%
+\hspace{-#1pt}}%
+\def\newmovearrow(#1,#2)#3{\makebox[0pt]{%
+\hspace{#1pt}\hspace{#1pt}%
+\raisebox{#2pt}[0pt][0pt]{\raisebox{#2pt}{$#3$}}}}%
+\def\newmovevertex(#1,#2)#3{%
+\mbox{\hspace{#1pt}%
+\raisebox{#2pt}{\raisebox{#2pt}{$#3$}}%
+\hspace{-#1pt}}}%
+\newcommand{\oldmovename}[3]{\newmovename(#2,#3){#1}}
+\newcommand{\oldmovearrow}[3]{\newmovearrow(#2,#3){#1}}
+\newcommand{\oldmovevertex}[3]{\newmovevertex(#2,#3){#1}}
+\renewcommand{\movename}{\@ifnextchar({\newmovename}{\oldmovename}}
+\renewcommand{\movearrow}{\@ifnextchar({\newmovearrow}{\oldmovearrow}}
+\renewcommand{\movevertex}{\@ifnextchar({\newmovevertex}{\oldmovevertex}}
+
+\newcount\A\newcount\B
+\newcommand{\Diag}[2]{\A=0\B=0\DIAG{#2}}
+\newcommand{\Diagv}[4]{\A=#2\B=#3\DIAG{#4}}
+\newcommand{\diaGv}[2]{\advance\B by -#1\diagv{\A}{\B}{#2}}
+\newcommand{\diaG}{\diagv{\A}{\B}{0}}
+\newcommand{\move}[3]{\movename(#2,#3){#1}}
+
+\setdisplayarrowlength{20}
+
+\typeout{\string\displayarrowlength has been put to value 20
+by the file OldMiniDiagram}
+
+
+\catcode`\@=12 \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/borceux/compatibility/OldMultipleArrows b/Master/texmf-dist/source/generic/borceux/compatibility/OldMultipleArrows
new file mode 100644
index 00000000000..1b97736a068
--- /dev/null
+++ b/Master/texmf-dist/source/generic/borceux/compatibility/OldMultipleArrows
@@ -0,0 +1,49 @@
+ % COMPATIBILITY WITH OLDER VERSIONS
+
+\newcommand{\etriarv}[1]{\etriar[#1]}
+\newcommand{\Etriarv}[4]{\Etriar[#4]{#1}{#2}{#3}}
+\newcommand{\etriaRv}[4]{\etriaR[#4]{#1}{#2}{#3}}
+\newcommand{\etriadjarv}[1]{\etriadjar[#1]}
+\newcommand{\Etriadjarv}[4]{\Etriadjar[#4]{#1}{#2}{#3}}
+\newcommand{\etriadjaRv}[4]{\etriadjaR[#4]{#1}{#2}{#3}}
+\newcommand{\equadriarv}[1]{\equadriar[#1]}
+\newcommand{\equadriadjarv}[1]{\equadriadjar[#1]}
+\newcommand{\equintiarv}[1]{\equintiar[#1]}
+\newcommand{\equintiadjarv}[1]{\equintiadjar[#1]}
+
+\newcommand{\wtriarv}[1]{\wtriar[#1]}
+\newcommand{\Wtriarv}[4]{\Wtriar[#4]{#1}{#2}{#3}}
+\newcommand{\wtriaRv}[4]{\wtriaR[#4]{#1}{#2}{#3}}
+\newcommand{\wtriadjarv}[1]{\wtriadjar[#1]}
+\newcommand{\Wtriadjarv}[4]{\Wtriadjar[#4]{#1}{#2}{#3}}
+\newcommand{\wtriadjaRv}[4]{\wtriadjaR[#4]{#1}{#2}{#3}}
+\newcommand{\wquadriarv}[1]{\wquadriar[#1]}
+\newcommand{\wquadriadjarv}[1]{\wquadriadjar[#1]}
+\newcommand{\wquintiarv}[1]{\wquintiar[#1]}
+\newcommand{\wquintiadjarv}[1]{\wquintiadjar[#1]}
+
+\newcommand{\ntriarv}[1]{\ntriar[#1]}
+\newcommand{\Ntriarv}[4]{\Ntriar[#4]{#1}{#2}{#3}}
+\newcommand{\ntriaRv}[4]{\ntriaR[#4]{#1}{#2}{#3}}
+\newcommand{\ntriadjarv}[1]{\ntriadjar[#1]}
+\newcommand{\Ntriadjarv}[4]{\Ntriadjar[#4]{#1}{#2}{#3}}
+\newcommand{\ntriadjaRv}[4]{\ntriadjaR[#4]{#1}{#2}{#3}}
+\newcommand{\nquadriarv}[1]{\nquadriar[#1]}
+\newcommand{\nquadriadjarv}[1]{\nquadriadjar[#1]}
+\newcommand{\nquintiarv}[1]{\nquintiar[#1]}
+\newcommand{\nquintiadjarv}[1]{\nquintiadjar[#1]}
+
+\newcommand{\Striarv}[4]{\Striar[#4]{#1}{#2}{#3}}
+\newcommand{\striaRv}[4]{\striaR[#4]{#1}{#2}{#3}}
+\newcommand{\striadjarv}[1]{\striadjar[#1]}
+\newcommand{\Striadjarv}[4]{\Striadjar[#4]{#1}{#2}{#3}}
+\newcommand{\striadjaRv}[4]{\striadjaR[#4]{#1}{#2}{#3}}
+\newcommand{\squadriarv}[1]{\squadriar[#1]}
+\newcommand{\squadriadjarv}[1]{\squadriadjar[#1]}
+\newcommand{\squintiarv}[1]{\squintiar[#1]}
+\newcommand{\squintiadjarv}[1]{\nquintiadjar[#1]}
+
+\setdisplayarrowlength{20}
+
+\typeout{\string\displayarrowlength has been put to value 20
+by the file OldMultipleArrows}
diff --git a/Master/texmf-dist/source/generic/german/betatest/00readme.1st b/Master/texmf-dist/source/generic/german/betatest/00readme.1st
new file mode 100644
index 00000000000..2013a24b454
--- /dev/null
+++ b/Master/texmf-dist/source/generic/german/betatest/00readme.1st
@@ -0,0 +1,7 @@
+The version 2.5e (1998-07-14) of the `german' collection
+has been moved to the parent directory language/german/.
+
+Future beta versions will be located _here_ again.
+
+Walter Schmidt <wschmi@ibm.net>
+
diff --git a/Master/texmf-dist/source/generic/german/german.MISSING b/Master/texmf-dist/source/generic/german/german.MISSING
new file mode 100644
index 00000000000..acfad9e270d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/german/german.MISSING
@@ -0,0 +1,10 @@
+If you need the style option/package "german.sty", you can find the
+newest version on CTAN in
+
+ tex-archive/languages/german/
+
+
+The participating hosts in the Comprehensive TeX Archive Network
+(CTAN) are:
+ ftp.dante.de (Germany)
+ ftp.tex.ac.uk (England)
diff --git a/Master/texmf-dist/source/generic/german/german.dtx b/Master/texmf-dist/source/generic/german/german.dtx
new file mode 100644
index 00000000000..50500e75a06
--- /dev/null
+++ b/Master/texmf-dist/source/generic/german/german.dtx
@@ -0,0 +1,2331 @@
+% \iffalse meta-comment
+%<*!hyphcfg>
+%<*!driver>
+% \begin{macrocode}
+%
+% Copyright (C) 1987-1990 by H.Partl
+% Copyright (C) 1991-1997 by B.Raichle and DANTE e.V.
+% Copyright (C) 1998 by B.Raichle
+% All rights reserved.
+%
+% Please read the documentation file `gerdoc.tex' for more
+% information of how to use this macro file and how to install
+% the pattern files necessary for german hyphenation.
+%
+% \end{macrocode}
+%
+% INSTALLATION GUIDE:
+%
+% The distribution of the `german' package consists of a set of
+% files, which are packed and documented in _one_ `docstrip archive
+% file' called `german.dtx'. This archive file can be unpacked to
+% create the necessary files containing the macros, implementation
+% documentation, and other files.
+%
+% To unpack this archive file you need:
+%
+% * `german.ins' (containing docstrip installation instructions)
+%
+% * `german.dtx' (it is the file you are currently reading)
+%
+% * `docstrip.tex' version 2.4 or newer
+% (You can find this file in the LaTeX2e release;
+% `docstrip' can be used with plainTeX, too!)
+%
+% Then run `german.ins' through plainTeX or LaTeX to unpack the
+% archive file:
+%
+% tex german.ins
+% or
+% latex german.ins
+%
+% This will create a set of files which contain the macro code or
+% code to produce the implementation documentation of the `german'
+% bundle of files.
+%
+% --------------- start of docstrip archive file ------------------
+%
+% To get the formatted code documentation do the following steps
+%
+% latex german.dtx
+% latex german.dtx
+% makeindex -s gind.ist german.idx
+% makeindex -s gglo.ist -o german.gls german.glo
+% latex german.dtx
+%
+%
+%</!driver>
+%<*driver>
+\ifx\documentclass\undefined % LaTeX2e or 2.09?
+ \documentstyle[newdoc,german]{article}
+ \ifx\LaTeXe\undefined
+ \newcommand{\LaTeXe}{%
+ \mbox{\LaTeX\kern.15em\(2_{\textstyle\varepsilon}\)}}\fi
+ \newcommand{\emph}[1]{{\em #1}}
+ \newcommand{\textit}[1]{{\it #1}}
+ \newcommand{\textbf}[1]{{\bf #1}}
+ \newcommand{\texttt}[1]{{\tt #1}}
+ \newcommand{\cs}[1]{{\tt\symbol{92}#1}}
+ \MakeShortverb{\|}\CodelineIndex
+\else
+ \documentclass[a4paper]{ltxdoc}
+ \usepackage{german}
+ \EnableCrossrefs
+ %\DisableCrossrefs % Say \DisableCrossrefs if index is ready
+ \CodelineIndex \RecordChanges
+\fi
+\begin{document}
+\setcounter{StandardModuleDepth}{0}
+\DocInput{german.dtx}
+\PrintIndex \PrintChanges
+\end{document}
+%</driver>
+%<*!driver>
+%
+% \fi
+% \CheckSum{2166}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \DoNotIndex{\',\(,\),\-,\.,\/,\{,\},\^,\`,\|,\ ,\@,\x,\Z}
+% \DoNotIndex{\@M,\@m,\m@ne,\z@,\z@skip,\@ne,\tw@,sixt@@n}
+% \DoNotIndex{\count@,\dimen@,\advance,\day,\month,year,\relax}
+% \DoNotIndex{\begin,\end,\bgroup,\egroup,\begingroup,\endgroup}
+% \DoNotIndex{\bf,\em,\it,\rm,\tt,\textbf,\textit,\texttt,\emph}
+% \DoNotIndex{\expandafter,\noexpand,\string,\the,\ifhmode,\ifmmode}
+% \DoNotIndex{\ifcase,\or,\else,\fi,\if,\ifdim,\ifnum,\ifx}
+% \DoNotIndex{\do,\afterassignment,\number,\escapechar,\space}
+% \DoNotIndex{\def,\edef,\let,\newcommand,\undefined,\active}
+% \DoNotIndex{\accent,\box,\dp,\ht,\wd,\char,\chardef,\discretionary}
+% \DoNotIndex{\catcode,\csname,\endcsname,\hbox,\hskip,\kern}
+% \DoNotIndex{\font,\fontdimen,\scriptscriptstyle,\textstyle}
+% \DoNotIndex{\lccode,\lowercase,\sfcode,\spacefactor,\penalty}
+% \DoNotIndex{\mathchar,\mathchardef,\mathaccent,\varepsilon,\m@th}
+% \DoNotIndex{\empty,\@empty,\leavevmode,\makeatletter,\mbox}
+% \DoNotIndex{\errhelp,\errmessage,\message,\wlog,\write,\immediate}
+% \DoNotIndex{\lower,\raise,\sfcode,\spacefactor,\setbox,\toks}
+% \DoNotIndex{\documentclass,\documentstyle,\LaTeX,\LaTeXe,\TeX}
+% \DoNotIndex{\ProvidesPackage,\usepackage,\CodelineIndex,\cs}
+% \DoNotIndex{\input,\endinput,\DocInput}
+%
+%
+% \title{Die Makropakete "`german"' und "`ngerman"' f"ur \LaTeXe, \LaTeX~2.09,
+% Plain-\TeX{} und andere darauf basierende Formate}
+% \date{8.~Juli 1998}
+% \author{Bernd Raichle \\
+% E-mail: \texttt{raichle@Informatik.Uni-Stuttgart.DE}}
+% \maketitle
+%
+% Dieses Dokument beschreibt Interna, Einschr"ankungen und einige
+% Tricks und Kniffe, die bei der Implementierung der Makropakete
+% "`german"' und "`ngerman"' verwendet werden.
+% Wie diese Pakete installiert
+% und verwendet werden, ist in der "`Kurzbeschreibung --
+% \texttt{german.sty} (Version~2.5)"' zu finden. Diese ist in der
+% Datei \texttt{gerdoc.tex} zu finden, die mit der Datei
+% \texttt{german.dtx} bzw. den Makropaketen mitgeliefert wird
+% und ist f"ur den Endanwender gedacht.
+%
+% Das vorliegende Dokument ist \emph{nicht} f"ur den Endanwender
+% gedacht. Es beschreibt die Implementierung und ist zum einen f"ur
+% den zuk"unftige Verwalter dieser Pakete gedacht, zum anderen
+% f"ur alle Makro-Schreiber, die Ideen und Verbesserungsvorschl"age
+% direkt am Code austesten wollen.
+%
+% Der Code der beiden Pakete "`german"' und "`ngerman"' ist weitgehend
+% identisch. Wo im folgenden nur von "`german"' die Rede ist, sind
+% \emph{beide} Pakete gemeint; auf Unterschiede wird stets explizit
+% hingewiesen. Mit |<old>| gekennzeichnete Codezeilen geh"oren zu
+% "`german"', mit |<new>| gekennzeichnete zu "`ngerman"'.
+%
+% \changes{2.5e (beta 1)}{98/05/05}{Es kann wahlweise "`german"' oder "`ngerman"'
+% erzeugt werden, indem \textsc{DocStrip} mit den Optionen \texttt{old}
+% oder \texttt{new} aufgerufen wird.}
+% \StopEventually{}
+%
+% \tableofcontents
+%
+% \ifx\emergencystretch\undefined \else
+% \setlength{\emergencystretch}{2em}
+% \fi
+% \hbadness=2000
+%
+% \section{Identifikation des Pakets}
+%
+% Damit diese Datei problemlos mehrmals eingelesen werden kann, wird
+% hier getestet, ob die Datei bereits geladen wurde. Dadurch wird
+% verhindert, da"s Makros, Z"ahler, etc.\ noch einmal und damit
+% unn"otig definiert werden und in einigen F"allen auch
+% zus"atzliche Ressourcen belegen. Damit auch Nutzer mit
+% vorgeladenen, alten "`german"'-Versionen in den Genu"s dieser
+% neuen Version kommen, wird nicht wie in "alteren Versionen die
+% Existenz der Anweisung Befehl |\mdqon| "uberpr"uft, sondern auf
+% eine Versionsnummer abgetestet. Diese Versionsnummer besteht aus
+% der Jahreszahl und einer pro Jahr fortlaufenden Nummer.
+%
+% Die \textit{control sequence} f"ur die Versionsnummer sollte mit
+% keinem anderen Paket kollidieren. Daher wird der Pr"afix
+% \texttt{grmn@} bzw. \texttt{ngrm@} im Namen verwendet. Da AMS-\TeX{} ein aktives
+% At-Zeichen verwendet, wird dieses hier explizit mit |\string|
+% deaktiviert, bis wir den |\catcode| "andern.
+%
+% \changes{2.5c}{96/02/26}{Total falsche Logik zur Verhinderung
+% mehrmaligen Lesen des Styles korrigiert, \cs{ifdim} durch
+% \cs{ifnum} ersetzt, \cs{grmn@VersionNo} mu"s mit \cs{csname}
+% erzeugt werden, da \cs{catcode} des At-Zeichens noch unbekannt
+% ist, Versionsnummer sollte in allen F"allen gesetzt werden.}
+% \changes{2.5c}{96/04/21}{Mit AMS-\TeX{} aktives At-Zeichen
+% in \cs{grmn@VersionNo} explizit mit \cs{string} deaktivieren
+% (found by \texttt{Michael.Schgraffer@uibk.ac.at}, 95/10/10).}
+% \changes{2.5e (beta 2)}{98/05/12}{Abgefragte Versionsnummer korrigiert;
+% 9805 statt 9701)}
+% \begin{macrocode}
+%<old>\expandafter\ifx\csname grmn\string @VersionNo\endcsname\relax
+%<new>\expandafter\ifx\csname ngrm\string @VersionNo\endcsname\relax
+\else
+%<old> \ifnum\number\csname grmn\string @VersionNo\endcsname<9806\relax
+%<new> \ifnum\number\csname ngrm\string @VersionNo\endcsname<9806\relax
+%<old> \else \germanTeX \expandafter\expandafter\expandafter\endinput
+%<new> \else \ngermanTeX \expandafter\expandafter\expandafter\endinput
+ \fi\fi
+% \end{macrocode}
+%
+% Ist "`german"' noch nicht geladen oder wurde bisher eine "altere
+% Version verwendet, so wird der Rest dieser Datei abgearbeitet.
+% Zuerst wird die Versionsnummer gesetzt. Da diese gr"o"ser als 255
+% ist, wird dazu |\mathchardef| verwendet.
+% \begin{macrocode}
+%<old>\expandafter\mathchardef\csname grmn\string @VersionNo\endcsname
+%<new>\expandafter\mathchardef\csname ngrm\string @VersionNo\endcsname
+=9806\relax % = v2.5e
+% \end{macrocode}
+%
+%
+% Die Style-Option "`german"' soll sowohl von Plain-\TeX\ als auch
+% von den unterschiedlichen \LaTeX-Versionen verwendet werden
+% k"onnen. Deshalb wird f"ur die Ausgabe das Primitiv |\message|
+% verwendet.
+% \changes{2.5e (beta 2)}{98/05/12}{Meldungen korrigiert und vereinfacht.}
+%
+% \begin{macrocode}
+\message{v2.5e 1998-07-08}
+% \end{macrocode}
+%
+% F"ur \LaTeXe\ wird die Style-Option als Paket deklariert. Da
+% andere Style-Optionen den Befehl |\ProvidesPackage| meist nur auf
+% \texttt{undefined} abtesten, wird hier eine auf den ersten Blick
+% komisch anmutende Konstruktion mit einer Gruppe verwendet. Sie
+% verhindert aber, da"s ein vorher undefiniertes |\ProvidesPackage|
+% danach die Bedeutung |\relax| hat. Dieser Gruppierungstrick wird
+% noch einige Male verwendet.
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
+%<old> \ProvidesPackage{german}[1998/07/08 v2.5e %
+%<new> \ProvidesPackage{ngerman}[1998/07/08 v2.5e %
+ Support for writing german texts (br)]
+\fi
+% \end{macrocode}
+%
+% Da diese Datei auch mit einem simplen |\input| geladen werden
+% kann, andererseits aber auf interne Befehle zugegriffen werden
+% mu"s, wird der \textit{category code} des Zeichens~\texttt{@}
+% gerettet, bevor er auf "`letter"' ge"andert wird.
+%
+% \begin{macrocode}
+\chardef\atcode=\catcode`\@
+\catcode`\@=11 % \makeatletter
+% \end{macrocode}
+%
+%
+% \section{Kompatibilit"atsmakros}
+%
+% \subsection{Low-Level-Makros}
+%
+% Einige Makros aus dem \LaTeX-Format sind sehr hilfreich und werden,
+% falls sie nicht definiert wurden, hier definiert.
+% \changes{2.5c}{95/01/24}{Im Makro \cs{@ifundefined} wurde in den
+% Namen der beiden Hilfsmakros in v2.5a/b das \texttt{dq}
+% vergessen.}
+% \begin{macrocode}
+\expandafter\ifx\csname @ifundefined\endcsname\relax
+ \def\@ifundefined#1{%
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\grmn@dqfirst\else\expandafter\grmn@dqsecond\fi}
+\fi
+% \end{macrocode}
+% Die Makros |\grmn@dqfirst|\label{grmndqfirst} und |\grmn@dqsecond|
+% werden sp"ater nochmals verwendet.
+% \begin{macrocode}
+\def\grmn@dqfirst#1#2{#1}
+\def\grmn@dqsecond#1#2{#2}
+% \end{macrocode}
+%
+% \subsection{Kompatibilit"atsmakros f"ur NFSS, Version~2}
+%
+% Das neue Schriftauswahlschema~NFSS hat in Version~2 den neuen
+% Schriftparameter |\fontencoding|. NFSS~2 wurde offiziell im
+% ersten \LaTeXe-Release vom 1.~Juni 1994 eingef"uhrt, jedoch im
+% n"achsten Release vom 1.~Dezember 1995 durch Fehlerberichtigungen,
+% Erweiterungen und neu eingef"uhrte Befehle verbessert.
+%
+% Im folgenden wird angenommen, da"s NFSS~2 vorhanden ist, wenn der
+% Befehl |\DeclareTextSymbol| definiert ist.
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
+% \end{macrocode}
+%
+% \subsubsection{Makros f"ur Textzeichen -- ohne NFSS~2}
+%
+% Der symbolische Name |\SS| f"ur ein SS mu"s f"ur \LaTeX~2.09 und
+% Plain-\TeX{} definiert werden, falls er noch nicht bekannt ist.
+% \changes{2.5d}{97/04/13}{F"ur \texttt{\symbol{`\"}S} wird
+% \cs{SS} verwendet, das in \LaTeXe{} bereits definiert ist.}
+% \begin{macrocode}
+\@ifundefined{SS}{\def\SS{SS}}{}
+% \end{macrocode}
+%
+%
+% Die nachfolgenden Abschnitte beschreiben die notwendigen
+% Deklarationen f"ur NFSS~2.
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% \subsubsection{Deklarationsmakros}
+%
+% Die neueren NFSS~2-Versionen haben einige Befehle, die f"ur Symbole
+% und Akzentmakros Defaultwerte f"ur diejenigen Schriften deklarieren,
+% f"ur die keine expliziten Symboldeklarationen angegeben wurden.
+% Diese Befehle werden f"ur "altere NFSS~2-Versionen in einer sehr
+% stark vereinfachten Realisierung nachfolgend definiert.
+% \emph{In diesen Definitionen werden einige Interna aus
+% \LaTeXe/NFSS~2 verwendet, so da"s dieser Teil der Style-Option
+% zuk"unftig m"oglicherweise zu Fehlern f"uhren kann! Dieser Teil ist
+% als schlechtes Beispiel zu betrachten -- es zeigt, wie man solche
+% Dinge m"oglichst nicht realisieren sollte. Jedoch sind diese
+% Definitionen notwendig, damit diese Style-Option auch mit diesen
+% "alteren Versionen laufen kann.}
+% \textbf{Es ist daher immer ratsam, eine alte \LaTeXe-Release durch
+% die neueste Version zu ersetzen.}
+% Aus diesem Grund wird hier ein Hinweis f"ur den Benutzer dieses
+% alten Release ausgegeben. In der n"achsten Version wird
+% German-Style abbrechen oder den sehr viel einfacheren Code
+% f"ur \LaTeX~2.09 verwenden.
+%
+% \changes{2.5c}{96/04/28}{Warnung und Hinweis auf Update bei
+% Benutzung der veralteten \LaTeXe-Release vom Juni~1994.}
+% \begin{macrocode}
+% \changes{2.5e (beta 1) }{98/05/04}{Formulierung ge"andert.}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ProvideTextCommandDefault\endcsname\relax
+ \immediate\write17{}
+ \immediate\write17{%
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
+ \immediate\write17{%
+!! Dies ist eine zu alte LaTeX2e-Version, die nicht}
+ \immediate\write17{%
+!! alle fuer german/ngerman notwendigen Deklarationen}
+ \immediate\write17{%
+!! zur Verfuegung stellt. Dennoch koennen Sie diese}
+ \immediate\write17{%
+!! Pakete, eventuell mit kleinen Fehlern, verwenden.}
+ \immediate\write17{!!}
+ \immediate\write17{%
+!! Bitte installieren Sie eine neuere LaTeX2e-Version,}
+ \immediate\write17{%
+!! da zukuenftige Versionen der Pakete diese}
+ \immediate\write17{%
+!! LaTeX2e-Version nicht mehr unterstuetzen werden!}
+ \immediate\write17{%
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
+ \immediate\write17{}
+\fi
+% \end{macrocode}
+%
+% Weiterhin wird angenommen, da"s der Befehl |\providecommand|
+% verf"ugbar ist. Dieser Befehl k"onnte in einer zuk"unftigen
+% NFSS~2-Version, die f"ur Plain-\TeX\ angepa"st wurde, nicht mehr
+% verf"ugbar sein.
+%
+% |\UseTextSymbol{|\meta{encoding}|}{|\meta{symbol}|}| schaltet die
+% angegebene Schriftkodierung zur Ausgabe dieses Zeichens um.
+% \begin{macrocode}
+\@ifundefined{UseTextSymbol}{%
+ \def\UseTextSymbol#1#2{{\fontencoding{#1}\selectfont #2}}
+}{}
+% \end{macrocode}
+%
+% |\UseTextAccent{|\meta{encoding}|}{|\meta{accent}|}{|\meta{base}|}|
+% verwendet das Akzentzeichen aus der Schrift mit der angegebenen,
+% eventuell vom aktuellen Wert abweichenden Kodierung.
+% \begin{macrocode}
+\@ifundefined{UseTextAccent}{%
+ \def\UseTextAccent#1#2#3{%
+ {\let\@curr@enc\f@encoding
+ \fontencoding{#1}\selectfont
+ #2{\fontencoding\@curr@enc\selectfont #3}}}%
+}{}
+% \end{macrocode}
+%
+% |\ProvideTextCommand{|\meta{csname}|}{|\meta{encoding}|}[|^^A
+% \meta{number}|][|\meta{default}|]{|\meta{definition}|}| definiert
+% einen Befehl, der nur f"ur die angegebene Kodierung verwendet wird,
+% falls dieser Befehl noch nicht f"ur diese Kodierung definiert
+% wurde.
+% \begin{macrocode}
+\@ifundefined{ProvideTextCommand}{%
+ \def\ProvideTextCommand#1#2{%
+ %%% misses \RobustTextCommand{#1}{...etc.etc...}!!
+ \expandafter\providecommand\csname #2\string#1\endcsname}%
+}{}
+% \end{macrocode}
+%
+% |\ProvideTextCommandDefault{|\meta{command}|}{|\meta{definition}|}|
+% definiert nun eine Defaultdefinition f"ur alle Kodierungen, f"ur
+% die keine explizite Definition angegeben wurde. Leider w"urde eine
+% einigerma"sen komplette Realisierung einer Re-Implementierung der
+% neueren NFSS~2-Versionen entsprechen, so da"s hier einfach nur eine
+% Definition f"ur die Kodierung~\glq U\grq{} get"atigt wird, die f"ur
+% unbekannte Kodierungen verwendet wird.
+% \begin{macrocode}
+\@ifundefined{ProvideTextCommandDefault}{%
+ \def\ProvideTextCommandDefault#1{%
+ \ProvideTextCommand{#1}{U}}%
+}{}
+% \end{macrocode}
+%
+% Mit |\DeclareTextCompositeCommand{|\meta{command}|}{|^^A
+% \meta{encoding}|}{|\meta{char}|}{|\meta{definition}|}| kann f"ur die
+% Umlaut- und Trema-Kombinationen sehr bequem eine Definition
+% angegeben werden. Bevor hier f"ur die "alteren NFSS~2-Versionen
+% eine eigene L"osung "`gestrickt"' wird, verl"a"st sich die
+% nachfolgende Definition auf einige \LaTeXe/NFSS~2-Interna!
+% \begin{macrocode}
+\@ifundefined{DeclareTextCompositeCommand}{%
+ \def\DeclareTextCompositeCommand#1#2#3#4{%
+ % define a `dummy' text composite
+ \DeclareTextComposite{#1}{#2}{#3}{`\Z}%
+ % then redefine this command including the new command
+ \expandafter\def\csname\expandafter\string\csname
+ #2\endcsname\string#1-\string#3\endcsname##1##2{#4}}%
+}{}
+% \end{macrocode}
+%
+% Damit ist gesichert, da"s bei Vorliegen von \LaTeXe/NFSS~2 die
+% wichtigsten Deklarationen unabh"angig von der \LaTeXe-Version
+% verf"ugbar sind. Dies vereinfacht die nachfolgenden Deklarationen.
+%
+% \subsubsection{Makros f"ur Textzeichen}
+%
+% Neben den zuvor aufgezeigten Makros definieren die neueren
+% NFSS~2-Versionen noch symbolische Namen f"ur viele der in den
+% Schriften vorhandenen Lettern. Im folgenden werden zum einen f"ur
+% die "alteren Versionen die anschlie"send verwendeten symbolischen
+% Namen nachdefiniert und zum anderen werden Definitionen, die in
+% "alteren \LaTeXe/NFSS~2-Versionen fehlen, f"ur die
+% Kodierung~\texttt{OT1} und Defaults f"ur einige Lettern
+% nachgereicht.
+%
+% \paragraph{Spezielle Behandlung von Babel~v3.5:}
+%
+% Babel Version~3.5 definiert f"ur Nicht-\LaTeXe-Formate die
+% wichtigsten NFSS~2-Anweisung zur Deklaration der symbolischen Namen.
+% Dadurch meint der Code des German-Style, da"s selbst f"ur diese
+% Formate ein vollst"andiges \LaTeXe{} mit NFSS~2 vorl"age. Leider
+% fehlten in "alteren Babel-Versionen wichtige Standarddeklarationen,
+% was zur Folge hat, da"s es bei deren Verwendung zu Fehlern wie
+% z.\,B.\ Endlosschleifen kommen kann. Eine Endlosschleife wird dabei
+% durch Deklaration eines Defaults mit
+% \cs{Provide\-Text\-Command\-Default} verursacht, wenn das Symbol
+% bisher noch nicht deklariert wurde. In Babel Version~3.6
+% werden daher jetzt die Symbole \cs{ss}, \cs{i},
+% \cs{textquotedblright} und \cs{textquoteright} deklariert, die in
+% Version~3.5 fehlten.
+%
+% In den folgenden Deklarationen werden NFSS~2-Interna verwendet:
+% Es wird beispielsweise angenommen, da"s die Existenz des Makros
+% \texttt{\symbol{`\\}OT1\symbol{`\\}ss} -- ein Makro! -- anzeigt,
+% da"s \cs{ss} f"ur NFSS~2 deklariert wurde. Ist dies f"ur die vier
+% Symbole \cs{ss}, \cs{i}, \cs{textquotedblright} und
+% \cs{textquoteright} der Fall, werden sie hier nachdeklariert.
+% Dabei wird dies in der Protokolldatei vermerkt, um eventuell
+% diese Ursache f"ur auftretende Fehler leichter erkennen zu k"onnen.
+% \cs{textquotedblright} und \cs{textquoteright} werden sp"ater noch
+% deklariert, so da"s dies hier noch nicht notwendig ist.
+%
+% \changes{2.5d}{97/04/13}{Die fehlenden Deklarationen f"ur \cs{ss} und
+% \cs{i}, werden f"ur Babel~v3.5, falls ben"otigt, nachdeklariert.
+% F"ur \cs{textquotedblright} und \cs{textquoteright} hier nicht
+% notwendig, da dies hier ein paar Zeilen sp"ater gemacht wird.}
+% \begin{macrocode}
+\@ifundefined{OT1\string\ss}{%
+%<old> \wlog{german: Re-declaration of \string\ss\space for OT1!}%
+%<new> \wlog{ngerman: Re-declaration of \string\ss\space for OT1!}%
+ \DeclareTextSymbol{\ss}{OT1}{25}}{}
+\@ifundefined{OT1\string\i}{%
+%<old> \wlog{german: Re-declaration of \string\i\space for OT1!}%
+%<new> \wlog{ngerman: Re-declaration of \string\i\space for OT1!}%
+ \DeclareTextSymbol{\i}{OT1}{16}}{}
+% \end{macrocode}
+%
+% \paragraph{Defaults f"ur Symbole:}
+%
+% F"ur die Makros |\"|, |\ss|, |\i| und |\SS| sollte ein Default
+% definiert sein.
+% \changes{2.5d}{97/04/13}{F"ur \texttt{\symbol{`\"}S} wird
+% \cs{SS} verwendet, das in \LaTeXe{} bereits definiert ist.}
+% \begin{macrocode}
+\ProvideTextCommandDefault{\"}{\UseTextAccent{OT1}{\"}}
+\ProvideTextCommandDefault{\ss}{\UseTextSymbol{OT1}\ss}
+\ProvideTextCommandDefault{\i}{\UseTextSymbol{OT1}\i}
+\ProvideTextCommandDefault{\SS}{SS}
+% \end{macrocode}
+%
+% Dann sollte auch sichergestellt sein, da"s symbolische Namen f"ur
+% die Zeichen definiert sind, die in den Makros f"ur die
+% Anf"uhrungszeichen verwendet werden. Die Defaults werden jeweils
+% aus den Schriften in Kodierung~\texttt{OT1} genommen.
+%
+% Zuerst die Zeichen f"ur die Anf"uhrungszeichen "`\ldots"' und
+% \glq\ldots\grq:
+% \begin{macrocode}
+\@ifundefined{textquotedblleft}{%
+ \ProvideTextCommandDefault{\textquotedblleft}{%
+ \UseTextSymbol{OT1}\textquotedblleft}%
+ \DeclareTextSymbol{\textquotedblleft}{OT1}{92}%
+% \end{macrocode}
+% (oder |\DeclareTextCommand{\textquotedblleft}{OT1}{``}|)
+% \begin{macrocode}
+ \DeclareTextSymbol{\textquotedblleft}{T1}{16}%
+}{}
+\@ifundefined{textquotedblright}{%
+ \ProvideTextCommandDefault{\textquotedblright}{%
+ \UseTextSymbol{OT1}\textquotedblright}%
+ \DeclareTextSymbol{\textquotedblright}{OT1}{`\"}%
+% \end{macrocode}
+% (oder |\DeclareTextCommand{\textquotedblright}{OT1}{''}|)
+% \begin{macrocode}
+ \DeclareTextSymbol{\textquotedblright}{T1}{17}%
+ %% \DeclareTextSymbol{\textquotedbl}{T1}{`\"}%
+}{}
+\@ifundefined{textquoteleft}{%
+ \ProvideTextCommandDefault{\textquoteleft}{%
+ \UseTextSymbol{OT1}\textquoteleft}%
+ \DeclareTextSymbol{\textquoteleft}{OT1}{`\`}%
+ \DeclareTextSymbol{\textquoteleft}{T1}{`\`}%
+}{}
+\@ifundefined{textquoteright}{%
+ \ProvideTextCommandDefault{\textquoteright}{%
+ \UseTextSymbol{OT1}\textquoteright}%
+ \DeclareTextSymbol{\textquoteright}{OT1}{`\'}%
+ \DeclareTextSymbol{\textquoteright}{T1}{`\'}%
+}{}
+\@ifundefined{quotesinglbase}{%
+ \DeclareTextSymbol{\quotesinglbase}{T1}{13}}{}
+\@ifundefined{quotedblbase}{%
+ \DeclareTextSymbol{\quotedblbase}{T1}{18}}{}
+% \end{macrocode}
+% Danach die Anf"uhrungszeichen in franz"osischer Form ">\ldots"< und
+% \frq\ldots\flq:
+% \begin{macrocode}
+\@ifundefined{guillemotleft}{%
+ \DeclareTextSymbol{\guillemotleft}{T1}{19}}{}
+\@ifundefined{guillemotright}{%
+ \DeclareTextSymbol{\guillemotright}{T1}{20}}{}
+\@ifundefined{guilsinglleft}{%
+ \DeclareTextSymbol{\guilsinglleft}{T1}{14}}{}
+\@ifundefined{guilsinglright}{%
+ \DeclareTextSymbol{\guilsinglright}{T1}{15}}{}
+% \end{macrocode}
+%
+% Damit sind die wichtigsten Makros so definiert, da"s die
+% nachfolgenden Definitionen nur noch wenige F"alle unterscheiden
+% m"ussen und damit "ubersichtlicher definiert werden k"onnen.
+%
+% Die nun folgenden Definitionen sind nicht nur f"ur NFSS~2
+% verwendbar, so da"s das \texttt{if}-NFSS~2 vorl"aufig beendet werden
+% kann.
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \section{Low-Level-Befehle f"ur die Style-Option}
+%
+% Die Style-Option verwendet Low-Level-Befehle zur Implementierung
+% von An"-f"uhrungs"-zeichen, der Umlaute u.\,a. Einige dieser
+% Befehle sind auch f"ur Benutzer verf"ugbar.
+%
+% \subsection{Verschiedenes}
+%
+% \LaTeX\ verwendet den Befehl |\protect|, um \emph{fragile}
+% Kommandos zu sch"utzen. Dieser Befehl mu"s f"ur Plain-\TeX\
+% nachdefiniert werden. Folgendes Code-St"uck definiert diesen
+% Befehl als |\relax|, falls er noch undefiniert ist,
+% andernfalls wird |\protect| nicht ge"andert.
+% \begin{macrocode}
+\expandafter\let\expandafter\protect\csname protect\endcsname
+% \end{macrocode}
+%
+% Mit |\allowhyphens| kann man \TeX\ signalisieren, da"s ein
+% trennbarer Wortteil endet (durch den |\penalty1000|- oder
+% |\nobreak|-Befehl) und ein neuer beginnt (durch den |\hskip|-Befehl,
+% der \textit{glue} ein"-f"ugt). Dieser Trick ist in Anhang~D des
+% \TeX{}book beschrieben, die Interna dazu in Anhang~H.
+%\begin{verbatim}
+%\def\allowhyphens{\nobreak \hskip 0pt plus 0pt\relax}
+%\end{verbatim}
+% entspricht der nachfolgenden Definition:
+% \begin{macrocode}
+\def\allowhyphens{\penalty\@M \hskip\z@skip}
+% \end{macrocode}
+%
+% Neben den Umlauten mu"s auch daf"ur gesorgt werden, da"s am und nach
+% dem Buchstaben~{\ss} getrennt werden kann, \TeX{} also diesen Letter
+% als Wortbestandteil erkennt. Dazu mu"s dem Letter ein
+% Lowercase-Code |\lccode| gr"o"ser als Null zugewiesen sein.
+% |\ss|~entspricht f"ur Schriften in Kodierung~\texttt{OT1} dem
+% Letter auf Position~|^^Y|. Um W"orter mit diesem Letter komplett
+% trennbar zu machen, reicht es daher aus, wenn man den |\lccode|
+% dieser Letter auf einen Wert ungleich Null setzt. F"ur ein |\ss|
+% aus anderen Schriften mu"s dies in der entsprechenden Makrodatei
+% getan werden, in dem die Schrift und der Befehl~|\ss| redefiniert
+% wird.
+% \begin{macrocode}
+\lccode`\^^Y=`\^^Y
+% \end{macrocode}
+%
+% \subsection{Anf"uhrungszeichen}
+%
+% Die deutschen Anf"uhrungszeichen werden f"ur Schriften, die keine
+% geeigneten Lettern besitzen, durch Box-Manipulationen aus den im
+% englischsprachigen Raum gebr"auchlichen Anf"uhrungszeichen erzeugt.
+%
+% |\set@low@box| verschiebt das Zeichen im Argument, normalerweise ``
+% bzw.\ '', auf die H"ohe des Kommas in dieser Schrift. Achtung: Da
+% das Makro den Inhalt der Box 0, 2 und ein L"angenregister "andert,
+% sollte dieses Makro nur innerhalb einer Gruppe aufgerufen werden.
+% \begin{macrocode}
+\def\set@low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}%
+ \setbox\z@\hbox{\dimen@\ht\z@ \advance\dimen@ -\ht\tw@
+ \lower\dimen@\box\z@}%
+ \ht\z@\ht\tw@ \dp\z@\dp\tw@}
+% \end{macrocode}
+%
+% Normalerweise wird der aktuelle |\spacefactor| nicht durch
+% An"-f"uhrungs"-zeichen ge"-"andert, so da"s bei aktiviertem
+% |\nonfrenchspacing| nach einem Satzzeichen und direkt nachfolgenden
+% Anf"uhrungszeichen ein gr"o"serer Wortzwischenraum gelassen wird.
+% Da \TeX\ den |\spacefactor| nach einem Box-Befehl auf~1000 setzt,
+% mu"s man diesen Wert von Hand vorher retten und danach wieder
+% setzen, um dieses Verhalten nicht zu "andern.
+% \begin{macrocode}
+\def\save@sf@q#1{{\ifhmode
+ \edef\@SF{\spacefactor\the\spacefactor}\else
+ \let\@SF\empty \fi \leavevmode #1\@SF}}
+% \end{macrocode}
+%
+% \subsection{Umlaute}
+%
+% Wird ein Umlaut mit Hilfe des |\accent|-Primitivs erzeugt, werden
+% bei den meisten Schriften die Umlautpunkte zu hoch gesetzt. Die
+% Umlautpunkte entsprechen dadurch eher einem Trema. Das Makro
+% |\umlaut| ersetzt das \TeX-Primitiv, um Umlaute mit etwas tieferen
+% Umlautpunkten zu erzeugen. Die Funktionsweise beruht auf dem
+% folgenden kleinen Trick: Das |\accent|-Primitiv hat die Eigenschaft,
+% die aktuelle \textit{x-height} und die Gr"o"se des Buchstabens zu
+% verwenden, um die vertikale Positionierung und in Abh"angigkeit
+% des \textit{slant} der Schrift die horizontale Verschiebung der
+% Punkte zu bestimmen. Um die Punkte etwas tiefer zu setzen, kann
+% nun entweder die H"ohe des Buchstabens verkleinert oder die
+% \textit{x-height} der Schrift tempor"ar vergr"o"sert werden. Da das
+% |\accent|-Primitiv keine Box als Argument erlaubt, wird der zweite
+% Weg gew"-"ahlt. Dabei mu"s beachtet werden, da"s "Anderungen der
+% |\fontdimen| immer global ausgef"uhrt werden, so da"s man den
+% urspr"unglichen Wert retten und danach wieder explizit
+% zur"uckschreiben mu"s!
+% \changes{2.5c}{95/01/24}{Abfrage auf L"angenregister \cs{grmnU@D}
+% hatte wegen eines At-Zeichens zuviel auf \cs{grmn@U@D} getestet.}
+% \begin{macrocode}
+\expandafter\ifx\csname grmnU@D\endcsname\relax
+ \csname newdimen\endcsname\grmnU@D
+\fi
+\def\newumlaut#1{{\grmnU@D 1ex%
+ {\setbox\z@\hbox{\char127}\dimen@-.45ex\advance\dimen@\ht\z@
+ \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
+ \accent127\fontdimen5\font\grmnU@D #1}\allowhyphens}
+% \end{macrocode}
+%
+% F"ur Tremata wird das urspr"ungliche |\accent|-Primitive verwendet.
+% Da die Style-Option das |\"|-Makro "andert, mu"s hier die originale
+% Definition selbst verwendet werden, wobei durch das |\allowhyphens|
+% nach dem Akzentprimitiv die Trennung im Rest des Wortes wieder
+% erlaubt ist. F"ur \LaTeXe\ kann durch die ge"anderten Interna das
+% |\"|-Makro direkt verwendet werden, wobei auch hier ein
+% |\allowhyphens| die Trennung im nachfolgenden Wortteil wieder
+% erlaubt.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
+ \def\highumlaut#1{{\accent127 #1}\allowhyphens}
+\else
+ \def\highumlaut#1{\"{#1}\allowhyphens}
+\fi
+% \end{macrocode}
+%
+% \subsection{Aktivierter Double\-quote}
+%
+% Die Style-Option "`german"' verwendet ein aktiviertes
+% Doublequote-Zeichen. Mit den Makros |\mdqon| und |\mdqoff| werden
+% hierzu Befehle zum Hin- und Herschalten definiert.
+% \begin{macrocode}
+\def\mdqon{\catcode`\"\active}
+\def\mdqoff{\catcode`\"12\relax}
+% \end{macrocode}
+%
+% Der Mechanismus der die Double\-quote-Eingabe\-notation realisiert,
+% verwendet folgende weitere symbolische Namen f"ur Makros und
+% spezielle Zeichen.
+% \changes{2.5d}{97/04/12}{"Uberbleibsel \cs{@UMLAUT}-Definition
+% als \cs{\protect\dq} aus Vor-NFSS2-Zeiten entfernt.}
+% \changes{2.5d}{97/04/13}{\cs{@SS} in \cs{@MATHss} umbenannt.}
+% \changes{2.5d}{97/05/01}{In \cs{@MATHss} ein eigentlich
+% "uberfl"ussiges \cs{mathord} eingef"ugt, das aber daf"ur sorgt,
+% da"s Leerzeichen danach nicht ignoriert werden.}
+% \begin{macrocode}
+\begingroup \mdqoff
+\def\x{\endgroup
+ \def\@MATHUMLAUT{\ddot}% = \mathaccent"707F
+ \def\@MATHss{\mathord{\mathchar"7019}}% TODO: correct?
+ \def\dq{"}}% TODO: or \textquotedbl?
+\x
+% \end{macrocode}
+%
+% Da das Zeichen aktiviert wird, mu"s es f"ur bestimmte Kontexte
+% explizit wieder deaktiviert werden. Plain-\TeX\ und \LaTeX\
+% verwenden f"ur Umgebungen, wie \texttt{verbatim}, die Befehle
+% |\dospecials| und |\@sanitize|, die Listen mit diesen speziellen
+% Zeichen darstellen. Der Double\-quote wird an diese Listen
+% angeh"angt.
+% \begin{macrocode}
+\begingroup
+ \def\do{\noexpand\do\noexpand}%
+ \edef\x{\endgroup
+ \def\noexpand\dospecials{\dospecials\do\"}}%
+\x
+% \end{macrocode}
+% |\@sanitize| ist nur f"ur \LaTeX\ definiert, so da"s dessen
+% Existenz explizit abgefragt wird.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname @sanitize\endcsname\relax \else
+ \begingroup
+ \def\@makeother{\noexpand\@makeother\noexpand}%
+ \edef\x{\endgroup
+ \def\noexpand\@sanitize{\@sanitize\@makeother\"}}%
+ \x
+\fi
+% \end{macrocode}
+%
+% \subsection{Kompatibilit"at mit "alteren Versionen}
+%
+% "Altere Versionen der Style-Option "`german"' definieren die
+% Befehle |\3| und |\ck|, die nicht mehr verwendet werden sollten.
+% Damit alte Dokumente mit diesen Kommandos nicht ge"andert werden
+% m"ussen, existieren diese Befehle auch noch f"ur Version~2.x.
+% In "`ngerman"' wird |\ck| so definiert, da"s ein "`ck"' mit Trennstelle
+% davor erzeugt wird; au"erdem wird eine Warnung ausgegeben.
+% \changes{2.5e (beta 1)}{98/05/04}{ge"anderte Definition von \cs{ck}
+% in "`ngerman"'}
+% \begin{macrocode}
+\let\grmn@original@three=\3 % \3 may be defined or undefined.
+%<*old>
+\def\ck{\penalty\@M\discretionary{k-}{}{c}k\allowhyphens}
+%</old>
+%<*new>
+\def\ck{%
+ \ifnum\grmn@dqwarninglevel>\@ne
+ \grmn@dq@warning@obsolete{\string\ck}{ck}%
+ \fi
+ \penalty\@M\-\allowhyphens ck}
+%</new>
+% \end{macrocode}
+%
+%
+% \section{Anf"uhrungszeichen}
+%
+% Die Makros |\glqq|, |\grqq|, |\glq|, |\grq|, |\flqq|, |\frqq|,
+% |\flq| und |\frq| f"ur die Anf"uhrungzeichen k"onnen mit NFSS
+% Version~2 (also mit \LaTeXe) abh"angig von der Kodierung der
+% Schrift definiert werden.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
+% \end{macrocode}
+%
+% \subsection{\ldots~ohne NFSS Version~2}
+%
+% Ohne NFSS Version~2 werden die Makros aus den "`alten"' Versionen
+% dieser Style-Option verwendet. Da diese Makros auf alle Zeichen
+% "uber symbolische Befehle oder Ligaturen zugreifen, sollten die
+% Ergebnisse f"ur die meisten Schriften korrekt sein, jedoch wird
+% wegen der nicht expandierbaren Tokens in den Makros kein Kerning
+% zwischen dem Anf"uhrungszeichen und umgebenden Text durchgef"uhrt
+% (und keine Ligaturen gebildet, auch wenn diese in bisher keiner
+% mir bekannten und f"ur \TeX{} verf"ugbaren Schrift vorhanden sind).
+%
+% Zuerst einmal die Makros f"ur die Anf"uhrungszeichen "`\ldots"' und
+% \glq\ldots\grq. Die Namen |\@glqq|, |\@grqq|, etc.\ der zu
+% sch"utzenden internen Makros aus "alteren Version des German-Style
+% werden eigentlich nicht mehr ben"otigt, werden hier aber zur
+% Kompatibilit"at dennoch definiert.
+% \changes{2.5d}{97/04/13}{Verwende Trick von \LaTeXe{} mit
+% dem Leerzeichen im Namen des zu sch"utzenden Makros.}
+% \begin{macrocode}
+\expandafter\def\csname glqq \endcsname{%
+ \save@sf@q{\set@low@box{''\/}\box\z@\kern-.04em\allowhyphens}}
+\edef\glqq{\noexpand\protect
+ \expandafter\noexpand\csname glqq \endcsname}
+\let\@glqq=\glqq
+\expandafter\def\csname grqq \endcsname{%
+ \save@sf@q{\kern-.07em``\kern.07em}}% ('')
+\edef\grqq{\noexpand\protect
+ \expandafter\noexpand\csname grqq \endcsname}
+\let\@grqq=\grqq
+\expandafter\def\csname glq \endcsname{%
+ \save@sf@q{\set@low@box{'\/}\box\z@\kern-.04em\allowhyphens}}
+\edef\glq{\noexpand\protect
+ \expandafter\noexpand\csname glq \endcsname}
+\let\@glq=\glq
+\expandafter\def\csname grq\endcsname{%
+ \save@sf@q{\kern-.0125em`\kern.07em}}
+\edef\grq{\noexpand\protect
+ \expandafter\noexpand\csname grq \endcsname}
+\let\@grq=\grq
+% \end{macrocode}
+% Danach folgen die Definitionen f"ur die franz"osische Form der
+% Anf"uhrungszeichen "<\ldots"> und {\flq}\ldots{\frq}. Da die
+% Definition auch f"ur Plain-\TeX\ verwendbar sein soll, k"onnte man
+% das Aussehen durch eine etwas andere Definition noch verbessern.
+% Auch hier werden die Namen der zu sch"utzenden internen Makros aus
+% "alteren Version obwohl nicht notwendig zur Kompatibilit"at
+% definiert.
+% \changes{2.5c}{96/02/26}{Im Code f"ur die franz"osischen
+% Anf"uhrungszeichen \cs{m@th} eingef"ugt.}
+% \changes{2.5c}{96/04/28}{Die Boxen f"ur \cs{flqq}, \cs{frqq},
+% \cs{flq} und \cs{frq} werden mit \cs{raise.2ex} etwas zu tief
+% gesetzt, deshalb wird jetzt \cs{raise.27ex} aus
+% \texttt{french.sty} verwendet.}
+% \changes{2.5d}{97/04/13}{Verwende Trick von \LaTeXe{} mit
+% dem Leerzeichen im Namen des zu sch"utzenden Makros.}
+% \changes{2.5d}{97/05/01}{In \cs{flqq} und \cs{frqq} um \cs{ll}
+% bzw.\ \cs{gg} ein \cs{mathrel} eingef"ugt (klammern oder ein
+% ein leeres Klammerpaar danach w"urde Abst"ande "andern).
+% Damit kann das leere Klammerpaar in dern entsprechenden
+% Doublequote-Notation f"ur die franz"osischen Anf"uhrungszeichen
+% entfernt werden.}
+% \begin{macrocode}
+\expandafter\def\csname flqq \endcsname{%
+ \relax\ifmmode \mathrel{\ll}\else \save@sf@q{\penalty\@M
+ \raise .27ex\hbox{$\m@th\scriptscriptstyle \ll $}%
+ \allowhyphens}\fi}
+\edef\flqq{\noexpand\protect
+ \expandafter\noexpand\csname flqq \endcsname}
+\let\@flqq=\flqq
+\expandafter\def\csname frqq \endcsname{%
+ \relax\ifmmode \mathrel{\gg}\else \save@sf@q{\penalty\@M
+ \raise .27ex\hbox{$\m@th\scriptscriptstyle \gg $}%
+ \allowhyphens}\fi}
+\edef\frqq{\noexpand\protect
+ \expandafter\noexpand\csname frqq \endcsname}
+\let\@frqq=\frqq
+\expandafter\def\csname flq \endcsname{%
+ \relax\ifmmode <\else \save@sf@q{\penalty\@M
+ \raise .27ex\hbox{$\m@th\scriptscriptstyle <$}\allowhyphens}\fi}
+\edef\flq{\noexpand\protect
+ \expandafter\noexpand\csname flq \endcsname}
+\let\@flq=\flq
+\expandafter\def\csname frq \endcsname{%
+ \relax\ifmmode >\else \save@sf@q{\penalty\@M
+ \raise .27ex\hbox{$\m@th\scriptscriptstyle >$}\allowhyphens}\fi}
+\edef\frq{\noexpand\protect
+ \expandafter\noexpand\csname frq \endcsname}
+\let\@frq=\frq
+% \end{macrocode}
+% Leider verhindert das |\nobreak| in |\allowhyphens| eine Trennung
+% an einem Wortzwischenraum, der nach dem Anf"uhrungszeichen folgen
+% kann. Da die obige Definition sowohl f"ur ">\ldots"< als auch f"ur
+% "<\ldots"> verwendbar sein mu"s, kann man ohne weitere Tricks
+% nichts an dieser Einschr"ankung "andern.
+%
+%
+% Die nachfolgenden Abschnitte beschreiben die notwendigen
+% Definitionen f"ur NFSS~2.
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% \subsection{\ldots~mit NFSS Version~2}
+%
+% Das Makro |\glqq| entspricht dem in neueren \LaTeXe-Releases
+% definiertem Symbol |\quotedblbase|. Die Definitionen dieses
+% Symbols werden auch f"ur die \texttt{OT1}-kodierten Schriften
+% erweitert, so da"s man eine relativ einfache Definition erh"alt.
+% \begin{macrocode}
+\DeclareRobustCommand{\glqq}{%
+ \ifmmode\hbox{\quotedblbase}\else\quotedblbase\fi}
+\ProvideTextCommandDefault{\quotedblbase}{%
+ \UseTextSymbol{OT1}\quotedblbase}
+\ProvideTextCommand{\quotedblbase}{OT1}{%
+ \save@sf@q{\set@low@box{\textquotedblright\/}\box\z@
+ \kern-.04em\allowhyphens}}
+% \end{macrocode}
+%
+% Leider existiert f"ur |\grqq| kein entsprechendes Pendant, so da"s
+% man hier auf die "`alte"' Version zur"uckgreifen mu"s. Jedoch wird
+% f"ur \texttt{T1}-kodierte Schriften keine \cs{kern}-Anweisungen
+% eingef"ugt, da diese insbesondere bei den EC-Fonts und dessen
+% Testversionen ab DC-Fonts Version~1.2 das Anf"uhrungszeichen zu
+% weit nach links plazieren und dieses dadurch den davorstehenden
+% Letter "uber"-schreiben k"onnte.
+% \changes{2.5c}{96/02/26}{F"ur \texttt{T1}-kodierte Schriften,
+% insbesondere den DC-Fonts~v1.2 d"urfen bei \cs{grqq} keine
+% expliziten \cs{kern} eingef"ugt werden. Deshalb separate
+% Deklarationen f"ur T1- und OT1-kodierte Schriften.}
+% \begin{macrocode}
+\ProvideTextCommand{\grqq}{T1}{\textquotedblleft}
+\ProvideTextCommand{\grqq}{OT1}{%
+ \save@sf@q{\kern-.07em%
+ \ifmmode\hbox{\textquotedblleft}\else\textquotedblleft\fi
+ \kern.07em\relax}}
+\ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}
+% \end{macrocode}
+% Entsprechend werden die Symbole |\glq| und |\grq| definiert\,\ldots
+% \begin{macrocode}
+\DeclareRobustCommand{\glq}{%
+ \ifmmode\hbox{\quotesinglbase}\else\quotesinglbase\fi}
+\ProvideTextCommandDefault{\quotesinglbase}{%
+ \UseTextSymbol{OT1}\quotesinglbase}
+\ProvideTextCommand{\quotesinglbase}{OT1}{%
+ \save@sf@q{\set@low@box{\textquoteright\/}\box\z@
+ \kern-.04em\allowhyphens}}
+% \end{macrocode}
+% \changes{2.5c}{96/04/27}{F"ur \texttt{T1}-kodierte Schriften
+% bin ich mir momentan nicht sicher, ob f"ur \cs{grq} explizite
+% \cs{kern} eingef"ugt werden sollten; die DC-Fonts~v1.2 haben
+% Kerning f"ur ein als schlie"sendes Quote verwendetes Backquote,
+% deshalb kein \cs{kern}.}
+% \begin{macrocode}
+\ProvideTextCommand{\grq}{T1}{\textquoteleft}
+\ProvideTextCommand{\grq}{OT1}{%
+ \save@sf@q{\kern-.0125em%
+ \ifmmode\hbox{\textquoteleft}\else\textquoteleft\fi
+ \kern.07em\relax}}
+\ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}
+% \end{macrocode}
+% \ldots\,und auch die franz"osische Form der Anf"uhrungszeichen.
+% \changes{2.5c}{96/02/26}{Im Code f"ur die franz"osischen
+% Anf"uhrungszeichen \cs{m@th} eingef"ugt.}
+% \changes{2.5c}{96/04/28}{Die Boxen f"ur \cs{flqq}, \cs{frqq},
+% \cs{flq} und \cs{frq} werden mit \cs{raise.2ex} etwas zu tief
+% gesetzt, deshalb wird jetzt \cs{raise.27ex} aus
+% \texttt{french.sty} verwendet.}
+% \changes{2.5d}{97/05/01}{\cs{mathrel} bzw.\ \cs{mathbin} in
+% \cs{flqq}, \cs{frqq}, \cs{flq} und \cs{frq} eingef"ugt.}
+% \begin{macrocode}
+\DeclareRobustCommand{\flqq}{%
+ \ifmmode\mathrel{\hbox{\guillemotleft}}\else\guillemotleft\fi}
+\ProvideTextCommandDefault{\guillemotleft}{%
+ \UseTextSymbol{OT1}\guillemotleft}
+\ProvideTextCommand{\guillemotleft}{OT1}{%
+ \ifmmode \ll \else \save@sf@q{\penalty\@M
+ \raise .27ex\hbox{$\m@th\scriptscriptstyle \ll $}%
+ \allowhyphens}\fi}
+\DeclareRobustCommand{\frqq}{%
+ \ifmmode\mathrel{\hbox{\guillemotright}}\else\guillemotright\fi}
+\ProvideTextCommandDefault{\guillemotright}{%
+ \UseTextSymbol{OT1}\guillemotright}
+\ProvideTextCommand{\guillemotright}{OT1}{%
+ \ifmmode \gg \else \save@sf@q{\penalty\@M
+ \raise .27ex\hbox{$\m@th\scriptscriptstyle \gg $}%
+ \allowhyphens}\fi}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareRobustCommand{\flq}{%
+ \ifmmode\mathbin{\hbox{\guilsinglleft}}\else\guilsinglleft\fi}
+\ProvideTextCommandDefault{\guilsinglleft}{%
+ \UseTextSymbol{OT1}\guilsinglleft}
+\ProvideTextCommand{\guilsinglleft}{OT1}{%
+ \ifmmode <\else \save@sf@q{\penalty\@M
+ \raise .27ex\hbox{$\m@th\scriptscriptstyle <$}\allowhyphens}\fi}
+\DeclareRobustCommand{\frq}{%
+ \ifmmode\mathbin{\hbox{\guilsinglright}}\else\guilsinglright\fi}
+\ProvideTextCommandDefault{\guilsinglright}{%
+ \UseTextSymbol{OT1}\guilsinglright}
+\ProvideTextCommand{\guilsinglright}{OT1}{%
+ \ifmmode >\else \save@sf@q{\penalty\@M
+ \raise .27ex\hbox{$\m@th\scriptscriptstyle >$}\allowhyphens}\fi}
+% \end{macrocode}
+%
+% Damit w"aren die Makros f"ur die Anf"uhrungszeichen definiert
+% und die Unterscheidung mit/ohne NFSS Version~2 wird f"ur's erste
+% nicht mehr ben"otigt.
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+%
+% \section{Anpassung der Umlautmakros}
+%
+% Wie schon bei der Definition des Befehls |\umlaut| erw"ahnt,
+% mu"s das Akzentmakro f"ur die Umlaute angepa"st werden.
+%
+% Um sp"ater zwischen der Original- und der neuen Definition
+% umschalten zu k"onnen, werden die internen Umschaltbefehle
+% |\umlauthigh| und |\umlautlow| definiert. Da NFSS Version~2
+% schon wieder eine Sonderrolle -- im positiven Sinne -- spielen
+% mu"s, ist wieder eine Unterscheidung der Versionen n"otig.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
+% \end{macrocode}
+%
+% F"ur Versionen ohne NFSS Version~2 wird relativ einfach zwischen
+% den beiden Versionen gewechselt. Wenn man Schriften mit ge"anderten
+% Kodierungen verwenden will, mu"s dieses Makro ebenso angepa"st
+% werden.
+% \begin{macrocode}
+\def\umlauthigh{\def\"##1{{\accent127 ##1}}}
+\def\umlautlow{\def\"{\protect\newumlaut}}
+% \end{macrocode}
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% F"ur NFSS Version~2 ist das ganze etwas komplizierter.
+% Da die Befehle |\DeclareText...| nicht mehr nach der Pr"aambel
+% verwendet werden d"urfen, wird der neue symbolische Name
+% |\grmn@OTumlaut| f"ur das Umlautmakro f"ur Schriften in
+% Kodierung~\texttt{OT1} definiert. Beim Umschalten wird dann die
+% Definition dieses Makro ver"andert.
+% \begin{macrocode}
+\def\umlauthigh{\def\grmn@OTumlaut##1{{\accent 127 ##1}}}
+\def\umlautlow{\def\grmn@OTumlaut{\protect\newumlaut}}
+\umlauthigh
+% \end{macrocode}
+% F"ur Schriften in Kodierung \texttt{OT1} und~\texttt{T1} werden hier
+% Standarddefinitionen angegeben, in der das neue Makro verwendet
+% wird.
+% \begin{macrocode}
+\DeclareTextAccent{\"}{T1}{4}
+\DeclareTextAccent{\"}{OT1}{127}
+\DeclareTextCompositeCommand{\"}{OT1}{a}{\grmn@OTumlaut{a}}%
+\DeclareTextCompositeCommand{\"}{OT1}{o}{\grmn@OTumlaut{o}}%
+\DeclareTextCompositeCommand{\"}{OT1}{u}{\grmn@OTumlaut{u}}%
+\DeclareTextCompositeCommand{\"}{OT1}{A}{\grmn@OTumlaut{A}}%
+\DeclareTextCompositeCommand{\"}{OT1}{O}{\grmn@OTumlaut{O}}%
+\DeclareTextCompositeCommand{\"}{OT1}{U}{\grmn@OTumlaut{U}}%
+\DeclareTextComposite{\"}{T1}{a}{228}
+% \end{macrocode}
+%
+% Da diese Definitionen in einer "alteren Patch-Datei am Beginn eines
+% Dokuments ge"andert werden, werden diese "Anderungen einfach
+% nochmals mit den oben angegebenen Anweisungen "uberschrieben,
+% obwohl dies eigentlich nur f"ur diese veraltete \LaTeXe-Version
+% mit dieser Patch-Datei notwendig w"are. Dies sollte in einer
+% der n"achsten Version des German-Style entfernt werden!
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname AtBeginDocument\endcsname\relax \else
+ \AtBeginDocument{%
+ \DeclareTextAccent{\"}{T1}{4}% % from `ltpatch.tex'
+ \DeclareTextAccent{\"}{OT1}{127}% % from `ltpatch.tex'
+ % \DeclareTextCommand{\"}{OT1}{\newumlaut}% from `ltpatch.tex'
+ % % has to be removed
+ \DeclareTextCompositeCommand{\"}{OT1}{a}{\grmn@OTumlaut{a}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{o}{\grmn@OTumlaut{o}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{u}{\grmn@OTumlaut{u}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{A}{\grmn@OTumlaut{A}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{O}{\grmn@OTumlaut{O}}%
+ \DeclareTextCompositeCommand{\"}{OT1}{U}{\grmn@OTumlaut{U}}%
+ \DeclareTextComposite{\"}{T1}{a}{228}% % from `ltpatch.tex'
+ }
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+%
+% \section{Mechanismus f"ur Doublequote-Notation}
+%
+% Die Eingabenotation |"x| f"ur Umlaute, spezielle Trennungen
+% u.\,a., die die Style-Option "`german"' anbietet, wird durch den
+% \textit{active character} Double\-quote realisiert. Dieses aktive
+% Zeichen liest das folgende Token als sein Argument und entscheidet
+% abh"angig von diesem Argument, welche Kommandos zur Realisierung
+% verwendet werden sollen.
+%
+% Nach dieser Beschreibung scheint die Makrodefinition, die diesem
+% aktiven Zeichen zugewiesen wird, relativ einfach zu realisieren zu
+% sein:
+%\begin{verbatim}
+%\catcode`\"=\active
+%\def "#1{\ifx#1a\newumlaut{a}\else ...etc.etc... \fi}
+%\end{verbatim}
+% Leider gibt es bei dieser einfachen Implementierung einige
+% Fehlerm"oglichkeiten: Zum einen "uberliest \TeX\ vor jedem nicht
+% begrenztem Argument eines Makros alle Leerzeichen, so da"s die
+% beiden Eingaben |" a| und~|"a| nicht unterscheidbar sind.
+% Zum zweiten erzeugen die Gruppenklammern |{| und~|}|
+% als Argument Fehler, da bei einer "offnenden Klammer eine komplette
+% Liste gelesen wird und eine schlie"sende Klammer zu einem Fehler
+% f"uhrt.
+%
+% Will man diese Probleme mit der etwas "`schlaueren"' L"osung
+%\begin{verbatim}
+%\catcode`\"=\active
+%\def "{\afterassignment\do@activedq \let\next= }
+%\def\do@activedq{\ifx\next\bgroup \def\next{\dq\bgroup}\else
+% \ifx\next\egroup \def\next{\dq\egroup}\else
+% \expandafter\ifx\space\next \def\next{\dq\space}\else
+% \ifx a\next \def\next{\newumlaut{a}}\else
+% ...etc.etc... \fi\fi\fi...\fi \next}
+%\end{verbatim}
+% vermeiden, handelt man sich ein anderes, schwerwiegenderes Problem
+% ein: In \TeX\ kann man ganzzahlige Konstanten auch in hexadezimaler
+% Notation eingeben. Dazu wird einfach der hexadezimalen Zahl ein
+% normales Double\-quote-Zeichen vorangestellt (Bsp.: |"FF| f"ur die
+% Konstante~255). Mit der "`schlaueren"' L"osung meldet \TeX\ jedoch
+% beim Einlesen aller hexadezimalen Konstanten bei aktiviertem
+% Double\-quote eine fehlende Zahl. Der Grund ist einfach:
+% Primitive, wie |\afterassignment| oder |\futurelet|, sind
+% nicht expandierbar und nichtexpandierbare Token beenden das
+% Scan\-nen einer Zahl.
+%
+% Um diesen schwerwiegenden Nachteil der "`schlaueren"' L"osung
+% zu vermeiden (die "ahnlich in Version~2.3c/d verwendet wurde, wobei
+% schon in den Versionen 2.2--2.3b ein |\protect| mit Bedeutung
+% |\relax| diesen Fehler erzeugt hat), mu"s man wohl oder "ubel die
+% erste L"osung verwenden und deren Nachteile in Kauf nehmen.
+%
+% Auf einen anderen Punkt mu"s auch geachtet werden: Damit \TeX\ f"ur
+% die resultierenden Umlaute und An"-f"uhrungs"-zeichen ein Kerning
+% durch"-f"uhrt und Ligaturen bildet, d"urfen vor und nach diesen
+% Zeichen keine nichtexpandierbaren Token, wie Gruppenklammern,
+% |\relax|, etc., in der Eingabe "`stehenbleiben"'. Dies mu"s
+% insbesondere auch f"ur die F"alle gelten, in denen der
+% Double\-quote eine hexadezimale Konstante einleitet!
+%
+%
+% \subsection{Fehler bei undefinierten
+% \protect\texttt{\char34x}-Kombinationen}
+%
+% F"ur Argumente des Double\-quote-Makros, f"ur die keine Bedeutung
+% definiert wurde, sollte eine Fehlermeldung an den Benutzer
+% ausgegeben werden. Dies verhindert zum einen, da"s einfache
+% Tippfehler "uber"-sehen werden, zum anderen gibt es in sp"ateren
+% Versionen, in denen f"ur weitere Argumente Bedeutungen definiert
+% werden, weniger Fehler in alten Dokumenten.
+%
+% Mit dem (undokumentierten) Befehl |\dqwarninglevel| kann festgelegt
+% werden, bei welchen Befehlen Warnungen ausgegeben werden:
+% 0~bedeutet momentan keine Warnung, 1~nur f"ur undefinierte
+% Kombinationen (Default) und 2~auch Warnungen f"ur die Befehle f"ur
+% drei gleiche Konsonanten.
+%
+% Es bietet sich an, den Level~2 daf"ur zu verwenden, vor
+% durch die Rechtschreibreform obsolet gewordenen Befehlen zu
+% warnen, n"amlich Dreier"=Kombinationen und zus"atzlich die
+% Befehle zur |ck|"~Trennung: |"ck| und |\ck|.
+% \changes{2.5e (beta 1)}{98/05/04}{Level~2 f"ur neue Rechtschreibung.}
+% \begin{macrocode}
+\def\dqwarninglevel#1{\chardef\grmn@dqwarninglevel=#1\relax}
+%<old> \dqwarninglevel{1}
+%<new> \dqwarninglevel{2}
+% \end{macrocode}
+%
+% Neuere \LaTeX-Versionen verwenden den in \TeX~3 vorhandenen
+% Parameter |\inputlineno|, um mit jeder Fehlermeldung auch die
+% Zeilennummer auszugeben. Da dies allgemein sinnvoll ist, wird das
+% dazu benutzte \LaTeX-Makro definiert, falls es bei Verwendung von
+% Plain-\TeX\ oder einer alten \LaTeX-Version noch nicht definiert
+% ist und \TeX~3 verwendet wird (|\inputlineno| mu"s existieren
+% und einen positiven Wert haben).
+% \changes{2.5d}{97/05/01}{\cs{@empty} ist in Plain-\TeX{} nicht
+% definiert, daher \cs{on@line} besser direkt definieren.}
+% \begin{macrocode}
+\expandafter\ifx\csname on@line\endcsname\relax
+ \ifx\inputlineno\undefined \def\on@line{}%
+ \else
+ \ifnum\inputlineno<\z@ \def\on@line{}%
+ \else \def\on@line{ on input line \the\inputlineno}%
+\fi\fi\fi
+% \end{macrocode}
+%
+% F"ur die Ausgabe von Warnungen und Fehlermeldungen werden
+% weitere Makros definiert.
+% \changes{2.5e (beta 1)}{98/05/04}{Neue Warnbefehle nur f"ur "`ngerman"'.}
+% \begin{macrocode}
+\def\grmn@dq@error#1{%
+ \errhelp{Use `` for a simple double quote character.}%
+%<old> \errmessage{german: The command \dq\string#1 is undefined}}
+%<new> \errmessage{ngerman: The command \dq\string#1 is undefined}}
+\def\grmn@dq@warning#1{%
+ \immediate\write\sixt@@n
+%<old> {german: \dq\string#1 is possibly wrong\on@line.}}
+%<new> {ngerman: \dq\string#1 is possibly wrong\on@line.}}
+% \end{macrocode}
+% Der Befehl |\grmn@dq@warning@obsolete| l"ot den
+% |\grmn@dq@warning|"~Befehl nur in den F"allen ab, bei denen
+% der "`Warning"=Level"' auf zwei steht, also bei denen der Anwender
+% auf den veralteten Befehl hingewiesen werden soll.
+% Da der erste Parameter sowohl ein Befehlsname |\ck| als auch eine
+% |"|"~Kombination sein kann, mu"s der Aufrufer daf"ur Sorge tragen,
+% da"s die Parameter richtig geschrieben werden k"onnen. Als
+% Beispiel sollte |"f| als |\dq f| und |\ck| als |\string\ck|
+% "ubergeben werden).
+% \begin{macrocode}
+%<*new>
+\def\grmn@dq@warning@obsolete#1#2{%
+ \immediate\write\sixt@@n
+ {ngerman: #1 is now obsolete, please use #2 instead\on@line.}}
+%</new>
+% \end{macrocode}
+% F"ur die Dreier"=Kombinationen sind die |"|"~Befehle
+% "uberfl"ussig geworden. Das Makro, abgeleitet aus
+% |\grmn@dqdisc|, gibt daher eine Warnung aus und
+% setzt die Buchstaben. Da drei gleiche Buchstaben nach dem
+% zweiten getrennt werden d"urfen, wird die entsprechende
+% Trennhilfe eingef"ugt (|"-|).
+% \begin{macrocode}
+%<*new>
+\def\grmn@dqobsolete@three#1{#1#1%
+ \ifnum\grmn@dqwarninglevel>\@ne
+ \grmn@dq@warning@obsolete{\dq#1#1}{#1#1#1}%
+ \fi
+ \penalty\@M\-\allowhyphens}
+%</new>
+% \end{macrocode}
+% Dasselbe wird nun f"ur die Kombination |"ck| gemacht,
+% wobei hier die Trennhilfe vor den Buchstaben |ck| wie
+% im |\ck|"~Befehl gesetzt wird.
+% \begin{macrocode}
+%<*new>
+\def\grmn@dqobsolete@ck#1#2{%
+ \ifnum\grmn@dqwarninglevel>\@ne
+ \grmn@dq@warning@obsolete{\dq#1#2}{#1#2}%
+ \fi
+ \penalty\@M\-\allowhyphens#1}
+%</new>
+% \end{macrocode}
+%
+%
+% \subsection{Definition der Double\-quote-Befehle}
+%
+% Jeder definierte Double\-quote-Befehl wird in einem eigenen Makro
+% abgelegt, in dessen Name das Argument, also das einzelne Zeichen
+% nach dem Double\-quote, als Schl"ussel verwendet wird.
+%
+% Das Makro |\grmn@dq@macro| hat zwei Argumente und erzeugt unter
+% Verwendung des zweiten Arguments diesen Makronamen. Das erste
+% Argument, ein einzelnes Token, wird vor diesen Makronamen gesetzt.
+% Diese zuerst etwas komisch anmutende Kombination von Argumenten
+% verhindert, da"s bei der Verwendung dieses Makros Unmengen von
+% \cs{expandafter}-Anweisungen notwendig werden. Der Befehl
+% \cs{string} verhindert, da"s aktive Zeichen als Argumente
+% (z.\,B.\ eine Tilde) Fehler erzeugen.
+% \begin{macrocode}
+\def\grmn@dq@macro#1#2{%
+ \expandafter#1\csname @grmn@@\string #2dq\endcsname}
+% \end{macrocode}
+%
+% Neue Befehlskombinationen k"onnen mit dem Befehl |\def@dqmacro|
+% definiert werden. Argument~1 ist dabei das Zeichen im Befehl,
+% Argument 2 und~3 die Expansionen, die jeweils f"ur Text- und
+% Mathematik"-modus verwendet werden sollen.
+% \begin{macrocode}
+\def\def@dqmacro#1#2#3{%
+ \grmn@dqredefcheck{#1}%
+ \grmn@dq@macro\def{#1}{{#2}{#3}}}
+% \end{macrocode}
+%
+% Ein Synonym f"ur einen schon zuvor definierten Befehl kann man mit
+% |\let@dqmacro| definieren.
+% \begin{macrocode}
+\def\let@dqmacro#1#2{\begingroup
+ \grmn@dqredefcheck{#1}%
+ \edef\x{\endgroup \let
+ \grmn@dq@macro\noexpand{#1}\grmn@dq@macro\noexpand{#2}}%
+ \x}
+% \end{macrocode}
+%
+% Wird ein zuvor definierter Befehl erneut definiert oder
+% umdefiniert, sollte dies zumindest in der Protokolldatei erscheinen,
+% um gemeldete Fehler, die darauf zur"uckzuf"uhren sind, einfacher
+% erkennen zu k"onnen. Hier wird f"ur das Makro |\grmn@dqredefcheck|,
+% das diese Zeile in die Protokolldatei schreibt, ein Dummy definiert,
+% die sp"ater durch die end"-g"ultige Makrodefinition ersetzt wird.
+% \begin{macrocode}
+\def\grmn@dqredefcheck#1{}
+% \end{macrocode}
+%
+%
+% \subsection{Makros f"ur den aktiven Double\-quote}
+%
+% Das Makro |\@active@dq| wird sp"ater an das aktive
+% Double\-quote-Zeichen gebunden. Dieses liest das n"achste Zeichen
+% (mit den zuvor schon genannten Einschr"ankungen), pr"uft ab, ob
+% hier"-f"ur eine Bedeutung definiert wurde und gibt in diesem Falle
+% einen Fehler aus.
+% \begin{macrocode}
+\def\@active@dq#1{%
+ \grmn@dq@macro\ifx{#1}\relax
+ \ifnum\grmn@dqwarninglevel>\z@ \grmn@dq@error{#1}\fi
+ \expandafter\grmn@@normal@dq
+ \else
+ \expandafter\grmn@@active@dq
+ \fi {#1}}
+% \end{macrocode}
+%
+% Leitet der Double\-quote eine hexadezimale Konstante ein, folgt
+% also eine Ziffer oder ein Gro"sbuchstabe im Bereich~\mbox{A--F}, so
+% soll "`nichts"' unternommen werden. Um diese speziellen Befehle zu
+% erkennen, werden den zugeordneten \emph{control sequences} sp"ater
+% die Bedeutung eines |\noexpand| zugeordnet.
+% \changes{2.5b}{95/01/20}{Einziger Bugfix f"ur v2.5a: In
+% \cs{grmn@@active@dq} wurde \cs{grmn@@normal@dq} (expandiert zu
+% zwei einfachen Quotes) statt \cs{grmn@normal@dq} (expandiert zu
+% einem Double\-quote) aufgerufen, so da"s es zu Fehlern bei
+% Hexzahlen kam.}
+% \begin{macrocode}
+\def\grmn@@active@dq#1{%
+ \grmn@dq@macro\ifx{#1}\noexpand
+ \expandafter\grmn@normal@dq
+ \else
+ \expandafter\grmn@@@active@dq
+ \fi {#1}}
+% \end{macrocode}
+%
+% F"ur die F"alle, in denen Anf"uhrungszeichen erzeugt werden sollen,
+% werden zwei weitere Befehle aufgerufen: |\grmn@normal@dq| wird f"ur
+% die hexadezimalen Konstanten verwendet, in denen ein Double\-quote
+% ben"otigt wird. |\grmn@@normal@dq| wird dagegen im Fehlerfalle
+% verwendet und gibt zwei einzelne Quotes aus, um Endlosschleifen bei
+% der Expansion zu vermeiden.
+% \begin{macrocode}
+\def\grmn@@normal@dq#1{``#1}
+\def\grmn@normal@dq#1{\dq #1}
+% \end{macrocode}
+%
+%
+% \subsection{Sch"utzen von zerbrechlichen Bedeutungen}
+%
+% Da die Double\-quote-Befehle auch zu zerbrechlichen Bedeutungen
+% expandieren k"onnen, mu"s ein |\protect| o.\,"a.\ so
+% eingef"ugt werden, da"s einerseits keine nicht expandierbaren Token
+% eingef"ugt werden. Andererseits kann, wie im Falle einer Tilde,
+% auch das Argument selbst expandierbar sein und mu"s zum mehrfachem
+% Lesen und Schreiben entsprechend gesch"utzt werden. (Beispielsweise
+% wird der Inhalt von \LaTeX{}s \texttt{aux}-Datei wieder in die
+% \texttt{toc}-Datei geschrieben, bevor diese end"-g"ultig eingelesen
+% wird.)
+%
+% Aufgrund letzterem folgt jetzt ein Hack mit \textit{category codes},
+% um beim Schreiben auf eine Datei keine zus"atzlichen Zeichen
+% ein"-f"ugen zu m"ussen, wie dies noch in Version~2.4a gemacht
+% wurde.
+%
+% Im folgenden ben"otigt dieser Hack geschweifte Klammern mit
+% \textit{category code} "`other"'. Als tempor"arer Ersatz f"ur
+% die \TeX-Klammern werden die runden Klammern verwendet. Au"serdem
+% wird der in \LaTeXe\ verwendete Trick mit einem Leerzeichen im
+% Makronamen verwendet, um diese speziellen Klammern f"ur "`interne"'
+% Expansionen, wie beim Primitiv |\marks|, wieder korrekt
+% einlesen zu k"onnen.
+% \begin{macrocode}
+\begingroup
+ \catcode`\(=1\lccode`\(=`\{\catcode`\{=12
+ \catcode`\)=2\lccode`\)=`\}\catcode`\}=12
+ \catcode`\ =11\relax% <= do not delete this and the
+\lowercase(\endgroup% <=== following percent characters!
+% \end{macrocode}
+%
+% Zuerst wird das m"oglicherweise expandierbare Argument durch den
+% Befehl |\string| vor Expansion beim Schreiben auf eine Datei
+% oder Erzeugen eines Mark gesch"utzt. Ist das Argument leer, so
+% wird die nachfolgende geschweifte Klammer zu einer Klammer mit
+% \textit{category code} "`other"'. Hierin liegt der Grund, wieso
+% f"ur diese Definitionen die \textit{category codes} der
+% geschweiften Klammern ge"-"andert wurden.
+% \begin{macrocode}
+\def\grmn@@@active@dq#1(%
+\expandafter\grmn@@@@active@dq\expandafter{\string#1})%
+% \end{macrocode}
+%
+% Nachdem das Argument gesch"utzt wurde, wird f"ur die F"alle, in
+% denen |\protect| eine besondere Bedeutung hat, dieses
+% eingef"ugt. Hat das |\protect| "`nur"' die Bedeutung eines
+% |\relax| oder eines leeren Makros, so wird es nicht
+% eingef"ugt, um Kerning und Ligaturbildung nicht zu verhindern.
+%
+% Die Makros \verb*:\active@dq : und \verb*:\dq@prtct :, die ein
+% Leerzeichen im Namen haben, sind die "`internen"' Versionen des
+% aktiven Double\-quote-Makros und eines Makros, das das Argument
+% sch"utzt. Werden diese auf eine Datei geschrieben und wieder
+% eingelesen, so werden beim Lesen die entsprechenden Makros ohne
+% diese Leerzeichen am Ende des Namens expandiert.
+% \begin{macrocode}
+\def\grmn@@@@active@dq(%
+\ifx\protect\relax\else\ifx\protect\empty\else%
+\expandafter\expandafter\expandafter\protect%
+\fi\fi%
+\active@dq \dq@prtct )%
+% \end{macrocode}
+%
+% Zuerst zum einfacheren Makropaar \verb*:\dq@prtct : und
+% |\dq@prtct|, das das nachfolgende Argument beim wiederholten
+% Einlesen von und Schreiben auf eine Datei sch"utzen soll. Beim
+% Wiedereinlesen, bei dem das Makro |\dq@prtct| verwendet wird, sollen
+% alle Zeichen (normalerweise nur Leerzeichen, in seltenen F"allen
+% aber auch die Zeichen des Makros |\dq@prtct|) bis zur "offnenden
+% Klammer ignoriert werden. Anschlie"send soll dieses Argument wieder
+% gesch"utzt werden, wobei gleich noch ein |\dq@prtct| vorangestellt
+% wird, um das Argument bei einem erneuten Schreiben wiederum zu
+% sch"utzen.
+% \begin{macrocode}
+\def\dq@prtct#1#(\@dq@prtct)%
+\def\@dq@prtct#1(\string\dq@prtct{\string#1})%
+% \end{macrocode}
+% Das Makro \verb*:\dq@prtct : k"onnte auf den ersten Blick einfacher
+% definiert werden, da das Argument schon zuvor in
+% |\grmn@@@active@dq| gesch"utzt wurde. Jedoch kann der Fall
+% auftreten, da"s zuerst (mit |\protect|\(=\)|\relax|) expandiert und
+% dann erst auf eine Datei geschrieben wird. Da auch in diesen
+% F"allen zumindest die Zeichenkette |\dq@prtct| in diese Datei
+% geschrieben werden mu"s, wird dies hier einfach getan\ldots
+% \begin{macrocode}
+\def\dq@prtct #1{#2}(\string\dq@prtct{\string#2})%
+% \end{macrocode}
+%
+% Jetzt folgt noch das Makropaar \verb*:\active@dq : und
+% |\active@dq|. F"ur die interne Variante \verb*:\active@dq : dieses
+% Paars mu"s die zuvor eingef"ugte Zeichenkette |\dq@prtct| "uberlesen
+% und die geschweiften Klammern mit \textit{category code} "`other"'
+% durch "`richtige"' Klammern ersetzt werden.
+% \begin{macrocode}
+\def\active@dq #1{#2}(\grmn@active@@dq(#2))%
+% \end{macrocode}
+%
+% Da die ge"anderten \textit{category codes} nicht mehr ben"otigt
+% werden, wird das Argument des |\lowercase|-Befehl beendet und
+% die Gruppe mit diesen "Anderungen geschlossen.
+% \begin{macrocode}
+)%
+% \end{macrocode}
+%
+% Wird |\active@dq| von einer Datei eingelesen, m"ussen alle Token
+% bis zur "offnenden Klammer (z.\,B.\ die Zeichenkette |\dq@prtct|)
+% "uber"-lesen werden. Anschlie"send kann der Doublequote-Mechanismus
+% "`angeschmissen"' werden, als ob ein normales Double\-quote gelesen
+% worden w"are. Wir k"onnten auch |\grm@active@@dq| aufrufen, was
+% jedoch den Nachteil h"atte, da"s nicht erneut Tokens gesch"utzt
+% werden, falls dies notwendig sein m"u"ste.
+% \changes{2.5c}{96/04/21}{In \cs{active@dq}, das nur in einer
+% wiedereingelesen Datei auftauchen sollte, das urspr"ungliche
+% \cs{grmn@active@@dq} durch \cs{@active@dq} ersetzt, um
+% Protection-Mechanismus erneut zu durchlaufen.}
+% \begin{macrocode}
+\def\active@dq#1#{\@active@dq}%
+% \end{macrocode}
+%
+% Zum Schlu"s bleibt nur noch die Auswahl der f"ur diese
+% Double\-quote-Kombination abgelegte Definition abh"angig vom
+% momentanen Modus.
+% \begin{macrocode}
+\def\grmn@active@@dq#1{%
+ \csname grmn@dq\ifmmode second\else first\fi
+ \expandafter\expandafter\expandafter\expandafter
+ \grmn@dq@macro\endcsname{#1}}
+% \end{macrocode}
+% Die Makros |\grmn@dqfirst| und |\grmn@dqsecond|, die hier verwendet
+% werden, sind schon zuvor in Abschnitt~\ref{grmndqfirst} definiert
+% worden.
+%
+%
+% \subsection{Liste der Standard-Doublequote-Befehle}
+%
+% Bisher melden alle |"x|-Befehle einen Fehler, da noch kein
+% einziger Double\-quote-Befehl definiert wurde. Da zumindest die
+% Double\-quote-Kombinationen, die eine hexadezimale Konstante
+% darstellen k"onnten, "`durchgelassen"' werden sollten, werden diese
+% als erste definiert. Wie schon in den zuvor beschriebenen Makros
+% erl"autert, wird den zugeordneten \textit{control sequences} die
+% Bedeutung eines |\noexpand| zugeordnet, um diese spezielle
+% Bedeutung zu markieren.
+% \begin{macrocode}
+\grmn@dq@macro\let{0}=\noexpand
+\let@dqmacro{1}{0}\let@dqmacro{2}{0}\let@dqmacro{3}{0}
+\let@dqmacro{4}{0}\let@dqmacro{5}{0}\let@dqmacro{6}{0}
+\let@dqmacro{7}{0}\let@dqmacro{8}{0}\let@dqmacro{9}{0}
+\let@dqmacro{A}{0}\let@dqmacro{B}{0}\let@dqmacro{C}{0}
+\let@dqmacro{D}{0}\let@dqmacro{E}{0}\let@dqmacro{F}{0}
+% \end{macrocode}
+% Einige der gerade definierten Kombinationen werden sp"ater
+% redefiniert. Darunter fallen die folgenden Gro"sbuchstaben: A, C,
+% E und~F, denen dann die Bedeutungen Umlaut-A,
+% \mbox{CK/K-K}-Trennung, Trema-E und \mbox{FF/FF-F}-Trennung
+% zugewiesen wird. Deshalb kann es zu Problemen mit hexadezimalen
+% Konstanten im Bereich |"A0|--|"FF| kommen.
+%
+% In "alteren Versionen der Style-Option "`german"' konnte man mit
+% |"{}| ein normales Double\-quote erzeugen. Dies sollte aus
+% Kompatibilit"at zu "alteren Texten, die dies ausnutzen, auch
+% weiterhin m"oglich sein, auch wenn dies der Grund f"ur die zuvor
+% beschriebenen Tricks mit den "Anderungen der \textit{category
+% codes} ist.
+% \changes{2.5d}{97/05/01}{Leeres Klammerpaar nach \cs{dq} f"ur
+% \texttt{\protect\dq\symbol{`\{}\symbol{`\}}} entfernt.}
+% \changes{2.5d}{97/05/01}{Leeres Klammerpaar nach \cs{dq} f"ur
+% \texttt{\protect\dq\symbol{`\{}\symbol{`\}}} wieder eingef"ugt,
+% da es dadurch mehrfach gelesen und geschrieben werden kann.}
+% \begin{macrocode}
+\def@dqmacro{}{\dq{}}{\dq{}}
+% \end{macrocode}
+%
+% Die Definition der Kombinationen, die Umlaute erzeugen, ist
+% entsprechend einfach,
+% \changes{2.5d}{97/04/12}{"Uberbleibsel \cs{@UMLAUT} aus
+% Vor-NFSS2-Zeiten durch \cs{\protect\dq} ersetzt.}
+% \begin{macrocode}
+\def@dqmacro{a}{\"a}{\@MATHUMLAUT a}
+\def@dqmacro{o}{\"o}{\@MATHUMLAUT o}
+\def@dqmacro{u}{\"u}{\@MATHUMLAUT u}
+\def@dqmacro{A}{\"A}{\@MATHUMLAUT A}
+\def@dqmacro{O}{\"O}{\@MATHUMLAUT O}
+\def@dqmacro{U}{\"U}{\@MATHUMLAUT U}
+% \end{macrocode}
+% genauso wie diejenige f"ur den Buchstaben~\ss. Leider verhindert
+% das leere Klammerpaar nach dem Token |\ss| in dieser Definition, die
+% f"ur Plain-\TeX\ notwendig ist, da"s nach dem~\ss\ Ligaturen
+% gebildet werden oder Kerning eingef"ugt werden kann. Dies soll in
+% der n"achsten Version verbessert werden.
+% \changes{2.5d}{97/04/13}{\cs{@SS} in \cs{@MATHss} umbenannt.}
+% \changes{2.5d}{97/04/13}{F"ur \LaTeXe{} werden die leeren
+% Klammerpaare nach \cs{ss} und \cs{@MATHss} entfernt.}
+% \changes{2.5d}{97/04/13}{F"ur \texttt{\symbol{`\"}S} wird
+% \cs{SS} verwendet, das in \LaTeXe{} bereits definiert ist
+% (Hinweis von Jaakob Kind
+% \texttt{j.kind@stochastik.rwth-aachen.de}, August 1996).}
+% \changes{2.5d}{97/05/01}{Expansion von \cs{@MATHss} ist nach
+% Einf"ugung eines \cs{mathord} ok, daher leeres Klammerpaar
+% auch f"ur \LaTeX~2.09 und Plain-\TeX{} entfernt.}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
+ \def@dqmacro{s}{\ss{}}{\@MATHss}
+\else
+ \def@dqmacro{s}{\ss}{\@MATHss}
+\fi
+\def@dqmacro{S}{\SS}{\SS}
+\let@dqmacro{z}{s}
+\def@dqmacro{Z}{SZ}{SZ}
+% \end{macrocode}
+% Spezielle Kombinationen f"ur Tremata sind, bis auf die Ausnahme
+% des~"`i"' ohne \mbox{I-Punkt}, ebenso einfach\ldots
+% \begin{macrocode}
+\def@dqmacro{e}{\highumlaut e}{\@MATHUMLAUT e}
+\def@dqmacro{E}{\highumlaut E}{\@MATHUMLAUT E}
+\def@dqmacro{i}{\highumlaut{\i}}{\@MATHUMLAUT\imath}
+\def@dqmacro{I}{\highumlaut I}{\@MATHUMLAUT I}
+% \end{macrocode}
+% \ldots\,wie die Definitionen f"ur die Anf"uhrungszeichen. Die hier
+% eigentlich f"ur Plain-\TeX\ notwendigen leeren Klammerpaare, die
+% Kerning und Ligaturbildung verhindern, konnten entfernt werden,
+% nachdem sichergestellt ist, da"s nach vollst"andiger Expansion der
+% Makros am Ende keine \textit{control sequence} verbleibt.
+% \changes{2.5d}{97/04/13}{F"ur \LaTeXe{} werden die leeren
+% Klammerpaare nach \cs{glqq}, \cs{grqq}, \cs{flqq} und
+% \cs{frqq} entfernt.}
+% \changes{2.5d}{97/05/01}{Leere Klammernpaare ebenso f"ur
+% \LaTeX~2.09 und Plain-\TeX{} entfernen, nachdem daf"ur gesorgt
+% wurde, da"s bei vollst"andiger Expansion am Ende keine cs
+% verbleibt.}
+% \begin{macrocode}
+\def@dqmacro{`}{\glqq}{\glqq}
+\def@dqmacro{'}{\grqq}{\grqq}
+\def@dqmacro{<}{\flqq}{\flqq}
+\def@dqmacro{>}{\frqq}{\frqq}
+% \end{macrocode}
+%
+% Bei den Definitionen der Trennhilfen mu"s nur auf die
+% Einschr"ankungen des Mathematik"-modus geachtet werden.
+% \begin{macrocode}
+\def@dqmacro{-}{\penalty\@M\-\allowhyphens}%
+ {\penalty\@M\-\allowhyphens}
+\def@dqmacro{|}{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}
+\def@dqmacro{"}{\hskip\z@skip}{\hskip\z@skip}
+% \end{macrocode}
+% \begin{macrocode}
+\def@dqmacro{~}{\leavevmode\hbox{-}}{-}
+\def@dqmacro{=}{\penalty\@M-\hskip\z@skip}%
+ {\penalty\@M-\hskip\z@skip}
+% \end{macrocode}
+%
+% Die restlichen Standard-Doublequote-Befehle werden je nach alter und
+% neuer Rechtschreibung verschieden definiert.
+%
+% Mit "`german"' sollen
+% Dreifachkonsonanten nur im Fall der Silbentrennung erzeugt werden:
+% Um die Definitionen f"ur die Ausnahmen der Silbentrennung zu
+% vereinfachen, wird das Makro |\grmn@dqdisc| verwendet, das die
+% gemeinsamen Code-Teile enth"alt.
+% \begin{macrocode}
+%<*old>
+\def\grmn@dqdisc#1#2{\penalty\@M
+ \ifnum\grmn@dqwarninglevel>\@ne \grmn@dq@warning{#1}\fi
+ \discretionary{#2-}{}{#1}\allowhyphens}
+% \end{macrocode}
+% Auch bei diesen Definitionen mu"s der Mathematikmodus separat
+% gehandhabt werden. Wie man hier bemerken sollte, liest das
+% Double\-quote-Makro nur das n"achste Zeichen und pr"uft nicht nach,
+% ob nach der Kombination~|"c| auch ein~\texttt{k} folgt. Dies
+% ist bis auf die Kombination~|"f| f"ur die meisten Schriften
+% nicht notwendig, da in diesen keine Ligaturen definiert sind.
+% \begin{macrocode}
+\def@dqmacro{c}{\grmn@dqdisc ck}{c}
+\def@dqmacro{C}{\grmn@dqdisc CK}{C}
+% \end{macrocode}
+% \begin{macrocode}
+\def@dqmacro{l}{\grmn@dqdisc l{ll}}{l}
+\def@dqmacro{L}{\grmn@dqdisc L{LL}}{L}
+\def@dqmacro{m}{\grmn@dqdisc m{mm}}{m}
+\def@dqmacro{M}{\grmn@dqdisc M{MM}}{M}
+\def@dqmacro{n}{\grmn@dqdisc n{nn}}{n}
+\def@dqmacro{N}{\grmn@dqdisc N{NN}}{N}
+\def@dqmacro{p}{\grmn@dqdisc p{pp}}{p}
+\def@dqmacro{P}{\grmn@dqdisc P{PP}}{P}
+\def@dqmacro{r}{\grmn@dqdisc r{rr}}{r}
+\def@dqmacro{R}{\grmn@dqdisc R{RR}}{R}
+\def@dqmacro{t}{\grmn@dqdisc t{tt}}{t}
+\def@dqmacro{T}{\grmn@dqdisc T{TT}}{T}
+\def@dqmacro{F}{\grmn@dqdisc F{FF}}{F}
+% \end{macrocode}
+%
+% \changes{2.5c}{96/04/21}{Bei \texttt{{\protect\dq}ff} sollte
+% ff-Ligatur nicht unterdr"uckt werden (Bugfix von Joachim Schrod,
+% ehemals f"ur Version 2.4, jedoch hier mit dem Trick des
+% initialisierten \cs{grmn@dqnextff} erg"anzt).}
+% \changes{2.5d}{97/04/13}{Fehler f"ur \texttt{{\protect\dq}f}, falls
+% danach kein weiteres~f folgt, beseitigt (Hinweis von Carsten
+% J"ager \texttt{jaeger@Physiology.RWTH-Aachen.DE}, M"arz 1997).}
+%
+% In den meisten Schriften ist f"ur \texttt{ff} eine Ligatur
+% definiert, die auch in Wortfugen bei Ausfall des
+% dritten~\glq f\grq{} verwendet werden sollte. Die hier verwendeten
+% Makros sind zerbrechlich (\emph{fragile}, jedoch mit einer nicht
+% ganz sauberen Abhilfe, siehe unten), was aber nur in
+% nicht-\LaTeX-basierten Formaten zu Problemen f"uhren wird. F"ur
+% diese Formate mu"s |\protect| in Primitiven wie |\edef|, |\write|,
+% |\mark|, etc.\ entsprechend definiert werden!
+% \begin{macrocode}
+\def@dqmacro{f}{\grmn@dqdiscff}{f}
+\def\grmn@dqdiscff{\penalty\@M
+ \ifnum\grmn@dqwarninglevel>\@ne \grmn@dq@warning f\fi
+ \afterassignment\grmn@dqinsertff \let\grmn@dqnextff= }
+\def\grmn@dqinsertff{%
+ \if f\grmn@dqnextff
+ \expandafter\grmn@dqfirst\else\expandafter\grmn@dqsecond\fi
+ {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\grmn@dqnextff}}
+% \end{macrocode}
+%
+% F"ur die zuvor schon erw"ahnten F"alle, in denen |\protect| nicht
+% entsprechend definiert wird, initialisieren wir |\grmn@dqnextff| auf
+% den typischen Wert~\glq f\grq. Da die Makros f"ur die ff-Ligatur
+% entsprechend definiert sind, vermeiden wir, wenn auch etwas
+% kryptisch, in den Nur-Expansions"-f"allen eine Fehlermeldung und
+% erhalten meist auch eine ff-Ligatur. Dazu haben wir au"serdem noch
+% im Makro |\grmn@dqinsertff| ein |\relax| f"ur |\afterassignment| in
+% den nur-expandierten Makrotext vor das |\discretionary| eingef"ugt.
+% \begin{macrocode}
+\let\grmn@dqnextff=f
+%</old>
+% \end{macrocode}
+%
+% Mit "`ngerman"' sollen die Makros dasjenige Ergebnis erzugen,
+% das offenbar gemeint ist, aber es soll gleichzeitig eine Warnung ins
+% Protokoll geschrieben werden:
+% \changes{2.5e (beta 1)}{98/05/04}{Die Befehle f"ur Dreifachkonsonanten
+% werden in "`ngerman"' sinnvoll definiert.}
+% \begin{macrocode}
+%<*new>
+\def@dqmacro{c}{\grmn@dqobsolete@ck ck}{c}
+\def@dqmacro{C}{\grmn@dqobsolete@ck CK}{C}
+\def@dqmacro{l}{\grmn@dqobsolete@three l}{l}
+\def@dqmacro{L}{\grmn@dqobsolete@three L}{L}
+\def@dqmacro{m}{\grmn@dqobsolete@three m}{m}
+\def@dqmacro{M}{\grmn@dqobsolete@three M}{M}
+\def@dqmacro{n}{\grmn@dqobsolete@three n}{n}
+\def@dqmacro{N}{\grmn@dqobsolete@three N}{N}
+\def@dqmacro{p}{\grmn@dqobsolete@three p}{p}
+\def@dqmacro{P}{\grmn@dqobsolete@three P}{P}
+\def@dqmacro{r}{\grmn@dqobsolete@three r}{r}
+\def@dqmacro{R}{\grmn@dqobsolete@three R}{R}
+\def@dqmacro{t}{\grmn@dqobsolete@three t}{t}
+\def@dqmacro{T}{\grmn@dqobsolete@three T}{T}
+\def@dqmacro{F}{\grmn@dqobsolete@three F}{F}
+\def@dqmacro{f}{\grmn@dqobsolete@three f}{f}
+%</new>
+% \end{macrocode}
+%
+%
+% \subsection{Definition der Double\-quote-Befehle (cont.)}
+%
+% Wie schon bei der vorl"aufigen Definition des Makros
+% |\grmn@dqredefcheck| er"-w"ahnt, sollten alle weiteren
+% Definitionen von Double\-quote-Befehlen zumindest in der
+% Protokolldatei erscheinen. Dann k"onnen von Benutzer gemeldete
+% Fehler, wenn auch die Protokolldatei mitgeschickt wird, schneller
+% eingegrenzt werden. Deshalb wird dieses Makro hier so definiert,
+% da"s es bei jeder Verwendung von |\def@dqmacro| und |\let@dqmacro|
+% eine Zeile in die Protokolldatei schreibt -- mit Informationen,
+% welche Kombination definiert wird und ob eine alte Definition
+% "uber"-schrieben wird.
+% \changes{2.5d}{97/05/01}{\cs{immediate}\cs{write}\cs{m@ne} durch
+% \cs{wlog} ersetzt.}
+% \begin{macrocode}
+\def\grmn@dqredefcheck#1{%
+%<old> \wlog{german: \grmn@dq@macro\ifx{#1}\relax \else re\fi
+%<new> \wlog{ngerman: \grmn@dq@macro\ifx{#1}\relax \else re\fi
+ defining dq-command for `\string#1'\on@line.}}%
+% \end{macrocode}
+%
+%
+% \section{Unterst"utzung f"ur Dokumente in verschiedenen Sprachen}
+%
+% Die Style-Option "`german"' unterst"utzt die Einbindung von
+% Textteilen in deutscher Sprache in Dokumente, die auch in englisch
+% oder franz"osisch geschrieben sind. Die folgenden Befehle sind
+% dagegen nur bedingt f"ur "`mehrsprachige"' Texte geeignet, in denen
+% zwei oder mehr Sprachen gleichrangig gesetzt werden.
+%
+%
+% \subsection{Datumsangaben}
+% \begin{macrocode}
+%<old>\def\month@german{\ifcase\month \or
+%<new>\def\month@ngerman{\ifcase\month \or
+ Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
+ Juli\or August\or September\or Oktober\or November\or Dezember\fi}
+%<old>\def\dategerman{\def\today{\number\day.~\month@german
+%<new>\def\datengerman{\def\today{\number\day.~\month@ngerman
+ \space\number\year}}
+%<old>\def\dateaustrian{\def\today{\number\day.~\ifnum 1=\month
+%<new>\def\datenaustrian{\def\today{\number\day.~\ifnum 1=\month
+%<old> J\"anner\else \month@german\fi \space\number\year}}
+%<new> J\"anner\else \month@ngerman\fi \space\number\year}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\month@english{\ifcase\month \or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi}
+\def\dateUSenglish{\def\today{\month@english
+ \space\number\day, \number\year}}
+\def\dateenglish{\def\today{\number\day \ifcase\day \or
+ st\or nd\or rd\or th\or th\or th\or th\or th\or th\or th\or% 1..10
+ th\or th\or th\or th\or th\or th\or th\or th\or th\or th\or% 11..20
+ st\or nd\or rd\or th\or th\or th\or th\or th\or th\or th\or% 21..30
+ st\fi
+ ~\month@english \space\number\year}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\datefrench{\def\today{\number\day \ifnum1=\day \/$^{\rm er}$\fi
+ \space\ifcase\month \or
+ janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
+ juillet\or ao\^ut\or septembre\or
+ octobre\or novembre\or d\'ecembre\fi
+ \space\number\year}}
+% \end{macrocode}
+%
+% \subsection{Textteile in "Uberschriften, etc.}
+%
+% Ab der \LaTeX~2.09-Release vom Dezember~1991 sind alle konstanten
+% Textteile in den Standard-Styles und Style-Optionen durch Makros
+% |\...name| ersetzt, so da"s man mit einigen Einschr"ankungen
+% durch Redefinition dieser Makros eine Sprachanpassung erreichen
+% kann. Will man diese Anpassung auch bei eigenen Styles und
+% Style-Optionen erreichen, so sollte man die entsprechenden
+% Textteile durch die entsprechenden Makros ersetzen, wobei man
+% eine Default-Definition dieser Makros mitliefern sollte.
+%
+% Als Beispiel mu"s die Definition
+%\begin{verbatim}
+%\def\tableofcontents{\section*{Contents%
+% \@mkboth{CONTENTS}{CONTENTS}}%
+% \@starttoc{toc}}
+%\end{verbatim}
+% die in den alten \LaTeX-Releases vor Dezember~1991 in
+% \texttt{article.sty} zu finden ist, durch
+%\begin{verbatim}
+%\def\contentsname{Contents}
+%\def\tableofcontents{\section*{\contentsname
+% \@mkboth{\uppercase{\contentsname}}%
+% {\uppercase{\contentsname}}}%
+% \@starttoc{toc}}
+%\end{verbatim}
+% ersetzt werden, um die englische "Uberschrift "`Contents"' f"ur
+% das Inhaltsverzeichnis entsprechend anpassen zu k"onnen.
+%
+% F"ur die Standard-Klassen und Pakete von \LaTeXe\ wurde dies von
+% Anfang an gemacht, so da"s hier keine "Anderungen notwendig sind.
+%
+% Die folgenden Makros |\captions|\meta{Sprache} definieren alle in
+% den \LaTeX-Standard-Klassen und \mbox{-Paketen} verwendeten
+% Textteile.
+% \begin{macrocode}
+%<old>\def\captionsgerman{%
+%<new>\def\captionsngerman{%
+ \def\prefacename{Vorwort}%
+ \def\refname{Literatur}%
+ \def\abstractname{Zusammenfassung}%
+ \def\bibname{Literaturverzeichnis}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Anhang}%
+ \def\contentsname{Inhaltsverzeichnis}% % oder nur: Inhalt
+ \def\listfigurename{Abbildungsverzeichnis}%
+ \def\listtablename{Tabellenverzeichnis}%
+ \def\indexname{Index}%
+ \def\figurename{Abbildung}%
+ \def\tablename{Tabelle}% % oder: Tafel
+ \def\partname{Teil}%
+ \def\enclname{Anlage(n)}% % oder: Beilage(n)
+ \def\ccname{Verteiler}% % oder: Kopien an
+ \def\headtoname{An}%
+ \def\pagename{Seite}%
+ \def\seename{siehe}%
+ \def\alsoname{siehe auch}}
+%<old>\let\captionsaustrian=\captionsgerman
+%<new>\let\captionsnaustrian=\captionsngerman
+% \end{macrocode}
+% \begin{macrocode}
+\def\captionsenglish{%
+ \def\prefacename{Preface}%
+ \def\refname{References}%
+ \def\abstractname{Abstract}%
+ \def\bibname{Bibliography}%
+ \def\chaptername{Chapter}%
+ \def\appendixname{Appendix}%
+ \def\contentsname{Contents}%
+ \def\listfigurename{List of Figures}%
+ \def\listtablename{List of Tables}%
+ \def\indexname{Index}%
+ \def\figurename{Figure}%
+ \def\tablename{Table}%
+ \def\partname{Part}%
+ \def\enclname{encl}%
+ \def\ccname{cc}%
+ \def\headtoname{To}%
+ \def\pagename{Page}%
+ \def\seename{see}%
+ \def\alsoname{see also}}
+\let\captionsUSenglish=\captionsenglish
+% \end{macrocode}
+% \begin{macrocode}
+\def\captionsfrench{%
+ \def\prefacename{Pr\'eface}%
+ \def\refname{R\'ef\'erences}%
+ \def\abstractname{R\'esum\'e}%
+ \def\bibname{Bibliographie}%
+ \def\chaptername{Chapitre}%
+ \def\appendixname{Annexe}%
+ \def\contentsname{Table des mati\`eres}%
+ \def\listfigurename{Liste des figures}%
+ \def\listtablename{Liste des tableaux}%
+ \def\indexname{Index}%
+ \def\figurename{Figure}%
+ \def\tablename{Tableau}%
+ \def\partname{Partie}%
+ \def\enclname{P.~J.}%
+ \def\ccname{Copie \`a}%
+ \def\headtoname{A}%
+ \def\pagename{Page}%
+ \def\seename{voir}%
+ \def\alsoname{voir aussi}}%
+% \end{macrocode}
+%
+% \subsection{Weitere sprachabh"angige Parameter}
+%
+% Die Sprache eines Dokuments bestimmt neben den Datumsangaben und
+% den Textteilen in "Uberschriften auch noch weitere Parameter, wie
+% z.\,B.\ ob nach einem Satzzeichen, wie Punkten und Kommas, ein
+% gr"o"serer Wortzwischenraum eingef"ugt werden soll. Au"serdem
+% sollten auch die den Trennmustern zugeordneten Parameter
+% \texttt{\string\left\-hyphen\-min} und
+% \texttt{\string\right\-hyphen\-min} auf entsprechende Werte gesetzt
+% werden.
+%
+% Nach der neuen Rechtschreibung w"are |\lefthyphenmin=1| zul"assig.
+% Dies wird allerdings von den Trennmustern \texttt{gnhyph01.tex}
+% nicht unterst"utzt.
+%
+% \changes{2.5c}{96/04/28}{\cs{(no)extras(US)english} als
+% expandierbare Makros statt als \cs{relax} definiert, damit
+% k"onnen diese Makros einfacher erg"anzt werden.}
+% \begin{macrocode}
+\def\extrasUSenglish{}
+\let\noextrasUSenglish=\extrasUSenglish
+\let\extrasenglish=\extrasUSenglish
+\let\noextrasenglish=\extrasenglish
+% \end{macrocode}
+% \changes{2.5c}{96/02/26}{Explizite Zuweisung an \cs{uchyph}
+% hinzugef"ugt (found by R. Wonneberger, David M. Jones,
+% 93/02/11).}
+% \begin{macrocode}
+%<old>\def\extrasgerman{\frenchspacing \uchyph\@ne
+%<new>\def\extrasngerman{\frenchspacing \uchyph\@ne
+ \lefthyphenmin\tw@ \righthyphenmin\tw@}
+%<old>\def\noextrasgerman{%
+%<new>\def\noextrasngerman{%
+ \ifnum\sfcode`\.=\@m \else \noexpand\nonfrenchspacing \fi
+ \uchyph\the\uchyph\relax
+ \lefthyphenmin\the\lefthyphenmin
+ \righthyphenmin\the\righthyphenmin}
+%<old>\let\extrasaustrian=\extrasgerman
+%<new>\let\extrasnaustrian=\extrasngerman
+%<old>\let\noextrasaustrian=\noextrasgerman
+%<new>\let\noextrasnaustrian=\noextrasngerman
+% \end{macrocode}
+% \begin{macrocode}
+\def\extrasfrench{\frenchspacing}
+\def\noextrasfrench{%
+ \ifnum\sfcode`\.=\@m \else \noexpand\nonfrenchspacing \fi}
+% \end{macrocode}
+%
+%
+% \subsection{Default-Werte f"ur Trennmusterwerte deklarieren}
+%
+% Jeder Sprache und deren zugeordnetem Satz von Trennmustern sollte
+% eine Nummer f"ur den \TeX-Parameter |\language| beim Erzeugen
+% der Formatdatei zugewiesen worden sein. Diese Nummer ist f"ur
+% jede Sprache in der \textit{control sequence}
+% |\l@|\(\langle\)Sprache\(\rangle\) abgespeichert.
+%
+% Die Style-Option "`german"' verwendet die Sprachen
+% \texttt{USenglish}, \texttt{english}, \texttt{german},
+% \texttt{austrian} und \texttt{french}. Sind f"ur diese Sprachen
+% keine Nummern abgespeichert worden, werden diese hier als Dialekt
+% einer schon definierten Sprache oder als~\(255\) definiert, so da"s
+% nicht getrennt wird.
+%
+% Ist f"ur \texttt{german} bzw.\ dessen "`Dialekt"' \texttt{austrian}
+% kein Wert definiert, wird eine entsprechende Meldung auf dem
+% Benutzerterminal ausgegeben. F"ur die anderen Sprache erscheint
+% diese Meldung nur in der Protokolldatei.
+%
+% "`german"' und "`ngerman"' unterscheiden sich
+% durch die Bezeichner f"ur die jeweils unterst"utzten die Sprachen:
+% F"ur die neue Rechtschreibung
+% werden \texttt{ngerman} und \texttt{naustrian} an Stelle von
+% \texttt{german} und \texttt{austrian} verwendet.
+%
+%
+% \begin{macrocode}
+\@ifundefined{l@USenglish}{%
+ \@ifundefined{l@english}{\chardef\l@USenglish=255 }%
+ {\chardef\l@USenglish=\l@english}%
+%<old> \wlog{german -- \string\language\space number for USenglish %
+%<new> \wlog{ngerman -- \string\language\space number for USenglish %
+ undefined, default \number\l@USenglish\space used.}%
+}{}
+% \end{macrocode}
+% \begin{macrocode}
+\@ifundefined{l@english}{%
+ \chardef\l@english=\l@USenglish
+%<old> \wlog{german -- \string\language\space number for UKenglish %
+%<new> \wlog{ngerman -- \string\language\space number for UKenglish %
+ undefined, default \number\l@english\space used.}%
+}{}
+% \end{macrocode}
+% \begin{macrocode}
+%<*old>
+\@ifundefined{l@german}{%
+ \@ifundefined{l@austrian}{%
+ \chardef\l@german=255 %
+ \message{german -- \string\language\space number for German %
+ undefined, default \number\l@german\space used,}%
+ \message{german -- Please read \string"gerdoc.tex\string" how %
+ to install hyphenation patterns.}%
+ }{%
+ \chardef\l@german=\l@austrian
+ \wlog{german -- \string\language\space number for German %
+ undefined, default \number\l@german\space used.}%
+ }%
+}{}
+%</old>
+%<*new>
+\@ifundefined{l@ngerman}{%
+ \@ifundefined{l@naustrian}{%
+ \chardef\l@ngerman=255 %
+ \message{ngerman -- \string\language\space number for ngerman %
+ undefined, default \number\l@ngerman\space used,}%
+ \message{ngerman -- Please read \string"gerdoc.tex\string" how %
+ to install hyphenation patterns.}%
+ }{%
+ \chardef\l@ngerman=\l@naustrian
+ \wlog{ngerman -- \string\language\space number for ngerman %
+ undefined, default \number\l@ngerman\space used.}%
+ }%
+}{}
+%</new>
+% \end{macrocode}
+% \begin{macrocode}
+%<*old>
+\@ifundefined{l@austrian}{%
+ \chardef\l@austrian=\l@german
+ \wlog{german -- \string\language\space number for Austrian %
+ undefined, default \number\l@austrian\space used.}%
+}{}
+%</old>
+%<*new>
+\@ifundefined{l@naustrian}{%
+ \chardef\l@naustrian=\l@ngerman
+ \wlog{ngerman -- \string\language\space number for naustrian %
+ undefined, default \number\l@naustrian\space used.}%
+}{}
+%</new>
+% \end{macrocode}
+% \begin{macrocode}
+\@ifundefined{l@french}{%
+ \chardef\l@french=255
+%<old> \wlog{german -- \string\language\space number for French %
+%<new> \wlog{ngerman -- \string\language\space number for French %
+ undefined, default \number\l@french\space used.}%
+}{}
+% \end{macrocode}
+%
+%
+% \subsection{Wechsel der Trennmuster, Datumsangabe und
+% "Uberschriften}
+%
+% Ein Wechsel der Sprache mit |\selectlanguage{|\meta{Sprache}|}|
+% schaltet einfach die Datumsangabe, Textteile, Trennmuster und
+% andere Parameter f"ur die angegebene \meta{Sprache} um.
+%
+% F"ur die n"achste Version ist endlich eine Anpassung an das
+% Babel-System geplant. Au"serdem fehlen momentan noch
+% Standard-Makros, um die aktuelle Sprache abzufragen und abh"angig
+% von dieser entsprechend reagieren zu k"onnen.
+%
+% Das Makro |\originalTeX| enth"alt alle Anweisungen, um die
+% Parameter"-anpassungen r"uck"-g"angig machen zu k"onnen, die man
+% beim Umschalten auf die momentane Sprache ge"-"andert hat. Dieses
+% Makro mu"s immer expandierbar sein; darf also nicht als |\relax|
+% definiert werden. Zu Beginn sind keine Anweisungen notwendig.
+% (Anmerkung: Wegen Problemen mit dem Paket \texttt{bibgerm}, das
+% einige der internen Makros von "`german"' umdefiniert, wurde der
+% Name des Makros ge"andert -- dies sollte in einer endg"ultigen
+% L"osung wieder verbessert werden, um beispielsweise kompatibel zu
+% Babel zu werden.)
+% \changes{2.5c}{96/02/26}{\cs{grmn@originalTeX} mu"s
+% \cs{original@TeX} hei"sen, damit einige andere Pakete, wie
+% `bibgerm' kompatibel bleiben. `bibgerm' sollte endlich verbessert
+% und "`sauberer"' programmiert werden (die zus"atzlichen Strings
+% kann man auch in die Makros \cs{extras\ldots} einf"ugen).}
+% \changes{2.5c}{96/04/21}{\cs{original@TeX} hei"st in Babel
+% \cs{originalTeX}, das in `german.sty' eine andere Bedeutung
+% hat (TODO).
+% Da ich in \cs{selectlanguage} den Leerzeichen-Trick verwende
+% (um `bibgerman' zu "`hintergehen"'), hei"st \cs{original@TeX}
+% bis zur endg"ultigen L"osung wieder \cs{grmn@originalTeX}.}
+% \begin{macrocode}
+\def\grmn@originalTeX{}
+% \end{macrocode}
+%
+% \changes{2.5c}{96/04/21}{\cs{languagename} neu mit Babels
+% Funktionalit"at eingef"uhrt, Hinweis auf m"ogliche other-Tokens.}
+%
+% Das Makro |\languagename| enth"alt den Namen der momentan
+% eingeschalteten Sprache. Der Name ist eine Folge von
+% Character-Tokens, die entweder einen |\catcode| von 11 (letter) oder
+% 12 (other) besitzen k"onnen. Die Ursache f"ur Other-Tokens ist das
+% Primitiv |\string|, das in |\selectlanguage| verwendet wird, um aus
+% einer als Argument angegebenen \textit{control sequence} das
+% Escape-Zeichen abzuspalten. (Die Dokumentation von Babel~3.5 gibt
+% einen Test der aktuellen Sprache mit |\languagename| an, der wegen
+% der Other-Tokens nicht immer funktionieren wird!)
+%
+% \begin{macrocode}
+\def\languagename{}
+% \end{macrocode}
+%
+% Mit dem Makro |\selectlanguage| wird auf die Sprache umgeschaltet.
+% Dabei werden, nachdem abgefragt wurde, ob die Sprache definiert
+% wurde, zuerst mit |\originalTeX| alle "Anderungen r"uck"-g"angig
+% gemacht, bevor das Datum, die "Uberschriften, sonstige Parameter
+% und die Trennmuster umgeschalten werden.
+% (Anmerkung: |\originalTeX| hei"st im Moment noch
+% |\grmn@originalTeX|, dies mu"s aber noch in der n"achsten Version
+% ge"andert werden, um kompatibler zu Babel zu sein.)
+%
+% \changes{2.5c}{96/04/21}{Der Trick aus \LaTeXe{} mit dem
+% abschlie"senden Leerzeichen im Namen des zu sch"utzenden Makros
+% wird auch f"ur \cs{selectlanguage } verwendet. Da damit die
+% Neudefinition im Paket `bibgerm' wirkungslos wird, verwende ich
+% hier einen tempor"aren Patch (in Form des \cs{bibs\ldots}) f"ur
+% dieses Paket. Besser w"are es aber, wenn `bibgerm' die
+% zus"atzlichen Definitionen an \cs{extras\ldots} anh"angen w"urde.}
+% \begin{macrocode}
+\expandafter\def\csname selectlanguage \endcsname#1{\relax
+ \expandafter\ifx\csname l@#1\endcsname\relax
+ \errhelp{Your command will be ignored, type <return> to proceed}%
+ \errmessage{You haven't defined the language #1 yet}%
+ \else
+ \grmn@originalTeX
+ \edef\languagename{#1}%
+ \edef\grmn@originalTeX{\csname noextras#1\endcsname
+ \def\noexpand\grmn@originalTeX{}}%
+ \csname date#1\endcsname
+ \csname captions#1\endcsname
+ \csname extras#1\endcsname\relax
+ % Diese Zeile ist fuer `bibgerm' ...
+ \csname bibs#1\endcsname
+ % ... sie wird in spaeteren `german.sty'-Versionen nicht
+ % mehr vorhanden sein. Also nicht darauf verlassen!
+ \language \csname l@#1\endcsname\relax
+ \fi}
+% \end{macrocode}
+%
+% Das Makro |\selectlanguage| ist \emph{fragile}. Deshalb wird es
+% implizit mit einem |\protect| gesch"utzt. Da dadurch so oder so
+% zwei Makros notwendig sind, k"onnen wir in dieses zweite Makro
+% gleich noch weitere Funktionalit"at stecken (die aber vollst"andig
+% expandierbar sein mu"s!):
+% In "alteren Versionen dieser Style-Option mu"ste man die Sprache als
+% \textit{control sequence}, z.\,B.\ |\german|, eingeben, w"ahrend man
+% in den aktuellen Versionen nur noch den Namen, also |german|,
+% verwenden sollte. Damit beides aus Kompatibilit"ats"-gr"unden
+% m"oglich ist, wird hier einfach die \textit{control sequence}
+% umgewandelt und das Escape-Zeichen, normalerweise ein Back\-slash,
+% mit einem kleinen Kniff entfernt.
+% \changes{2.5c}{96/04/21}{Der Trick aus \LaTeXe{} mit dem
+% abschlie"senden Leerzeichen im Namen des zu sch"utzenden Makros
+% wird auch f"ur \cs{selectlanguage} verwendet.}
+% \begin{macrocode}
+\begingroup\catcode`\ =11\relax% <= do not delete this and the
+\toks0={\endgroup% <=== following percent characters!
+\def\selectlanguage#1{\protect\selectlanguage {%
+\ifnum\escapechar=\expandafter`\string#1\empty%
+\else\string#1\empty\fi}}}%
+\the\toks0\relax%
+% \end{macrocode}
+%
+%
+% In "alteren \texttt{.aux}-Dateien kann immer noch die alte interne
+% Form \cs{p@select\-language} auftauchen. Daher wird diese hier
+% nochmals definiert, um diese eigentlich unn"otigen Fehlermeldungen
+% zu vermeiden. Au"serdem fr"agt \texttt{bibgerm.sty} die Existenz
+% dieses Makros ab und, falls es nicht existiert, definiert
+% \texttt{bibgerm.sty} ein eigenes Makro \cs{select\-language} mit der
+% alten Definition aus \texttt{german.sty} Version~2.3. Dies mu"s
+% auf alle F"alle vermieden werden!
+%
+% \changes{2.5c}{96/04/23}{\cs{p@selectlanguage} aus Kompatibilit"at
+% mit v2.5b und noch "alteren Versionen wieder eingef"uhrt.}
+%
+% \begin{macrocode}
+\def\p@selectlanguage{\selectlanguage}
+% \end{macrocode}
+%
+%
+% \changes{2.5c}{96/04/21}{\cs{iflanguage} neu eingef"uhrt.}
+% \changes{2.5e (beta 1)}{98/05/04}{\cs{iflanguage} ge"andert.}
+%
+% Das Makro |\iflanguage| kann dazu benutzt werden, abh"angig von
+% der aktuellen Sprache Aktionen auszuf"uhren. Das Makro hat drei
+% Argumente. Das erste Argument ist die Sprache in Form einer
+% Folge von Character-Tokens, das zweite und dritte Argument enth"alt
+% die Aktionen, falls dies die aktuelle Sprache ist bzw.\ falls nicht.
+%
+% Mit dem folgenden |\iflanguage| kann man in den "`then"'- und
+% "`else"'"~Argumenten auch Makros verwenden, deren Parameter
+% hinter dem |\iflanguage|-Befehl folgen. Diese Implementation,
+% abgeschaut von |\@ifundefined|, erm"oglicht
+% Konstrukte wie |Sto\iflanguage{german}{"}{f}ffetzen|.
+%
+% |\iflanguage| kann sich in sp"ateren Version noch geringf"ugig
+% "andern, falls dies im Babel-Paket geschehen sollte.
+%
+% \begin{macrocode}
+\def\iflanguage#1{%
+ \ifx\csname l@#1\endcsname\relax
+ \expandafter\grmn@dqsecond
+ \else \ifnum\csname l@#1\endcsname=\language
+ \expandafter\expandafter\expandafter\grmn@dqfirst
+ \else
+ \expandafter\expandafter\expandafter\grmn@dqsecond
+ \fi\fi
+}
+% \end{macrocode}
+%
+%
+% \subsection{Kompatibilit"at mit \protect\TeX~2}
+%
+% In \TeX\ Version 2.x konnte man Trennmuster f"ur nur eine einzige
+% Sprache in einer Format"-datei laden und verwenden. Deshalb fehlen
+% in dieser alten \TeX-Version, die von einigen, wenn auch wenigen
+% Personen immer noch verwendet wird/werden mu"s, die Parameter
+% |\language|, \texttt{\string\left\-hyphen\-min},
+% \texttt{\string\right\-hyphen\-min} und das Primitiv
+% \texttt{\string\set\-language}. Um diese Style-Option mit dieser
+% alten Version verwenden zu k"onnen, werden diese f"ur \TeX\
+% Version~2 einfach ohne Funktionalit"at nachimplementiert.
+%
+% Die Parameter sind einfache Z"ahler, die mit |\newcount| allokiert
+% werden k"onnen und mit sinnvollen, wenn auch nie von \TeX\ selbst
+% verwendete Werten initialisiert werden. Da |\newcount| in
+% Plain-\TeX\ als "`outer"' deklariert ist, mu"s hier der Trick mit
+% |\csname| verwendet werden.
+% \begin{macrocode}
+\expandafter\ifx\csname language\endcsname\relax
+ \csname newcount\endcsname\language
+ \language=0 \fi
+\expandafter\ifx\csname lefthyphenmin\endcsname\relax
+ \csname newcount\endcsname\lefthyphenmin
+ \lefthyphenmin=2 \fi
+\expandafter\ifx\csname righthyphenmin\endcsname\relax
+ \csname newcount\endcsname\righthyphenmin
+ \righthyphenmin=3 \fi
+% \end{macrocode}
+%
+% F"ur das in \TeX~3 neu hinzugekommene Primitiv
+% \texttt{\string\set\-language} k"onnte man eine relativ einfache
+% Definition verwenden. Da jedoch Makros die Existenz dieses Befehls
+% abpr"ufen und es dann mit der Bedeutung, die es in \TeX~3 besitzt,
+% verwenden k"onnten, sollte es das Verhalten, insbesondere dessen
+% Einschr"ankungen, dieses neuen Primitivs nachbilden.
+% Da |\setlanguage| in "alteren Versionen dieser Style-Option zu
+% Wechseln der Sprache verwendet wurde, kann man gleich in der
+% Fehlermeldung auf das neue Makro |\selectlanguage| hinweisen.
+% \begin{macrocode}
+\expandafter\ifx\csname setlanguage\endcsname\relax
+ \def\setlanguage{\relax
+ \ifhmode \else
+ \errhelp{Use \selectlanguage to switch languages.}%
+ \errmessage{\setlanguage allowed only in horizontal mode}%
+ \fi
+ \begingroup\afterassignment\endgroup\count@=}
+\fi
+% \end{macrocode}
+%
+% \subsection{Ein-/Ausschalten der deutschen Befehle}
+% \changes{2.5e (beta 3)}{98/05/28}{In {\tt ngerman.sty} wird nun
+% \cs{ngermanTeX} definiert.}
+%
+% \begin{macrocode}
+\begingroup \mdqon
+\def\x{\endgroup
+ \def\originalTeX{\mdqoff \let"\dq \umlauthigh
+ \let\3\grmn@original@three
+ \selectlanguage{USenglish}}%
+%<old> \def\germanTeX{\mdqon \let"\@active@dq \umlautlow
+%<new> \def\ngermanTeX{\mdqon \let"\@active@dq \umlautlow
+ \let\grmn@original@three\3\let\3\ss
+%<old> \selectlanguage{german}}}%
+%<new> \selectlanguage{ngerman}}}%
+\x
+% \end{macrocode}
+%
+% Zum Schlu"s bleibt nur noch das R"ucksetzen des \textit{category
+% codes} des Zeichens~\texttt{@} und das Einschalten der deutschen
+% Befehle, das gleichzeitig die deutschen Trennmuster aktiviert,
+% falls sie geladen wurden.
+% \begin{macrocode}
+\catcode`\@=\atcode % return to previous catcode
+%<old>\germanTeX
+%<new>\ngermanTeX
+% \end{macrocode}
+%
+%\iffalse
+%</!driver>
+%</!hyphcfg>
+%\fi
+%
+% \section{Beispieldatei \texttt{hyphen.cfg} zum Laden der
+% Trennmuster}
+%
+% In \texttt{gerdoc.tex}, der Dokumentation zum German-Style, sind
+% die Schritte zur Installation der Trennmuster genauer erl"autert.
+% Zur Vereinfachung f"ur den Benutzer wird die Beispieldatei
+% \texttt{hyphxmpl.cfg} zur Verf"ugung gestellt, die entweder direkt
+% oder mit wenigen "Anderungen als Datei \texttt{hyphen.cfg}
+% f"ur \LaTeXe{} verwendet werden kann.
+%
+% \begin{macrocode}
+%<+hyphcfg>%% ----------------------------------------------
+%<+hyphcfg>%% Beispielkonfigurationsdatei fuer: `hyphen.cfg'
+%<+hyphcfg>%% Naeheres siehe Dokumentation `gerdoc.tex'.
+%<+hyphcfg>%% Copyleft 1995-1998 by Bernd Raichle.
+%<+hyphcfg>
+%<+hyphcfg>%% Konfigurationsdatei -- Trennmuster: `hyphen.cfg'
+%<+hyphcfg>\message{== Loading hyphenation patterns:}
+%<+hyphcfg>
+%<+hyphcfg>%% american english
+%<+hyphcfg>\chardef\l@USenglish=\language
+%<+hyphcfg>%% british english als "Dialekt"
+%<+hyphcfg>\chardef\l@english=\l@USenglish
+%<+hyphcfg>\input hyphen
+%<+hyphcfg>
+%<+hyphcfg>%% german
+%<+hyphcfg>\newlanguage\l@german \language=\l@german
+%<+hyphcfg>%% oesterreichisch als "Dialekt"
+%<+hyphcfg>\chardef\l@austrian=\l@german
+%<+hyphcfg>\input ghyph31
+%<+hyphcfg>
+%<+hyphcfg>%% new german
+%<+hyphcfg>\newlanguage\l@ngerman \language=\l@ngerman
+%<+hyphcfg>%% oesterreichisch (neu) als "Dialekt"
+%<+hyphcfg>\chardef\l@naustrian=\l@ngerman
+%<+hyphcfg>\input gnhyph01
+%<+hyphcfg>
+%<+hyphcfg>%% weitere Sprachen nach folgendem Schema:
+%<+hyphcfg>% \newlanguage\l@SPRACHE \language=\l@SPRACHE
+%<+hyphcfg>% \chardef\l@DIALEKT=\l@SPRACHE
+%<+hyphcfg>% \input SPRACHhyphen
+%<+hyphcfg>
+%<+hyphcfg>%% Default-Trennmuster: USenglish
+%<+hyphcfg>\language=\l@USenglish \lefthyphenmin=2 \righthyphenmin=3
+%<+hyphcfg>\message{done.}
+% \end{macrocode}
+%
+% Ich hoffe, das Lesen dieses dokumentierten Quellcodes hat einige
+% Einblicke in die Implementierung der Style-Option "`german"'
+% gegeben. Da ich sie haupt"-s"achlich als eigene Ged"achtnisst"utze
+% geschrieben habe, kaum Korrekturen vorgenommen habe, ist sie
+% unvoll"-st"andig, ent"-h"alt viele \mbox{Tipp-}, Ausdrucks- und
+% sonstige Fehler. Man m"oge "uber diese hinwegsehen oder mir
+% entsprechende Korrekturen zukommen lassen. Wichtiger ist mir
+% jedoch, da"s der Makro-Code m"oglichst wenig Fehler enth"alt, soda"s
+% jede Meldung eines Fehlers und jeder Verbesserungsvorschlag immer
+% willkommen ist. Daf"ur schon jetzt meinen Dank!
+% \pagebreak
+%
+% \Finale
+\endinput
+%% End of german.dtx
diff --git a/Master/texmf-dist/source/generic/german/german.ins b/Master/texmf-dist/source/generic/german/german.ins
new file mode 100644
index 00000000000..c68647ad303
--- /dev/null
+++ b/Master/texmf-dist/source/generic/german/german.ins
@@ -0,0 +1,84 @@
+%% german.ins
+%%
+%% Docstrip installation instruction file
+%% for the `german' collection, Version 2.5e of 1998-07-08
+%%
+%% Copyright (C) 1991-1997 by B.Raichle and DANTE e.V.
+%% Copyright (C) 1998,1999 by B.Raichle
+%%
+
+\def\batchfile{german.ins}
+\input docstrip.tex
+
+\expandafter\ifx\csname declarepreamble\endcsname\relax
+ \Msg{==> This file requires docstrip version 2.4}
+ \Msg{==> available from CTAN (e.g. ftp.dante.de) in}
+ \Msg{==> tex-archive/macros/latex/unpacked/docstrip.tex}
+ \Msg{}\expandafter\endinput\fi
+
+\keepsilent
+
+\preamble
+
+This file is part of the `german' collection,
+providing German language support for
+plain TeX or LaTeX version 2e/2.09.
+
+----------- Copyright (C) 1998, 1999 by B.Raichle ----------
+------------------- All rights reserved. -------------------
+Maintained by Bernd Raichle (Uni Stuttgart),
+using ideas by H.Partl (TU Wien, Uni.f.Bodenkultur Wien)
+and many other people.
+
+
+IMPORTANT NOTICE:
+
+This program can be redistributed and/or modified under the terms
+of the LaTeX Project Public License Distributed from CTAN
+archives in directory macros/latex/base/lppl.txt; either
+version 1 of the License, or any later version.
+
+
+Error Reports (in case of UNCHANGED versions) should be sent to:
+
+ Bernd Raichle <raichle@Informatik.Uni-Stuttgart.DE>
+
+\endpreamble
+
+\declarepreamble\emptypreamble
+\endpreamble
+
+\Msg{*** Generating files ***}
+\generate{%
+ \file{german.sty}{\from{german.dtx}{old}}
+ \file{ngerman.sty}{\from{german.dtx}{new}}
+% \file{german.drv}{\from{german.dtx}{driver}}
+ \usepreamble\emptypreamble
+ \file{hyphxmpl.cfg}{\from{german.dtx}{hyphcfg}}%
+}
+\Msg{************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space german.sty ngerman.sty}
+\Msg{*}
+\Msg{* There exists a separate file `gerdoc.tex' containing}
+\Msg{* the user documentation. Please get this file, run it}
+\Msg{* through LaTeX (LaTeX2e or LaTeX 2.09):}
+\Msg{*}
+\Msg{* \space\space latex gerdoc.tex}
+\Msg{*}
+\Msg{* and follow the instructions how to install the hyphenation}
+\Msg{* patterns when creating format files. The file `hyphxmpl.cfg'}
+\Msg{* can be used as an example for LaTeX2e's `hyphen.cfg' file.}
+\Msg{*}
+\Msg{* (Gurus only!) To produce the implementation documentation you}
+\Msg{* can run the file `german.dtx' through LaTeX:}
+\Msg{* \space\space latex german.dtx}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{************************************************************}
+\endbatchfile
+%%
+%% End of file `german.ins'.
diff --git a/Master/texmf-dist/source/generic/kastrup/binhex.drv b/Master/texmf-dist/source/generic/kastrup/binhex.drv
new file mode 100644
index 00000000000..91ab4acc211
--- /dev/null
+++ b/Master/texmf-dist/source/generic/kastrup/binhex.drv
@@ -0,0 +1,49 @@
+%%
+%% This is file `binhex.drv',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% binhex.dtx (with options: `driver')
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file.
+%%
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from binhex.drv.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file binhex.dtx.
+%%
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+ \documentclass{ltxdoc}
+ \usepackage{amsmath}
+ \input binhex.tex
+ \def\verbatize#1{\begingroup
+ \toks0{#1}\edef\next{\the\toks0}%
+ \dimen0\the\fontdimen2\font
+ \fontdimen2\font=0pt
+ \expandafter\stripit
+ \meaning\next
+ \fontdimen2\font=\dimen0
+ \endgroup}
+ \def\next{}
+ \expandafter\def\expandafter\stripit\meaning\next{}
+ \newcommand\showeffect[1]{%
+ \text{\verbatize{#1}}\quad&\rightarrow\quad\text{#1}%
+ \\}
+ \def\samples{\begingroup\MacroFont\[\begin{aligned}\nextsample}
+ \def\nextsample#1#2{%
+ \if.\noexpand#2\expandafter\endsamples\fi
+ \showeffect{#1{#2}}\nextsample{#1}}
+ \def\endsamples#1\nextsample#2{\end{aligned}\]\endgroup}
+ \begin{document}
+ \DocInput{binhex.dtx}
+ \end{document}
+\endinput
+%%
+%% End of file `binhex.drv'.
diff --git a/Master/texmf-dist/source/generic/kastrup/binhex.dtx b/Master/texmf-dist/source/generic/kastrup/binhex.dtx
new file mode 100644
index 00000000000..202308d3a7c
--- /dev/null
+++ b/Master/texmf-dist/source/generic/kastrup/binhex.dtx
@@ -0,0 +1,518 @@
+% \iffalse
+% Copyright(c) 2001 by David Kastrup
+% Any use of the code is permitted as long as this copyright notice is
+% preserved in the code.
+%
+% In case of an emergency (no LaTeX available), you may rename this
+% file to binhex.tex. In all other cases, use the accompanying
+% binhex.ins in order to extract binhex.drv (run LaTeX on it for
+% getting the documentation) and binhex.tex. If binhex.ins is
+% missing, you can regenerate it by running docstrip on this file with
+% the option ``installer'' set.
+% \fi
+% \CheckSum{251}
+% \title{The \texttt{binhex.tex} package for expansible conversion
+% into binary-based number systems}
+% \author{David Kastrup\thanks
+% {David.Kastrup@neuroinformatik.ruhr-uni-bochum.de}}
+% \maketitle
+% \tableofcontents
+%
+% \section{Usage}
+% This is a file for expandably converting numbers into binary, octal
+% and hexadecimal. All constructs \TeX\ accepts as an argument to its
+% |\number| primitive are valid. This holds for all numeric arguments
+% of the macros presented in here.
+%
+% You use this package by simply inputting it with
+% \begin{verbatim}
+%\input binhex
+% \end{verbatim}
+% It will work equally well under \LaTeX\ and plain \TeX. It does not
+% even use plain \TeX, but only \TeX\ primitives. Simply setting the
+% correct |\catcode| values for |{}#| and end of line will make it
+% load and work under ini\TeX.
+%
+% The following macros are defined:
+% \DescribeMacro{\binary}
+% |\binary{|\meta{number}|}| will convert \meta{number} into its binary
+% representation.
+% \samples\binary{0}{\maxdimen}{-"7EE6}.
+%
+% \DescribeMacro{\nbinary}
+% |\nbinary{|\meta{size}|}{|\meta{number}|}| will convert \meta{number}
+% into a binary representation of at least \meta{size} digits length,
+% filling up with leading zeros where necessary. The |-| sign of
+% negative numbers is not counted. If both \meta{size} and
+% \meta{number} are zero, an empty string is generated. This should
+% please some computer scientists in some situations.
+% \samples{\nbinary{3}}{3}{-2}{-12}.
+%
+% \DescribeMacro{\hex}
+% |\hex{|\meta{number}|}| converts \meta{number} into its hexadecimal
+% representation, using uppercase letters.
+% \samples\hex{34}{-4711}.
+%
+% \DescribeMacro{\nhex}
+% |\nhex{|\meta{size}|}{|\meta{number}|}| will convert \meta{number}
+% into a hexadecimal representation of at least \meta{size} digits length,
+% filling up with leading zeros where necessary. The |-| sign of
+% negative numbers is not counted. If both \meta{size} and
+% \meta{number} are zero, an empty string is generated. This should
+% please some computer scientists in some situations.
+% \samples{\nhex{3}}{3}{-\maxdimen}.
+%
+% \DescribeMacro{\oct}
+% |\oct{|\meta{number}|}| converts \meta{number} into its octal
+% representation.
+% \samples\oct{34}{-4711}.
+%
+% \DescribeMacro{\noct}
+% |\noct{|\meta{size}|}{|\meta{number}|}| will do the right thing.
+% \samples{\noct{3}}{13}{-\maxdimen}.
+%
+% \DescribeMacro{\tetra}
+% |\tetra{|\meta{number}|}| is for people counting with arms and legs
+% instead of fingers, or for quadrupeds.
+% \samples\tetra{34}{-4711}.
+%
+% \DescribeMacro{\ntetra}
+% |\ntetra{|\meta{size}|}{|\meta{number}|}| is for those of the same
+% count which have minimum requirements.
+% \samples{\ntetra{3}}{3}{-\maxdimen}.
+%
+% \DescribeMacro{\nbinbased}
+% |\nbinbased{|\meta{logbase}|}{|\meta{size}|}{|\meta{number}|}| will
+% convert \meta{number} into number base $2^{\text{\meta{logbase}}}$ and
+% generate at least \meta{size} digits. Only supported values of
+% \meta{logbase} are 1, 2, 3, 4. This is called by all other macros
+% except of the faster binary conversion macros.
+% \samples{\nbinbased{3}{3}}{13}{-\maxdimen}.
+% \samples{\nbinbased{2}{4}}{13}{-\maxdimen}.
+%
+% That's it, have fun!
+% \StopEventually{}
+% \section{Implementation}
+% Now the implementation. First save catcode of |@| and old contents of
+% |\toks0| in |\toks0|, then make |@| a letter to enable internal
+% macros.
+% \begin{macrocode}
+%<*style>
+\edef\next{\toks0=%
+ {\catcode`\noexpand\@=\the\catcode`\@\toks0{\the\toks0}}%
+}
+\next
+\catcode`\@11
+% \end{macrocode}
+%
+% \subsection{Binary conversions}
+% \subsubsection{Basics}
+% \begin{macro}{\bb@00}
+% \begin{macro}{\bb@01}
+% \begin{macro}{...}
+% \begin{macro}{\bb@19}
+% We now define the work horse macros for conversion of binary
+% commands. If numbers were allowed in macro names, one of those
+% definitions would be
+% \begin{verbatim}
+%\def\bb@13#1{6\csname bb@1#1\endcsname}
+% \end{verbatim}
+% That is, the macro divides the decimal two-digit number (up to~19)
+% embedded into its name by~2, spews out the result and starts up the
+% next macro with the first digit of the name of \emph{that} being the
+% remainder from its own division, and the second digit being the next
+% following one.
+% \begin{macrocode}
+\def\next#1#2#3{\expandafter \def \csname bb@#1\endcsname##1%
+ {#2\csname bb@#3##1\endcsname}}
+\next{00}00 \next{01}01 \next{02}10 \next{03}11
+\next{04}20 \next{05}21 \next{06}30 \next{07}31
+\next{08}40 \next{09}41 \next{10}50 \next{11}51
+\next{12}60 \next{13}61 \next{14}70 \next{15}71
+\next{16}80 \next{17}81 \next{18}90 \next{19}91
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\bb@0+}
+% \begin{macro}{\bb@1+}
+% Now we need to end such a conversion. For no particular reason at
+% all (well, some sneakiness might explain it later), we use |+| as an
+% end marker for the decimal digits. After the |+|, we collect the
+% resulting binary digits, from last to first. So here are two macros
+% to deal with the last digit produced. Simply tacks them on after
+% replacing the gobbled |+|.
+% \begin{macrocode}
+\expandafter \def \csname bb@0+\endcsname {+0}
+\expandafter \def \csname bb@1+\endcsname {+1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Now all that remains to be done is to initiate the process, and to
+% end it again. The process ends when the decimal number reaches~0.
+% Since we want to produce one digit even when starting out, and we
+% check the end of recursion by comparing the result with~|0|, we have a
+% problem here. We solve it by comparing two letters, and looking for
+% the complete |0+| sequence, and we start out by prepending a trivial |0|
+% before the number to convert, so that at the first run it will be |00|
+% instead of |0| if the number in question is~0.
+%
+% \begin{macro}{(\binary)}
+% \begin{macro}{(\bb@dobinary)}
+% Actually, this is how we \emph{could} do things. The actual, slightly
+% different version used can be shared by the other converters, but
+% we'll keep this listed for reference.
+% \begin{verbatim}
+%\def\binary#1{\expandafter \bb@dobinary \expandafter 0\number#1+}
+%\def\bb@dobinary#1#2{\if0#1\if+#2\bb@endbinary \fi\fi
+% \expandafter \bb@dobinary \number \csname bb@0#1\endcsname #2}
+% \end{verbatim}
+% Notice that |\number| here serves multiple purposes. It will
+% initiate expansion that will only be stopped once the macros
+% generating the next binary digit will crank out a space or anything
+% else stopping expansion. Its second purpose is to get rid of any
+% leading zeros that might remain from the last loop through.
+%
+% \begin{macro}{\bb@endbinary}
+% |\bb@endbinary| can
+% be used as written, though. It scraps everything up to the tack
+% mark |+|, leaving only the converted results accumulated behind
+% that. Since this means scrapping |\fi\fi| as well, it reinserts
+% it in order to properly finish the conditional.
+% \begin{macrocode}
+\def\bb@endbinary#1+{\fi\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Negative numbers}
+% We would like negative numbers to work, too. The semantics for
+% defined field widths are unclear (so we basically just tack a |-| on
+% and convert the remaining number to the full width). Since the sign
+% of the number is easy to discern, further massaging of the number to
+% replace leading zeros by spaces, insert |+| signs and similar folderol
+% are easy to do and left as an exercise to the reader. We mostly
+% implement this to have the conversion not fail on any number.
+%
+% \begin{macro}{\bb@0-}
+% The following one-liner achieves that. Figure out why. It is easy.
+% \begin{macrocode}
+\expandafter \def \csname bb@0-\endcsname {0+-\bb@dobinary}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Minimum field widths}
+% \begin{macro}{\bb@0m}
+% \begin{macro}{\bb@1m}
+% We often have the situation that we want to produce a number that is
+% at least of a certain length. We specify this by tagging on an
+% appropriate number of |m| characters to the decimal as sort of a
+% format string. If we match such an~|m| at the end of the conversion,
+% we produce a digit and remove one~|m|, leaving all other |m| intact (or
+% whatever else happens to be before our |+| sign).
+% \begin{macrocode}
+\expandafter\def\csname bb@0m\endcsname#1+{#1+0}
+\expandafter\def\csname bb@1m\endcsname#1+{#1+1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{(\nbinary)}
+% We call |\nbinary| with the number of digits as first argument, the number
+% itself as second.
+%
+% This now becomes trivial:
+% \begin{verbatim}
+%\def \nbinary#1#2{%
+% \binary{\number #2\romannumeral \number \number #1 000}%
+%}
+% \end{verbatim}
+%
+% Whoa, what about all these calls of |\number|? First notice the space
+% after |#1|. We need that in case |#1| happens to be octal or whatever,
+% since the |000| at the end is supposed to multiply by 1000 \emph{decimal}.
+% If |#1| were something like |'13| (11 decimal), the last |\number| will
+% expand |'13|, the |\number| before that will remove the blank we
+% inserted in case it was not needed to finish the number of digits,
+% we multiply by~1000 and turn this into a roman numeral consisting of
+% the appropriate amount of |m| letters. The very first |\number| ensures
+% that in case |#2| is a complete number without the need of trailing
+% spaces, still |\romannumeral| will be expanded when |\binary| first sets
+% sight on the whole thing.
+% \end{macro}
+%
+% \begin{macro}{\nbinary}
+% \begin{macro}{\binary}
+% \begin{macro}{\bb@dobinary}
+% Actually, since there is a certain logic to returning
+% an empty string when 0 is to be converted into a number at least 0
+% characters long, we redefine the stuff the other way round, |\binary|
+% as a special case of |\nbinary|. We check the end by testing against
+% |0| followed by anything but~|m|. This has reasons\dots
+%
+% \begin{macrocode}
+\def\bb@dobinary#1#2{\if#10\if m\string#2\else\bb@endbinary\fi\fi
+ \expandafter\bb@dobinary\number\csname bb@0#1\endcsname#2}
+\def\nbinary#1#2{\expandafter\bb@dobinary\number\number#2%
+ \romannumeral\number\number#1 000+}
+\def\binary{\nbinary1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Hexadecimal and the rest}
+%
+% Ok, stop with the small fry. Now we want to convert into
+% hexadecimal and octal as well. We do this by first converting into
+% binary, then into the wanted base whenever enough binary digits have
+% accumulated. In the following, we will talk about hex digits
+% exclusively for simplicity, even though they might indeed be octal
+% instead.
+%
+% \begin{macro}{\bb@h0}
+% \begin{macro}{\bb@h1}
+% \begin{macro}{\bb@h10}
+% \begin{macro}{...}
+% \begin{macro}{\bb@h1111}
+%
+% The following defines the equivalents of
+% \begin{verbatim}
+%\def \bb@h110#1+{\bb@dohex #1+6}
+% \end{verbatim}
+% This is a macro that appends 6, the representation of the binary
+% number in its name, after the tack mark |+|. So what's with the
+% |\number+|? Actually, here it does nothing but disappear. We just
+% write this to remind us of how the macros will be called. When the
+% macros are called, we use the same construct, and then |\number|
+% will disappear together with the~|+| (that we use as a tack mark)
+% and take along any leading zeros. We drop leading zeros so that we
+% can share the conversion macros for hex and octal (and quaternary?)
+% where they overlap.
+%
+% \begin{macrocode}
+\def \next #1#2{\expandafter \def
+ \csname bb@h\number +#1\endcsname ##1+{\bb@dohex ##1+#2}%
+}
+\next {0}0 \next {1}1 \next {10}2 \next {11}3
+\next {100}4 \next {101}5 \next {110}6 \next {111}7
+\next{1000}8 \next{1001}9 \next{1010}A \next{1011}B
+\next{1100}C \next{1101}D \next{1110}E \next{1111}F
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bb@dohex}
+% |\bb@dohex| is the magic macro that initiates accumulation of enough
+% binary digits for one hexadecimal one. It is called in
+% the following form:
+% \begin{quote}
+% |\bb@dohex| \meta{m\{\#rhex\}} |\endcsname| \meta{m\{\#bin\}} |+|
+% \end{quote}
+% Where |+| is the tack after which hex digits will accumulate,
+% \meta{m\{\#rhex\}} is a sequence of |m|, one for every remaining hex
+% digit we want to force out (same convention as with |\nbinary| above),
+% and \meta{m\{\#bin\}} is a sequence of |m| corresponding in length to
+% the number of binary digits we need to accumulate for one hexadecimal
+% (or octal) digit.
+% \begin{macrocode}
+\def\bb@dohex #1{\csname bb@x#1\endcsname}
+% \end{macrocode}
+%
+% Eeek! What is that? Ok, let's split it into the two cases, one with
+% forced digits remaining, one without any remaining forced digits.
+% If no forced digits remain, we get
+% \begin{quote}
+% |\bb@x \endcsname \endcsname| \meta{m\{\#bin\}}
+% \end{quote}
+% \end{macro}
+%
+% \begin{macro}{\bb@x}
+% |\bb@x| is defined as
+% \begin{macrocode}
+\def\bb@x\endcsname#1{ \bb@xm{m\endcsname}}
+% \end{macrocode}
+%
+% Notice the space at the start of the macro! It will stop
+% expansion. Furthermore, the |\endcsname| that |\bb@dohex| inserted is
+% scrapped, as well as the first |m| from
+% \meta{m\{\#bin\}}.\footnote{Why do we match |\string\endcsname| explicitly
+% for scrapping? The answer is debugging. We know it should always
+% be |\string\endcsname|, so let \TeX\ assert that it is indeed so. But we
+% also know that the next character will be |m|, why don't we match
+% \emph{that} explicitly? The answer is that we cannot be sure about the
+% |\string\catcode| of the matched~|m|. A hand-entered |m| has
+% |\string\catcode|~11, a \TeX-generated one (with |\string\string| or
+% |\string\romannumeral| or such) has |\string\catcode|~12. You'll
+% find that all the code here has been carefully
+% designed so that it will not care which it gets, so we don't make
+% an exception here.
+% }
+% \end{macro}
+%
+% \begin{macro}{\bb@xm}
+% The argument fed to |\bb@xm| is part of some jiggery-pokery we want
+% to happen when |\bb@dobinary| resumes expansion. First, however, it
+% will take a look and decide whether it will stop generating digits
+% altogether. As |\string \bb@xm| does not start with |m|, |\bb@dobinary|
+% will stop expansion when the decimal to convert has shrunk to 0.
+% Fine. Now what does |\bb@xm| do?
+% \begin{macrocode}
+\def\bb@xm #1\endcsname #2#3+{#2#3%
+ \csname bb@h\number+\endcsname
+ #1\endcsname m#3+}
+% \end{macrocode}
+% \end{macro}
+%
+% This is rather straightforward for the case of forced digits: the
+% number of binary digits is encoded in the form of \meta{m\{\#bin\}} in
+% |#2#3|. After the conversion of those digits, the appropriate hex
+% digit macro is called and sets up |\bb@dohex| again for the next hex
+% digit. Piece of cake. Now what happens in the case we have resumed
+% from |\do@binary| having had its option of stopping expansion?
+%
+% In that case, we get called with the next \meta{digit}
+% already arriving. This looks more or less like
+% \begin{quote}
+% |\csname bb@|\meta{digit}|\bb@xm \endcsname{m\endcsname}|
+% \meta{m\{\#bin-1\}}
+% \end{quote}
+% See what happens? This expands |\bb@xm|, after which a command of the
+% name |\bb@|\meta{digit}|m| (\meta{digit} being 0 or~1) gets executed.
+% It stashes away \meta{digit} after
+% the conveniently provided |+| sign, and \meta{\#bin-1} digits remain for
+% conversion.
+%
+% You think this contrived? Well, buster, let me tell you that the
+% previous version was way more insane. Have it still in RCS.
+%
+% \begin{macro}{\bb@nbinbased}
+% The following macro needs to get |#1|, the decimal number to convert,
+% in text form already. This is so that |\number#1| will continue
+% expanding after |#1|, expanding |\bb@dohex| exactly once. This problem
+% does not exist for the |\romannumeral| calls for |#2| and |#3|, so
+% spurious expansion with |\number\number| does no harm, since it is
+% stopped readily at the hard |\endcsname| and |+| thresholds.
+% \begin{macrocode}
+\def\bb@nbinbased #1#2#3{\expandafter \bb@dobinary \number#1%
+ \expandafter \bb@dohex
+ \romannumeral \number\number #2 000\expandafter\endcsname
+ \romannumeral \number\number #3 000+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\nbinbased}
+% The following macro gets 3~arguments, the number of binary digits the
+% output digits shall be based on, the number of digits to produce at
+% least, and the number itself. It expands the number into text
+% form. If the number is not space-terminated, the closing brace
+% reliably stops expansion nevertheless, so that |\bb@nbinbased| gets a
+% clean number.
+% \begin{macrocode}
+\def\nbinbased #1#2#3{\expandafter\bb@nbinbased
+ \expandafter {\number#3}{#2}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\nhex}
+% \begin{macro}{\noct}
+% \begin{macro}{\ntetra}
+% \begin{macro}{\hex}
+% \begin{macro}{\oct}
+% \begin{macro}{\tetra}
+% Now follow the obvious definitions:
+% \begin{macrocode}
+\def\nhex{\nbinbased4}
+\def\noct{\nbinbased3}
+\def\ntetra{\nbinbased2}
+\def\hex{\nhex1}
+\def\oct{\noct1}
+\def\tetra{\ntetra1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \subsection{The end}
+% Restore |\catcode`\@| and |\toks0| and finish.
+% \begin{macrocode}
+\the\toks0
+%</style>
+% \end{macrocode}
+% And that was that!
+% \section{Various drivers}
+% The installer, in case it is missing.
+% \begin{macrocode}
+%<installer> \input docstrip
+%<installer> \generate{
+%<installer> \file{binhex.drv}{\from{binhex.dtx}{driver}}
+%<installer> \usedir{tex/generic/misc}
+%<installer> \file{binhex.tex}{\from{binhex.dtx}{style}}
+%<installer> }
+%<installer> \endbatchfile
+% \end{macrocode}
+% And here comes the documentation driver.
+% \begin{macrocode}
+%<driver> \documentclass{ltxdoc}
+%<driver> \usepackage{amsmath}
+%<driver> \input binhex.tex
+% \end{macrocode}
+% \begin{macro}{\verbatize}
+% |\detokenize| is available in e\TeX, but we may not have that\dots
+% The |\fontdimen| folderol makes spaces temporarily disabled. Looks
+% prettier. Sorry for that.
+% \begin{macrocode}
+%<driver> \def\verbatize#1{\begingroup
+%<driver> \toks0{#1}\edef\next{\the\toks0}%
+%<driver> \dimen0\the\fontdimen2\font
+%<driver> \fontdimen2\font=0pt
+%<driver> \expandafter\stripit
+%<driver> \meaning\next
+%<driver> \fontdimen2\font=\dimen0
+%<driver> \endgroup}
+%<driver> \def\next{}
+%<driver> \expandafter\def\expandafter\stripit\meaning\next{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\showeffect}
+% |\showeffect|\meta{Stuff} will put out a one-line correspondence of
+% the verbatim source of \meta{Stuff} with its expansion, to be used
+% in a |aligned| environment or similar.
+% \begin{macrocode}
+%<driver> \newcommand\showeffect[1]{%
+%<driver> \text{\verbatize{#1}}\quad&\rightarrow\quad\text{#1}%
+%<driver> \\}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\samples}
+% |\samples| gets one parameter, and a following expression list ended
+% by a period. It applies that parameter to each of the expressions
+% in the list and generates a correspondance table for each. For
+% example,
+% \begin{verbatim}
+%\samples{\nbinary{3}}{3}{-2}{-12}.
+% \end{verbatim}
+% was used in this document to produce
+% \samples{\nbinary{3}}{3}{-2}{-12}.
+% \begin{macrocode}
+%<driver> \def\samples{\begingroup\MacroFont\[\begin{aligned}\nextsample}
+%<driver> \def\nextsample#1#2{%
+%<driver> \if.\noexpand#2\expandafter\endsamples\fi
+%<driver> \showeffect{#1{#2}}\nextsample{#1}}
+%<driver> \def\endsamples#1\nextsample#2{\end{aligned}\]\endgroup}
+% \end{macrocode}
+% \end{macro}
+% Now all that remains is inputting the stuff.
+% \begin{macrocode}
+%<driver> \begin{document}
+%<driver> \DocInput{binhex.dtx}
+%<driver> \end{document}
+% \end{macrocode}
+% \Finale{} \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/kastrup/binhex.ins b/Master/texmf-dist/source/generic/kastrup/binhex.ins
new file mode 100644
index 00000000000..fc3322cd039
--- /dev/null
+++ b/Master/texmf-dist/source/generic/kastrup/binhex.ins
@@ -0,0 +1,32 @@
+%%
+%% This is file `binhex.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% binhex.dtx (with options: `installer')
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file.
+%%
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from binhex.ins.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file binhex.dtx.
+%%
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+ \input docstrip
+ \generate{
+ \file{binhex.drv}{\from{binhex.dtx}{driver}}
+ \usedir{tex/generic/misc}
+ \file{binhex.tex}{\from{binhex.dtx}{style}}
+ }
+ \endbatchfile
+\endinput
+%%
+%% End of file `binhex.ins'.
diff --git a/Master/texmf-dist/source/generic/mfpic/grafbase.dtx b/Master/texmf-dist/source/generic/mfpic/grafbase.dtx
new file mode 100644
index 00000000000..0eadd2885a9
--- /dev/null
+++ b/Master/texmf-dist/source/generic/mfpic/grafbase.dtx
@@ -0,0 +1,5900 @@
+% \iffalse
+% Copyright 2002--2003, Daniel H. Luecking
+%
+% Mfpic consists of the 3 files mfpic.dtx, grafbase.dtx and mfpic.ins
+% and the 5 files they generate: mfpic.tex, mfpic.sty, grafbase.mf,
+% grafbase.mp, and dvipsnam.mp.
+%
+% Mfpic may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License, either version 1.2 of this license or (at
+% your option) any later version. The latest version of this license is in
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.2 or later is part of all distributions of LaTeX version
+% 1999/12/01 or later.
+%
+% Documentation, examples, and ancillary files are separate and not
+% covered by this license. See readme.1st for a complete list. See
+% individual files for any copyright and license restrictions.
+%
+% With respect to the proposed draft LPPL-1.3: mfpic has maintenance
+% status "maintained". The Current Maintainer is Daniel H. Luecking. There
+% are several Base Interpreters: TeX, LaTeX, MetaPost and Metafont.
+%
+%<*driver>
+\documentclass[draft]{ltxdoc}
+\usepackage{docmfp}
+\def\fileversion{0.7a beta}
+\def\filedate{2004/04/16}
+
+\addtolength{\textwidth}{.5878pt}
+
+\def\mytt{\upshape\mdseries\ttfamily}
+\renewcommand\marg[1]{{\mytt \{#1\}}}
+\renewcommand\oarg[1]{{\mytt [#1]}}
+\renewcommand\parg[1]{{\mytt (#1)}}
+\renewcommand{\meta}[1]{{$\langle$\rmfamily\itshape#1$\rangle$}}
+\DeclareRobustCommand\cs[1]{{\mytt\char`\\#1}}
+\def\prog#1{{\mdseries\scshape #1}}
+\def\grafbase{\prog{grafbase}}
+\def\Grafbase{\prog{Grafbase}}
+\def\mfpic{\prog{mfpic}}
+\def\Mfpic{\prog{Mfpic}}
+\def\MF{\prog{metafont}}
+\def\MP{\prog{metapost}}
+\def\CMF{\prog{Metafont}}
+\def\CMP{\prog{Metapost}}
+\def\opt#1{{\sffamily\upshape#1}}
+\def\env#1{{\mytt#1}}
+\let\file\env
+\let\mfc\env
+\let\gbc\env
+\renewcommand\{{\char`\{}
+\renewcommand\}{\char`\}}
+\renewcommand\|{${}\mathrel{|}{}$}
+
+\makeatletter
+\newcommand\bsl{{\mytt\@backslashchar}}
+% Stupid lists!
+\def\@listi{\leftmargin\leftmargini
+ \parsep \z@ \@plus\p@ \@minus\z@
+ \topsep 4\p@ \@plus\p@ \@minus2\p@
+ \itemsep\parsep}
+\let\@listI\@listi \@listi
+\renewcommand\labelitemi{\normalfont\bfseries \textendash}
+\renewcommand\labelitemii{\textasteriskcentered}
+\renewcommand\labelitemiii{\textperiodcentered}
+\leftmargini\parindent
+% Stupid index!
+\def\IndexParms{%
+ \parindent \z@ \columnsep 15pt
+ \parskip 0pt plus 1pt
+ \rightskip 5pt plus2em \mathsurround \z@
+ \parfillskip=-5pt \small
+ % less hanging:
+ \def\@idxitem{\par\hangindent 20pt}%
+ \def\subitem{\@idxitem\hspace*{15pt}}%
+ \def\subsubitem{\@idxitem\hspace*{25pt}}%
+ \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}}
+\renewcommand\routinestring{}
+\renewcommand\variablestring{\space(var.)}
+% Why does every command have to be indexed twice?
+\renewcommand\SpecialMfpIndex[3]{\@bsphack
+ \index{%
+ \string#1\actualchar
+ \string\verb\quotechar*\verbatimchar\string#1\verbatimchar
+ #2 \encapchar usage}%
+ \@esphack}
+\makeatother
+
+\def\pdfTeX{\textrm{pdf\kern.04em\TeX}}
+\def\pdfLaTeX{\textrm{pdf\kern.06em\LaTeX}}
+\def\ConTeXt{\textrm{Con\kern-.16em\TeX\kern-0.06em t}}
+\def\PiCTeX{\textrm{P\kern-.13em\lower.3ex\hbox{I}C\TeX}}
+
+\title{The \grafbase{} macros\thanks{This file has version number
+ \fileversion, last revised \filedate. The code described here
+ was developed by several people, notably Thomas Leathrum,
+ Geoffrey Tobin and Dan Luecking. Dan wrote this documentation.}}
+\author{Dan Luecking}
+\date{\filedate}
+\DisableCrossrefs
+\CodelineIndex
+\AlsoImplementation
+
+\begin{document}
+ \DeleteShortVerb{\|}
+ \DocInput{grafbase.dtx}
+\end{document}
+%</driver>
+%\fi
+%
+% \CheckSum{1}
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \catcode`\_=12
+% \maketitle
+%
+% \begin{abstract}
+% Macros are defined for use with \mfpic{}. The latter is a set of \TeX{}
+% macros which allows a \file{.tex} file to write a \file{.mf} or
+% \file{.mp} file that, with the help of these macros and \MF{} (or \MP),
+% can be used to create pictures in the document, especially mathematical
+% pictures. There are two versions of \grafbase, one for \MF{} and one for
+% \MP{}. As they are alike more than unlike, we document both here.
+%
+% This file documents the \grafbase{} source code. The user manual for
+% \mfpic{} is \file{mfpicdoc.tex}.
+% \end{abstract}
+%
+% \StopEventually{\PrintIndex}
+% \tableofcontents
+%
+%
+% \section{Introduction}\label{intro}
+%
+% \subsection{Identification and checks}\label{checks}
+%
+% We start with identifying information. Then we detect if grafbase was
+% loaded already, but we don't do anything about it except write a
+% message.
+%
+% The \gbc{grafbaseversion} is required to match the definition of
+% \cs{mfpicversion} in \file{mfpic.tex}. The output file written by the
+% \mfpic{} macros includes a test that these are the same, but that would
+% fail to catch a new \grafbase{} with an old \mfpic. So we also put a test
+% here, and it alone would fail to catch the use of older versions of
+% \grafbase{} with current versions of \mfpic. Newer versions of \mfpic{}
+% signal their version before inputting \file{grafbase}. Unfortunately
+% (for error checking), \grafbase{} can also be used without \mfpic, so if
+% \gbc{mfpicversion} is unknown, we merely write a message.
+%
+% It might be possible (at some point) to optimize things for \mfpic{} use
+% whenever \gbc{mfpicversion} is defined, but so far we don't do anything
+% except test the version and set this boolean.
+%
+% \DescribeRoutine{GBmsg}
+% \DescribeRoutine{GBerrmsg}
+% These are used fairly consistently and identify the source of the
+% message delivered as being \gbc{"Grafbase"}. The \gbc{GBerrmsg} takes
+% care of both the error message and the \mfc{errhelp} string.
+% \begin{macrocode}
+%<*MF|MP>
+string fileversion, filedate;
+fileversion := "0.7a beta"; filedate := "2004/04/16";
+def GBmsg expr s = message "Grafbase: " & s; enddef;
+def GBerrmsg (expr s) expr t =
+ errhelp t;
+ errmessage "Grafbase: "& s;
+ errhelp "";
+enddef;
+if (known grafbaseversion) or (known grafbase) :
+ GBmsg "You have loaded grafbase more than once! " &
+ "Please make sure that it is loaded only once.";
+ endinput;
+fi
+
+boolean grafbase; grafbase := true;
+boolean MFPIC; MFPIC := false;
+
+def checkversions (expr g)=
+ numeric grafbaseversion; grafbaseversion := g;
+ if unknown mfpicversion : % no mfpic, or < 0.63
+ GBmsg "Recent mfpic not detected.";
+ elseif g = mfpicversion :
+ MFPIC := true;
+ else:
+ GBerrmsg ("version mismatch")
+ "The installation may be broken: mfpic and grafbase " &
+ "versions do not match.";
+ fi
+enddef;
+
+checkversions (70);
+
+% \end{macrocode}
+% We try to make sure that the macros of \file{plain.mf} or
+% \file{plain.mp} are available.
+% \begin{macrocode}
+if unknown base_name : input plain;
+elseif not string base_name : input plain;
+elseif base_name <> "plain" : input plain;
+fi
+
+% \end{macrocode}
+%
+% We try to determine which of \MF{} or \MP{} is using these macros.
+% Perhaps one day we'll merge both versions of \grafbase{} in one file and
+% use the following boolean. For now, we only use it to catch cases where
+% the \grafbase{} file is being used by the wrong compiler.
+%
+% Of course, \MP{} natively knows about colors but \MF{} doesn't, so we
+% use that to set a boolean \gbc{METAPOST}. We don't simply check if
+% \mfc{known blue} is \mfc{true} because `\mfc{blue}' is certainly a legal
+% variable name in \MF. Instead we check \mfc{known color X} for
+% some unlikely \gbc{X}. In \MP, \gbc{color X} is either true or
+% false (\gbc{X} is a color or it isn't) and therefore always known, so
+% \gbc{known color X} is always true.
+%
+% In \MF{} \mfc{color X} is an identifier (presumably unknown) with the
+% base name \mfc{color} and suffix \mfc{X}.
+% \begin{macrocode}
+boolean METAPOST;
+
+if known color Maurits Cornelis Escher : METAPOST := true;
+else: METAPOST := false;
+fi
+
+%<*MF>
+if METAPOST :
+ GBerrmsg ("wrong compiler")
+ "You may have input to Metapost a file designed for Metafont. " &
+ "Instead of the file grafbase.mf, Metapost should be using " &
+ "grafbase.mp. Make sure Metapost can find it.";
+fi
+%</MF>
+%<*MP>
+if not METAPOST :
+ GBerrmsg ("wrong compiler")
+ "You may have input to Metafont a file designed for Metapost. " &
+ "Instead of the file grafbase.mp, Metafont should be using " &
+ "grafbase.mf. Make sure the extension was not changed.";
+fi
+%</MP>
+
+% \end{macrocode}
+%
+% \DescribeRoutine{GBdebug}
+% \DescribeRoutine{GBenddebug}
+% The \gbc{debug} flag is for developers, who should set it before
+% inputing \file{grafbase}. These two routines start and end debug
+% messages.
+%
+% \DescribeRoutine{mftitle}
+% The \gbc{mftitle} macro is useful when debugging.
+% It will put its argument, which should be a string, as a TFM comment,
+% and also print it to the terminal and log file.
+% \begin{macrocode}
+if (unknown debug) or (not boolean debug) :
+ boolean debug; debug := false;
+fi
+
+def GBdebug =
+ begingroup
+ save >>; def >> = message enddef;
+ >> "Grafbase DEBUG: ";
+enddef;
+def GBenddebug =
+ >> "End DEBUG";
+ endgroup
+enddef;
+
+vardef mftitle expr t =
+ t; message t;
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Setting up the font}\label{font}
+%
+% Font-related housekeeping is for \MF{} only. \MF{} only produces
+% fonts, so we have to define the variables it thinks are needed for
+% fonts.
+%
+% We intercept the \mfc{mode} variable before \mfc{mode_setup} can set
+% \mfc{proof} mode. We used to set \mfc{mode := cx} if it was unknown,
+% then for a while we just issued an error message; in this version we
+% try \mfc{ljfour}.
+%
+% The font identifier and coding scheme are just for information and end
+% up as comments in the \file{.tfm} file (in all capitals). The design
+% size just needs to be rather large for graphics, and \mfc{128pt\#} is
+% anyway the default if we didn't set it ourselves.
+% \begin{macrocode}
+%<*MF>
+if unknown mode :
+ GBerrmsg ("unknown Metafont mode")
+ "Please use \mode:=localfont; or a mode known on your " &
+ "system. If you continue, ljfour mode will be tried.";
+ mode := lfjour;
+fi
+
+mode_setup;
+if debug :
+ GBdebug;
+ >> "pixels_per_inch = " & decimal pixels_per_inch;
+ GBenddebug;
+fi
+font_identifier := "MFpic graphics";
+font_coding_scheme := "Arbitrary";
+interim designsize := 128pt#;
+
+%</MF>
+% \end{macrocode}
+%
+% \Mfpic-generated files make reference to \mfc{aspect_ratio} and
+% \mfc{pt\#}, while \MP{} has no need for them. Rather than make
+% \mfpic{} write different things, and to make the files intended for
+% \MF{} also work with \MP, we define them in the obvious way. We also
+% add a definition of \mfc{hppp} and \gbc{t_} to simplify maintenance of
+% two versions of the \file{grafbase} files. Then we define
+% \gbc{currenttransform} for \MP{} sake.
+% \begin{macrocode}
+%<MP>pt# := 1pt;
+%<MP>def t_ = transformed currenttransform enddef;
+if unknown aspect_ratio: aspect_ratio := 1; fi
+if unknown hppp : hppp := 1 fi;
+if unknown currenttransform :
+ transform currenttransform;
+ currenttransform := identity yscaled aspect_ratio;
+fi
+
+% \end{macrocode}
+%
+% Don't complain when variables get too large. For \MF{} this has to be
+% after \mfc{mode_setup}, which sets \mfc{warningcheck := 1}. Also don't
+% complain if a clockwise path is filled (\MF).
+% \begin{macrocode}
+%<MF>interim turningcheck := 0;
+interim warningcheck := 0;
+% \end{macrocode}
+%
+% \subsection{Initializations}\label{init}
+%
+% Picture size variables would normally be set by a user for each
+% picture, or by \mfpic, but we give them default values anyway.
+% \begin{macrocode}
+numeric unitlen, xscale, yscale, xneg, xpos, yneg, ypos;
+
+%<MF>unitlen := 1 bp#;
+%<MP>unitlen := 1 bp;
+xscale := 7.2; % (xscale * unitlen) = 1/10 inch
+yscale := 7.2; % (yscale * unitlen) = 1/10 inch
+xneg := 0; xpos := 10;
+yneg := 0; ypos := 10;
+
+% \end{macrocode}
+%
+% We support both degrees and radians for angles. In \MF, one degree is
+% the unit of angle. One radian is $180/\pi$ degrees. A user can say
+% \gbc{90} or \gbc{90deg} or \gbc{pi/2*radian} for the same effect.
+% \begin{macrocode}
+newinternal radian, pi, deg;
+deg := 1; pi := 3.14159;
+radian := 180/pi;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{resizedrawpen}
+% Since we need to do this frequently, we define a macro that changes the
+% pen width for subsequent drawing. This enables the file written by
+% \mfpic{} to be less cluttered. At least that was the original reason.
+% Now it gives us the opportunity to localize changes to \mfc{currentpen}
+% and \gbc{drawpen}. (We already had this for different
+% \gbc{beginmfpic}, since that reinitializes drawpen, but now it is local
+% to other groups as well.)
+
+% We could do this for the hatching pen, but it doesn't seem to change as
+% often. The \mfc{pickup} command performs \mfc{yscaled aspect_ratio}, but
+% so does the \gbc{shpath}, the only other place pens are required. In
+% fact, we wouldn't need to \mfc{pickup} the pen at all, except power
+% users may want to rely on \gbc{drawpen} always being the current pen. We
+% make its diameter \mfc{.5pt} for backward compatibility. But many
+% journal publisher (e.g., AMS) recommend no smaller than \mfc{.5bp} for
+% author-supplied drawings.
+%
+% The default \gbc{hatchwd} used to be larger, but it seemed ugly to me.
+% (Backward compatibility? What's that?).
+% \begin{macrocode}
+newinternal penwd; penwd := 0.5pt;
+pen drawpen;
+
+def resizedrawpen (expr s) =
+ interim penwd := s;
+ setvariable (pen) (drawpen) (pencircle scaled penwd);
+ save currentpen; pen currentpen; pickup drawpen;
+enddef;
+
+numeric hatchwd; hatchwd := 0.5bp;
+pen hatchpen; hatchpen := pencircle scaled hatchwd;
+
+% \end{macrocode}
+%
+% We have two booleans related to clipping. One, \gbc{clipall} is meant to
+% be turned on just once (per picture), and it causes the \gbc{endmfpic}
+% code to clip the current picture to the boundaries defined by the
+% picture size variables. The other, \gbc{ClipOn}, is meant to be turned
+% on and off. While on, most drawing macros (all?) will clip their result
+% to the current \emph{clipping path array}. The clipping path array is an
+% array of paths: \gbc{ClipPath[]} together with a numeric \gbc{ClipPath}.
+% The numeric variable contains the number of clipping paths; the paths
+% are \gbc{ClipPath[1]} through \gbc{ClipPath[ClipPath]}. A macro later on
+% is defined to loop through the array, clipping the current picture to
+% the union of their interiors.
+%
+% The \gbc{truebbox} boolean sets the bounding box of the picture to its
+% natural size in \MP. The default behavior of \MP{} is to output a
+% bounding box that is the natural size of the graphic. The \grafbase{}
+% default is to override this default, setting \gbc{truebbox} to
+% \mfc{false}. \CMF's default behavior is to force the user to specify the
+% bounding box, and provides no natural way to obtain any information
+% about the actual extent of the ink. So, for now, this boolean is only
+% for \MP.
+%
+% \DescribeRoutine{DoClip}
+% This is for the frequent conditional code to implement \gbc{ClipOn}.
+% The command \gbc{clipsto} is defined later.
+%
+% \DescribeRoutine{noclip}
+% For debugging we sometimes want to make sure something is drawn
+% without clipping being applied. For this we have \gbc{noclip}.
+% \begin{macrocode}
+boolean clipall; clipall := false;
+boolean ClipOn; ClipOn := false;
+path ClipPath[]; numeric ClipPath; ClipPath = 0;
+boolean truebbox; truebbox := false;
+
+def DoClip (suffix v) =
+ if ClipOn and (ClipPath > 0) : clipsto (v, ClipPath); fi
+enddef;
+
+def noclip (text t) =
+ hide( save ClipOn; boolean ClipOn; ClipOn := false; t)
+enddef;
+
+% \end{macrocode}
+%
+% The boolean \gbc{showbbox} is for debugging the \gbc{*bbox} macros.
+% \begin{macrocode}
+boolean showbbox; showbbox := false;
+
+% \end{macrocode}
+%
+% \subsubsection{Colors}\label{colors}
+%
+% Of course colors are only recognized by \MP. The colors \mfc{black},
+% \mfc{white}, \mfc{red}, \mfc{green} and \mfc{blue} are part of
+% \file{plain.mp}. We define other standard colors to get all eight
+% colors where the coordinates are 0 or 1.
+%
+% \DescribeRoutine{color}
+% We begin trying to merge the format of mfpic output files by defining
+% \MF{} replacements for some of the \MP{} color variables and macros. Our
+% point of view will be: make each color variable a numeric in \MF. Each
+% will lie between $0$ and $1$ representing shades of gray. For
+% \emph{drawing} commands we will only between nonwhite (black, ${}<1$) or
+% white (${}=1$). For filling commands we will allow levels in between,
+% and fill with an approximation using a version of \gbc{shade}
+% \begin{macrocode}
+%<*MF>
+let color = numeric; color black, white;
+black := 0; white := 1;
+def _wc_ = killtext enddef;
+%</MF>
+%<MP>def _wc_ = withcolor enddef;
+
+% \end{macrocode}
+%
+% We also define some color variables whose names reflect their use.
+% Thus, \gbc{fillcolor} is used for filling, etc. The color
+% \gbc{currentcolor} isn't used anywhere yet. The color
+% \mfc{background} is used in \MP{} for unfilling a region.
+% \begin{macrocode}
+color currentcolor, fillcolor, drawcolor, hatchcolor,
+ headcolor, pointcolor, tlabelcolor, background;
+currentcolor := fillcolor := drawcolor := hatchcolor :=
+ headcolor := pointcolor := tlabelcolor := black;
+background := white;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{snapto}
+% This truncates numerics to the $[0,1]$ range, but also returns a value
+% ($0$) for unknown and non-numeric input.
+% \begin{macrocode}
+vardef snapto expr t =
+ if unknown t : 0
+ elseif not (numeric t) : 0
+ elseif t < 0 : 0
+ elseif t > 1 : 1
+ else : t
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% The \mfpic{} handling of \LaTeX-like color models relies on being able
+% to convert those models to \MP's \opt{rgb} system. Because of the use of
+% \gbc{snapto}, the following color functions will return \mfc{black} for
+% unknown parameters. In the \MF{} case, they are all converted to
+% numerics through \gbc{makeclr}.
+%
+% \DescribeRoutine{gray}
+% The simplest is \gbc{gray} which converts a numeric to a multiple of
+% white. In \MF, \gbc{white} is a numeric and equal to $1$ so this is
+% almost redundant except for handling unknowns and out of range values.
+%
+% \DescribeRoutine{makeclr}
+% This is defined to convert a triple of numerics to a color, mainly for
+% \MF. The formula has three desirable properties: it weights the
+% different color coordinates approximately like some color luminescence
+% models do, it assigns different graylevels to the eight colors that have
+% components 0 or 1 only, and it is biased toward lighter grays. Of course
+% it takes \mfc{black} to 0 and \mfc{white} to 1. In \MP, it simply turns
+% three numeric parameters to a color triple in the obvious way.
+%
+% \DescribeRoutine{rgb}
+% To simplify \mfpic, we have the nearly redundant \gbc{rgb} which
+% converts a triple of numeric arguments to \opt{rgb}. Rather than make
+% it formally the identity function under \MP, we define it to handle
+% unknowns, and truncate out of range values.
+% \begin{macrocode}
+vardef gray (expr g) = (snapto g)*white enddef;
+
+vardef makeclr (expr r, g, b) =
+%<MF> gray (sqrt((2r*r + 4g*g + b*b)/7))
+%<MP> (r, g, b)
+enddef;
+
+vardef rgb (expr r, g, b) =
+ makeclr (snapto r, snapto g, snapto b)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{cmyk}
+% This algorithm for converting \opt{cmyk} values to \opt{rgb} values is
+% the one used in the PostScript header file \file{color.pro} (distributed
+% with \prog{dvips}).
+% \begin{macrocode}
+vardef cmyk (expr c, m, y, k) =
+ rgb (1-c-k, 1-m-k, 1-y-k)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{RGB}
+% This merely rescales numbers in the range 0--255 to the range 0--1.
+%
+% \DescribeRoutine{named}
+% \DescribeRoutine{forceclr}
+% These, too, are nearly redundant, but they convert numerics to gray, and
+% convert other non-color variables and unknown color variables to
+% black. The difference between \gbc{named} and \gbc{forceclr} is that the
+% former requires a suffix parameter, while the latter takes an
+% expression. It may be that the latter will never be needed, but for a
+% time it seemed there were cases where we ought to use it to force an
+% expression to be a color.
+% \begin{macrocode}
+vardef RGB (expr R, G, B) =
+ rgb (R/255, G/255, B/255)
+enddef;
+
+vardef named (suffix c) = forceclr (c) enddef;
+vardef forceclr (expr c) =
+ if unknown c : black
+ elseif numeric c : gray (c)
+ elseif color c : c
+ else : black
+ fi
+enddef;
+
+% \end{macrocode}
+% And then the standard colors. Using \gbc{rgb} ensures they are defined
+% in \MF{} as well as \MP.
+% \begin{macrocode}
+color red, green, blue, cyan, magenta, yellow;
+red := rgb (1, 0, 0);
+green := rgb (0, 1, 0);
+blue := rgb (0, 0, 1);
+cyan := rgb (0, 1, 1);
+magenta := rgb (1, 0, 1);
+yellow := rgb (1, 1, 0);
+
+% \end{macrocode}
+%
+% \subsection{Arrays}\label{arrays}
+%
+% \gbc{ClipPath} is a standard example of an array. It is based on the
+% fact that a variable can be of a different type from (and can be
+% almost completely unrelated to) the variables formed by putting numeric
+% suffixes on it.
+%
+% \DescribeRoutine{list}
+% The \gbc{list} macro is essentially due to Frank Michielsen, and assigns
+% a \emph{list} (i.e., a comma separated sequence of expressions) to an
+% array. Note that the items in the list have to be the same type, and the
+% same type as \mfc{v[]}. But \mfc{v} itself must be numeric.
+%
+% \DescribeRoutine{map}
+% The \gbc{map} macro takes two text parameters. The first is any
+% procedure, the second is a list of expressions. The procedure is applied
+% to each expression and the resulting new expressions are separated by
+% commas, that is, a new list is generated (for use in \mfc{for} loops).
+% This is full of possibilities for errors. One reared its head because
+% the original version started with a comma indicating an empty starting
+% expression (normally it would be ignored and that turn through the loop
+% skipped). However, it managed to produce an error in a reasonable
+% but unforeseen usage and so I added the \gbc{_map} variable that
+% skips the comma on the first time through the loop. This routine is
+% currently only used in the code \mfpic's \cs{plr} writes.
+% \begin{macrocode}
+vardef list (suffix v) (text lst) =
+ v := 0; for _itm = lst: v[incr v] := _itm; endfor
+enddef;
+
+def map (text proc) (text lst) =
+ hide(_map := 0;)
+ for _a = lst :
+ if _map = 0 : hide(_map := 1;) else: , fi
+ proc(_a)
+ endfor
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{knownarray}
+% Checks if a suffix is the name of an array. Requires \gbc{arr} to be a
+% known positive integer, and all the variables \gbc{arr[n]} to be known
+% for \gbc{n} from 1 to \gbc{arr}.
+% \begin{macrocode}
+vardef knownarray suffix arr =
+ save _kna; boolean _kna;
+ _kna := (known arr) and (numeric arr);
+ if _kna :
+ _kna := (arr = floor arr) and (arr >= 1);
+ for _idx = 1 upto arr :
+ exitif not _kna;
+ _kna := known arr[_idx];
+ endfor
+ fi
+ _kna
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{copyarray}
+% We only need this once, but it makes the code much more readable. It
+% simply steps through an array and copies the values into another array.
+% \begin{macrocode}
+def copyarray(suffix from, to) =
+ to := 0;
+ for _idx = 1 upto from:
+ to[incr to] := from[_idx];
+ endfor
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{maparr}
+% The \gbc{maparr} macro applies a procedure \gbc{proc} to each member of
+% array \gbc{p[]} with \gbc{p} members. It returns nothing, and currently
+% is unused. Though it could have been used for things like \gbc{maxpair}.
+% \begin{macrocode}
+def maparr (text proc) (suffix p) =
+ for _idx = 1 upto p: proc (p[_idx]); endfor
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{textpairs}
+% This macro takes a suffix (name of an array to be constructed) and a
+% list of pairs, and assigns them to the array. It is normally called from
+% another macro, which does any necessary \mfc{save}-ing of the variable
+% used for the array name. We used to include ``\mfc{save p;}'' in this
+% macro, but ran into a problem once when \mfc{p} had a suffix. You can't
+% apply \mfc{save} to a variable with a suffix. Moreover, ``\mfc{save p}''
+% also renders \mfc{p.x} unknown, so I judged it best to let whoever calls
+% this macro decide what to save.
+% \begin{macrocode}
+def textpairs (suffix p) (text t) =
+ numeric p; pair p[]; list (p) (t);
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{chpair}
+% This applies a procedure \gbc{proc} (which maps numeric to
+% numeric) to each part of pair \gbc{p}, and returns the resultant pair.
+%
+% \DescribeRoutine{floorpair}
+% \DescribeRoutine{ceilingpair}
+% \DescribeRoutine{hroundpair}
+% \gbc{floorpair}, \gbc{ceilingpair} and \gbc{hroundpair} use it with
+% \gbc{proc} equal to \mfc{floor}, \mfc{ceiling} and \mfc{hround}.
+% The last one is not defined in the \MP{} version of \grafbase{}
+% because \mfc{hround} is not defined (only \mfc{round}, which already
+% works on pairs). Actually, none of these is used any longer in
+% \file{grafbase.mp}.
+% \begin{macrocode}
+vardef chpair (text proc) (expr p) =
+ (proc (xpart p), proc (ypart p))
+enddef;
+
+vardef floorpair (expr p) = chpair (floor) (p) enddef;
+vardef ceilingpair (expr p) = chpair (ceiling) (p) enddef;
+%<MF>vardef hroundpair (expr p) = chpair (hround) (p) enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{emin}
+% \DescribeRoutine{emax}
+% These are more efficient versions of \prog{plain}'s \mfc{min} and
+% \mfc{max}: avoiding a \mfc{for} loop when only two values are compared.
+%
+% \DescribeRoutine{pairmin}
+% \DescribeRoutine{pairmax}
+% \gbc{pairmin} operates on two pairs, returning a pair having the
+% smaller of the two xparts and the smaller of the two yparts. Of course
+% \gbc{pairmax} is analogous, producing the maximum.
+%
+% \DescribeRoutine{minpair}
+% \DescribeRoutine{maxpair}
+% The \gbc{minpair} macro returns the pair comprising the minimum $x$ and
+% minimum $y$ coordinates of all pairs in the array \gbc{p[]}, where
+% \gbc{p} itself is a numeric count of the members in \gbc{p[]}.
+% \gbc{maxpair} is analogous. These operate by repeatedly calling
+% \gbc{pairmin} or \gbc{pairmax}.
+% \begin{macrocode}
+vardef emin (expr a, b) = if a < b : a else: b fi enddef;
+vardef emax (expr a, b) = if a > b : a else: b fi enddef;
+
+vardef pairmin (expr z, w) =
+ ( emin (xpart z, xpart w), emin (ypart z, ypart w ) )
+enddef;
+vardef pairmax (expr z, w) =
+ ( emax (xpart z, xpart w), emax (ypart z, ypart w ) )
+enddef;
+
+vardef minpair (suffix p) =
+ save _mp; pair _mp; _mp := p1;
+ for _idx = 2 upto p - 1 :
+ _mp := pairmin(_mp, p[_idx]);
+ endfor
+ pairmin (_mp, p[p])
+enddef;
+vardef maxpair (suffix p) =
+ save _mp; pair _mp; _mp := p1;
+ for _idx = 2 upto p - 1: _mp := pairmax(_mp, p[_idx]); endfor
+ pairmax (_mp, p[p])
+enddef;
+
+% \end{macrocode}
+%
+%
+% \section{The \grafbase{} coordinate system}\label{coordinate}
+%
+% We need to make a distinction between graph units, sharped units, and
+% device units. In \MF, a device unit is 1 pixel. On a LaserJet IV, one
+% inch is 600 pixels. When constructing a character, \MF{} uses the pixel
+% as its unit. Since this differs from one printing device to another,
+% \file{plain.mf} arranges for \emph{sharped} units (the name comes from the
+% convention that they are written using a name that ends in \mfc{\#}). The
+% dimension \mfc{1pt\#} in \MF{} is arbitrarily set to 1, and other
+% units defined by conversion factors (\mfc{in\#=72.27}; neither \MF{}
+% nor \MP{} makes a distinction between distances and numbers: \mfc{2pt}
+% just means \mfc{2} times the value of \mfc{pt}). When one needs to
+% draw something actually \emph{one point long}, then \mfc{1pt} is used.
+% It is defined to be equal \mfc{pt\#*hppp}, where \mfc{hppp} stands for
+% ``horizontal pixels per point'' and its value is usually set by
+% \mfc{mode_setup}. So \mfc{1pt} is $600/72.27$ (pixels) if
+% \mfc{mode} is \mfc{ljfour}.
+%
+% Often, when we want numbers not to become too large, we do calculations,
+% define paths, etc., in sharped units, then draw by scaling to device
+% units. In \grafbase{} we take this one step further: a horizontal graph
+% unit (i.e., the difference between the graph points (0, 0) and (1, 0))
+% represents \gbc{unitlen*xscale} sharped units, and
+% \gbc{unitlen*xscale*hppp} actual pixels. The \grafbase{} macros do much
+% of the calculations in graph units.
+%
+% In \MP, there is no difference between device and sharped units.
+% The \emph{postscript point} or \emph{big point} (1/72 inches) is the
+% unit in \MP: \mfc{bp = 1}.
+%
+% Some things need to be in graph units (for example, positions within a
+% graph defined by the user) or independent of units (standard shapes)
+% that scale appropriately when scales change. Other things (thickness of
+% lines) are a design decision that is either independent of scale, or
+% scales in a non-obvious way. The diameter of the drawing pen is one of
+% the latter things, so the default pen width is in device units. Also for
+% the hatching pen.
+%
+% When drawing a path we want to use device coordinates. When defining
+% paths, we typically want to use graph coordinates. The macros that do
+% the drawing, therefore, need to convert from one to the other. In
+% addition, for inclusion of the picture in a \TeX{} document, we normally
+% want the lower left corner of the graph space to have device coordinates
+% (0, 0).
+%
+% We therefore have two transforms: \gbc{vtr} is the \emph{vector} or
+% linear transform for pair quantities that remain invariant under shifts,
+% and \gbc{ztr} is a \emph{point} or affine transformation for pair
+% quantities that change appropriately under shifts.
+%
+% The quantities \gbc{xneg}, \gbc{xpos}, \gbc{yneg}, and \gbc{ypos} are
+% in \emph{graph} coordinates. Shifting by \gbc{(-xneg, -yneg)} transforms
+% the lower left corner to $(0, 0)$. Multiplication by \gbc{xscale} and
+% \gbc{yscale} converts to multiples of \gbc{unitlen} and multiplication
+% by \gbc{unitlen} gets us sharped coordinates. For \MF{},
+% multiplication by \mfc{hppp} converts to device coordinates, while for
+% \MP{} sharped and device are the same (the printer's PostScript
+% rasterizing engine -- or \prog{GhostScript} -- does the final conversion
+% to actual pixels).
+%
+% \mfc{currenttransform} (via the macro \mfc{.t_}, defined by
+% \mfc{mode_setup}) takes care of the aspect ratio.
+%
+% \gbc{charwd} and \gbc{charht} are sharped coordinates defined by the
+% startup code \gbc{beginmfpic}, and \gbc{w_} and \gbc{h_} are the
+% corresponding device (pixel) coordinates
+%
+% \DescribeRoutine{setztr}
+% This macro does the defining of \gbc{ztr} and \gbc{vtr}. It is called
+% by \gbc{beginmfpic}, at which time all the necessary quantities should be
+% known.
+% \begin{macrocode}
+transform ztr, vtr;
+def setztr =
+ if debug :
+ GBdebug;
+%<*MF>
+ >> "charwd = " & decimal charwd & "pt#";
+ >> "charht = " & decimal charht & "pt#";
+ >> "w_ = " & decimal w_ & " pixels";
+ >> "h_ = " & decimal h_ & " pixels";
+ >> "unitlen = " & decimal unitlen & "pt#";
+ >> "hppp = " & decimal hppp;
+%</MF>
+%<*MP>
+ >> "w_ = " & decimal w_ & "bp";
+ >> "h_ = " & decimal h_ & "bp";
+ >> "unitlen = " & decimal unitlen & "bp";
+%</MP>
+ >> "xneg = " & decimal xneg;
+ >> "xpos = " & decimal xpos;
+ >> "yneg = " & decimal yneg;
+ >> "ypos = " & decimal ypos;
+ >> "xscale = " & decimal xscale;
+ >> "yscale = " & decimal yscale;
+ GBenddebug;
+ fi
+ save ztr, vtr;
+ transform ztr, vtr;
+ vtr := identity xscaled (xscale) yscaled (yscale)
+ scaled (unitlen*hppp);
+ ztr := identity shifted (-(xneg, yneg)) transformed vtr;
+ if debug :
+ GBdebug;
+ >> "ztr: ";
+ show ztr;
+ >> "vtr: ";
+ show vtr;
+ GBenddebug;
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{zconv}
+% \DescribeRoutine{invzconv}
+% The macro \gbc{zconv} converts a variety of expressions from graph to
+% device coords. The expressions include pairs, paths, and transforms.
+% This is an affine transform. The inverse, \gbc{invzconv}, converts a
+% variety of expressions from device to graph coordinates.
+%
+% \DescribeRoutine{vconv}
+% \DescribeRoutine{invvconv}
+% The vector version, \gbc{vconv}, converts a vector \gbc{v} from graph to
+% device coordinates. This is a linear (ie, vector) transform. Finally,
+% \gbc{invvconv} converts a vector from device to graph coordinates.
+% \begin{macrocode}
+vardef zconv (expr a) = a transformed ztr enddef;
+vardef invzconv (expr a) = a transformed (inverse ztr) enddef;
+vardef vconv (expr v) = v transformed vtr enddef;
+vardef invvconv (expr v) = v transformed (inverse vtr) enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{active_plane}
+% \gbc{active_plane} is the active drawing plane. \mfc{currentpicture} is
+% unknown at this stage (because it's set in \gbc{beginmfpic}). We use a
+% \mfc{def}, and not a picture assignment, partly for this reason but also
+% because we can achieve special effects (see \gbc{image} below, and the
+% \gbc{tile} macro) by redefining it.
+%
+% \DescribeRoutine{image}
+% The \mfc{image} macro exists in \file{plain.mp} but not \file{plain.mf}.
+% The purpose is to just use the \file{plain} \MF{} and \grafbase{} macros
+% as you normally would, but wrap the whole thing in parentheses preceded
+% by \gbc{X := image} to get all those things drawn on the picture
+% variable \gbc{X}.
+% \begin{macrocode}
+def active_plane = currentpicture enddef;
+
+%<*MF>
+vardef image(text t) =
+ save currentpicture; picture currentpicture;
+ currentpicture := nullpicture;
+ t;
+ currentpicture
+enddef;
+
+%</MF>
+% \end{macrocode}
+%
+% \DescribeRoutine{initpic}
+% \gbc{initpic} is called by \gbc{beginmfpic} after \gbc{w_} and
+% \gbc{h_} are defined. At this point \gbc{xneg}, \gbc{xscale}, etc.,
+% have known values and \gbc{setztr} can define the transforms that are
+% based on them. Also, the default \gbc{drawpen} is initialized and the
+% boundary of the graph space is assigned to the clipping array.
+%
+% If \gbc{overlaylabels} is \gbc{true}, we try to make labels in \MP{}
+% behave the same as labels in \TeX{} (for \mfpic) by adding the labels
+% on last. We do this by adding them to the picture variable
+% \gbc{current_labels} as they occur, then add that picture onto
+% \gbc{active_plane} just before shipout. For backward compatibility,
+% the default for \gbc{overlaylabels} is \gbc{false}. We initialize
+% \gbc{current_labels} here. The pair variables \gbc{labelbb.ll} and
+% \gbc{labelbb.ur} keep track of the bounding box of added labels in case
+% \gbc{overlaylabels}, \gbc{truebbox}, and \gbc{clipall} are all
+% \gbc{false}.
+% \begin{macrocode}
+%<*MP>
+boolean overlaylabels;
+overlaylabels = false;
+
+%</MP>
+def initpic =
+ setztr;
+ resizedrawpen (penwd);
+ if ClipOn : ClipPath := 1;
+ ClipPath1 := rect (origin, (w_, h_));
+ fi
+ if debug :
+ GBdebug;
+ >> "Drawing nominal bounding box around picture";
+ GBenddebug;
+ noclip ( safedraw rect (origin, (w_, h_)) );
+ fi
+%<*MP>
+ save current_labels; picture current_labels;
+ current_labels := nullpicture;
+ save labelbb; pair labelbb.ll, labelbb.ur;
+ labelbb.ll := labelbb.ur := origin;
+%</MP>
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{mfpicenv}
+% \DescribeRoutine{endmfpicenv}
+% For compatibility with older \file{graphbase.mf} (for
+% \prog{fig2dev}'s \file{genmf.c}). Actually, I have no idea if
+% \prog{fig2dev} even works with the current \mfpic.
+% \begin{macrocode}
+def mfpicenv = enddef;
+def endmfpicenv = enddef;
+% \end{macrocode}
+% \DescribeRoutine{bounds}
+% This used to be for compatibility also, but I decided it was a
+% convenient abbreviation, so \mfpic{} uses it now.
+% \begin{macrocode}
+def bounds (expr a, b, c, d) =
+ xneg := a; xpos := b;
+ yneg := c; ypos := d;
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{setvariable}
+% This is mainly to save space in \mfpic-generated files.
+def setvariable (text kind) (suffix name) (expr value) =
+ save name; kind name; name := value;
+enddef;
+
+% \begin{macrocode}
+% \end{macrocode}
+%
+% \DescribeRoutine{beginmfpic}
+% This is the figure wrapper. \mfpic{} used to begin with figure 1 and
+% progressively increment the number. The current value of \gbc{gcode} was
+% always equal to the current figure number. Now, \mfpic{} explicitly
+% writes the figure number, so we assign \gbc{gcode} to that number in
+% case any old files made use of the current number through the
+% \gbc{gcode} variable.
+%
+% Originally, \gbc{beginmfpic} defined \mfc{w}, \mfc{h} and \mfc{d}, but
+% that caused problems if an \mfpic{} user tried to store a path in a
+% variable named \gbc{h}, etc. So now we use the less obvious names ending
+% in underscore. Apart from this, the code below is a clone of
+% \file{plain.mf}'s \mfc{beginchar} (for \MF). In fact, it used to invoke
+% \mfc{beginchar}. For \MP, we invoke \mfc{beginfig} explicitly. This does
+% the \mfc{clear...} actions and \mfc{charcode} assignment.
+%
+% The `\mfc{extra_...mfpic}' strings provide a compiler-independent way
+% to add to the extra beginning and ending tokens.
+% \begin{macrocode}
+string extra_beginmfpic; extra_beginmfpic := "";
+string extra_endmfpic; extra_endmfpic := "";
+
+def beginmfpic (expr ch) =
+%<MP> beginfig (ch);
+%<MF> begingroup
+ gcode := ch;
+ save w_, h_, d_; numeric w_, h_, d_;
+ charwd := (xpos-xneg)*xscale*unitlen;
+ charht := (ypos-yneg)*yscale*unitlen;
+ chardp := 0;
+%<*MF>
+ charcode := if known ch : byte ch else: 0 fi;
+ w_ := hround(charwd*hppp);
+ h_ := vround(charht*hppp);
+ d_ := vround(chardp*hppp);
+ charic := 0; clearxy; clearit; clearpen;
+ scantokens extra_beginchar;
+%</MF>
+%<*MP>
+ w_ := charwd;
+ h_ := charht;
+ d_ := chardp;
+%</MP>
+ initpic;
+ scantokens extra_beginmfpic;
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{endmfpic}
+% For \MF, we again clone \file{plain.mf}'s \mfc{endchar}, adding support
+% for the \gbc{clipall} (clip to the graph rectangle), and \gbc{ClipOn}
+% (clip to some user specified array of paths), and \gbc{showbbox} (draw
+% the boundary of the graph for debugging purposes).
+% \begin{macrocode}
+def endmfpic =
+ scantokens extra_endmfpic;
+ if debug :
+ GBdebug;
+%<MF> >> "TFM charwd = " & decimal charwd & "pt#";
+%<MF> >> "TFM charht = " & decimal charht & "pt#";
+%<MP> >> "width = " & decimal w_ & "bp";
+%<MP> >> "height = " & decimal h_ & "bp";
+ GBenddebug;
+ fi
+%<*MF>
+ if proofing>0 : makebox(proofrule); fi
+ chardx := w_; % desired width of character in pixels
+%</MF>
+ DoClip (active_plane);
+ if clipall : clipto (active_plane) rect(origin, (w_, h_)); fi
+ if showbbox : noclip ( safedraw rect (origin, (w_, h_)) ); fi
+%<*MF>
+ shipit;
+ if displaying > 0 : makebox(screenrule); showit; fi
+ endgroup
+%</MF>
+% \end{macrocode}
+%
+% \MP's code is more involved due to the possibility to put typeset text
+% in a picture. In addition to the \gbc{clipall}, \gbc{ClipOn} and
+% \gbc{showbbox} support, we have support for labels and \gbc{truebbox}.
+% \begin{macrocode}
+%<*MP>
+ save _ll, _ur;
+ pair _ll, _ur;
+ if truebbox :
+ _ll := llcorner active_plane;
+ _ur := urcorner active_plane;
+% \end{macrocode}
+% We try to let the bbox include labels, even when they extend beyond the
+% nominal picture boundaries. However, they will have been clipped off if
+% \gbc{clipall} is set. In that case, just set the bounding box to the
+% coordinates determined by \gbc{w_} and \gbc{h_}
+% \begin{macrocode}
+ elseif clipall:
+ _ll := origin;
+ _ur := (w_,h_);
+ else: % expand to accomodate labels
+ _ll := pairmin((0, 0 ), labelbb.ll);
+ _ur := pairmax((w_, h_), labelbb.ur);
+ fi
+% \end{macrocode}
+% A bounding box in the output PostScript code can have a side with
+% length 0 (e.g., a picture drawn with \mfpic{} that contains only
+% text placed by \TeX). This can cause division by 0 errors in some
+% contexts. That's why we don't just let \MP{} determine the bounding box,
+% but force the upper and lower coordinates to differ.
+% \begin{macrocode}
+ _ur := pairmax(_ur, _ll + eps*(1, 1));
+ setbounds active_plane to rect(_ll, _ur);
+% \end{macrocode}
+% If \gbc{overlaylabels} was true during a \gbc{newgblabel} command,
+% then \gbc{current_labels} contains that labels. We add them now, on top
+% of the picture. This might also extend the bbox, but that is an effect
+% we want to achieve.
+% \begin{macrocode}
+ addto active_plane also current_labels;
+ endfig;
+%</MP>
+enddef;
+
+% \end{macrocode}
+%
+%
+% \section{Text}\label{text}
+%
+% In the \MP{} version, \gbc{label_adjust} and \gbc{label_sep} are the
+% equivalent of \mfpic's \cs{tlabeloffset} and \cs{tlabelsep}. In the
+% \MF{} version they are still needed (in \gbc{textrect}, etc.) to place
+% the paths that are to surround the text that \TeX{} places.
+%
+% \gbc{label_adjust} is a vector displacement for the label,
+% while \gbc{label_sep} is the distance from the label to
+% the point of placement, when that point is on the edges of the label's
+% bounding box. Both are in device coordinates (e.g., \mfc{3bp}).
+% \begin{macrocode}
+pair label_adjust; label_adjust := (0, 0);
+numeric label_sep; label_sep := 0;
+
+% \end{macrocode}
+%
+% Another aspect of trying to make \mfpic's \file{.mp} and \file{.mf}
+% the same, we here define a version of \mfc{verbatimtex} for \MF. This
+% works only if \mfc{etex} is fillowed by a semicolon, and no semicolons
+% appear in the \TeX{} material. (There may be other forbidden things, and
+% certainly any parentheses have to be in matching pairs.) We would like
+% the output of \mfpic{} under the \opt{metapost} option to be usable in
+% \MF{} with minimal changes.
+% \begin{macrocode}
+%<MF>def verbatimtex = killtext enddef;
+
+% \end{macrocode}
+%
+% \subsection{Placement of text, \MP{} only}\label{placement}
+%
+% \DescribeRoutine{newgblabel}
+% \DescribeRoutine{gblabel}
+% This is how \mfpic{} places labels when \opt{mplabels} is in effect.
+% Since labels will typically be \mfc{btex...etex}, which are picture
+% expressions, it will actually place any picture, \gbc{s}. If you feed it
+% a string or path, it will convert it to a picture (with the \mfc{infont}
+% operator or the \gbc{picpath} macro). The first two parameters could easily
+% be condensed into one if \mfpic{} support were all that was required,
+% however I thought it best to generalize. The first two parameters
+% \gbc{hf} and \gbc{vf} are numeric. The \gbc{hf} represent the fraction of
+% the text that lies left of the point where the text is placed. Normally,
+% \gbc{vf} represents the fraction of text that lies below the point, but
+% if the third parameter is \mfc{true}, this fraction is relative to the
+% baseline (i.e., the depth is ignored). Currently we only use this with
+% \gbc{vf = 0} to get placement on the baseline. (Actually, \mfpic{} only
+% ever uses values of 0, .5 and 1 for \gbc{hf} or \gbc{vf}).
+%
+% The macro \gbc{newgblabel} takes 6 parameters. The first 3, as explained
+% above, effect the justification of the text (location of the point of
+% placement relative to the label). They correspond to the optional
+% parameter of \cs{tlabel} in \mfpic{} as follows:
+% \begin{itemize}
+% \item \gbc{hf} determines horizontal position: 0 = \texttt{l},
+% .5 = \texttt{c}, and 1 = \texttt{r}.
+% \item \gbc{vf} and \gbc{BL} determine vertical position. For placement
+% option \texttt{B}, \gbc{vf} = 0 and \gbc{BL} is \mfc{true}. For the
+% rest, \gbc{BL} is \mfc{false} and \gbc{vf} corresponds as follows:
+% 0 = \texttt{b}, .5 = \texttt{c} and 1 = \texttt{t}.
+% \item \gbc{r} is degrees of rotation about the specified point.
+% \item \gbc{s} is a string or picture expression (typically
+% \mfc{btex ... etex} code)
+% \item \gbc{pts} is a list of pairs in graph coordinates.
+% \end{itemize}
+% First the bounding box of the picture is extended by \gbc{label_sep} in
+% all directions by \gbc{labeldims}, then a new reference point for the
+% picture is calculated using
+% \DescribeRoutine{ref_shift}\gbc{ref_shift}
+% and then \gbc{thegblabel} rotates it around the reference
+% point and adds the \gbc{label_adjust}. Finally, for each \gbc{_itm} in
+% \gbc{pts}, the result is shifted by \gbc{_itm}. If \gbc{overlaylabels}
+% is true, the label is placed on the picture \gbc{current_labels} and
+% added to \gbc{active_plane} at \gbc{endmfpic}. Otherwise, it is added
+% directly to \gbc{active_plane} and and the \gbc{labelbb} are adjusted.
+%
+% We also use \gbc{ref_shift} in \MF{} since the curves that surround text
+% require it.
+%
+% We keep \gbc{gblabel} for backward compatibility with old \mfpic{}
+% files, but it merely calls \gbc{newgblabel}. While the old \gbc{gblabel}
+% had the same flexibility as \gbc{newgblabel}, this one assumes that the
+% parameters are only those that \mfpic{} would write. We provide a null
+% definition for \MF{} to allow \mfpic's \file{.mp} files to be usable with
+% minimal changes.
+% \begin{macrocode}
+%<MF>def newgblabel (expr hf, vf, BL, r) (text s) (text pts) = enddef;
+%<*MP>
+vardef newgblabel (expr hf, vf, BL, r) (expr s) (text pts) =
+ save _lab, _ll, _ur; picture _lab; pair _ll, _ur;
+ _lab :=
+ if picture s : s
+ elseif string s : s infont defaultfont scaled defaultscale
+ elseif path s : picpath (s)
+ else : nullpicture
+ fi;
+ labeldims (origin, _lab) (_ll, _ur);
+ _lab := thegblabel(ref_shift (hf, vf, BL, _ll, _ur), r, _lab);
+ save _b; pair _b;
+ for _itm = pts :
+ _b := zconv(_itm);
+ if overlaylabels :
+ addto current_labels also _lab shifted _b _wc_ tlabelcolor;
+ else:
+ addto active_plane also _lab shifted _b _wc_ tlabelcolor;
+ labelbb.ll := pairmin (_b + llcorner _lab, labelbb.ll);
+ labelbb.ur := pairmax (_b + urcorner _lab, labelbb.ur);
+ fi
+ endfor
+enddef;
+
+% Assumes a+b=1 and either c+d=1 or c=d=0:
+vardef gblabel (expr a, b, c, d, r) (expr s) (text t) =
+ newgblabel (b, d, (c = 0) and (d = 0), r) (s) (t);
+enddef;
+
+%</MP>
+vardef ref_shift (expr hf, vf, BL, ll, ur) =
+ - ( (hf)[xpart ll, xpart ur],
+ (vf)[if BL: 0 else: (ypart ll) fi, ypart ur] )
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{thegblabel}
+% When \gbc{thegblabel} is called by the above, \gbc{p} is a text picture,
+% but it is also called by the \gbc{textrect}, etc., in which case \gbc{p}
+% is a path. This is why it is needed in the \MF{} version.
+% \begin{macrocode}
+vardef thegblabel (expr z, r, p) =
+ ((p shifted z) rotated r) shifted label_adjust
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Decorating the text}\label{decorating}
+%
+% \DescribeRoutine{textrect}
+% \DescribeRoutine{textoval}
+% \DescribeRoutine{textellipse}
+% The three macros \gbc{textrect}, \gbc{textoval} and \gbc{textellipse}
+% are designed to surround a bit of text with some curve. These macros
+% return the path in graph coordinates. In the first one, the path is a
+% rectangle with rounded corners. The second parameter, \gbc{rad}, is the
+% radius of quarter circles at the corners (in device units). In the other
+% two cases, the path is an ellipse. They differ in the meaning of the
+% second parameter.
+%
+% In \gbc{textoval}, the second parameter \emph{multiplies} the ratio of
+% width to height of the text to produce the ratio for the ellipse. Thus,
+% with \gbc{mult}=1, the ratio will be the same as that of the text. In
+% \gbc{textellipse}, the second parameter \gbc{rat} is the actual value of
+% the ratio of width to height of the ellipse and a value of 1 produces a
+% circle. In either macro, if that parameter is 0, we draw a rectangle.
+%
+% The size of each path is determined so that, when the text is placed and
+% the path drawn, it passes through the four corners of the following
+% rectangle: the rectangle which just encloses the text plus the amount of
+% space on all sides determined by \gbc{label_sep}. Note that this means
+% a rectangle with rounded corners will have larger height and width than
+% one without.
+%
+% The placement of each path is: centered at the point given in the third
+% parameter \gbc{loc}, shifted by the vector specified in \gbc{label_adjust}.
+%
+% The first parameter \gbc{lbl} is either a pair representing the
+% height and width of the text (only possibility in \MF) or the actual
+% text. These macros are being kept for backward compatibity, but now they
+% call the extended versions that allow the path to follow arbitrary
+% text placement. The parameters \gbc{(.5,.5,false,0)} were those
+% assumed in the past version: centered at the point, with no rotation.
+%
+% The extended versions of \gbc{textoval} and \gbc{textellipse} are both
+% now implemented in a single command \gbc{xellipse}, with a boolean to
+% specify whether the aspect ratio of the text is used to calculate the
+% aspect of the ellipse.
+% \begin{macrocode}
+vardef textrect (expr lbl, rad, loc) =
+ textrectx (.5, .5, false, 0) (origin, lbl, rad, loc)
+enddef;
+vardef textoval (expr lbl, mult, loc) =
+ xellipse (true, .5, .5, false, 0) (origin, lbl, mult, loc)
+enddef;
+vardef textellipse (expr lbl, rat, loc) =
+ xellipse (false, .5, .5, false, 0) (origin, lbl, rat, loc)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{textrectx}
+% \DescribeRoutine{textovalx}
+% \DescribeRoutine{textellipsex}
+% These are extended versions of the previous three. They will now be
+% able adjust the position of the path in the same manner as \gbc{newgblabel}
+% does the text. In fact, they calculate the position in exactly the same
+% manner as that macro, and the first 4 parameters encode that in the same
+% way.
+%
+% \gbc{lbl} is either the upper right corner of the text or the label
+% itself. In the first case \gbc{xy} is the lower left corner, in the
+% second case it is a dummy parameter, the bounding box being obtained (in
+% \gbc{labeldims}) by measuring the label. For these extended macros, the
+% parameters \gbc{lbl}, \gbc{mult}, \gbc{rad}, and \gbc{loc} are as in
+% the unextended versions.
+%
+% \gbc{roundends} is a boolean. We really only need it to be a type
+% distinguishable from any numeric value. \Mfpic{} users can specify it
+% rather than an explicit radius, and when the code of \gbc{textrectx}
+% detects this, it uses the maximum radius for the corners (making the
+% short side of the `rectangle' a semicircle). That is, if \gbc{rad} is
+% a boolean (and \mfc{true}) then the radius at the corners is so chosen.
+% (If \gbc{rad} is \mfc{false} the corners are not rounded at all.)
+% \begin{macrocode}
+boolean roundends; roundends := true;
+vardef textrectx (expr a, b, c, rot, xy, lbl, rad, loc) =
+ save ll, ur, _r, f, zz;
+ pair ll, ur, zz; path f;
+ labeldims (xy, lbl) (ll, ur);
+ _r :=
+ if boolean rad :
+ if rad : emin (xpart (ur-ll), ypart (ur-ll))/sqrt(2)
+ else: 0
+ fi
+ elseif numeric rad : rad
+ else: 0
+ fi;
+ if _r = 0 :
+ f := rect(ll, ur);
+ else:
+ save p, q;
+ pair p[]; path q;
+ p1 := ur - _r*dir(45); % center of upper right arc
+ p3 := ll + _r*dir(45); % lower left
+ p2 := (xpart p3, ypart p1); % upper left
+ p4 := (xpart p1, ypart p3); % lower right
+ q := quartercircle scaled 2_r;
+ if _r > 0:
+ f := (q shifted p1) -- (q rotated 90 shifted p2)
+ -- (q rotated 180 shifted p3)
+ -- (q rotated -90 shifted p4)
+ -- cycle;
+ else:
+ f := (q shifted p1) -- (q rotated -90 shifted p4)
+ -- (q rotated 180 shifted p3)
+ -- (q rotated 90 shifted p2)
+ -- cycle;
+ fi
+ fi
+ invvconv(thegblabel(ref_shift(a, b, c, ll, ur), rot, f)) shifted loc
+enddef;
+
+% \end{macrocode}
+%
+% As the coding of \gbc{textoval} and \gbc{textellipse} was refined, it
+% turned out that each refinement in one suggested a similar change in the
+% other. In the end the two differed only in two lines, so now both call
+% another macro \gbc{xellipse}.
+% \begin{macrocode}
+def textovalx = xellipse (true) enddef;
+def textellipsex = xellipse (false) enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{xellipse}
+% In \gbc{xellipse}, \gbc{aa} and \gbc{bb} are the horizontal and
+% vertical radii of the resulting ellipse, while \gbc{ww} and \gbc{hh}
+% are half the width and height size of the text. If the boolean
+% \gbc{aspect} is true, the aspect ratio of the ellipse (i.e., \gbc{aa/bb})
+% equals \gbc{mult*hh/ww}, otherwise it equals \gbc{mult}.
+% \begin{macrocode}
+vardef xellipse (expr aspect, a, b, c, r, xy, lbl, mult, loc) =
+ if mult = 0 :
+ textrectx (a, b, c, r) (xy, lbl, 0, loc)
+ else:
+ save ll, ur, cc, ww, hh, f;
+ pair ll, ur, cc; path f;
+ labeldims (xy, lbl) (ll, ur);
+ cc := .5[ll, ur]; % center
+ (ww, hh) = ur - cc;
+ if (ww = 0) or (hh = 0) : % make a line:
+ f = (ll--ur);
+ else:
+ save aa, bb, mm;
+ mm := if aspect : ww/hh*mult else: mult fi;
+ aa := ww ++ hh*mm;
+ bb := aa/mm;
+ f := ellipse(cc, aa, bb, 0);
+ fi
+ invvconv(thegblabel (ref_shift (a, b, c, ll, ur), r, f)) shifted loc
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{labeldims}
+% This has been changed to make the code of \mfpic{} a bit simpler and
+% to aid in backward compatibility. It takes a couple of pairs (the actual
+% or nominal label bounding box corners) or something visible (picture,
+% string or path) and assigns suitable values to \gbc{ll} and \gbc{ur}
+% then expands the bbox by \gbc{label_sep}.
+% \begin{macrocode}
+
+def labeldims (expr xy, lbl) (suffix ll, ur) =
+ if pair lbl :
+ ll := xy; ur := lbl;
+ else:
+%<MF> ll := ur := (0, 0);
+%<*MP>
+ save _lbl; picture _lbl;
+ _lbl :=
+ if picture lbl : lbl
+ elseif string lbl :
+ lbl infont defaultfont scaled defaultscale
+ elseif path lbl : picpath (lbl)
+ else : nullpicture
+ fi;
+ ll := llcorner _lbl;
+ ur := urcorner _lbl;
+%</MP>
+ fi
+ ll := ll - label_sep*(1, 1);
+ ur := ur + label_sep*(1, 1);
+enddef;
+
+% \end{macrocode}
+%
+%
+% \section{Additional functions}\label{functions}
+%
+% Complex variable functions are provided, which interpret a pair $(x, y)$
+% as the complex number $z = x + iy$. We also provide for the use of
+% radians, add the standard exponential and logarithms, and add the
+% hyperbolic functions and their inverses.
+%
+% The value \gbc{eps/2 + epsilon} is the smallest value with
+% reciprocal less than \mfc{infinity}. I set \gbc{nottoosmall} a speck
+% bigger to ensure that the same is true of \gbc{2*(nottoosmall/2)}.
+%
+% Normally \mfc{infinity = 2**12 - epsilon} is the largest number allowed
+% (as a value involved in actual drawing in \MF). Since we set
+% \mfc{warningcheck=0}, values not assigned to a variable and not
+% written to the \file{.tfm} file (and any value in \MP) can be as high as
+% \mfc{2**15 - epsilon}, which is a speck smaller than \mfc{1/(2epsilon)}.
+% So \gbc{reallysmall} is to be the smallest number whose reciprocal is a
+% usable number. (\mfc{epsilon} is the smallest possible positive number
+% in \MF.)
+%
+% We set \gbc{secd x = 1/(cosd x)} unless \gbc{cosd x} is less than ``really
+% small'', then we set it equal to \gbc{1/reallysmall}. We do a similar
+% thing with \gbc{cscd}.
+%^^A
+% \DescribeRoutine{TruncateWarn}
+% (When such a substitution happens \gbc{TruncateWarn} prints a message
+% that a truncation has taken place.)
+%
+% Why not just determine what number will produce arithmetic overflow and
+% test for that? Because I'm lazy: it would require a different number
+% for each of the functions. Instead, since \MF{} has no ``arithmetic
+% underflow'', I compute something that is guaranteed to work and occurs
+% in the formula for the function as a reciprocal (e.g., $t = e^{-|x|}$
+% for \gbc{cosh x}) and make sure the number is not too small to take its
+% reciprocal.
+%
+% \DescribeRoutine{signof}
+% This expands to a minus sign if its argument is negative, otherwise
+% nothing.
+% \begin{macrocode}
+newinternal nottoosmall; nottoosmall := eps/2 + 2epsilon;
+newinternal reallysmall; reallysmall := 3epsilon;
+def signof (expr X) = if X < 0 : - fi enddef;
+def TruncateWarn expr s = GBmsg s & " too large; truncating"; enddef;
+
+% \end{macrocode}
+% In addition to \mfc{sind} and \mfc{cosd} which take angles in degrees,
+% we define the remaining trig functions \gbc{tand}, \gbc{cotd},
+% \gbc{secd}, and \gbc{cscd}.
+%
+% \DescribeRoutine{secd}
+% \DescribeRoutine{tand}
+% \DescribeRoutine{cscd}
+% \DescribeRoutine{cotd}
+% We define \gbc{secd}, one of the simplest, to include an ``out of range''
+% test (which also prevents division by 0). Then \gbc{tand} can make use
+% of it without any division. We do the same with \gbc{cscd} and
+% \gbc{cotd}.
+% \begin{macrocode}
+vardef secd primary X =
+ save temp; temp := cosd(X);
+ if abs(temp) < reallysmall :
+ TruncateWarn "Secant";
+ temp := signof (temp) reallysmall;
+ fi
+ 1/temp
+enddef;
+vardef tand primary X = sind(X)*secd(X) enddef;
+
+vardef cscd primary X =
+ save temp; temp := sind(X);
+ if abs(temp) < reallysmall :
+ TruncateWarn "Cosecant";
+ temp := signof(temp) reallysmall;
+ fi
+ 1/temp
+enddef;
+vardef cotd primary X = cosd(X)*cscd(X) enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{acos}
+% \DescribeRoutine{asin}
+% \DescribeRoutine{atan}
+% These are the inverse functions, which return an angle in degrees.
+% \begin{macrocode}
+vardef acos primary X = angle (X, 1 +-+ X) enddef;
+vardef asin primary X = angle (1 +-+ X, X) enddef;
+vardef atan primary X = angle (1, X) enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{sin}
+% \DescribeRoutine{cos}
+% \DescribeRoutine{tan}
+% \DescribeRoutine{cot}
+% \DescribeRoutine{sec}
+% \DescribeRoutine{csc}
+% Now the trig functions that take angles in radians.
+% \begin{macrocode}
+vardef sin primary X = sind (X*radian) enddef;
+vardef cos primary X = cosd (X*radian) enddef;
+vardef tan primary X = tand (X*radian) enddef;
+vardef cot primary X = cotd (X*radian) enddef;
+vardef sec primary X = secd (X*radian) enddef;
+vardef csc primary X = cscd (X*radian) enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{invsin}
+% \DescribeRoutine{invcos}
+% \DescribeRoutine{invtan}
+% And the inverses that return angles in radians.
+% \begin{macrocode}
+vardef invcos primary X = (acos X)/radian enddef;
+vardef invsin primary X = (asin X)/radian enddef;
+vardef invtan primary X = (atan X)/radian enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{exp}
+% \DescribeRoutine{ln}
+% \DescribeRoutine{log}
+% \DescribeRoutine{logbase}
+% \DescribeRoutine{logtwo}
+% \DescribeRoutine{logten}
+% Here we define the standard exponential function. (The \MF{} function
+% \mfc{mexp} has the unusual base $e^{1/256}$ to avoid overflow.) The
+% inverse of \gbc{exp} is the natural logarithm (\gbc{ln} or \gbc{log}).
+% We also have the general base logarithm \gbc{logbase} and its two
+% special instances \gbc{logtwo} and \gbc{logten}.
+% \begin{macrocode}
+vardef exp primary X = mexp (256 * X) enddef;
+vardef ln primary X = (mlog X) / 256 enddef;
+def log = ln enddef;
+vardef logbase (expr B) primary X = (mlog X)/(mlog B) enddef;
+def logtwo = logbase( 2) enddef;
+def logten = logbase(10) enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{Arg}
+% \DescribeRoutine{Log}
+% \DescribeRoutine{cis}
+% \DescribeRoutine{zexp}
+% \DescribeRoutine{sgn}
+% \CMF's pair variables are a decent replacement for complex variables.
+% These give some of the more basic functions of standard complex
+% analysis.
+% \begin{macrocode}
+vardef Arg primary Z = (angle Z)/radian enddef;
+vardef Log primary Z = (ln(abs(Z)), Arg (Z)) enddef;
+vardef cis primary T = dir(radian*T) enddef;
+vardef zexp primary Z = (exp (xpart Z))*(cis(ypart Z)) enddef;
+vardef sgn primary Z =
+ if Z = origin : origin else: unitvector Z fi
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{cosh}
+% \DescribeRoutine{sinh}
+% \DescribeRoutine{tanh}
+% \DescribeRoutine{sech}
+% \DescribeRoutine{csch}
+% \DescribeRoutine{coth}
+% The hyperbolic functions.
+% \begin{macrocode}
+vardef cosh primary X =
+ save temp; temp := 2 exp (-abs(X));
+ if temp < reallysmall :
+ TruncateWarn "Cosh";
+ temp := reallysmall;
+ fi
+ 1/temp + temp/4
+enddef;
+
+vardef sinh primary X =
+ save temp; temp := 2 exp (-abs(X));
+ if temp < reallysmall :
+ TruncateWarn "Sinh";
+ temp := reallysmall;
+ fi
+ signof (X) (1/temp - temp/4)
+enddef;
+
+vardef sech primary X =
+ save temp; temp := exp(-(abs (X)));
+ 2temp/(1 + temp*temp)
+enddef;
+
+vardef tanh primary X =
+ save temp; temp := exp(-2(abs (X)));
+ signof (X) (1 - temp)/(1 + temp)
+enddef;
+
+vardef csch primary X =
+ save temp; temp := exp(-(abs (X)));
+ if abs(1 - temp*temp) < reallysmall :
+ TruncateWarn "Csch";
+ signof (X) 2temp / reallysmall
+ else:
+ signof (X) 2temp / (1 - temp*temp)
+ fi
+enddef;
+
+vardef coth primary X =
+ save temp; temp := tanh(X);
+ if abs(temp) < reallysmall :
+ TruncateWarn "Coth";
+ temp := signof (temp) reallysmall;
+ fi
+ 1/temp
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{acosh}
+% \DescribeRoutine{asinh}
+% \DescribeRoutine{atanh}
+% The inverses of some of the hyperbolic functions.
+% \begin{macrocode}
+vardef acosh primary y =
+ if y < 1 :
+ GBerrmsg ("Undefined function: acosh " & decimal y)
+ "If you proceed, a value of 0 will be used. " &
+ "Expect more errors later.";
+ 0
+ else:
+ ln (y + (y+-+1))
+ fi
+enddef;
+
+vardef asinh primary y = ln (y + (y++1)) enddef;
+
+vardef atanh primary y =
+ if abs (y) < 1 :
+ (ln(1+y) - ln(1-y))/2
+ else:
+ GBerrmsg ("Undefined function: atanh " & decimal y)
+ "If you proceed, a value of plus or minus infinity " &
+ "will be used. Expect more errors later.";
+ signof (y) infinity
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{polar}
+% \DescribeRoutine{id}
+% \gbc{polar} converts a polar coordinate pair $(r, \theta)$ to the
+% corresponding rectangular coordinate pair.
+%
+% \gbc{id} returns its argument, which can be any expression of any type.
+% \begin{macrocode}
+vardef polar (expr p) = (xpart p) * dir (ypart p) enddef;
+def id (expr x) = x enddef;
+
+% \end{macrocode}
+%
+%
+% \section{Coordinate systems and transformations}\label{systems}
+%
+% \DescribeRoutine{T_push}
+% \DescribeRoutine{T_pop}
+% \DescribeRoutine{bcoords}
+% \DescribeRoutine{ecoords}
+% We want to define a localization of the ``current transform''. To do
+% this we define a LIFO stack of transforms \gbc{T_stack[]}, a pair of
+% macros \gbc{T_push} puts its argument (a transform) on the stack, and
+% \gbc{T_pop} pops it off into its argument (a transform variable name).
+% We also define two localizing macros \gbc{bcoords} that pushes our
+% \gbc{ztr} and \gbc{vtr} on the stack, and \gbc{ecoords} that pops them
+% off.
+% \begin{macrocode}
+transform T_stack[]; T_stack := 0;
+def T_push (expr T) = T_stack[incr T_stack] := T; enddef;
+def T_pop (suffix $) =
+ if T_stack > 0 :
+ $ := T_stack[T_stack]; T_stack := T_stack - 1;
+ fi
+enddef;
+
+def bcoords = hide ( T_push (ztr); T_push (vtr) ) enddef;
+def ecoords = hide ( T_pop (vtr); T_pop (ztr) ) enddef;
+
+% \end{macrocode}
+%
+% \subsection{Coordinate changes}\label{changes}
+%
+% \DescribeRoutine{apply_t}
+% Here we define a mechanism for changing \gbc{ztr} and \gbc{vtr} by
+% composing them with a new transform. Since a transform can be any affine
+% transform, we get \gbc{ztr} by composing with the transform, but we
+% calculate \gbc{vtr} from \gbc{ztr} by arranging that \mfc{origin
+% transformed vtr} is \mfc{origin}. The syntax is \gbc{apply_t(rotated
+% theta)} or \gbc{apply_t(transformed T)} if \mfc{T} is a variable or
+% expression of type transform. Thus the argument of \gbc{apply_t} is
+% phrase which, were it to follow a path, would produce a transformed
+% path. Knuth calls such a phrase a \emph{transformer}.
+% \begin{macrocode}
+def apply_t (text Transformer) =
+ ztr := identity Transformer transformed ztr;
+ vtr := ztr shifted - zconv(origin);
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{xslant}
+% \DescribeRoutine{yslant}
+% \DescribeRoutine{zslant}
+% \DescribeRoutine{xyswap}
+% \DescribeRoutine{boost}
+% And now we define some available transformers. The only two that
+% need comment are \gbc{zslant} and \gbc{boost}. I know that boost comes
+% from special relativity, but I have no idea what zslant is about.
+% \begin{macrocode}
+def xslant = slanted enddef; % (x+sy, y).
+def yslant primary s = % (x, y+sx).
+ transformed
+ begingroup
+ save _T; transform _T;
+ origin transformed _T = origin;
+ (1, 0) transformed _T = (1, s);
+ (0, 1) transformed _T = (0, 1);
+ _T
+ endgroup
+enddef;
+
+def zslant primary p = % (xu+yv, xv+yu), where p = (u, v).
+ transformed
+ begingroup
+ save _T; transform _T;
+ xpart _T = ypart _T = 0;
+ xxpart _T = yypart _T = xpart p;
+ xypart _T = yxpart _T = ypart p;
+ _T
+ endgroup
+enddef;
+
+def xyswap = zslant (0, 1) enddef;
+def boost primary X = zslant (cosh X, sinh X) enddef;
+
+% \end{macrocode}
+%
+% \subsection{Path transformation}\label{transformation}
+%
+% These are functions that accept a path and return a path in graph
+% coordinates. For the most part they are named and defined to
+% apply a similarly named transform to the path and return the result.
+% There are two exceptions. When we draw things, we expect that rotated
+% and reflected objects appear congruent to the originals. If we define a
+% path in graph coordinates, and the x and y directions are scaled
+% differently, then simply rotating the graph coordinates will distort
+% angles. The same is true of reflection. Therefore, we apply \gbc{vtr}
+% (so we are in drawing coordinates) then rotate, then apply \gbc{inverse
+% vtr}. This may be a mistake, or perhaps we should do it for all of
+% these. For now, I'm sticking with the scheme I inherited. One can
+% always use \gbc{coords} and \gbc{apply_t} if one wants the difference in
+% scales ignored.
+%
+% \DescribeRoutine{rotatedpath}
+% This returns the path rotated around point \gbc{p} by angle
+% \gbc{th} in degrees.
+%
+% \DescribeRoutine{scaledpath}
+% This returns the path scaled so that distances from the point
+% \gbc{p} are multiplied by \gbc{s}.
+%
+% \DescribeRoutine{xslantedpath}
+% This returns the path x-slanted with line $y = {}$\gbc{b}
+% being the pivot rather than the x-axis.
+%
+% \DescribeRoutine{yslantedpath}
+% This returns the path y-slanted with line $x = {}$\gbc{a}
+% being the pivot rather than the y-axis.
+%
+% \DescribeRoutine{xscaledpath}
+% This returns the path scaled so that vertical distances
+% from the line $y={}$\gbc{a} are multiplied by \gbc{s}.
+%
+% \DescribeRoutine{yscaledpath}
+% This returns the path scaled so that vertical distances
+% from the line $x={}$\gbc{b} are multiplied by \gbc{s}.
+%
+% \DescribeRoutine{shiftedpath}
+% This returns the path shifted by the vector (pair) \gbc{v}.
+%
+% \DescribeRoutine{reflectedpath}
+% This returns the path relected about the line through the
+% points \gbc{p} and \gbc{q}.
+%
+% \DescribeRoutine{xyswappedpath}
+% Finally, this returns the path in which all coordinates
+% have had the coordinates exchanged $(a, b) \to (b, a)$. Note that this
+% is not the same as \gbc{reflectedpath ((0, 0), (1, 1))}, as it performs the
+% reflection in graph coordinates, as its name implies. If \gbc{vtr} has
+% not been changed (by \gbc{apply_t}) then \gbc{xyswappedpath} will
+% convert vertical lines to horizontal and vice versa. The
+% \gbc{reflectedpath} version will not when x and y are scaled differently,
+% for then the line \gbc{(0, 0)--(1, 1)} is not at a 45 degree angle in
+% device coordinates where drawing takes place.
+% \begin{macrocode}
+vardef rotatedpath (expr p, th) expr f =
+ f transformed vtr rotatedaround (p transformed vtr, th)
+ transformed (inverse vtr)
+enddef;
+vardef scaledpath (expr p, s) expr f =
+ f shifted -p scaled s shifted p
+enddef;
+vardef xslantedpath (expr b, s) expr f =
+ f shifted (0, -b) slanted s shifted (0, b)
+enddef;
+def slantedpath = xslantedpath enddef;
+vardef yslantedpath (expr a, s) expr f =
+ f shifted (-a, 0) yslant s shifted (0, a)
+enddef;
+vardef xscaledpath (expr a, s) expr f =
+ f shifted (-a, 0) xscaled s shifted (a, 0)
+enddef;
+vardef yscaledpath (expr b, s) expr f =
+ f shifted (0, -b) yscaled s shifted (0, b)
+enddef;
+vardef shiftedpath (expr v) expr f = f shifted v enddef;
+vardef reflectedpath (expr p, q) expr f =
+ f transformed vtr
+ reflectedabout (p transformed vtr, q transformed vtr)
+ transformed (inverse vtr)
+enddef;
+vardef xyswappedpath expr f = f xyswap enddef;
+vardef transformedpath (text Transformer) expr f =
+ f Transformer
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{partialpath}
+% \DescribeRoutine{gsubpath}
+% It seems odd, in retrospect, that we got by with a user interface that
+% didn't include any subpath operations. But recently a user asked for the
+% ability to add an arrowhead to the \emph{middle} of a path, and it
+% seemed best to provide a subpath and use existing commands to add an
+% arrowhead on its end. This macro takes two fractions $\alpha$ and
+% $\beta$ between 0 and 1, and a path \gbc{f}, and returns the subpath
+% from $\alpha * {} $\meta{length of \gbc{f}} to $\beta * {}$\meta{length
+% of \gbc{f}} of \gbc{f}. \gbc{gsubpath} is the same as \MF's subpath
+% primitive, but follows the prefix macro syntax of accepting a path
+% expression (rather than a primary) and wrapping the result in a
+% \mfc{vardef}.
+% \begin{macrocode}
+vardef partialpath (expr a, b) expr f =
+ save p; path p;
+ p := zconv (f) scaled (1/unit_of_length);
+ save cumlen, totlen, idx, ta, tb;
+ totlen := makelengtharray(cumlen) p;
+% \end{macrocode}
+% \gbc{idx} holds the current index into the array \gbc{cumlen[]}. The
+% code of \gbc{gettime} is optimized for sorted lengths. If we always
+% found \gbc{ta} first, we'd have to re-initialize \gbc{idx} in case
+% \gbc{tb < ta}, i.e., search from the beginning again.
+% \begin{macrocode}
+ idx := 0;
+ if a <= b:
+ ta := gettime (cumlen, idx) (a*totlen);
+ tb := gettime (cumlen, idx) (b*totlen);
+ else:
+ tb := gettime (cumlen, idx) (b*totlen);
+ ta := gettime (cumlen, idx) (a*totlen);
+ fi
+ subpath (ta, tb) of f
+enddef;
+vardef gsubpath (expr a, b) expr f = subpath (a, b) of f enddef;
+
+% \end{macrocode}
+%
+%
+% \section{Picture level operations}\label{picture}
+%
+% None of these operations are available in \MP. Mostly these are used by
+% higher level operations. Those higher level operations are available in
+% \MP, but need to be defined differently.
+%
+% \subsection{Bitwise logical operations}\label{logical}
+%
+% We have two types of operations. One type is a binary operator that
+% takes two picture expressions and returns a picture, the other type
+% returns nothing, but merely modifies a given picture variable. These
+% take the name of a picture and a picture expression and modify the named
+% one. The binary operators are not used elsewhere in graphbase except
+% for \gbc{picsub}, which occurs in \gbc{picneg} and \gbc{shadepic}.
+%
+% \DescribeRoutine{mono}
+% Here we define the bitwise logical operations: and, or, xor, and
+% difference. These mostly only work if all pixels have values 0 or 1.
+% Since \MF{} allows other integer values, we define a \gbc{mono} operator
+% that converts all pixels with weight ${}\ge 1$ to 1 and all pixels
+% with weight ${}\le 0$ to 0.
+% \begin{macrocode}
+%<*MF>
+def mono (suffix u) = cull u keeping (1, infinity); enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{andto}
+% \DescribeRoutine{picand}
+% The bitwise and: in the resulting picture, a pixel is \emph{on} if and
+% only if it is \emph{on} in both \gbc{u} and \gbc{v}.
+% \begin{macrocode}
+def andto (suffix u) (expr v) =
+ mono (u); addto u also v; cull u keeping (2, 2);
+enddef;
+primarydef u picand v =
+ begingroup save t; picture t;
+ t := u; andto (t, v); t
+ endgroup
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{orto}
+% \DescribeRoutine{picor}
+% The inclusive or: in the result, a pixel is \emph{on} if and only if it
+% is \emph{on} in \gbc{u} or \gbc{v} or both.
+% \begin{macrocode}
+def orto (suffix u) (expr v) =
+ mono (u); addto u also v; cull u keeping (1, 2);
+enddef;
+primarydef u picor v =
+ begingroup save t; picture t;
+ t := u; orto (t, v); t
+ endgroup
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{xorto}
+% \DescribeRoutine{picxor}
+% The exclusive or, also called the symmetric difference:
+% in the result, a pixel is \emph{on} if and only if it is \emph{on} in
+% \gbc{u} or \gbc{v}, but not both. These are not used elsewhere in
+% \grafbase.
+% \begin{macrocode}
+def xorto (suffix u) (expr v) =
+ mono (u); addto u also v; cull u keeping (1, 1);
+enddef;
+primarydef u picxor v =
+ begingroup save t; picture t;
+ t := u; xorto (t, v); t
+ endgroup
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{subto}
+% \DescribeRoutine{picsub}
+% The nonsymmetric difference: in the result, a pixel is \emph{on} if
+% and only if it is \emph{on} in \gbc{u} and off in \gbc{v}.
+% \begin{macrocode}
+def subto (suffix u) (expr v) =
+ mono (u); addto u also -v; cull u keeping (1, 1);
+enddef;
+primarydef u picsub v =
+ begingroup save t; picture t;
+ t := u; mono (t); subto (t, v); t
+ endgroup
+enddef;
+
+%</MF>
+% \end{macrocode}
+%
+% \subsection{Producing and modifying pictures}
+%
+% Here we define some slightly higher level commands that make use (in \MF)
+% of the previous bitmap operations. In \MP, they mostly need different
+% definitions, but we have merged most of them by providing a \MP{}
+% alternative for the most frequently used bitmap operation in the
+% previous section, \gbc{orto}. These operations either return a picture
+% or modify a picture variable. They do not draw anything unless
+% \gbc{active_plane} is the modified picture. All curves, points,
+% dimension, etc., are in device coordinates.
+%
+% \DescribeRoutine{coloraddto}
+% This has become a useful abbreviation. In \MF{} it adds when the color
+% is not white, subtracts when it is. Grays are handles in \MF{} by
+% appropriate preparation of \gbc{u} and \gbc{v}. See, for example, the
+% code of \gbc{colorsafefill}. In \MP{} it is an abbreviation for the
+% basic \mfc{addto} operation, and is defined only so that \MP{} and \MF{}
+% can share the same higher level code.
+% \begin{macrocode}
+def coloraddto (expr clr) (suffix u) (expr v) =
+%<*MF>
+ if clr < white :
+ orto (u, v);
+ else:
+ subto (u) (v);
+ fi;
+%</MF>
+%<MP> addto u also v _wc_ clr;
+enddef;
+
+%<MP>def orto (suffix u) (expr v) = addto u also v; enddef;
+%<MP>
+% \end{macrocode}
+%
+% \DescribeRoutine{interior}
+% This takes the following expresion, \gbc{c}, which must be a
+% closed path, and returns the picture expression which is that path
+% filled. The cull command (\MF{} only) retains negative pixels
+% (converting them to positive). This way, clockwise contours are filled
+% also. \gbc{interior} is one of the most used commands throughout the
+% rest of \grafbase.
+%
+% We ignore color (new behavior), since the higher level commands now
+% implement the coloring operations.
+% \begin{macrocode}
+vardef interior expr c =
+ save v; picture v; v := nullpicture;
+ addto v contour (c.t_);
+%<MF> cull v dropping (0, 0);
+ v
+enddef;
+% \end{macrocode}
+%
+% \DescribeRoutine{interiors}
+% This is followed by the name of an array of closed paths and
+% returns the picture of the interiors of those closed paths. It builds
+% the returned picture from \mfc{nullpicture} by successively adding
+% the result of \gbc{interior} applied to each path in the array. This is
+% only used once by \grafbase, in \gbc{clipsto}, which might be a better
+% place to put the \mfc{for}-loop and not use this at all.
+% \begin{macrocode}
+vardef interiors suffix cc =
+ save _ints; picture _ints; _ints := nullpicture;
+ for _idx = 1 upto cc:
+ addto _ints also interior cc[_idx]);
+ endfor
+%<MF> mono (_ints);
+ _ints
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Clipping}\label{basicclipping}
+%
+% \DescribeRoutine{clipto}
+% \gbc{clipto} takes the name of a picture \gbc{vt} and a closed path
+% \gbc{c} and modifies the picture leaving only the part inside the path.
+% In \MP{} we just invoke the \mfc{clip} primitive.
+%
+% \DescribeRoutine{clipsto}
+% This is similar, except it takes an array of paths \gbc{cc} and
+% leaves what is interior to any of the paths. This is one case where
+% \MP{} requires a substantially different point of view. In \MF, we
+% create the interiors and `and' the result to the named picture. In \MP,
+% we have to create the picture which is \gbc{vt} clipped to each separate
+% path, and combine the results. \Grafbase{} only uses this in the
+% \gbc{DoClip} command.
+% \begin{macrocode}
+def clipto (suffix vt) expr c =
+%<MF> andto (vt, interior c);
+%<MP> clip vt to c;
+enddef;
+def clipsto (suffix vt, cc) =
+%<MF> andto (vt, interiors cc);
+%<*MP>
+ begingroup
+ save _cl, _cl_; picture _cl, _cl_; _cl_ := nullpicture;
+ for _idx = 1 upto cc:
+ _cl := vt; clip _cl to cc[_idx]; addto _cl_ also _cl;
+ endfor
+ vt := _cl_;
+ endgroup
+%</MP>
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{Clipped}
+% Here, rather than modify a given picture, \gbc{Clipped} is a vardef
+% returning the picture which is the result of clipping the given picture
+% to the path.
+%
+% Having found out that \mfc{clipped} is a \MP{} primitive, I've
+% changed the name to the uppercase version, but keep the lowercase
+% version for now (backward compatibility). We save the primitive
+% meaning in \gbc{clipped_}. We also define \gbc{clip} in \MF{} for
+% backward compatibility.
+% \begin{macrocode}
+vardef Clipped (suffix vt) expr c =
+ save _Cl; picture _Cl; _Cl := vt; clipto (_Cl) c; _Cl
+enddef;
+%<MP>let clipped_ = clipped;
+def clipped = Clipped enddef;
+%<MF>def clip = Clipped enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{picneg}
+% The reverse video is easy in \MF, where \gbc{picneg} takes a picture
+% name and a closed path, and returns the part of the picture inside the
+% path, but with pixels reversed. In \MP{} we can only approximate this:
+% we clip the given picture and add that (using color \gbc{background})
+% on top of the \gbc{interior} of the curve. This is not used elsewhere
+% in \file{grafbase.mp} so it is not really important if \gbc{fillcolor}
+% or \mfc{black} is the right choice.
+% \begin{macrocode}
+vardef picneg (suffix vt) expr c =
+%<*MF>
+ mono (vt);
+ (interior c) picsub vt
+%</MF>
+%<*MP>
+ save _pn; picture _pn; _pn := nullpicture;
+ addto _pn (interior c) _wc_ fillcolor;
+ addto _pn also (Clipped (vt) c) _wc_ background;
+ _pn
+%</MP>
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{shpath}
+% \gbc{shpath} does most of the work of drawing curves in \grafbase. It is
+% called by \gbc{safedraw} which is used by almost all the commands that
+% somehow draw a curve. It takes the name of a picture, a pen expression
+% and a path expression. It draws the path on the picture with the pen.
+% Since we use this (ultimately) for almost all drawing of paths, we
+% automatically have the aspect ratio taken care of by the \mfc{.t_}
+% macro.
+%
+% \DescribeRoutine{picpath}
+% \gbc{picpath} accepts a path expression and returns a picture, which is
+% either \gbc{nullpicture} (\gbc{penwd} too small) or the path drawn with
+% \gbc{drawpen}. This is mostly how \gbc{shpath} gets used: curve drawing
+% commands produce a picture with \gbc{picpath} and that gets used.
+%
+% \begin{macrocode}
+def shpath (suffix v) (expr q, f) =
+ addto v doublepath (f.t_) withpen (q.t_);
+enddef;
+
+numeric minpenwd;
+%<MF>minpenwd := 1; % 1 pixel
+%<MP>minpenwd := .05bp; % 1 pixel at 1440dpi
+vardef picpath expr d =
+ save v; picture v; v := nullpicture;
+ if penwd >= minpenwd :
+ shpath (v, drawpen) (d);
+%<MF> mono (v);
+ fi
+ v
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{picdot}
+% This places a specified picture expression (\gbc{w}) at a specified
+% location (\gbc{p}) in a specified picture variable (\gbc{v}). It is used
+% a number of places. It's \MF{} version takes care of the aspect ratio
+% via \mfc{.t_}. This is how we draw points and symbols and dots along a
+% curve: make the symbol into a picture \gbc{w} and add that picture with
+% \gbc{picdot}.
+% \begin{macrocode}
+def picdot (suffix v) (expr w, p) =
+ addto v also
+%<MP> (w shifted p);
+%<MF> (w shifted hroundpair (p.t_));
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{setdot}
+% \gbc{setdot} is named for its use rather than what it does. It takes a
+% path and a scale (numeric expression) and returns a picture which is a
+% drawing of the filled interior of the path (if it is a cycle) or the
+% path itself (not a cycle). In \MF, we ensure that the scale is at least
+% one pixel (assumes that the \gbc{apath} has dimension about 1 and
+% \gbc{minpenwd} is 1). This usually assures that something is drawn. In
+% \MP, \gbc{minpenwd} has the same purpose (though it is probably not
+% necessary). This routine is used a number of times where dots are
+% needed. Not in \gbc{shaded} (just below) but later in \gbc{shade}, an
+% older command taking paths in graph coordinates.
+% \begin{macrocode}
+vardef setdot (expr apath, sc) =
+ if cycle apath : interior
+ else : picpath
+ fi
+%<MF> (apath scaled emax(ceiling (sc), minpenwd))
+%<MP> (apath scaled emax(sc, minpenwd))
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{shadepic}
+% We want to shade regions with a very regular pattern of black and white
+% pixels for best appearance. Experiments show that symmetric dots
+% (e.g., circles, squares) work better than non-symmetric (e.g.,
+% rectangular). Circular dots are not significantly better than square at
+% the size needed. I believe that the default result of \gbc{shade} looks
+% reasonably good on my system. (That happens to produce two 3-pixel by
+% 3-pixel square dots in a 8-pixel square on a 360dpi printer.) So we try
+% to produce something similar. That is, the shading picture is 1.6bp
+% (8 pixels at 360dpi) square.
+%
+% As a compromise (symmetric dots look better, but rectangular dots give
+% more gray levels) we allow dots to be $k\times (k+1)$-pixels (assuming
+% the aspect ratio is 1) rectangles. This produces twice the number of
+% gray levels. In my 360dpi example we get 15 gray levels. The two
+% farthest apart (4 by 4 dots versus 3 by 4 dots) differ by 1/8 in
+% fraction of area of coverage (which we equate to grayness).
+%
+% The parameter \gbc{dims} needs to be a pair variable, and it will be
+% assigned the actual dimensions of the picture returned. These routines
+% are complicated by the fact that we may have an aspect ratio unequal to
+% $1$. When \mfc{aspect_ratio = 1} the basic concept is simple: make an
+% $n\times n$ square with two dots, each nearly $k \times k$ and nearly
+% square, where $2k^2/n^2$ is the gray level needed.
+%
+% First \gbc{dims} is equated to half the size needed, the dot is created
+% (\gbc{_shp}) and then the dot is repeated and \gbc{dims} is doubled.
+% Finally, for dark gray (gray levels less than .5) we calculate the shade
+% picture for \gbc{1 - greylevel} and subtract it from a black square.
+% \begin{macrocode}
+%<*MF>
+numeric shadepicsize; shadepicsize := 0.8bp;
+vardef shadepic (suffix dims) (expr grparam) =
+ pair dims;
+ save _frac; _frac := 2*emin(grparam, 1 - grparam);
+ save _hp, _vp, _dotwd, _dotht;
+ if aspect_ratio < 1 :
+ _vp := emax (2, hround(shadepicsize.o_));
+ _hp := hround (_vp._o_);
+ _dotwd := hround (_hp*sqrt _frac);
+ _dotht := if _dotwd = 0 : 0
+ else: hround (_hp*_vp*_frac/_dotwd)
+ fi;
+ else:
+ _hp := emax (2, hround (shadepicsize));
+ _vp := hround (_hp.o_);
+ _dotht := hround (_vp*sqrt _frac);
+ _dotwd := if _dotht = 0 : 0
+ else: hround (_hp*_vp*_frac/_dotht)
+ fi;
+ fi
+ dims := ( _hp, _vp._o_ );
+ save _shp; picture _shp; _shp := nullpicture;
+ addto _shp contour rect ((0,0), (_dotwd, _dotht));
+ picdot (_shp, _shp, dims);
+ dims := 2dims; mono (_shp);
+ if grparam >= .5 : _shp
+ else : (interior (rect ((0,0), dims))) picsub _shp
+ fi
+enddef;
+
+%</MF>
+% \end{macrocode}
+%
+% \DescribeRoutine{shaded}
+% This fills the interior of a contour (device coordinates) with copies of
+% \gbc{shadepic}. The routine \gbc{filledwith} is defined later, but its
+% name reflects its effect: a bounding rectangle (corners at \gbc{ll} and
+% \gbc{ur}) is filled with copies of a picture (\gbc{shpic} in this case),
+% the picture having nominal dimensions \gbc{shdims} in this case.
+%
+% It may seem odd that black and white return the same thing. That is
+% because white is handled in the calling routine by subtracting the
+% result.
+%
+% The \gbc{gbbox} command is defined in the next section. The bounding
+% rectangle it obtains is only approximate in \MF{}, but that is
+% sufficient, since we only use it to produce things that are eventually
+% clipped.
+%
+% I am not sure why we return \gbc{picpath} for non-cycles, but I think
+% I once thought to make \gbc{shaded} a replacement for setdot to get gray
+% dots (in the \gbc{polkadot} routine).
+% \begin{macrocode}
+vardef shaded (expr clr) expr c =
+ if cycle c :
+%<*MP>
+ save v; picture v;
+ v := nullpicture;
+ addto v contour c _wc_ clr;
+ v
+%</MP>
+%<*MF>
+ if (clr <= black) or (clr >= white) :
+ interior c
+ else:
+ save vsh, shpic, shdims, ll, ur;
+ picture vsh, shpic; pair shdims, ll, ur;
+ shpic := shadepic (shdims) (clr);
+ gbbox (c, ll, ur);
+ vsh := filledwith (shpic) (shdims, ll, ur);
+ Clipped (vsh) c
+ fi
+%</MF>
+ else: picpath c % should we? or just make it null?
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{filledwith}
+% This is one of the ways we obtain something other than a solid fill. The
+% routines \gbc{polkadot}, \gbc{tess} and (in \MF) \gbc{shade} and
+% \gbc{shaded} all use it.
+%
+% It takes a picture expression, along with its dimensions (the pair
+% \gbc{dims}) in device coordinates, plus the opposite corners, \gbc{ll}
+% and \gbc{ur}, of a boundingbox rectangle, and returns the picture which
+% is that rectangle filled with copies of the picture.
+%
+% One might do this with two nested loops, but it turns out to be much
+% (much!) faster to do two separate loops: the second one stacking the row
+% built by the first loop.
+%
+% We try to do any rounding that might have been forgotten. This code
+% takes a mode's aspect ratio into account so that (most) calling routines
+% don't have to. (That is, \gbc{dims} should be measured in horizontal
+% pixels, while \gbc{fwdims} is in actual pixels. I would have written
+% this in terms of \gbc{picdot}, which already handles aspect, but it
+% has got to be more efficient to do the aspect ratio calculations
+% once rather than every time through the loop.)
+% \begin{macrocode}
+vardef filledwith (expr pic, dims, ll, ur) =
+ save b, v; picture b, v;
+ b := v := nullpicture;
+%<*MF>
+ save fwdims, _ll, _ur; pair fwdims, _ll, _ur;
+ fwdims := hroundpair (dims.t_);
+ _ll := floorpair (ll.t_);
+ _ur := ur.t_;
+ for s = xpart _ll step xpart fwdims until xpart _ur:
+ addto b also pic shifted (s, 0);
+ endfor
+ for s = ypart _ll step ypart fwdims until ypart _ur:
+ addto v also b shifted (0, s);
+ endfor
+ mono (v);
+%</MF>
+%<*MP>
+ for s = xpart ll step xpart dims until xpart ur:
+ addto b also pic shifted (s, 0);
+ endfor
+ for s = ypart ll step ypart dims until ypart ur:
+ addto v also b shifted (0, s);
+ endfor
+%</MP>
+ v
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Hatching}\label{basichatching}
+%
+% \DescribeRoutine{thatchf}
+% This is the all-purpose macro called by the other macros that
+% fill a region with hatching. It takes the name of a picture \gbc{v},
+% a transform expression \gbc{CT}, a numeric expresion \gbc{sp} giving the
+% space between hatch lines, and two pairs, \gbc{a} and \gbc{b},
+% that represent the lower left and upper right limits of a rectangle.
+% The expression \gbc{sp} must be nonzero. The calling macros should take
+% care of that.
+%
+% It modifies the picture by adding to it the rectangle full of
+% hatching lines spaced \gbc{sp} apart. The rectangle is initially upright
+% and the lines horizontal, but they are drawn transformed by the
+% transform \gbc{CT}. This is how diagonal hatching is accomplished: the
+% transform is a rotation.
+%
+% We guard against \gbc{ypart a} being greater than \gbc{ypart b} or
+% \gbc{sp} being negative: \gbc{_sp} is \gbc{sp} modified to have the same
+% sign as \gbc{ypart (b - a)}. Thus, repeatedly adding it to \gbc{ypart a}
+% gets one to \gbc{ypart b}. We make the starting value an integer
+% multiple of \gbc{_sp} to make sure adjacent regions don't have jarringly
+% misaligned hatch lines. (I guess that's the reason; this algorithm
+% predates me.)
+% \begin{macrocode}
+vardef thatchf (suffix v) (expr CT, sp, a, b) =
+ save _sp;
+ _sp = signof (ypart(b - a)) abs(sp);
+ for _y = _sp*( ceiling ((ypart a)/_sp) ) step _sp until ypart b:
+ shpath (v, hatchpen)
+ ( ( (xpart a, _y)--(xpart b, _y) ) transformed CT );
+ endfor
+%<MF> mono(v);
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Tiles}\label{tiles}
+%
+% Tesselations are a generalization type of fill in which a rectangular
+% pattern is repeated throughout a region. The rectangular pattern is
+% called a tile. We provide here an environment in which the drawing commands
+% add to a picture variable other than \mfc{currentpicture}. We do this
+% very simply by redefining \gbc{active_plane}, localizing the
+% redefinition between \gbc{tile} and \gbc{endtile}
+%
+% \DescribeRoutine{tile}
+% \DescribeRoutine{endtile}
+% \gbc{tile} accepts one suffix parameter, the name of the tile, followed
+% by three numeric expressions and a boolean. \gbc{unit} should be a
+% dimension in device units and is the unit of length for all high level
+% drawing commands within the environment. \gbc{height} and \gbc{width}
+% specify the size of the tile in multiples of \gbc{unit}, and
+% \gbc{clipit} is a boolean that determines if the resulting picture is
+% clipped to the rectangle these parameters determine. For example,\\
+% \indent \gbc{tile (fred)(1in, 1, 2, true)} \\
+% starts a tile named \gbc{fred} which will be 1 inch wide and 2 inches
+% tall, and any marks that extend beyond this rectangle are clipped off.
+%
+% In \MF, the picture should be a whole number of pixels in size, so that
+% the tiles fit perfectly together. The fact that shifts must be integer
+% values is only mildly relevant, because the placement code does the
+% rounding.
+%
+% For tesselation (filling with tiles), we need to know various properties
+% of the tile so, in fact, a tile is a composite object consisting of a
+% picture, \gbc{fred.pic} in our example (the actual tile), two numerics
+% \gbc{fred.wd} and \gbc{fred.ht} (the device dimensions) and a boolean
+% \gbc{fred.clipon}.
+% \begin{macrocode}
+def tile (suffix atile) (expr unit, width, height, clipit) =
+ picture atile.pic; atile.pic := nullpicture;
+ numeric atile.wd, atile.ht;
+%<MF> (atile.wd, atile.ht) = round ((width, height)*unit);
+%<MP> (atile.wd, atile.ht) = (width, height)*unit;
+ boolean atile.clipon; atile.clipon := clipit;
+ begingroup
+% \end{macrocode}
+% We simply do a subset of what we do in \gbc{beginmfpic}, redefining
+% \gbc{active_plane} so that all drawing commands that add to it will
+% contribute to the tile.
+% \begin{macrocode}
+% save active_plane;
+ save active_plane;
+ def active_plane = atile.pic enddef;
+ save ztr, vtr; transform ztr, vtr;
+ ztr := identity scaled unit; vtr := ztr;
+% \end{macrocode}
+% And if clipit is true we set the \gbc{ClipPath} to the bounding
+% rectangle so that all commands that respect \gbc{ClipOn} will draw only
+% inside the tile. And in case some don't, \gbc{endtile} clips it all
+% anyway.
+% \begin{macrocode}
+ save ClipOn; boolean ClipOn;
+ if clipit :
+ ClipOn := true;
+ save ClipPath; path ClipPath[];
+ ClipPath = 1;
+ ClipPath[1] = rect(origin, (atile.wd, atile.ht));
+ else:
+ ClipOn := false;
+ fi
+enddef;
+def endtile =
+ DoClip (active_plane);
+ endgroup
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{is_tile}
+% To test whether \gbc{atile} is really a tile, just see if all the
+% components are defined and of the correct type.
+% \begin{macrocode}
+vardef is_tile (suffix atile) =
+ (known atile.pic ) and (picture atile.pic ) and
+ (known atile.wd ) and (numeric atile.wd ) and
+ (known atile.ht ) and (numeric atile.ht ) and
+ (known atile.clipon) and (boolean atile.clipon)
+enddef;
+
+% \end{macrocode}
+%
+% \section{Bounding boxes of paths}\label{bboxes}
+%
+% To fill a region with other than a solid fill, we normally fill a
+% rectangle with copies of a picture (or a path) and then clip to the
+% boundary curve. In order not to place too many copies, we try to find a
+% rectangle that is not too much larger than that region. For this we have
+% the macro \gbc{gbbox} which takes a path expression and two pair
+% variables, and sets the pairs to the lower left corner and upper right
+% corner, respectively, of a rectangle enclosing the path. In \MF, this
+% finds a rather loose box, the smallest rectangle containing all the
+% control points and all the nodes of the path. Or rather it used to do
+% that. Now we break the path into twice as many nodes and use the control
+% points relative to that, which gives a tighter box. Both algorithms make
+% use of the fact that the convex hull of the points and controls for a
+% path segment contains the segment.
+%
+% The bounding box macros are used on paths in device coordinates, but
+% there is no intrinsic reason that has to be so: they will return the
+% bounding box in whatever coordinates the supplied path is in.
+%
+% We also have \gbc{tightbbox} and \gbc{tbbox} in \MF{} but these are no
+% longer used so we'll omit them from \grafbase, but keep them in the
+% documentation for now.
+%
+% \DescribeRoutine{tightbbox}
+% Calculate tight bounding box points \gbc{ll} and \gbc{ur} for path
+% \gbc{g}. The tight bounding box is accurate to the limits of the
+% \mfc{solve} macro, which is the numeric \mfc{tolerance}, which we set to
+% \mfc{.5} (pixel). This is only called by \gbc{tbbox}, which is never
+% used.
+%
+% \DescribeRoutine{xlimit}
+% \DescribeRoutine{ylimit}
+% \gbc{xlimit(x)} returns a value of true if the path \gbc{g} doesn't
+% cross the vertical line at \gbc{x}. \gbc{ylimit(y)} is the same for
+% the horizontal line at \gbc{y}.
+% \begin{macrocode}
+%<*unused>
+vardef tightbbox (expr g) (suffix ll, ur) =
+ % true iff horizontal at y does not intersect g:
+ vardef xlimit (expr x) =
+ (((x, -infinity)--(x, infinity)) intersectiontimes g) < origin
+ enddef;
+ % true iff vertical at x does not intersect g:
+ vardef ylimit (expr y) =
+ (((-infinity, y)--(infinity, y)) intersectiontimes g) < origin
+ enddef;
+ interim tolerance := .5;
+ ll := ( (solve xlimit (-infinity, xpart pnt 0 (g))),
+ (solve ylimit (-infinity, ypart pnt 0 (g))) );
+ ur := ( (solve xlimit ( infinity, xpart pnt 0 (g))),
+ (solve ylimit ( infinity, ypart pnt 0 (g))) );
+ if showbbox :
+ noclip ( safedraw rect (ll, ur) );
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{tbbox}
+% \gbc{tbbox} simply calls \gbc{tightbbox} on each of an array of paths
+% and takes the maximum of all the upper right corners and the minimum of
+% all the lowerleft. Same syntax as \gbc{tightbbox} except that, instead
+% of a path parameter, \gbc{g} must be the name of an array of paths.
+%
+% This macro is never used elsewhere in \grafbase. Changed recently to
+% use the new \gbc{pairmin} and \gbc{pairmax} macros. This avoids two
+% \mfc{for} loops (which seem to be something of a \MF{} bottleneck).
+% \begin{macrocode}
+vardef tbbox (suffix g) (suffix ll, ur) =
+ save _gll, _gur; pair _gll, _gur;
+ tightbbox (g1, ll, ur);
+ for _idx = 2 upto g:
+ tightbbox (g[_idx], _gll, _gur);
+ ll := pairmin(ll, _gll); ur := pairmax(ll, _gur);
+ endfor
+ if showbbox : noclip ( safedraw rect (ll, ur) ); fi
+enddef;
+%</unused>
+% \end{macrocode}
+%
+% \DescribeRoutine{gbbox}
+% One can get a rather loose bounding rectangle by using the fact that
+% each segment of a path (from \mfc{point j of g} to \mfc{point j+1 of g})
+% is contained in the convex set determined by all 4 control points for
+% that segment. So we get a containing rectangle by getting the smallest
+% and largest values of the x- and y-coordinates of all those points. We
+% can get a considerably tighter fit if we cut each segment in half.
+%
+% \DescribeRoutine{ctrlsbbox}
+% There is a difference between `\mfc{postcontrol j of (subpath (j,j+1/2)
+% of p)}' and `\mfc{postcontrol j of p}'. To gain the tighter box we have
+% to look at the former. \gbc{ctrlsbbox} just updates the previously found
+% corners \gbc{ll} and \gbc{ur} of the bounding box based on the controls
+% of the path segment \gbc{p}, and the calling routine \gbc{gbbox} passes
+% it half a segment at a time. We don't actually examine both endpoints of
+% the half-segment, only those that are nodes of the original path. The
+% reason is that the subdivision points are already on the line segment
+% connecting the controls of the subpaths on either side. We've given this
+% potentially unlimited accuracy by allowing the number of subdivisions
+% (\gbc{bbox_split}) to be arbitrary. We choose 2 for the default.
+%
+% This description applies only to \MF, because \MP{} has primitive
+% facilities for determining the bounding box.
+%
+% \DescribeRoutine{pnt}
+% \DescribeRoutine{pre}
+% \DescribeRoutine{post}
+% I got tired of typing long expressions like `\gbc{precontrol length p of p}',
+% and now use the abbreviation `\gbc{pre[length p](p)}'.
+% \begin{macrocode}
+vardef pnt@# (expr p) = point @# of p enddef;
+vardef pre@# (expr p) = precontrol @# of p enddef;
+vardef post@# (expr p) = postcontrol @# of p enddef;
+
+vardef gbbox (expr g) (suffix ll, ur) =
+%<MP> ll := llcorner g; ur := urcorner g;
+%<*MF>
+ save _s; _s := emax(1, ceiling bbox_split);
+ ur := ll := pnt 0 (g);
+ if (length g) > 0 :
+ for _j = 1 upto length g:
+ ll := pairmin(ll, pnt[_j] (g)); ur := pairmax(ur, pnt[_j] (g));
+ endfor
+ for _j = 1 upto _s*(length g):
+ ctrlsbbox (subpath ((_j-1)/_s, _j/_s) of g) (ll, ur);
+ endfor
+ fi
+%</MF>
+ if showbbox : noclip ( safedraw rect (ll, ur) ); fi
+enddef;
+
+%<*MF>
+numeric bbox_split; bbox_split := 2;
+def ctrlsbbox (expr p) (suffix ll, ur) =
+ ll := pairmin (ll, post0 (p)); ll := pairmin (ll, pre 1 (p));
+ ur := pairmax (ur, post0 (p)); ur := pairmax (ur, pre 1 (p));
+enddef;
+
+%</MF>
+% \end{macrocode}
+%
+% \section{Device coordinate rendering
+% commands}\label{basicrendering}
+%
+% We use the word rendering to refer to commands that accept a path
+% expression as one parameter and use it to modify the \gbc{active_plane}.
+% All the commands in this section expect paths, pairs and dimensions in
+% device coordinates.
+%
+% \subsection{Drawing}\label{basicdrawing}
+%
+% \DescribeRoutine{safedraw}
+% \gbc{safedraw} accepts a path expression, and adds the result to
+% \gbc{active_plane}. It is the first drawing command to draw
+% exclusively on \gbc{active_plane}. This is the first of many uses of
+% \gbc{coloraddto}. In \MP{} it is basically the primitive \mfc{addto
+% ... also ... withcolor ...}, but in \MF{} it adds when the color is less
+% than 1 (gray or black), otherwise it subtracts (white).
+%
+% \DescribeRoutine{colorsafedraw}
+% \gbc{safedraw} merely calls colorsafedraw, which calls \gbc{picpath},
+% which calls \gbc{shpath}. One reason for this roundabout path
+% is to support older files (\gbc{colorsafedraw} not defined). Another
+% is that color handling in \MF{} requires a picture with pixels of
+% weight 1 or 0 only (\gbc{picpath}). Moreover, \gbc{shpath} guarantees
+% that the mode's aspect ratio is respected.
+% \begin{macrocode}
+def safedraw = colorsafedraw (drawcolor) enddef;
+vardef colorsafedraw (expr clr) expr d =
+ save v; picture v; v := picpath d;
+ DoClip (v);
+ coloraddto (clr) (active_plane, v);
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Filling}\label{basicfilling}
+%
+% \DescribeRoutine{NoCycleWarn}
+% This is a common warning for all those commands that require a cycle
+% (closed) path but an open path is supplied. In addition to the warning
+% in those commands, we also call \gbc{safedraw} for debugging purposes.
+% We make no attempt to color the path, but maybe we should.
+%
+% \DescribeRoutine{safefill}
+% \DescribeRoutine{colorsafefill}
+% \DescribeRoutine{safeunfill}
+% These three take one parameter that is a path expression, and
+% \gbc{colorsafefill} takes another that is a color. These commands fill
+% (or unfill) it in the \gbc{active_plane}. In \MF, when the color is
+% strictly between $0$ and 1, a gray fill is simulated with the
+% \gbc{shaded} macro.
+%
+% To simulate the effect of painting over in gray, the \MF{} version
+% clears the region before adding the shaded fill.
+%
+% \gbc{safeunfill} is just \gbc{safefill} with the color \mfc{background}.
+% In \MF{}, when \gbc{background = white = 1}, this is detected by
+% \gbc{coloraddto} which then subtracts the picture.
+% \begin{macrocode}
+def NoCycleWarn expr s =
+ GBmsg s & " cannot be applied to an open path. "
+ & "The path will be drawn instead.";
+enddef;
+
+def safefill = colorsafefill (fillcolor) enddef;
+vardef colorsafefill (expr clr) expr c =
+ if cycle c :
+ save v; picture v; v := interior c;
+ DoClip (v);
+%<*MF>
+ if (clr > black) and (clr < white) :
+ subto (active_plane) (v);
+ v := nullpicture;
+ v := shaded (clr) c;
+ fi
+%</MF>
+ coloraddto (clr) (active_plane, v);
+ else: NoCycleWarn "fill"; safedraw c;
+ fi
+enddef;
+def safeunfill expr c =
+ if cycle c : noclip (colorsafefill (background) c);
+ else: NoCycleWarn "unfill"; safedraw c;
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Clipping}\label{clipping}
+%
+% \DescribeRoutine{safeclip}
+% This applies \gbc{clipto} to the active drawing plane. It follows the
+% pattern started with \gbc{safefill} where commands that require a cycle
+% will \gbc{safedraw} non-cyclic paths.
+% \begin{macrocode}
+def safeclip expr c =
+ if cycle c : clipto (active_plane) c;
+ else: NoCycleWarn "clip"; safedraw c;
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \section{Rendering: the highest level commands}\label{rendering}
+%
+% \DescribeRoutine{store}
+% Now we come to the highest level rendering operations. These are the
+% commands written to the output file by \mfpic. They accept a path in
+% \emph{graph} coordinates, convert it to device coordinates, rendering
+% the result, and return the original path. This way one can render a
+% path and pass it on to the preceding command for further processing.
+% This is how \mfpic{} implements multiple prefix macros. However, this
+% cannot be kept up because \MF{} abhors an isolated expression. Therefore
+% we provide a command that accepts a path and doesn't pass it on. In
+% theory, it could do nothing, but in \mfpic{} we store the path in
+% \gbc{curpath}, making every \mfpic{} figure a path assigment command
+% and the rendering is merely a side-effect.
+%
+% \DescribeRoutine{stored}
+% The macro \gbc{stored} performs \gbc{store}, but passes the same path as
+% its return value. This is used by \mfpic{} to implements the \cs{store}
+% command, allowing it to also be a prefix macro
+%
+% I don't know if \gbc{store} needs to employ \mfc{hide()}, but it seems
+% not to hurt.
+% \begin{macrocode}
+def store (suffix fs) expr f =
+hide(
+ if (not path f) and (not pair f) :
+ GBerrmsg ("Second argument to `store' must be a path or pair")
+ "";
+ fi
+ if not path fs : path fs; fi
+ fs := f
+)
+enddef;
+vardef stored (suffix fs) expr f = store (fs) f; f enddef;
+
+% \end{macrocode}
+%
+% \subsection{Drawing}\label{drawing}
+%
+% \DescribeRoutine{drawn}
+% \DescribeRoutine{colordrawn}
+% \gbc{drawn} and \gbc{colordrawn} accept a path
+% expression \gbc{f} and return the same. In between, \gbc{zconv(f)} is
+% subjected to \gbc{colorsafedraw}.
+% \begin{macrocode}
+def drawn = colordrawn (drawcolor) enddef;
+vardef colordrawn (expr clr) expr f =
+ colorsafedraw (clr) (zconv (f)); f
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Filling, unfilling and clipping}\label{filling}
+%
+% \DescribeRoutine{filled}
+% \DescribeRoutine{colorfilled}
+% \DescribeRoutine{unfilled}
+% \DescribeRoutine{Clip}
+% These subject \gbc{zconv(f)} to \gbc{colorsafefill}, \gbc{safeunfill} or
+% \gbc{safeclip}. The name \gbc{clip} (lowercase) is taken: it is a \MP{}
+% primitive and an old \file{grafbase.mf} command we keep for compatibility.
+%
+% \begin{macrocode}
+def filled = colorfilled (fillcolor) enddef;
+vardef colorfilled (expr clr) expr c =
+ colorsafefill (clr) zconv (c); c
+enddef;
+vardef unfilled expr c = safeunfill zconv (c); c enddef;
+vardef Clip expr c = safeclip zconv(c); c enddef;
+
+% \end{macrocode}
+%
+% \subsection{Shading}\label{shading}
+%
+% Shading is accomplished differently in \MP{} from \MF; however, many of
+% the same parameters are used for compatibility (so that \MP{} can be run
+% on a \file{.mf} created for \grafbase{} by \mfpic). In \MP, shading is
+% just filling with some level of gray. In \MF, we place a pattern of
+% small dots with the size and spacing adjustable. For compatibility,
+% \MP{} accepts these size and spacing parameters, but simply uses them to
+% calculate the darkness of gray.
+%
+% Ideally (i.e., for best appearance) one would shade with single pixels
+% placed in a regular pattern. Unfortunately, this is the most memory
+% intensive for \MF, which stores bitmaps by scanning each row of pixels,
+% and records where changes from black to white occur. We do use simple
+% dots, but make them quite a bit larger than one pixel. By default,
+% \gbc{0.5bp} in diameter, spaced (in \mfpic) a default \gbc{1pt} between
+% centers.
+%
+% \DescribeRoutine{shade}
+% This is the old \gbc{shade} macro, filling a contour with small dots.
+% The shape and size of the dot used can be selected by defining
+% \gbc{shadedotpath} and \gbc{shadewd}.
+%
+% A closed path representing the boundary of one dot of unit size,
+% \gbc{shadedotpath} is initialized to a circle.
+%
+% The parameter \gbc{sp} is the distance between the centers of the dots in
+% device coordinates, and \gbc{f} is the path to be filled in \emph{graph
+% coordinates}.
+%
+% As usual, if the path is not closed, we draw the curve instead. If the
+% spacing is too small relative to \gbc{shadewd}, we fill the curve. Otherwise the \gbc{filledwith} macro is used to fill with copies of
+% a dot picture. For speed, it actually fills with a two-dot picture.
+% \begin{macrocode}
+numeric shadewd; shadewd := 0.5bp;
+path shadedotpath;
+shadedotpath := fullcircle; % unitsquare;
+
+vardef shade (expr sp) expr f =
+ save g; path g; g := zconv (f);
+% \end{macrocode}
+% It seems clear that the gray level (\gbc{gr}) should depend
+% quadratically on \gbc{shadewd/sp}. Also, there is a point where the
+% result is essentially black and a fill would be more efficient.
+% The value .88 is arrived at empirically and is a compromise so that
+% \MF{} and \MP{} produce similar levels of gray on both printers available
+% to me. Theoretically, no white will appear when
+% \gbc{sqrt(2)*shadewd/sp >= 1}
+% \begin{macrocode}
+ save gr; numeric gr;
+ gr := 1 - (.88*abs(shadewd)/sp)**2;
+ if not cycle g : NoCycleWarn "shade"; safedraw g;
+ elseif gr <= 0 : safefill g;
+ else:
+%<*MF>
+ save ll, ur; pair ll, ur;
+ gbbox (g, ll, ur);
+ ll := floorpair (ll);
+% \end{macrocode}
+%
+% What we do is draw a row of dots and stack the rows to fill a rectangle.
+% We call \gbc{filledwith} to draw these copies. To save a little memory
+% we do this twice with half the dots each time. The second set
+% interleaves the first and is staggered from the first by half the
+% horizontal spacing. I wonder which which uses less memory, rendering
+% \gbc{v} unknown with \mfc{picture v}, or null with \mfc{v := nullpicture}?
+%
+% Shifts of pictures need to be by integer number of pixels, but this is
+% ensured by \gbc{filledwith}, using \mfc{ceiling} to define \gbc{dx} is
+% more to ensure it is not rounded down to 0.
+% \begin{macrocode}
+ save sh, v; picture sh, v;
+ save dx; dx := ceiling(sp/(sqrt 2));
+ sh := setdot (shadedotpath, abs(shadewd));
+ v := filledwith (sh, 2(dx, dx), ll, ur);
+ DoClip(v);
+ orto (active_plane, Clipped (v) g);
+ sh := sh shifted hroundpair ((dx, dx).t_);
+ v := nullpicture;
+ v := filledwith (sh, 2(dx, dx), ll, ur);
+ DoClip(v);
+ orto (active_plane, Clipped (v) g);
+%</MF>
+% \end{macrocode}
+% In \MP{} we just fill with gray. The gray level having been calculated
+% at the beginning.
+% \begin{macrocode}
+%<*MP>
+ colorsafefill (gr*white) g;
+%</MP>
+ fi
+ f
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{polkadot}
+% The macro \gbc{polkadot} is intended to fill a region with \emph{large}
+% dots. The diameter, \gbc{polkadotwd}, is initialized to \mfc{5bp}. The
+% code is similar to that of \gbc{shade}, but here we attempt a hexagonal
+% array: each dot surrounded by 6 equally spaced dots. Because of their
+% larger size and presumably larger spacing, we can be a little less
+% efficient and so we aim for improved visual appearance. We do what we
+% can to avoid unsightly slivers of partial dots, and only draw a dot if
+% its center lies in the bounding box.
+%
+% We also permit the circles to overlap, and only replace the code with a
+% fill if the dots overlap so much that no background can show (this assumes
+% that \gbc{polkadotpath} is a circle).
+%
+% If the space \gbc{sp} and \gbc{polkadotwd} are too small, there will
+% be a great many tiny dots. It is quite easy to overflow \MP{} capacity
+% and the dots are really ugly. In \MF, we already have \gbc{shade} to
+% place tiny dots. Therefore, we merely fill if \gbc{sp} is less that a
+% certain minimum, even if that minimum is greater than \gbc{polkadotwd}.
+% \begin{macrocode}
+polkadotwd := 5bp;
+mindotspace := 1bp;
+path polkadotpath; polkadotpath := fullcircle;
+
+vardef polkadot (expr sp) expr f =
+ save g; path g; g := zconv (f);
+ if not cycle g : NoCycleWarn "polkadot"; safedraw g;
+ elseif sp <= emax (2*polkadotwd/3, mindotspace) :
+ safefill g;
+ else:
+ save ll, ur; pair ll, ur;
+ gbbox (g, ll, ur);
+% \end{macrocode}
+% As with \gbc{shade}, we shift alternate rows by half the spacing between
+% dot centers, \gbc{dx}. The vertical shift \gbc{dy} is slightly larger
+% (relatively speaking) and the horizontal smaller. We also apply a
+% horizontal and vertical shift to avoid small pieces of dots. What it does
+% is take only those dots whose centers lie in the bounding box, and center
+% the whole array relative to that box.
+% \begin{macrocode}
+ save dx, dy; dx := sp/2; dy := dx*(sqrt 3);
+ hshift := ((xpart (ur - ll)) mod dx)/2;
+ vshift := ((ypart (ur - ll)) mod dy)/2;
+% \end{macrocode}
+% Here, \gbc{p} is the center of the first dot in the lower left corner.
+% \begin{macrocode}
+ save p, dims; pair p, dims;
+ p := ll + (hshift, vshift);
+ dims := 2(dx, dy);
+% \end{macrocode}
+% The extra \MF{} code is to clear what's under the dots in case they
+% are gray dots. And then to `gray' the dots when fillcolor demands it.
+% \begin{macrocode}
+ save v, thepolkadot; picture v, thepolkadot;
+ thepolkadot := setdot (polkadotpath, polkadotwd);
+ v := filledwith (thepolkadot, dims, p, ur);
+ p := p + (dx, dy);
+ orto (v, filledwith (thepolkadot, dims, p, ur));
+ DoClip (v); clipto (v) g;
+%<*MF>
+ if (fillcolor > black) and (fillcolor < white): % gray
+ subto (active_plane) (v);
+ thepolkadot :=
+ shaded (fillcolor) polkadotpath scaled ceiling(polkadotwd);
+ v := filledwith (thepolkadot, dims, p, ur);
+ p := p - (dx, dy);
+ orto (v, filledwith (thepolkadot, dims, p, ur));
+ DoClip (v); clipto (v) g;
+ fi
+%</MF>
+ coloraddto (fillcolor) (active_plane) (v);
+ fi
+ f
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Hatching}\label{hatching}
+%
+% \DescribeRoutine{thatch}
+% \DescribeRoutine{colorthatch}
+% Hatch interior of path \gbc{f} (graph coordinates) with lines at angle
+% \gbc{theta}, spaced \gbc{sp} apart (device coordinates). As usual an
+% unclosed path is simply drawn. The thickness of the lines is determined
+% by \gbc{hatchwd}. If \gbc{sp} is not greater than \gbc{abs(hatchwd)}, we
+% simply fill. This will ensure \gbc{thatchf} is called only for positive
+% \gbc{sp}.
+%
+% We find the bounding box of the backward rotated path, so when that box
+% is filled with lines and rotated, it will cover the path. After calling
+% \gbc{thatchf} we add the picture, clipped to the path.
+% \begin{macrocode}
+def thatch = colorthatch (hatchcolor) enddef;
+vardef colorthatch (expr clr) (expr sp, theta) expr f =
+ save g; path g; g := zconv (f);
+ if not cycle g : NoCycleWarn "hatch"; safedraw g;
+ elseif sp <= abs(hatchwd) : colorsafefill (clr) g;
+ else:
+ save v; picture v; v := nullpicture;
+ save CT; transform CT; CT := identity rotated theta;
+ save ll, ur; pair ll, ur;
+ gbbox (g transformed inverse CT, ll, ur);
+ thatchf (v, CT, sp, ll, ur);
+ DoClip(v);
+ coloraddto (clr) (active_plane) (Clipped (v) g);
+ fi
+ f
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{hhatch}
+% \DescribeRoutine{vhatch}
+% \DescribeRoutine{lhatch}
+% \DescribeRoutine{rhatch}
+% \DescribeRoutine{xhatch}
+% We offer some special cases, calling \gbc{thatch} with different angles.
+% These take only the spacing (in device coordinates) and a path
+% expression (in graph coordinates) as parameters. \gbc{hhatch} has angle
+% 0 and so produces horizontal lines; \gbc{vhatch} produces vertical
+% lines; \gbc{lhatch} produces lines tilted to the left (running from
+% upper left to lower right), and \gbc{rhatch} produces lines running from
+% lower left to upper right. \gbc{xhatch} produces cross-hatching, and
+% essentially runss \gbc{lhatch} and \gbc{rhatch}.
+%
+% Color is a parameter only for \gbc{colorxhatch}. The reason for that
+% is to make code written by \mfpic{} simpler. The \mfpic{} commands for
+% the others actual write calls to \gbc{thatch} or \gbc{colorthatch}.
+%
+% \begin{macrocode}
+def hhatch (expr sp) = thatch (sp, 0) enddef;
+def vhatch (expr sp) = thatch (sp, 90) enddef;
+def lhatch (expr sp) = thatch (sp, -45) enddef;
+def rhatch (expr sp) = thatch (sp, 45) enddef;
+
+def xhatch = colorxhatch (hatchcolor) enddef;
+vardef colorxhatch (expr clr, sp) expr f =
+ colorthatch (clr) (sp, 45) colorthatch (clr) (sp, -45) f
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Tesselations}\label{tess}
+%
+% \DescribeRoutine{tess}
+% Tesselation of interior of closed path is filling with copies of a tile
+% (see subsection~\ref{tiles}). The path is in graph units, the tile is a
+% suffix parameter and is the name of a previously defined tile. In fact,
+% one can create the picture any way one likes (it doesn't have to be with
+% the \gbc{tile} environment). Thus \gbc{tess (fred) f;} will work as long
+% as \gbc{fred.pic} is a picture \gbc{fred.wd} is its width, etc.
+% \begin{macrocode}
+vardef tess (suffix atile) expr c =
+ save _g; path _g; _g := zconv (c);
+ if not is_tile (atile) :
+ GBerrmsg ("Tile parameter " & str atile & " of tess() is invalid")
+ "This tile may be undefined or incorrectly defined. " &
+ "If you proceed, tess() will be abandoned and the curve " &
+ "merely drawn."; safedraw _g;
+ elseif not cycle _g : NoCycleWarn "tess"; safedraw _g;
+ else:
+ save _ll, _ur; pair _ll, _ur;
+ gbbox (_g, _ll, _ur);
+ save _ts; picture _ts;
+ _ts := filledwith (atile.pic, (atile.wd, atile.ht), _ll, _ur);
+ DoClip (_ts);
+ orto (active_plane, Clipped (_ts) _g);
+ fi
+ c
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Dots and Dashes}\label{dashes}
+%
+% \MP{} has some builtin commands for drawing a dashed or dotted curve,
+% but \MF{} does not. Considerable effort went into making this possible
+% (before \MP{} even existed). The code is reasonably fast and the result
+% is actually better quality than the builtin commands of \MP{} so we use
+% the same code in both versions. The \grafbase{} dashing code is designed
+% to produce a whole number of dashes on any curve to which it is applied,
+% and (usually) to begin and end with half a dash (so that when dashed
+% curves abut the result looks decent). The built-in facilities do neither
+% of these. In addition, the dotting code is flexible enough that copies
+% of any picture (not just a circular dot) can be used to trace a path.
+%
+% The general command is \gbc{gendashed} which takes a suffix parameter
+% (the name of a \emph{dashing pattern}, see below) and a path expression
+% in graph coordinates.
+%
+% A dashing pattern \gbc{pat} consists of three arrays, \gbc{pat.start},
+% which is used to draw the beginning of the path (half a dash in the
+% default \gbc{dashed} command), \gbc{pat.finish}, which is used to draw
+% the other end, and \gbc{pat.rep}, which is the repeating pattern for
+% drawing the rest of the curve. Each of these is an \emph{array} of
+% numerics. These should be lengths, in device units, and represent the
+% lengths of dashes and spaces.
+%
+% We start with some variables and their defaults, some of which are no
+% longer used. \gbc{segment_split} is used in the code for finding the
+% approximate length of a curve. This is needed so that adjustments
+% can be made so that a whole number of repeated patterns are used.
+% \gbc{dashsize} and \gbc{dashgap} are no longer used. Originally they
+% gave the lengths of default dashes and the spaces in between.
+% \gbc{dash_start} and \gbc{dash_finish} are the fractions of a dash
+% length that are used at the start and finish if the command
+% \gbc{dashpat} is used to create the dashing pattern.
+%
+% And \gbc{unit_of_length} is used to adjust numbers downward and avoid
+% arithmetic overflow. For a 1200dpi \MF{} mode, a curve 4 inches long
+% will be over \mfc{infinity} pixels in length, but only 40 deci-inches.
+% Our default for this variable is just that: 1/10 inch.
+% \begin{macrocode}
+if unknown segment_split : segment_split := 8; fi
+if unknown dashsize : dashsize := 3bp; fi
+if unknown dashgap : dashgap := dashsize + 2penwd; fi
+if unknown dash_finish : dash_finish := .5; fi
+if unknown dash_start : dash_start := .5; fi
+if unknown unit_of_length : unit_of_length := 0.1in; fi
+
+% \end{macrocode}
+%
+% \DescribeRoutine{gendashed}
+% The main idea is to have a list of lengths represent the repeating
+% pattern of dashes and dots. These lengths represent a dash length,
+% followed by a gap length, etc., so there are an even number. To start
+% dashing a path, we normally take a fraction (\gbc{dash_start}) of the
+% first dash, then the rest of the pattern. We continue by repeating the
+% pattern as many times as will fit, then we finish off with a fraction
+% (\gbc{dash_finish}) of the first dash. A dash of length 0 is a dot. A
+% gap of length 0 is OK, but useless unless it's between a dot and a dash,
+% and you arrange for the dot's size to be different from \gbc{penwd}.
+%
+% We generalize this so that \gbc{pat.start} and \gbc{pat.finish} can be
+% any patterns, not necessarily related to \gbc{pat.rep}. Also "dots" can be
+% symbols like \gbc{Triangle}. We also supply (later) the \gbc{dashpat}
+% command which takes a list of lengths, equates \gbc{pat.rep} to them,
+% and generates \gbc{pat.start} and \gbc{pat.finish} according to the
+% description above.
+% \begin{macrocode}
+vardef gendashed (suffix pat) expr f =
+ save _g; path _g; _g := zconv(f);
+ if (unknown pat.rep) : % no "pattern"
+ GBmsg "Dash pattern " & str pat & " undefined. " &
+ "Path will be drawn instead.";
+ safedraw _g;
+ elseif pat.rep < 2 : % no "spaces"
+ safedraw _g;
+ else:
+% \end{macrocode}
+% We want to manipulate the values of \gbc{pat} so that a whole number of
+% repetitions are used. So we copy \gbc{pat} to \gbc{_tmppat}.
+%
+% After this loop, \gbc{_dl.s} is the total length of the corresponding
+% \gbc{pat.s} in multiples of \gbc{unit_of_length}, and \gbc{_tmppat.s[i]}
+% is \gbc{pat.s[i]} converted to these units.
+% \begin{macrocode}
+ save _dl, _tmppat;
+ forsuffixes _s = start, rep, finish :
+ _dl._s := 0; _tmppat._s := pat._s;
+ for i = 1 upto pat._s :
+ _tmppat._s[i] := pat._s[i]/unit_of_length;
+ _dl._s := _dl._s + _tmppat._s[i];
+ endfor
+ endfor
+ if _dl.rep = 0 :
+ GBmsg "Dash pattern " & str pat & " has length 0. " &
+ "Path will be drawn instead.";
+ safedraw _g;
+ else:
+% \end{macrocode}
+% Here \gbc{_g} is our path in device units, but we convert that to our
+% unit of length to avoid having paths of length \gbc{infinity}.
+%
+% This is how we process a path mathematically: let $f(t)$, $0 \le t \le
+% k$ be the formula for the path \gbc{f}, $k$ being the number of segments
+% of \gbc{f}, we consider the polygon connecting the points $f(0), f(1/8),
+% f(2/8),\ldots,f(k)$ and compute the length of \emph{that} path (assuming
+% \gbc{segment_split = 8}). Actually, we compute and save the cumulative
+% lengths at each vertex of this polygon, since we use that later to
+% determine ``when'' (i.e., at what values of $t$) to place a dot or draw
+% a dash. The command \gbc{makelengtharray} does this, storing the
+% cumulative lengths in the array \gbc{_cumlen} and returning the total
+% length.
+% \begin{macrocode}
+ save _p; path _p;
+ _p := _g scaled (1/unit_of_length);
+ save _cumlen, _totlen, _n, _sf;
+ _totlen := makelengtharray(_cumlen) _p;
+% \end{macrocode}
+% Now we scale the dashes so that a whole number of patterns make up
+% the lengths of the approximating polygon. \gbc{scale_adjust} returns
+% the scaling factor, equates \gbc{_n} to the total number of
+% \gbc{pat.rep} to use. If the path length is already less than the length
+% of the start and finish patterns, this is equated to $-1$ as a flag to
+% draw the path instead. (recall \gbc{_dl.s} holds the length of part
+% \gbc{s}).
+%
+% After this we rescale the dashes and spaces stored in \gbc{_tmppat}, and
+% the length of the patterns in \gbc{_dl}.
+% \begin{macrocode}
+ _sf := scale_adjust (_n, _dl)(_totlen);
+ if _n < 0 : safedraw _g;
+ else:
+ forsuffixes _s = start, rep, finish :
+ for _i = 1 upto _tmppat._s :
+ _tmppat._s[_i] := _tmppat._s[_i]*_sf;
+ endfor
+ _dl._s := _dl._s*_sf;
+ endfor
+% \end{macrocode}
+% The user has the capability to use something other than a small disk for
+% a dot by defining \gbc{plot_pic}. The utility \gbc{makesymbol} is
+% defined later. It examines \gbc{plot_pic} and makes a picture depending
+% on what type of variable it is. The default \gbc{dotpath} is
+% \mfc{fullcircle}, but user may also change that to get different dots.
+% \gbc{makesymbol} scales by \gbc{penwd} \emph{only if the first
+% parameter is a path}. This is how to increase the dot size (the code in
+% \gbc{plot} uses this.)
+% \begin{macrocode}
+ save dashingdot; picture dashingdot;
+ if known plot_pic : dashingdot := makesymbol(plot_pic, penwd);
+ else: dashingdot := makesymbol(dotpath, penwd);
+ fi
+% \end{macrocode}
+% The macro \gbc{dashit} draws the dashes, computing where they go and
+% drawing the appropriate subpaths of \gbc{_g} or placing a dot at the
+% appropriate point. \gbc{dashit} returns nothing and assumes all the
+% information accumulated so far, so it can only be called by
+% \gbc{gendashed}.
+%
+% \gbc{_t} and \gbc{_d} are temporary variables used by
+% \gbc{dashit}, but we declare them here since we initialize them
+% differently for each call. \gbc{_d0} and \gbc{_d1} hold the
+% position along the curve of the ends of a dash in distance from the
+% start; \gbc{_t0} and \gbc{_t1} are the same, but in terms of time.
+% A macro \gbc{gettime} converts the first to the second. It uses the
+% cumulative length array \gbc{_cumlen} for this, and maintains
+% \gbc{_ct} as the current index into that array. The parameters to
+% \gbc{dashit} are the name of the part of the dashing pattern that is being
+% drawn, and a temporary picture variable. The latter holds the picture
+% until \gbc{DoClip} can process it, then it is added to \gbc{active_plane}.
+% The code of \gbc{dashit} leaves \gbc{_d0} pointing to the current
+% position on the curve, but for safety and to reduce accumulated
+% round-off error, we initialize it to what it should be before each call.
+% \begin{macrocode}
+ save _ct, _t, _d, _v;
+ picture _v; _v := nullpicture;
+ _ct := 0;
+ % Begin with pat.start
+ _d0 := 0; _t0 := 0;
+ dashit (_tmppat.start) (_v);
+% \end{macrocode}
+% The repeating pattern has the tendency to use lots of memory. Previously
+% I added all the dashes to \gbc{_v} and then added it all at once to
+% \gbc{active_plane}. The purpose was to be able to \gbc{DoClip} it once,
+% and add it once with \gbc{coloraddto} to get it drawn in color under \MF.
+% This was simplest, but a memory hog requiring $O(n)$ in memory, where
+% $n$ is the number of repeated patterns. Then we tried clipping and adding
+% within \gbc{dashit}. This was terribly slow, requiring $O(n)$ in time.
+% Now I'm going to try a standard programming trick: accumulate $m < n$
+% repetitions before adding them, the memory should be $O(m)$ and the
+% time $O(n/m)$. As a first try, we make $m$ about $\sqrt n$.
+% \begin{macrocode}
+ % then pat.rep
+ if _n > 0 :
+ save _m; _m := ceiling sqrt(_n);
+ for _j = 0 step _m until _n - 1 :
+ for _i = 0 upto _m - 1 :
+ exitif (_i + _j) > _n - 1;
+ _d0 := _dl.start + (_j + _i)*_dl.rep;
+ _t0 := gettime(_cumlen, _ct) (_d0);
+ dashit (_tmppat.rep) (_v);
+ endfor
+ % add _m patterns and reset.
+ DoClip(_v);
+%<MF> mono (_v)
+ coloraddto (drawcolor) (active_plane, _v);
+ _v := nullpicture;
+ endfor
+ fi
+ % and finally, pat.finish
+ _d0 := _totlen - _dl.finish;
+ _t0 := gettime(_cumlen, _ct) (_d0);
+ dashit (_tmppat.finish) (_v);
+ DoClip(_v);
+%<MF> mono(_v)
+ coloraddto (drawcolor) (active_plane, _v);
+ fi
+ fi
+ fi
+ f
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{makelengtharray}
+% This takes an array name and a path expression (any coordinates),
+% computes the array of partial lengths (of the polygon approximation),
+% and returns the total length.
+% \begin{macrocode}
+vardef makelengtharray (suffix clen) expr p =
+ save _s; _s := emax (1, ceiling segment_split);
+ clen := _s*length p; clen[0] := 0;
+ for _i = 1 upto clen :
+ clen[_i] := clen[_i-1] + abs (pnt[_i/_s] (p) - pnt[(_i-1)/_s] (p));
+ endfor
+ clen[clen]
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{scale_adjust}
+% Here \gbc{n} is a suffix defined by the calling routine,
+% \gbc{pl.\{start\|ref\|finish\}} are the lengths of corresponding parts
+% of a dashing pattern, \gbc{lngth} is the length of some path (determined
+% by the calling routine). It determines how many times \gbc{pl.rep} goes
+% into \gbc{lngth - pl.start - pl.finish}. If this is negative it remains
+% negative, otherwise it is rounded. \gbc{scale_adjust} then determines
+% and returns the scaling factor \gbc{sf} required to make
+% \gbc{sf*(pl.start + n*pl.rep + pl.finish)} equal to \gbc{lngth}.
+% \begin{macrocode}
+vardef scale_adjust (suffix n, pl) (expr lngth) =
+ n := (lngth - pl.start - pl.finish)/pl.rep;
+ n := if n < 0 : -1 else: round(n) fi;
+ lngth/(pl.start + emax(n, 0)*pl.rep + pl.finish)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{gettime}
+% \gbc{arr} is an increasing array of lengths, defined by the calling
+% routine. \gbc{ct} is current index into that array; it will vary with
+% subsequent calls. Calling routine initializes it before the first call,
+% \gbc{gettime} updates it. \gbc{lngth} is a length interpreted as the
+% length along the path associated to the array.
+%
+% Since this array is generated by splitting the segments of the path at
+% times \gbc{i/segment_split} we first determine in which of these splits
+% the given distance is (i.e., find \gbc{ct} so that \gbc{lngth} lies
+% between \gbc{arr[ct-1]} and \gbc{arr[ct]}). To avoid problems with
+% round-off error, bad length parameter, etc., we force \gbc{lngth} to
+% satisfy this for some index between the current value of \gbc{ct} and
+% \gbc{arr} inclusive.
+%
+% Once we know what segment we are in, we determine the time by linear
+% interpolation between the times corresponding to \gbc{ct} and
+% \gbc{ct+1}.
+% \begin{macrocode}
+vardef gettime (suffix arr, ct) (expr lngth) =
+ save _gtl, _s;
+ _s := emax(1, ceiling segment_split);
+ _gtl := emax (arr[ct], emin (arr[arr], lngth));
+ forever:
+ exitif ( (arr[ct] <= _gtl) and (_gtl <= arr[ct+1]) );
+ ct := ct + 1; % need to exit *before* incrementing
+ endfor
+ if arr[ct] = arr[ct+1] : ct
+ else: ( ct + (_gtl - arr[ct]) / (arr[ct+1] - arr[ct]) )
+ fi /_s
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{dashit}
+% No variables are saved or initialized; \gbc{gendashed} defines array
+% \gbc{_cumlen}, path \gbc{_g}, and initializes \gbc{_d0},
+% \gbc{_t0} and \gbc{_ct}.
+%
+% \gbc{pos} is one of the dashpattern arrays, so it consists of numerics
+% interpreted as lengths of dashes (odd index) and spaces (even index). In
+% the first case \gbc{_d0} and \gbc{_t0} will already be pointing to
+% the beginning of the dash and we get to the end of the dash by adding
+% the length of a dash (\gbc{pos[_j]}) to \gbc{_d0} (getting
+% \gbc{_d1}) and calling \gbc{gettime} (getting \gbc{_t1}). We draw
+% the subpath between thos points. Unless \gbc{pos[_j] = 0}, in which case
+% a dot is placed.
+%
+% For even \gbc{j} (a space) we are at \gbc{_d1} and \gbc{_t1} and
+% we increment them to get \gbc{_d0} and \gbc{_t0} for the next
+% iteration.
+% \begin{macrocode}
+def dashit (suffix pos) (suffix pic) =
+ for _k = 1 upto pos:
+ if odd _k : % draw a dash of length pos[_k]
+ if pos[_k] = 0 : % point required
+ _d1 := _d0; _t1 := _t0;
+ picdot (pic, dashingdot, pnt [_t0] (_g));
+ else:
+ _d1 := _d0 + pos[_k];
+ _t1 := gettime (_cumlen, _ct) (_d1);
+ shpath (pic, drawpen) (subpath (_t0, _t1) of _g);
+ fi
+ else: % find the start of the next dash:
+ _d0 := _d1 + pos[_k];
+ _t0 := gettime(_cumlen, _ct) (_d0);
+ fi
+ endfor
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{dashpat}
+% This is a utility to convert a text list of lengths to the three dash
+% pattern arrays required by \gbc{gendashed}. We first simply copy the
+% list to array \gbc{pat.rep}. If the number is odd we add a 0-length
+% item (a nonspacing space). Unless the number is 1, which we use as a
+% signal that a curve should be solid and not dashed at all.
+%
+% \gbc{pat.start} is the same as \gbc{pat.rep} except the first dash is
+% reduced by the factor \gbc{dash_start}. \gbc{pat.finish} is just the
+% first dash of \gbc{pat.rep} reduced by the factor \gbc{dash_finish}.
+% \begin{macrocode}
+def dashpat (suffix pat) (text t) =
+ pat.rep := 0;
+ for _itm = t:
+ pat.rep[incr pat.rep] := _itm;
+ endfor;
+ if odd (pat.rep) and (pat.rep > 1):
+ pat.rep[incr pat.rep] := 0;
+ fi
+ pat.start := 1;
+ pat.start[1] := pat.rep[1]*dash_start;
+ for _idx = 2 upto pat.rep :
+ pat.start[incr pat.start] := pat.rep[_idx];
+ endfor
+ pat.finish := 1;
+ pat.finish[1] := pat.rep[1]*dash_finish;
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{dashed}
+% \DescribeRoutine{DASHED}
+% The old \gbc{dashed} is now implemented by making a dashpattern from the
+% two arguments and calling gendashed. When \MP{} support was added, I
+% thought it best not to overwrite the \MP{} primitive \gbc{dashed} and
+% the command was named \gbc{DASHED}, but then later it seemed better to
+% keep \MF/\MP{} compatibility so \gbc{dashed} was used. Now for backward
+% compatibility we maintain both. In \MP, we save the primitive
+% \mfc{dashed} as \gbc{dashed_}.
+%
+% \gbc{dashed} takes parameters which are the length and the space (device
+% coordinates) and a path (graph coordinates). It returns the path.
+% \begin{macrocode}
+vardef DASHED (expr dlen, dgap) expr f =
+ save dashes; dashpat (dashes) (dlen, dgap);
+ gendashed (dashes) f
+enddef;
+
+%<MP>let dashed_ = dashed;
+def dashed = DASHED enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{doplot}
+% \gbc{doplot} places symbols at positions along a path determined by
+% \gbc{dgap} (space between symbols), they are scaled by \gbc{sc} and the
+% actual symbol is \gbc{spath}. Currently this may be one of three things:
+% \begin{enumerate}
+% \item A path, giving the shape of the dot, which should be defined in
+% units so that the desired size is obtained under scaling by
+% \gbc{sc}. Normally this means one unit across.
+% \item A picture. This is used unscaled, it being presumed that it has
+% been prepared by a user to the correct size.
+% \item (\MP{} only) a string.
+% \end{enumerate}
+% All these are converted to a picture by the \gbc{makesymbol} command and
+% it is assigned to \gbc{plot_pic}, which \gbc{gendashed} has been
+% trained to use when dots are needed.
+%
+% After this \gbc{gendashed} is called with a pattern where the dashes are
+% 0 length, signalling that dots are used. \gbc{dotted} is implemented by
+% calling \gbc{doplot} with \gbc{dotpath} the symbol.
+% \begin{macrocode}
+vardef doplot (expr spath, sc, dgap) expr f =
+ save dots; dashpat (dots) (0, dgap);
+ save plot_pic; picture plot_pic;
+ plot_pic := makesymbol (spath, sc);
+ gendashed (dots) f
+enddef;
+
+path dotpath; dotpath := fullcircle;
+vardef dotted (expr dsize, dgap) expr f =
+ doplot (dotpath, dsize, dgap) f
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{plotnodes}
+% This is a useful little utility to draw the points on top of the
+% curve through them. It differs from \gbc{plotsymbol} (defined later) in
+% that it takes a path parameter (rather than a list of points) and
+% returns that path (so it works with \mfpic{} as a prefix macro). It
+% also uses \gbc{drawcolor}. Otherwise it calls the same code.
+% \begin{macrocode}
+vardef plotnodes (expr symbol, size) expr f =
+ save _pln; pair _pln[];
+ _pln := 0;
+ for _a = 0 upto (length f) if cycle f : - 1 fi :
+ _pln[incr _pln] := pnt[_a] (f);
+ endfor
+ dosymbols (drawcolor, symbol, size) (_pln);
+ f
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{centerit}
+% This accepts a picture and returns the same picture centered. This
+% is close to impossible in \MF, so we only do it in \MP. Actually, we
+% no longer use it, because in the one case where we did
+% (\gbc{makesymbol}), it seemed to restrict the user's choices too much.
+% \begin{macrocode}
+%<*MP>
+vardef centerit (expr pic) =
+ pic shifted -(0.5[urcorner pic, llcorner pic]);
+enddef;
+
+%</MP>
+% \end{macrocode}
+%
+% \DescribeRoutine{makesymbol}
+% This utility: takes \emph{any} expression and scale and returns a picture.
+% If the expression \gbc{spath} is a cycle it returns the interior, for
+% other paths it draws the path, in either case scaled by \gbc{sc}. If
+% already a picture, it returns it. In \MP, if it is a string, it returns
+% a picture containing that string drawn in the \mfc{defaultfont}. In any
+% other case, the default dot is returned.
+% \begin{macrocode}
+vardef makesymbol (expr spath, sc) =
+ if path spath : setdot (spath, sc)
+ elseif picture spath :
+%<MF> save v; picture v; v:= spath; mono (v); v
+%<*MP>
+ spath
+ elseif string spath :
+ spath infont defaultfont scaled defaultscale
+%</MP>
+ else:
+ GBmsg "Undefined symbol for plotting, using dotpath instead.";
+ setdot (dotpath, sc)
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% These are some symbols to be used by \gbc{doplot} and \gbc{plotsymbol}.
+% They are paths. The ones named with ``\gbc{Solid}'' are closed paths.
+% Since these two drawing commands feed the path to \gbc{setdot}, they end
+% up filled if they are cyclic, merely drawn if not.
+%
+% All are intended to have roughly the area (when area makes sense) of a
+% circle with diameter 1.
+% \begin{macrocode}
+path Triangle, Square, Circle, Diamond, Star, Plus, Cross,
+ Asterisk, SolidTriangle, SolidSquare, SolidCircle,
+ SolidDiamond, SolidStar;
+
+Triangle := (for n = 0 upto 2:
+ (up rotated 120n)-- endfor up) scaled .78;
+SolidTriangle := Triangle & cycle;
+
+Square := (for n = 0 upto 3:
+ dir (90n + 45)-- endfor dir 45) scaled .63;
+SolidSquare := Square & cycle;
+
+Circle := halfcircle & halfcircle rotated 180;
+SolidCircle := Circle & cycle;
+
+Diamond := (Square rotated 45) xscaled (1/1.2) yscaled 1.2;
+SolidDiamond := Diamond & cycle;
+
+Plus := (origin for n = 0 upto 3:
+ --(up rotated 90n)--origin endfor) scaled .65;
+Cross := Plus rotated 45;
+Asterisk := (origin for n = 0 upto 5:
+ --(up rotated 60n)--origin endfor) scaled .6;
+
+% \end{macrocode}
+%
+% We do some computations to find the vertices of a standard 5-pointed
+% star (pentagram). The first equation says the indented vertex at the
+% ``left shoulder'' is on the line from the top of the ``head'' to the
+% ``left foot'', and the second says it is on the line from the ``left
+% hand'' to the ``right hand''. That point determined, we get the rest by
+% rotaing 72 degrees.
+% \begin{macrocode}
+pair zz;
+zz = (whatever)[up, up rotated 144];
+zz = (whatever)[up rotated 72, up rotated -72];
+Star := (for n = 0 upto 4:
+ (up rotated 72n)--(zz rotated 72n)-- endfor up) scaled .84;
+SolidStar := Star & cycle;
+save zz;
+
+% \end{macrocode}
+%
+% In \mfpic, the \cs{plotdata} command draws several curves with one
+% command. The curves are drawn with changeable methods of rendering.
+% There are three schemes. The first draws the curves with different dash
+% patterns. Another scheme is to plot the curves with different symbols.
+% Still another is to use different colors (\MP{} only).
+%
+% We implement the changing of patterns (symbols, colors) by defining
+% arrays of such things and changing the index into the array. For
+% example, when the user has selected dashes, the first curve is
+% \gbc{gendashed} with the pattern \gbc{dashtype0}, the next with
+% \gbc{dashtype1}, etc.
+%
+% \DescribeRoutine{defaultdashes}
+% These are the usual dash patterns. Their setting is done by a macro
+% so the user may easily restore them. The spaces are apparently larger
+% than the dashes, but taking the thickness of the pen into account
+% (\mfc{.5bp}) the dashes will appear about \mfc{.5bp} larger than stated
+% and the spaces about \mfc{.5bp} smaller.
+% \begin{macrocode}
+numeric dashtype;
+forsuffixes s = start, rep, finish :
+ numeric dashtype[].s, dashtype[].s[];
+endfor
+def defaultdashes =
+ dashpat (dashtype0) (0); % solid
+ dashpat (dashtype1) (3bp, 4bp); % dashed
+ dashpat (dashtype2) (0, 4bp); % dotted
+ dashpat (dashtype3) (0, 4bp, 3bp, 4bp); % dot-dash
+ dashpat (dashtype4) (0, 4bp, 3bp, 4bp, 0, 4bp);% dot-dash-dot
+ dashpat (dashtype5) (0, 4bp, 3bp, 4bp, 3bp, 4bp);% dot-dash-dash
+ dashtype := 6;
+enddef;
+defaultdashes;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{isdashpat}
+% Checks, for the given variable \gbc{pat}, if the three arrays that
+% make up a dash pattern are know arrays. It does not check if they are
+% numeric arrays, but one hardly thinks they could all three exist
+% accidentally if they hadn't been created by \gbc{dashpat}.
+%
+% \DescribeRoutine{setdatadashes}
+% We have this method for users to select their own dash patterns. The
+% \gbc{setdatadashes} command requires a list of suffixes previously
+% defined by the \gbc{dashpat} command.
+%
+% \DescribeRoutine{getdashpat}
+% And finally, we remove the mod-ing operation from \TeX, where it is
+% cumbersome, to \MF, where it is trivial, with this command.
+% \begin{macrocode}
+vardef isdashpat suffix pat =
+ (knownarray pat.start) and
+ (knownarray pat.finish) and
+ (knownarray pat.rep)
+enddef;
+
+def setdatadashes (text lst) =
+ save dashtype; dashtype := 0;
+ forsuffixes _itm = lst :
+ if isdashpat _itm :
+ forsuffixes _s = start, rep, finish :
+ copyarray (_itm._s, dashtype[dashtype]._s);
+ endfor
+ dashtype := dashtype + 1;
+ else: GBmsg "Improper dash pattern in setdatadashes.";
+ fi
+ endfor
+ if dashtype = 0 :
+ SetdataWarn "dashes";
+ defaultdashes;
+ fi
+enddef;
+def getdashpat expr n = dashtype[n mod dashtype] enddef;
+
+def SetdataWarn expr s =
+ GBmsg "Command setdata"& s &"() failed; using defaults."
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{setdatasymbols}
+% This can be used to define the sequence of point plotting styles for
+% \mfpic's \cs{plotdata} command. We could use it to set the default
+% symbols, but I worry about the difficulty chasing down bugs if
+% \gbc{defaultpoints} calls \gbc{setdatasymbols} which can again call
+% \gbc{defaultpoints}.
+%
+% \DescribeRoutine{getsymbol}
+% This is similar to \gbc{getdashpat}. In fact we could write a
+% single macro to do both, but I think we get a more readable \mfpic{}
+% output file if we have separate commands.
+% \begin{macrocode}
+def setdatasymbols (text lst) =
+ save pointtype; path pointtype[]; pointtype := 0;
+ for _itm = lst :
+ if (known _itm) and (path _itm):
+ pointtype[pointtype] := _itm;
+ pointtype := pointtype + 1;
+ else:
+ GBmsg "Improper path in setdatasymbols().";
+ fi
+ endfor
+ if pointtype = 0:
+ SetdataWarn "symbols";
+ defaultsymbols;
+ fi
+enddef;
+def getsymbol expr n := pointtype[n mod pointtype] enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{defaultsymbols}
+% We store the default definitions in a macro so the user can restore
+% them easily.
+% \begin{macrocode}
+numeric pointtype; path pointtype[];
+def defaultsymbols =
+ pointtype0 := Circle;
+ pointtype1 := Cross;
+ pointtype2 := SolidDiamond;
+ pointtype3 := Square;
+ pointtype4 := Plus;
+ pointtype5 := Triangle;
+ pointtype6 := SolidCircle;
+ pointtype7 := Star;
+ pointtype8 := SolidTriangle;
+ pointtype := 9;
+enddef;
+defaultsymbols;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{setdatacolors}
+% \DescribeRoutine{getcolor}
+% Finally, for \MP, we do a similar pair of commands for setting and
+% getting the colors for the \cs{plotdata} command. The default colors
+% were tested on screen and on an inkjet printer. The adjustments away
+% from pure colors is based on a compromise between those experiments.
+%
+% \DescribeRoutine{defaultcolors}
+% We store the default definitions in a macro so the user can restore
+% them easily.
+% \begin{macrocode}
+%<*MP>
+def setdatacolors (text lst) =
+ save colortype; color colortype[]; colortype := 0;
+ for _itm = lst :
+ if (known _itm) and (color _itm) :
+ colortype[colortype] := _itm;
+ colortype := colortype + 1;
+ else: GBmsg "Improper color in setdatacolors().";
+ fi
+ endfor
+ if colortype = 0 :
+ SetdataWarm "colors";
+ defaultcolors;
+ fi
+enddef;
+def getcolor expr n = colortype[n mod colortype] enddef;
+
+numeric colortype; color colortype[];
+def defaultcolors =
+ colortype0 := black;
+ colortype1 := red;
+ colortype2 := 0.80blue + .2white; % blue
+ colortype3 := 0.66yellow + .34red; % orange
+ colortype4 := 0.80green; % green
+ colortype5 := 0.85magenta; % magenta
+ colortype6 := 0.85cyan; % cyan
+ colortype7 := 0.85yellow; % yellow
+ colortype := 8;
+enddef;
+defaultcolors;
+
+%</MP>
+% \end{macrocode}
+%
+% Points are filled or unfilled circles. They are implemented with
+% \gbc{plotsymbol}, but the code differs in that filled or unfilled
+% circles are determined by a parameter rather than the type of curve.
+% In addition, for unfilled circles, it clears the pixels inside the circle.
+%
+% \DescribeRoutine{bpoint}
+% \gbc{bpoint} is basicly a shorthand for a scaled circle shifted to a
+% point. The scale and the point are in device coordinates. We don't use
+% it anywhere in grafbase anymore.
+% \begin{macrocode}
+vardef bpoint (expr ptwd, b) =
+ fullcircle scaled ptwd shifted b
+enddef;
+% \end{macrocode}
+%
+% \DescribeRoutine{pointd}
+% This draws disks with diameter \gbc{ptwd}, filled or unfilled based on
+% the boolean \gbc{filled}, at the graph coordinate coordinates in the
+% list \gbc{t}. In case \gbc{filled} is true, \gbc{pointd} calls
+% \gbc{plotsymbol (SolidCircle)} otherwise we make \gbc{clearsymbols} true
+% (so that the area where each point is drawn will be cleared before
+% drawing it) and call \gbc{plotsymbol(Circle)}.
+% \begin{macrocode}
+def pointd (expr ptwd, filled) (text t) =
+ if filled :
+ plotsymbol (SolidCircle, ptwd) (t);
+ else :
+ begingroup;
+ save clearsymbols; boolean clearsymbols; clearsymbols := true;
+ plotsymbol (Circle, ptwd) (t);
+ endgroup
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{plotsymbol}
+% \DescribeRoutine{colorplotsymbol}
+% These place a symbol centered at each of the graph
+% coordinate points in the list. The symbol placed is the first parameter,
+% which would normally be a path, but can be a picture or, in \MP, a
+% string. Like the \gbc{doplot} command, it calls \gbc{makesymbol}.
+% If \gbc{spath} is of type path, and is cyclic, it is drawn filled. This
+% is because we call \gbc{makesymbol} on it, and that subjects it to
+% \gbc{setdot}, which has that behavior. For other types of symbols, we
+% simply convert them to pictures with \gbc{makesymbol} and then place
+% them. Unlike \gbc{pointd} above, the interior of the path is not
+% erased by default. However, in the special case where the symbol is an
+% open path, if its first point is equal to its last point, and
+% \gbc{clearsymbols} is true, then the interior of the path obtained by
+% \gbc{\& cycle} is cleared before the path itself is drawn.
+%
+% \DescribeRoutine{dosymbols}
+% \DescribeRoutine{addsymbols}
+% We copy the text list to an array and call \gbc{dosymbols} so that
+% \gbc{plotnodes} can share the code. Also, since \gbc{dosymbols} uses
+% identical code twice (once to clear, once to draw), we put that code
+% in \gbc{addsymbols}
+% \begin{macrocode}
+boolean clearsymbols; clearsymbols := false;
+vardef clearable (expr pth) =
+ false
+ if path pth :
+ if (not cycle pth) and (length pth > 0):
+ if ( pnt0 (pth) = pnt[length pth] (pth) ) :
+ or true
+ fi fi fi
+enddef;
+
+def plotsymbol = colorplotsymbol (pointcolor) enddef;
+vardef colorplotsymbol (expr clr, spath, sc) (text t) =
+ save _cpls;
+ textpairs (_cpls) (t);
+ dosymbols (clr, spath, sc) (_cpls);
+enddef;
+
+vardef dosymbols (expr clr, spath, sc) (suffix arr) =
+ save one_symbol, _pls; picture one_symbol, _pls;
+ if clearsymbols and clearable (spath):
+ addsymbols (background, spath&cycle, sc) (arr);
+ fi
+ addsymbols (clr, spath, sc) (arr);
+enddef;
+
+def addsymbols (expr clr, spath, sc) (suffix arr) =
+ one_symbol := makesymbol (spath, sc);
+ _pls := nullpicture;
+ for _idx = 1 upto arr:
+ picdot (_pls, one_symbol, zconv(arr[_idx]));
+ endfor
+ DoClip (_pls);
+%<MF> mono (_pls);
+ coloraddto (clr) (active_plane) (_pls);
+enddef;
+
+% \end{macrocode}
+%
+%
+% \section{Modification of paths}\label{modification}
+%
+% \subsection{Closing a path}\label{closing}
+%
+% In \MF{} one can close a path by any legal path connection between the
+% last point and the keyword \mfc{cycle}. Connecting the last point to the
+% first point is not enough. \Grafbase{} commands provide a few different
+% ways. All the closure commands have a version with a tension parameter
+% when that makes sense. These version make the connection with the
+% supplied tension. The ones where it doesn't make sense are \gbc{lclosed},
+% \gbc{cbclosed} and \gbc{qbclosed}. The first always uses a straight line
+% and the other two require explicit controls.
+%
+% \DescribeRoutine{lclosed}
+% This closes with a line segment.
+% \begin{macrocode}
+vardef lclosed expr f = f if not cycle f : --cycle fi enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{sclosed}
+% \DescribeRoutine{sclosedt}
+% This closes the path in the manner that \gbc{mksmooth} creates a path.
+% This will change the first and last segment of the original path. In
+% particular, if there are fewer than three segments, the whole path is
+% different.
+% \begin{macrocode}
+numeric default_tension;
+default_tension := 1;
+
+def sclosed = sclosedt (default_tension) enddef;
+vardef sclosedt (expr t) expr f =
+ if cycle f : f
+ else: save n; n := length f;
+ if n = 0 : f&cycle
+ elseif n = 1 : f..tension t..cycle
+ else :
+ (pnt0 (f)) { (pnt1(f)) - (pnt[n] (f)) }..tension t
+ ..(subpath (1, n-1) of f)..tension t
+ ..(pnt[n](f)) { pnt0(f) - pnt[n-1](f) }
+ ..tension t..cycle
+ fi
+ fi
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{bclosed}
+% This closes with the basic default \MF{} Bezi\'er. It is a smooth
+% closure, but it does not have the same direction at the endpoints
+% that \gbc{mksmooth (true)} would have produced.
+% \begin{macrocode}
+def bclosed = bclosedt (default_tension) enddef;
+vardef bclosedt (expr t) expr f =
+ f if not cycle f : ..tension t..cycle fi
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{uclosed}
+% This is now just a renaming of \gbc{bclosed}. It turns out (contrary
+% to my earlier belief) that just adding \mfc{..cycle} does \emph{not}
+% change the original curve. \gbc{sclosed} will do that because it
+% takes the curve apart and redoes its end segments.
+% \begin{macrocode}
+def uclosed = bclosed enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{bsplinecontrols}
+% This utility is for use in \gbc{cbclosed}. It converts Bezier segment
+% key points of a path \gbc{f}, to cubic B-spline control points stored
+% in an array \gbc{b}. The data needed are the first point and first two
+% control points of \gbc{f}. The B-spline points needed are \gbc{b1} and
+% \gbc{b4}. The extra two points \gbc{b2} and \gbc{b3} divide the line
+% from \gbc{b1} to \gbc{b4} into thirds and will be turned into Bezier
+% control points of a new path segment.
+% \begin{macrocode}
+def bsplinecontrols (suffix b) expr f =
+ b := 4;
+ b1 := 2[pre 1(f), post0(f)];
+ b2 := 2[post0(f), pnt 0(f)];
+ b3 := 2[b1, b2];
+ b4 := 2[b2, b3];
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{cbclosed}
+% This closes a path with a cubic B-spline. If the path \gbc{f} had been
+% produced by \gbc{opencbs}, then \gbc{q1} and \gbc{q4} would have been the
+% last two points in the argument list, and \gbc{p4} and \gbc{p1} would
+% have been the first two. We just use them and mimic the effect of
+% \gbc{closedcbs}.
+% \begin{macrocode}
+vardef cbclosed expr f =
+ if cycle f : f
+ elseif (length f)=0 : f&cycle
+ else:
+ save p, q; pair p[], q[];
+ bsplinecontrols (p) f; % defines p1 to p4
+ bsplinecontrols (q) reverse f; % defines q1 to q4
+ f..controls q2 and q3..opencbs (q1,q4,p4,p1)
+ ..controls p3 and p2..cycle
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{qbclosed}
+% It seems wrong to be able to close with a cubic B-spline but not a
+% quadratic B-spline. Therefore I will add such a possibility. We
+% calculate B-spline controls \gbc{p[n]} that will agree with those of
+% \gbc{f}, if \gbc{f} had been created as a quadratic B-spline. Note
+% that \gbc{cbclosed} required three \MF{} links to close the curve;
+% \gbc{qbclosed} only requires two.
+% \begin{macrocode}
+vardef qbclosed expr f =
+ if cycle f : f
+ else: save n; n := length f;
+ if n = 0 : f&cycle
+ else:
+ save p; pair p[]; p := 4;
+ p1 := (3/2)[pnt[n](f), pre[n](f)];
+ p2 := 2[p1, pnt[n](f)];
+ p4 := (3/2)[pnt 0 (f), post0 (f)];
+ p3 := 2[p4, pnt 0 (f)];
+ f & mkqbs (p) & cycle
+ fi
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{makesector}
+% This makes sense only if the path being modified is an arc. It closes
+% the arc by connecting its ends to the center of the circle, as
+% computed by \gbc{pathcenter}.
+% \begin{macrocode}
+vardef makesector expr p =
+ (pathcenter p)--p--cycle
+enddef;
+
+% \end{macrocode}
+% \subsection{Trimming a path}\label{trimming}
+%
+% \DescribeRoutine{cutoffbefore}
+% \DescribeRoutine{cutoffafter}
+% This is a useful utility operation present in \file{plain.mp} but
+% missing from \file{plain.mf}. We write a different version for our
+% purposes; it has the syntax of most of our path modification
+% commands. Plus, the first loop tries to avoid a bug (or perhaps
+% inaccuracy) in \mfc{intersectiontimes} which can return an intersection
+% time in a later segment of \gbc{f} than the first intersection point.
+% If I can learn the actual method used to find intersection times, I'll
+% put in some \mfc{solve} code to get the first \gbc{t} rather than the
+% minimal `shuffled binary' of the pair \gbc{w}.
+% \begin{macrocode}
+%<MF>path cuttings;
+vardef cutoffbefore (expr b) expr f =
+ save w, t, u, n; n:= length f;
+ pair w;
+ for k = 1 upto n :
+ w := (subpath (0,k) of f) intersectiontimes b;
+ exitif w > left;
+ endfor
+ if debug :
+ GBdebug;
+ >> "Intersectiontimes:";
+ show w;
+ GBenddebug;
+ fi
+ t := xpart w;
+ if t < 0:
+ cuttings := pnt0 (f);
+ f
+ else:
+ cuttings := subpath (0,t) of f;
+ subpath (t, n) of f
+ fi
+enddef;
+
+vardef cutoffafter (expr b) expr f =
+ save g; path g;
+ g := cutoffbefore (b) reverse f;
+ cuttings := reverse cuttings;
+ reverse g
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{trimmedpath}
+% This takes two lengths and a path and trims off the ends of the path
+% that lie within the given lengths of the endpoints. The lengths are in
+% device coordinates, the path in graph coordinates.
+% \begin{macrocode}
+vardef trimmedpath (expr btrim, etrim) expr f =
+ save g, h; path g, h;
+ g := invvconv (fullcircle scaled 2btrim) shifted pnt0(f);
+ h := invvconv (fullcircle scaled 2etrim) shifted pnt[length f] (f);
+ cutoffafter (h) cutoffbefore (g) f
+enddef;
+
+% \end{macrocode}
+%
+% \subsection{Appending an arrowhead}
+%
+%
+% \DescribeRoutine{predirection}
+% \DescribeRoutine{postdirection}
+% \DescribeRoutine{__dir}
+% First, some better \mfc{direction} commands. They makes use of the fact
+% (easily proved) that a cubic B\'ezier $z\sb0(1 - t)^3 + 3z\sb1(1-t)^2t +
+% z\sb2(1-t)t^2 + z\sb3t^3$ has a direction at $z\sb0$ equal to the first
+% one of $z\sb{j} -z\sb0$ that is nonzero.
+%
+% \gbc{__dir} gets the direction at point 0 for an arbitrary path.
+% \gbc{postdirection} reduces to this case using \mfc{subpath}. If the
+% postdirection is 0, that means the path is trivial from that point to
+% the end so we are effectively at an endpoint (noncyclic path) and we use
+% the incoming direction. \gbc{predirection} just runs
+% \gbc{postdirection} on the reversed path.
+% \begin{macrocode}
+vardef predirection@# (expr p) =
+ - postdirection[length p - @#] (reverse p)
+enddef;
+
+vardef postdirection@# (expr p) =
+ save _n; _n := length (p);
+ save v; pair v; v := __dir (subpath (@#, @# + _n) of p);
+ if v = origin :
+ v := - __dir (subpath (@#, @# - _n) of p);
+ fi
+ v
+enddef;
+
+vardef __dir (expr p) =
+ save v, w; pair v, w; w := pnt0 (p);
+ v := origin;
+ for n = 1 upto length (p) :
+ v := post[n-1] (p) - w;
+ if v = origin :
+ v := pre[n] (p) - w;
+ if v = origin :
+ v := pnt[n] (p) - w;
+ fi
+ fi
+ exitif v <> origin;
+ endfor
+ v
+enddef;
+
+% \end{macrocode}
+%
+% Arrowheads can be just two straight lines at an angle placed on the end
+% of a curve, or it can be a filled triangle. \grafbase{} permits both,
+% but it also allows the two lines (or the corresponding sides of the
+% triangle) to be gracefully concave and tangent to the path at the
+% endpoint of the path. The parameters controlling the shape of the arrowhead
+% are the two numerics \gbc{hdwdr}, the ratio of the length to width of the
+% arrowhead, and \gbc{hdten}, the tension in the two angled curves. By
+% default, one side of an arrowhead is just the \MF{} path
+% \mfc{a..b\marg{\meta{tangent}}}, where \mfc{a} is the base of the
+% arrowhead (calculated from \gbc{hdwdr}) and \gbc{b} is the end of the
+% path and \meta{tangent} is the direction of the curve at that
+% point. The curve can be straightened by increasing \gbc{hdten}, the
+% head widened by increasing \gbc{hdwdr}
+%
+% The arrowhead is drawn by drawing two of the curves described above. If
+% \gbc{hfilled} is \mfc{true}, the two base points (\gbc{a} above) are
+% connected and the three sided region filled.
+% \begin{macrocode}
+newinternal hdwdr, hdten;
+interim hdwdr := 1; interim hdten := 1;
+boolean hfilled; hfilled := false;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{headshape}
+% The following little utility adjusts the above parameters, call it
+% with two pure numbers \gbc{wr} and \gbc{tens} for the \gbc{hdwdr} and
+% \gbc{hdten}, and a boolean \gbc{fil} for \gbc{hfilled}.
+% \begin{macrocode}
+def headshape (expr wr, tens, fil) =
+ interim hdwdr := wr; interim hdten := tens;
+ save hfilled; boolean hfilled; hfilled := fil;
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{ahead}
+% \DescribeRoutine{colorhead}
+% This command draws an arrowhead. \gbc{front} and \gbc{back} are in
+% device coordinates. They are the point of the arrowhead (\gbc{front})
+% and the point such that \gbc{front - back} points in the direction of
+% the arrow. We use the ratio \gbc{hwr} to compute the other two
+% corners. So \gbc{side} is the vector from \gbc{back} to one of the
+% corners \gbc{p1}, and the other corner is on the other side. \gbc{f}
+% is the path of the arrowhead.
+%
+% If \gbc{filled} is true we close the curve and fill it, otherwise we
+% draw it. \gbc{clr} is the color used to draw or fill it.
+%
+% For backward compatibility we define \gbc{head}. In \MF{} \gbc{head}
+% didn't have a color parameter, while in \MP{} it has always had one,
+% in retrospect, this was not a good idea, and we should have followed
+% the pattern of other macros. However, \gbc{head} was never a user-level
+% macro and I didn't think it mattered.
+% \begin{macrocode}
+%<MF>def head = ahead (headcolor) enddef;
+%<MP>def head = ahead enddef;
+
+vardef ahead (expr clr, front, back, hwr, tens, filled) =
+ if front <> back :
+ save side; pair side;
+ side := (hwr/2) * ((front-back) rotated 90);
+ save f; path f;
+ f := (back + side)..tension tens..
+ {front-back}front{back-front}..tension tens..
+ (back - side)
+ if filled : --cycle; colorsafefill (clr) f fi;
+ colorsafedraw (clr) f;
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% It is a fact of life that, unless the path to which the head is added is
+% a straight line, the above described arrowhead looks ``off''. But I know
+% of no automatic way of making it look good. Therefore \grafbase{} and
+% \mfpic{} have provided a means to micro-adjust the head. (Actually, I
+% think the best looking arrowhead for small heads and paths of modest
+% curvature is obtained by taking a secant for the direction of the head
+% head rather than a tangent.)
+%
+% \DescribeRoutine{headpath}
+% \DescribeRoutine{colorheadpath}
+% This takes a path expression \gbc{f} in graph coordinates, puts an
+% arrowhead on it and returns \gbc{f}. The arrowhead is placed according
+% to the first four parameters. \gbc{hlen} is the length of the head in
+% device coordinates, the width being determined by \gbc{hdwdr}, and
+% and \gbc{hrot} is a rotation adjustment. \gbc{hback} is a distance (in
+% device coordinates) by which it is set back from the point of placement.
+% It is set back in the direction determined after the rotation.
+%
+% If the length of the head is 0, we just skip everything and return
+% \gbc{f}.
+%
+% \gbc{headpath} calls \gbc{colorheadpath} with the color set to
+% \gbc{headcolor}.
+% \begin{macrocode}
+def headpath = colorheadpath (headcolor) enddef;
+vardef colorheadpath (expr clr, hlen, hrot, hback) expr f =
+ if hlen <> 0 :
+ save g; path g; g := zconv (f);
+ save P; pair P[];
+ P2 := pnt[length g] (g);
+ P1 := predirection[length g] (g);
+ if P1 <> (0, 0) :
+ P3 := (unitvector P1) rotated hrot;
+ P4 := P2 - (hback * P3);
+ P5 := P4 - (hlen * P3);
+ ahead (clr, P4, P5, hdwdr, hdten, hfilled);
+ fi
+ fi
+ f
+enddef;
+
+% \end{macrocode}
+%
+% \section{Axes, Axis Tic Marks, and Grids}
+%
+% \DescribeRoutine{arrowdraw}
+% This is used elsewhere only to draw axes. It returns nothing. This
+% doesn't follow the usual pattern of drawing something and returning the
+% same path. This makes the old \cs{axes}, \cs{xaxis} and \cs{yaxis}
+% commands in \mfpic{} impossible to dash or dot. The newer axis drawing
+% commands permit this and so use other code.
+%
+% We simply call \gbc{headpath} with default values, but add \gbc{drawn}
+% to make sure the path is drawn, and precede it with \gbc{store} so
+% \MF{} won't complain of an isolated expression. The new axis commands
+% just call \gbc{headpath}, and the \mfpic{} code makes sure it is drawn,
+% but it can also be \gbc{dashed}, \gbc{dotted}, and \gbc{doplot}\,ed.
+%
+% The order is important if axis and head are different colors. This
+% order puts the head on top of the shaft.
+% \begin{macrocode}
+def arrowdraw (expr hlen) (expr f) =
+ store (curpath) headpath (hlen, 0, 0) drawn f;
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{xaxis}
+% \DescribeRoutine{yaxis}
+% \DescribeRoutine{axes}
+% These draw the obvious things: the corresponding axis or axes through
+% the point (0, 0) in graph coordinates. The only parameter is the length
+% of the arrowhead in device coordinates. \gbc{axes} draws both axes with
+% the same length of head.
+% \begin{macrocode}
+def xaxis (expr hlen) = arrowdraw (hlen) ((xneg, 0)--(xpos, 0)); enddef;
+def yaxis (expr hlen) = arrowdraw (hlen) ((0, yneg)--(0, ypos)); enddef;
+def axes (expr hlen) = xaxis (hlen); yaxis (hlen); enddef;
+
+% \end{macrocode}
+%
+% For axes at the borders of the graph coordinates, we allow for them to
+% be shifted inwards. The amount of the shift is given by \gbc{laxis} for
+% the left side axis, \gbc{baxis} for the bottom axis, etc. They are in
+% graph coordinates.
+%
+% \DescribeRoutine{axisline.x}
+% \DescribeRoutine{axisline.y}
+% \DescribeRoutine{axisline.l}
+% \DescribeRoutine{axisline.b}
+% \DescribeRoutine{axisline.r}
+% \DescribeRoutine{axisline.t}
+% The commands \gbc{axisline.l}, etc., return the straight line along the
+% corresponding edge shifted the appropriate amount. These are vardefs
+% rather than variables so they can be affected by changing shift values.
+%
+% \DescribeRoutine{axis}
+% Finally, the commands \gbc{axis.x}, etc. examine their suffix and
+% apply \gbc{headpath} to the corresponding axis line. With a recent
+% change in \mfpic{} code, it no longer gets used, as we now simply apply
+% \cs{arrow} to the appropriate \gbc{axisline}. The change was made for
+% consistency: so that the head would be drawn on top of the shaft.
+% \begin{macrocode}
+laxis := baxis := raxis := taxis := 0;
+
+vardef axisline.x = (xneg + laxis, 0)--(xpos - raxis, 0) enddef;
+vardef axisline.y = (0, yneg + baxis)--(0, ypos - taxis) enddef;
+vardef axisline.l = axisline.y shifted (xneg + laxis, 0) enddef;
+vardef axisline.b = axisline.x shifted (0, yneg + baxis) enddef;
+vardef axisline.r = axisline.y shifted (xpos - raxis, 0) enddef;
+vardef axisline.t = axisline.x shifted (0, ypos - taxis) enddef;
+vardef axis@# (expr len) =
+ headpath (len, 0, 0) axisline@#
+enddef;
+
+% \end{macrocode}
+%
+% Tick marks can be on the inside or outside of a border axis,
+% above or below any horizontal axes, left or right of any vertical axis
+% or centered on any axis. The following numerics are merely used to
+% convert the names to numeric code that the drawing routine will examine.
+%
+% However, it is no accident that \gbc{onbottom = onright} and that
+% \gbc{centered} is halfway between \gbc{onright} and \gbc{onleft}. The
+% code uses the numeric values to compute a shift, and one can supply an
+% expression like \gbc{.33ontop+.67onbottom]} and then 1/3 of each mark
+% will be above (and 2/3 will be below) the axis.
+%
+% The negative value of \gbc{inside} and \gbc{outside} is a flag that they
+% are to be treated differently. The others have the property that the
+% direction is the direction of the axis rotated a certain way (e.g.,
+% $90$ degrees from \mfc{up} points \mfc{left}, $-90$ points \mfc{right}).
+% But \gbc{inside} is right of the left axis and left of the right axis.
+% \begin{macrocode}
+numeric inside, outside, centered, onleft, onright, ontop, onbottom;
+inside := -2;
+outside := -1;
+onright := 1;
+onleft := 2;
+centered := .5[onright, onleft];
+onbottom := onright;
+ontop := onleft;
+% \end{macrocode}
+%
+% We interact with \mfpic{} by allowing the user to change the value of
+% \gbc{ltick}, for example, with a command like \
+% \cs{setaxismarks l}\marg{outside}. Here we set the defaults.
+% \begin{macrocode}
+ltick := rtick := ttick := btick := inside;
+xtick := ytick := centered;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{axismarks}
+% This utility macro draws the tick marks on an arbitrary axis. The
+% different commands \gbc{xmarks}, etc., call this command with particular
+% values of these parameters.
+% \begin{itemize}
+% \item \gbc{inang} is the direction one must rotate the axis to point
+% inside. This is always $\pm90$ degrees. The x-axis and y-axis are
+% treated just like bottom and left axis in this respect.
+% \item \gbc{tp} is the tick position (e.g., \gbc{inside} or
+% \gbc{ontop}).
+% \item \gbc{loc} is the location of the 0-point of the axis (graph
+% coordinates).
+% \item \gbc{pdir} is the positive direction on the axis (right or up).
+% \item \gbc{len} is the length of a tick mark, supplied as an argument
+% to the individual axis mark commands.
+% \item \gbc{t} is the list of positions, also supplied.
+% \end{itemize}
+% \begin{macrocode}
+vardef axismarks (expr inang, tp, loc, pdir) (expr len) (text t) =
+ save _tp, _U, _P, _tic, _ticang;
+ pair _U, _P, _tic[];
+% \end{macrocode}
+% For \gbc{onleft}, \gbc{onright}, \gbc{ontop} or \gbc{onbottom}, which
+% are positive, don't examine \gbc{inang} but for \gbc{inside/outside}
+% use it to determine what inside means. \gbc{_ticang} will be the angle
+% to rotate \gbc{pdir} to set the direction of the tic mark.
+%
+% Then we shift the numeric value of \gbc{tp} by one, so \gbc{centered}
+% corresponds to $.5$ and the rest to either $0$ or $1$.
+% \begin{macrocode}
+ _ticang := if tp<0 : inang else: 90 fi;
+ _tp := abs(tp) - 1;
+% \end{macrocode}
+% Except, we go through the following shenanigans so that the marks are
+% always perpendicular to the axis, even if a coordinate transform will
+% slant the axis. After this \gbc{_U} should point in direction of inside,
+% onleft or ontop.
+% \begin{macrocode}
+ _U := unitvector (vconv (pdir)) rotated _ticang;
+% \end{macrocode}
+% Next, we use \gbc{_tp} to calculate the ends of the mark. For example,
+% if \gbc{tp = inside}, then \gbc{_tp = 1}. Since \gbc{_U} points toward
+% inside, \gbc{_tic2} will be \gbc{len} toward the inside and \gbc{_tic1 =
+% (0, 0)}.
+% \begin{macrocode}
+ _tic1 := (_tp - 1) * len * _U; % start of mark
+ _tic2 := _tp * len * _U; % end of mark
+% \end{macrocode}
+% Finally, convert each numeric position to a point on the axis, a
+% multiple of \gbc{pdir} from the 0 point of the axis, and than draw the
+% tic.
+% \begin{macrocode}
+ for _a = t:
+ safedraw ((_tic1--_tic2) shifted zconv (loc + _a*pdir));
+ endfor
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{xmarks}
+% \DescribeRoutine{ymarks}
+% \DescribeRoutine{lmarks}
+% \DescribeRoutine{bmarks}
+% \DescribeRoutine{rmarks}
+% \DescribeRoutine{tmarks}
+% And now the specialized command for each axis. Inside and outside
+% really make no sense for the x- and y-axis, but since a bottom axis is
+% usually used for x and a left axis for y, we give \gbc{xmarks} the same
+% first parameter as \gbc{bmarks} and \gbc{ymarks} the same as \gbc{lmarks}.
+% \begin{macrocode}
+def xmarks = axismarks ( 90, xtick, (0, 0), right) enddef;
+def ymarks = axismarks (-90, ytick, (0, 0), up) enddef;
+def lmarks = axismarks (-90, ltick, (xneg + laxis, 0), up) enddef;
+def bmarks = axismarks ( 90, btick, (0, yneg + baxis), right) enddef;
+def rmarks = axismarks ( 90, rtick, (xpos - raxis, 0), up) enddef;
+def tmarks = axismarks (-90, ttick, (0, ypos - taxis), right) enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{vgrid}
+% \DescribeRoutine{grid}
+% This is mainly for the purpose of visualising coordinates. \gbc{vgrid}
+% draws a dot of size \gbc{dsize} at every point whose coordinates
+% are are \gbc{(n*xspace, m*yspace)}, \gbc{n} and \gbc{m} being integers.
+% \gbc{dsize} is in device coordinates, the spacings are in graph
+% coordinates. \gbc{grid} is for backward compatibility, calling vgrid
+% with a default \gbc{dsize} of \mfc{.5bp}.
+%
+% \begin{macrocode}
+path griddotpath; griddotpath := fullcircle;
+def grid = vgrid (0.5bp) enddef;
+vardef vgrid (expr dsize, xspace, yspace) =
+ save gdot, gridpic; picture gdot, gridpic;
+ gdot := setdot (griddotpath, dsize);
+ gridpic := nullpicture;
+ for n = ceiling(xneg/xspace) upto floor(xpos/xspace):
+ for m = ceiling(yneg/yspace) upto floor(ypos/yspace):
+ picdot (gridpic, gdot, zconv((n*xspace, m*yspace)));
+ endfor
+ endfor
+%<MF> mono (gridpic);
+ coloraddto (pointcolor) (active_plane) (gridpic);
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{hgridlines}
+% \DescribeRoutine{vgridlines}
+% \DescribeRoutine{gridlines}
+% This is more what I think of when I hear ``grid'', but the name was already
+% taken. \gbc{gridlines} draws horizontal and vertical lines through the
+% same points where \gbc{grid} would draw a dot. To draw only horizontal
+% or only vertical lines use \gbc{hgridlines} or \gbc{vgridlines}.
+% \begin{macrocode}
+def hgridlines (expr ysp) =
+ for n = ceiling((yneg + baxis)/ysp) upto floor((ypos - taxis)/ysp) :
+ safedraw zconv((xneg + laxis, n*ysp)--(xpos - raxis, n*ysp));
+ endfor
+enddef;
+def vgridlines (expr xsp) =
+ for n = ceiling((xneg + laxis)/xsp) upto floor((xpos - raxis)/xsp) :
+ safedraw zconv((n*xsp, yneg + baxis)--(n*xsp, ypos - taxis));
+ endfor
+enddef;
+def gridlines (expr xsp, ysp) =
+ vgridlines (xsp); hgridlines (ysp);
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{plrpatch}
+% \DescribeRoutine{patcharcs}
+% \DescribeRoutine{patchrays}
+% Polar grids can be drawn two ways. \gbc{patcharcs} draws the arcs
+% \gbc{tstart}${}\le \theta \le{}$\gbc{tstop} with $r = {}$\gbc{rstart},
+% stepping by \gbc{rstep} until \gbc{rstop}. \gbc{patchrays} draws the lines
+% \gbc{rstart}${}\le r \le{}$\gbc{rstop} with $\theta = {}$\gbc{tstart}
+% stepping by \gbc{tstep} until \gbc{tstop}. \gbc{plrpatch} then calls
+%
+% They are utilities that draw on a picture variable \gbc{X}, and then a
+% calling command like \gbc{plrpatch} adds them to \gbc{active_plane}.
+% \gbc{plrpatch} used to be called by \gbc{polarpatch}, but now it is
+% not called at all.
+% \begin{macrocode}
+vardef plrpatch (expr rstart, rstop, rstep, tstart, tstop, tstep) =
+ save v; picture v; v := nullpicture;
+ patcharcs (v) (rstart, rstop, rstep, tstart, tstop);
+ coloraddto (drawcolor) (active_plane, v);
+ v := nullpicture;
+ patchrays (v) (tstart, tstop, tstep, rstart, rstop);
+ coloraddto (drawcolor) (active_plane, v);
+enddef;
+def patcharcs (suffix X) (expr rstart, rstop, rstep, tstart, tstop) =
+ for rad = (if rstart=0: rstep else: rstart fi) step rstep until rstop:
+ orto (X, picpath zconv (arcplr ((0, 0), tstart, tstop, rad)) );
+ endfor
+enddef;
+def patchrays (suffix X) (expr tstart, tstop, tstep, rstart, rstop) =
+ for _ang = tstart step tstep until tstop:
+ orto (X) (picpath zconv ((rstart*dir _ang)--(rstop*dir _ang)));
+ endfor
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{polargrid}
+% \DescribeRoutine{polargridpoints}
+% \DescribeRoutine{gridarcs}
+% \DescribeRoutine{gridrays}
+% These are analogous to \gbc{gridlines} and \gbc{grid}. They first draw a
+% grid large enough to cover the whole graph, then clip it to the. graph
+% boundaries. The arcs have radii that are multiples of \gbc{rstep} and
+% radial lines have angles that are multiples of \gbc{tstep}. The command
+% \gbc{polargridpoints} draws dots at the points where the lines and arcs
+% in \gbc{poloargrid} would intersect. The `step' parameters are in graph
+% coordinates. \gbc{beginpolargrid} computes the bounds for the patch and
+% declares the picture variable \gbc{gridpic}, while \gbc{endpolargrid}
+% clips the resulting picture and adds it to \gbc{active_plane}.
+%
+% The \gbc{rmin}, etc., returned are modified to fit the grid established
+% by the step sizes. A ray could happen to be one of the graph's sides, so
+% we use \mfc{ceiling} and \mfc{floor} which doesn't change integer
+% values. However, the arc with radius \gbc{rmin} or \gbc{rmax} could
+% touch the graph rectangle in at most 4 points, so we use \mfc{floor (1
+% + x)} and \mfc{ceiling(x - 1)} to start and stop before the edge of the
+% graph.
+% \begin{macrocode}
+def polargrid (expr rstep, tstep) =
+ gridarcs (rstep); gridrays (tstep);
+enddef;
+
+def polargridpoints (expr dsize, rstep, tstep) =
+ beginpolargrid;
+ save gdot; picture gdot; gdot := setdot (griddotpath, dsize);
+ if rmin = 0:
+ picdot (gridpic, gdot, zconv(origin));
+ rmin := rstep;
+ fi
+ for n = ceiling (rmin/rstep) upto floor (rmax/rstep) :
+ for m = ceiling (tmin/tstep) upto floor (tmax/tstep) :
+ picdot ( gridpic, gdot, zconv ( polar((n*rstep, m*tstep)) ) );
+ endfor
+ endfor
+ endpolargrid (pointcolor, .5dsize);
+enddef;
+
+def gridarcs (expr rstep) =
+ beginpolargrid;
+ if rmin = 0 : % add "circle" of radius 0
+ picdot (gridpic, setdot(griddotpath, penwd), zconv(origin));
+ fi
+ rmin := rstep * floor(rmin/rstep + 1);
+ rmax := rstep*ceiling(rmax/rstep - 1);
+ patcharcs (gridpic) (rmin, rmax, rstep, tmin, tmax);
+ endpolargrid (drawcolor, .5penwd);
+enddef;
+
+def gridrays (expr tstep) =
+ beginpolargrid;
+ tmin := tstep*ceiling(tmin/tstep);
+ tmax := tstep * floor(tmax/tstep);
+ patchrays (gridpic) (tmin, tmax, tstep, rmin, rmax);
+ endpolargrid (drawcolor, .5penwd);
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{beginpolargrid}
+% This computes the bounds (on $r$ and $\theta$) of the smallest polar
+% coordinate patch that covers the graph rectangle. It leaving the values
+% in \gbc{rmin}, \gbc{rmax}, \gbc{tmin} and \gbc{tmax}. It is only for use
+% in \gbc{polargrid}, \gbc{gridarcs} and \gbc{gridrays}.
+% \begin{macrocode}
+def beginpolargrid =
+ begingroup;
+ save p, r, t, rmax, rmin, tmax, tmin;
+ pair p[];
+ % Four corners:
+ p0 := (xneg, yneg); p1 := (xneg, ypos);
+ p2 := (xpos, ypos); p3 := (xpos, yneg);
+% \end{macrocode}
+% This loop finds the radial coordinate of each corner of the graph and
+% finds the maximum while doing so.
+% \begin{macrocode}
+ r0 := abs(p0); rmax := r0;
+ for j = 1 upto 3 :
+ r[j] := abs(p[j]);
+ if rmax < r[j] : rmax := r[j]; fi
+ endfor
+% \end{macrocode}
+% When the origin is inside the graph rectangle we need the full range
+% of $r$ and $\theta$. When the origin is one of the corners, the angles
+% can just be read off. Otherwise, to find the range of $\theta$ we
+% rotate one corner to have angle zero (so now we are guaranteed all
+% angles are between $-180$ and $180$) and get the largest and smallest of
+% the angles to all the corners.
+% \begin{macrocode}
+ rmin := 0;
+ if (xneg < 0) and (xpos > 0) and (yneg < 0) and (ypos > 0) :
+ tmin := 0; tmax := 360;
+ elseif (p0 = (0,0)) : tmin := 0; tmax := 90;
+ elseif (p1 = (0,0)) : tmin := -90; tmax := 0;
+ elseif (p2 = (0,0)) : tmin := -180; tmax := -90;
+ elseif (p3 = (0,0)) : tmin := 90; tmax := 180;
+ else :
+ tmax := tmin := t0 := angle p0;
+ for j = 1 upto 3:
+ t := t0 + angle (p[j] rotated -t0);
+ if tmax < t : tmax := t; fi
+ if tmin > t : tmin := t; fi
+ endfor
+% \end{macrocode}
+% The minimum value of $r$ can be one of 9 possibilities: if the four
+% sides of the graph are extended infinitely far in both directions, the
+% origin can be in any one of the 9 regions formed. We've already disposed
+% of the inside of the graph. This code considers the remaining regions in
+% the following order: (1)~above or below, (2)~left or right, and (3)~one
+% of the four corner regions.
+% \begin{macrocode}
+ if (xneg < 0) and (xpos > 0) : % (1)
+ rmin := emin(abs(yneg), abs(ypos));
+ elseif (yneg < 0) and (ypos > 0) : % (2)
+ rmin := emin(abs(xneg), abs(xpos));
+ else : % (3)
+ rmin := min(r0, r1, r2, r3);
+ fi
+ fi
+ save gridpic; picture gridpic; gridpic := nullpicture;
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{endpolargrid}
+% The \gbc{clr} is \gbc{drawcolor} for line grids, \gbc{pointcolor} for
+% dot grids. The size is half the width of the grid's lines or half the
+% width of the grid's dots. The purpose is to make sure dots and lines on
+% the graph's edge aren't cut off. For dots I should probably put this
+% decision in the code that draws them on \gbc{gridpic}.
+% \begin{macrocode}
+
+def endpolargrid (expr clr, size)=
+ clipto (gridpic) rect ( zconv((xneg, yneg)) - size*(1,1),
+ zconv((xpos, ypos)) + size*(1,1) );
+ coloraddto (clr) (active_plane) (gridpic);
+ endgroup
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{polarpatch}
+% Finally, this just does \gbc{plrpatch}, but also draws the ending
+% boundaries, in case they are not an integer number of steps from the
+% start.
+% \begin{macrocode}
+vardef polarpatch (expr rstart, rstop, rstep, tstart, tstop, tstep) =
+ plrpatch (rstart, rstop, rstep, tstart, tstop, tstep);
+ safedraw zconv ( arcplr ((0, 0), tstart, tstop, rstop) );
+ safedraw zconv ( ((rstart, 0)--(rstop, 0)) rotated tstop );
+enddef;
+
+% \end{macrocode}
+%
+% \section{Path construction}
+%
+% \DescribeRoutine{rect}
+% Most of the macros that only define paths are coordinate independent.
+% The simplest is \gbc{rect}. It accepts two pair expressions and produces
+% the upright rectangle with those points at opposite corners. It might be
+% noted that if the corners really are lower left and upper right, then
+% the path is anticlockwise, If they are on the other diagonal, the
+% path is clockwise. The path is a cycle (closed).
+%
+% \DescribeRoutine{triangle}
+% Produces a closed path joining three points with straight lines; first
+% named point \gbc{A} is \mfc{point 0 of triangle (A, B, C)}, etc.
+% \begin{macrocode}
+vardef rect (expr ll, ur) =
+ ll--(xpart ur, ypart ll)--ur--(xpart ll, ypart ur)--cycle
+enddef;
+vardef triangle (expr A, B, C) = A--B--C--cycle enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{regularpolygon}
+% The first argument is the number of sides, the second is an array name
+% to hold the list of vertices. The third argument contains two
+% equations, preferably the location of two of the vertices, or the
+% location of the center and one vertex. That plus the equations in the
+% \mfc{for}-loop give \gbc{n+1} equations to determine the \gbc{n}
+% vertices and the center. Note that the vertices are numbered
+% anticlockwise.
+% \begin{macrocode}
+vardef regularpolygon (expr n) (suffix Bob) (text eqns) =
+ pair Bob[]; Bob := emax(round (abs (n)), 2);
+ eqns;
+ for _uncle = 1 upto Bob - 1 :
+ (Bob1 - Bob0) rotated (360*_uncle/Bob) = Bob[_uncle+1] - Bob0;
+ endfor
+ mkpoly (true) (Bob)
+enddef;
+
+% \end{macrocode}
+%
+% The following set of commands accept any path as argument, but it is
+% intended that it be a triangle. Even then, they work correctly only if
+% it is a cycle.
+%
+% \DescribeRoutine{altitudept}
+% \DescribeRoutine{altitude}
+% These first two produce the perpendicular from \gbc{point n of t}
+% to the (extension of) the opposite side (i.e., the altitude). The
+% first one determines where the altitude meets the opposite side, and the
+% second just connects the two points
+% \begin{macrocode}
+vardef altitudept expr n of t =
+ save A, B, C, zz; pair A, B, C, zz;
+ A := pnt[n] (t);
+ B := pnt[n + 1] (t); % wraps around a cyclic path
+ C := pnt[n + 2] (t);
+ zz = whatever[B,C];
+ zz = A + whatever*((C-B) rotated 90);
+ zz
+enddef;
+
+vardef altitude expr n of t =
+ (pnt[n](t))--(altitudept n of t)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{medianpt}
+% \DescribeRoutine{median}
+% These two produce the line from \gbc{point n of t} to the midpoint of
+% the opposite side.
+% \begin{macrocode}
+vardef medianpt expr n of t =
+ 0.5[pnt[n + 1] (t), pnt[n + 2] (t)]
+enddef;
+
+vardef median expr n of t =
+ (pnt[n](t))--(medianpt n of t)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{anglebisectorpt}
+% \DescribeRoutine{anglebisector}
+% These two produce the line from \gbc{point n of t} to the opposite side
+% that bisects the angle there.
+% \begin{macrocode}
+vardef anglebisectorpt expr n of t =
+ save A, B, C; pair A, B, C;
+ A := pnt[n ] (t);
+ B := pnt[n + 1] (t);
+ C := pnt[n + 2] (t);
+ save zz; pair zz;
+ zz = whatever[B,C];
+ zz = A + whatever*((B-A) rotated (.5*cornerangle (A,B,C)));
+ zz
+enddef;
+
+vardef anglebisector expr n of t =
+ (pnt[n](t))--(anglebisectorpt n of t)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{cornerangle}
+% This calculates the angle at the corner of a triangle. Specifically,
+% the angle (between $-180$ and $180$) required to rotate the vector
+% \gbc{B-A} into \gbc{C-A}. For degenerate triangles the seemingly
+% arbitrary values 0, 60 and 90 are designed to match the assumptions used
+% in the \gbc{arc*} commands. But also to guarantee that the three
+% \gbc{cornerangle}\,s add up to $\pm180$. \gbc{cornerangle (A,B,C)} gives
+% the angle at \gbc{A}, positive if \gbc{A--B--C--cycle} is
+% anticlockwise.
+% \begin{macrocode}
+vardef cornerangle (expr A, B, C) =
+ if (A = B) and (B = C) : 60
+ elseif (B = C) : 0
+ elseif (A = B) or (A = C) : 90
+ else: angle ((C - A) rotated (-angle (B - A)))
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{mkpath}
+% This accepts the name of an array of pairs and produces a path
+% that connects them. The first two parameters are booleans. If
+% \gbc{smooth} is \mfc{true} a smooth path is produced, otherwise a
+% polyline. If \gbc{cyclic} is \mfc{true} the path is closed. The work is
+% actually done by \gbc{mksmooth} or \gbc{mkpoly}.
+% \begin{macrocode}
+vardef mkpath (expr smooth, tens, cyclic) (suffix pts) =
+ if smooth : mksmooth (tens, cyclic, pts)
+ else : mkpoly (cyclic, pts)
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{mkpoly}
+% This produces the path of line segments connecting \gbc{pts1},
+% \gbc{pts2}, etc., closing it up if the boolean \gbc{cyclic} is true.
+% \begin{macrocode}
+vardef mkpoly (expr cyclic) (suffix pts) =
+ for _i = 1 upto pts-1: pts[_i]-- endfor
+ pts[pts] if cyclic : -- cycle fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{polyline}
+% This is the \mfpic{} interface. Instead of an array name, it accepts a
+% list of pair expressions, forms an array from them and calls
+% \gbc{mkpoly}.
+% \begin{macrocode}
+vardef polyline (expr cyclic) (text t) =
+ save _pl; textpairs (_pl) (t); mkpoly (cyclic, _pl)
+enddef;
+
+% \end{macrocode}
+%
+% We added an optional parameter for the tension of smooth curves to
+% \mfpic. It used to be implemented this way: functions that implement a
+% tension parameter set \gbc{cur_tension} and called \gbc{mksmooth}, which
+% uses that tension in its formation of a path. Since \gbc{mksmooth} was
+% only ever used in this way, I decided to change its syntax to include a
+% tension parameter. Only the functions \gbc{tcurve} and \gbc{mkpath}
+% actually call \gbc{mksmooth} directly, other path building commands with
+% tension parameters call \gbc{mkfcn}, which calls \gbc{mkpath}.
+%
+% \DescribeRoutine{mksmooth}
+% This takes a tension value, a boolean, and the name of an array of
+% points, draws the curve connecting them and closes it up if the boolean
+% is true. It draws the curve forcing it to have the same direction at a
+% point as the line segment connecting the preceding and following points.
+% This is normally best if the curve direction changes relatively modestly
+% from point to point. For example, if the polyline would be convex, then
+% this smooth version would be pretty close to being convex. If the convex
+% polygon has several consecutive sides that are in the same direction,
+% all but the first and last of these segments in the smooth version would
+% be straight. We should experiment with ``\mfc{tension atleast}'' here
+% to see what difference it makes.
+% \begin{macrocode}
+vardef mksmooth (expr tens, cyclic) (suffix pts) =
+ pts1
+ if pts = 1 :
+ if cyclic : &cycle fi
+ else:
+ if cyclic :
+ {pts[2]-pts[pts]}
+ fi
+ for _i = 2 upto pts-1:
+ ..tension tens..pts[_i]{pts[_i+1]-pts[_i-1]}
+ endfor
+ ..tension tens..pts[pts]
+ if cyclic :
+ {pts[1]-pts[pts-1]}..tension tens..cycle
+ fi
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{curve}
+% \DescribeRoutine{tcurve}
+% The old \cs{curve} command in \mfpic{} permitted no tension parameter
+% and wrote a \grafbase{} \gbc{curve} command. For backward compatibility
+% we keep that name, but simply call the \gbc{tcurve} command with the
+% default value for tension. \gbc{tcurve} converts a list of pairs to an
+% array, then calls \gbc{mksmooth} on the array.
+% \begin{macrocode}
+def curve = tcurve (default_tension) enddef;
+vardef tcurve (expr tens, cyclic) (text t) =
+ save _tc; textpairs (_tc) (t); mksmooth (tens, cyclic, _tc)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{mkbezier}
+% \DescribeRoutine{bezier}
+% \DescribeRoutine{tbezier}
+% It seemed odd that we had no way for an \MF-savvy user to easily get
+% the standard \mfc{p..q..r} kind of path. For such a simple one
+% \cs{mfobj} with the explicit path expression would work, but when one
+% has to add a tension to it, it is nice to have an abbreviation. That's
+% what these are for.
+% \begin{macrocode}
+vardef mkbezier (expr tens, cyclic) (suffix pts) =
+ for _i = 1 upto pts-1 : pts[_i]..tension tens.. endfor
+ pts[pts] if cyclic : ..tension tens..cycle fi
+enddef;
+
+def bezier = tbezier (default_tension) enddef;
+vardef tbezier (expr tens, cyclic) (text t) =
+ save _tsb; textpairs (_tsb) (t); mkbezier (tens, cyclic) (_tsb)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{qbezier}
+% \DescribeRoutine{mkqbezier}
+% It also semed we ought to allow \mfpic{} users to easily reproduce the
+% effect of a sequence of \LaTeX's \cs{qbezier} commands. That's what
+% these are for.
+%
+% These commands and the various splines don't use tension as they have
+% their control points explicitly given, not computed from the tension
+% value by \MF. The \gbc{qbezier} command does not produce a smooth path
+% unless the controls are explicitely chosen for that. The spline commands
+% will almost always produce a smooth path.
+%
+% \gbc{mkqbezier} requires an even number of points for a cyclic path,
+% an oddnumber for a noncyclic path. If \gbc{pts} has the wrong parity,
+% the last point in the list is repeated. This makes the last segment
+% either trivial or a straight line. We increment \gbc{_mqb} instead of
+% \gbc{pts} so a user's suffix doesn't unexpectedly change.
+% \begin{macrocode}
+vardef mkqbezier (expr cyclic) (suffix pts) =
+ save _mqb; _mqb := pts;
+ if (cyclic and odd pts) or not (cyclic or odd pts):
+ pts[incr _mqb] := pts[pts];
+ fi
+ if cyclic : pts[incr _mqb] := pts1; fi
+ pts1
+ for _i = 2 step 2 until _mqb - 1 :
+ ..controls 1/3[pts[_i],pts[_i-1]] and 1/3[pts[_i], pts[_i+1]]
+ ..pts[_i+1]
+ endfor
+ if cyclic : &cycle fi
+enddef;
+
+vardef qbezier (expr cyclic) (text t) =
+ save _qbz; textpairs (_qbz) (t); mkqbezier (cyclic) (_qbz)
+enddef;
+
+% \end{macrocode}
+%
+% For quadratic B-splines, a list of pairs representing the control
+% points must be given. The nodes of the path and the cubic Bezi\'er
+% controls required to produce a quadratic B-spline are computed.
+%
+% \DescribeRoutine{mkqbs}
+% For simplicity, the list is converted to an array \gbc{_oq} first and
+% \gbc{mkqbs} is called. This draws an open spline based on the points in
+% an array \gbc{b}.
+% \begin{macrocode}
+vardef openqbs (text t) =
+ save _oq; textpairs (_oq) (t); mkqbs (_oq)
+enddef;
+
+vardef closedqbs (text t) =
+ save _cq; textpairs (_cq) (t);
+ _cq[incr _cq] := _cq1; _cq[incr _cq] := _cq2;
+ mkqbs (_cq) & cycle
+enddef;
+
+vardef mkqbs (suffix b) =
+ for _i = 1 upto b-2:
+ 0.5[b[_i], b[_i+1]]
+ ..controls 1/6[b[_i+1], b[_i]] and 1/6[b[_i+1], b[_i+2]]..
+ endfor
+ 0.5[b[b-1], b[b]]
+enddef;
+
+% \end{macrocode}
+% As for cubic B-splines, I'll have to trust the previous coder, as I
+% didn't even know what a cubic B-spline was until I deduced it from his
+% code. Earlier versions of \gbc{mkclosedcbs} would define
+% \gbc{b[incr b]:=b1} and \gbc{b[incr b]:=b2}. I decided we shouldn't
+% change the values of variables associated with the given suffix \gbc{b}
+% and so now we use \gbc{mkopencbs} to get most of the way around and then
+% fill in the gap with an explicit call to \gbc{opencbs}).
+% \begin{macrocode}
+vardef mkopencbs (suffix b) =
+ for _i = 1 upto b-3:
+ (b[_i]+4b[_i+1]+b[_i+2])/6
+ ..controls 1/3[b[_i+1], b[_i+2]] and 2/3[b[_i+1], b[_i+2]]..
+ endfor
+ (b[b-2]+4b[b-1]+b[b])/6
+enddef;
+vardef mkclosedcbs (suffix b) =
+ mkopencbs (b) & opencbs (b[b-2],b[b-1],b[b], b1, b2, b3) & cycle
+enddef;
+
+vardef opencbs (text t) =
+ save _oc; textpairs (_oc) (t); mkopencbs (_oc)
+enddef;
+vardef closedcbs (text t) =
+ save _clc; textpairs (_clc) (t); mkclosedcbs (_clc)
+enddef;
+
+% \end{macrocode}
+% When calling \gbc{curve} or \gbc{tcurve} there there can be a problem
+% with the resulting path: even with high tension one is not guaranteed
+% that a sequence of points with increasing x-coordinate will produce a
+% path with increasing x-coordinate. The requirement to guarantee this is
+% that the control points of the segment connecting $(x\sb1, y\sb1)$ to the
+% next $(x\sb2, y\sb2)$ have their \gbc{xpart} in the interval $x\sb1 < x
+% < x\sb2$.
+%
+% Therefore, if we wish to plot a curve connecting points with increasing
+% x-coordinates and believe that the resulting path should be the graph of
+% a function, we pretty much have to select the control points ourselves.
+% A related problem is to keep the path under control. That is, the
+% segment of the curve connecting $(x\sb1, y\sb1)$ to the next $(x\sb2,
+% y\sb2)$ should have \gbc{ypart} within an interval not too much larger
+% than the interval $y\sb1 < y < y\sb2$.
+%
+% We accomplish both these tasks at once by making the vector from
+% $(x\sb n, y\sb n)$ to its \mfc{postcontrol} have length less than
+% $|x\sb{n+1} - x\sb n|$, and the same for the vector from $(x\sb{n+1},
+% y\sb{n+1})$ to its \mfc{precontrol}
+%
+% Another concern is what direction to place the controls. In
+% \gbc{mksmooth} we ask the direction at a given point to be the average
+% of the straight line directions to adjacent points. For graphing
+% functions, we average the slopes instead. An added refinement is that
+% this is a weighted average, with the nearer x-coordinate being weighted
+% more.
+%
+% Finally, we permit a tension of sorts by dividing the distance to the
+% controls by a parameter \gbc{fcn_tension}.
+%
+% \DescribeRoutine{fcncontrol}
+% This computes the control point for the points on the path. The
+% parameters \gbc{X, Y, Z} are three successive points of the path to be
+% constructed. If they are given in order, it gives the postcontrol of
+% \gbc{Y}. If they are in reverse order, the precontrol is obtained.
+% Oddly enough, the addition of the trap for \gbc{dl=0} or \gbc{dr=0}
+% made it possible to trivially extend the array (in
+% \gbc{functioncurve}) and get better looking results than either method
+% used before this.
+%
+% \DescribeRoutine{mkfcnpath}
+% This produces the path, calling \gbc{fcncontrol} to produce the controls.
+%
+% \DescribeRoutine{functioncurve}
+% \DescribeRoutine{fcncurve}
+% This is the interface; \gbc{fcncurve} calls \gbc{functioncurve} with the
+% default tension, which then takes a list of points, converts it to an
+% array, and calls \gbc{mkfcnpath} to build the path.
+% \begin{macrocode}
+vardef fcncontrol (expr ftens, X, Y, Z) =
+ save dl, dr, before, after; pair before, after;
+ before := Y - X; after := Z - Y;
+ dl := xpart (before); dr := xpart (after);
+ if (dr = 0) or (dl = 0):
+ Y + abs(dr)/ftens * sgn before
+ else:
+ Y + abs(dr)/ftens * unitvector (before*dr/dl + after*dl/dr)
+ fi
+enddef;
+
+vardef mkfcnpath (expr ftens) (suffix q) =
+ for _i = 1 upto q - 1:
+ q[_i]..controls fcncontrol (ftens) (q[_i-1], q[_i], q[_i+1])
+ and fcncontrol (ftens) (q[_i+2], q[_i+1], q[_i])..
+ endfor
+ q[q]
+enddef;
+
+def fcncurve = functioncurve (emax(1.2default_tension, eps)) enddef;
+vardef functioncurve (expr ftens) (text t) =
+ save _fc; textpairs (_fc) (t);
+ if _fc > 1 : _fc0 := _fc1; _fc[_fc+1] := _fc[_fc]; fi
+ mkfcnpath (ftens)(_fc)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{turtle}
+% \emph{Turtle graphics} was a teaching tool to get youngsters used to the
+% concept of programming while also teaching geometry. The students fed an
+% Apple II computer a sequence of angles and distances, and a small
+% triangle on the screen (the ``turtle'') would turn the indicated amount
+% and travel the indicated distance, tracing a polyline on the screen.
+%
+% The argument of \gbc{turtle} is a list of pairs. The first is the
+% starting point, the rest are vector displacements (moves). The
+% distance and incremental angles of the original turtle graphics seems
+% to have been abandoned at some point in the development of \grafbase.
+% \begin{macrocode}
+vardef turtle (text t) =
+ save _tu; pair _tu[]; _tu := 0; _tu0 := (0, 0);
+ for _a = t: _tu[incr _tu] := _tu[_tu - 1] + _a; endfor
+ mkpoly (false, _tu)
+enddef;
+
+% \end{macrocode}
+%
+%
+% \section{Arcs, Circles and Ellipses}
+%
+% We have multiple commands that generate circular arcs, differing in
+% how the arc is specified. All are (in part) based on the following
+% \gbc{mkarc}. However, perfectly reasonable arcs can have centers so far
+% away that requiring the center among the parameters can cause numeric
+% overflow.
+%
+% I'd like to use some scheme that avoids this. It is possible, given
+% three reasonably spaced points on an arc with angle less than 90
+% degrees between each, to draw the arc without finding the center.
+% However, I am not sure how to reduce any given format to this
+% information
+%
+% Another problem is that of accuracy. If the angle is small, accuracy is
+% not usually a problem, but if an angle is close to 360, and the
+% endpoints are known, then finding the center (or finding other points on
+% the arc without knowing the center) is unstable.
+%
+% There is really no problem with \gbc{mkarc} itself: if you can express
+% both \gbc{center} and \gbc{from} in \MF, then the other values on the
+% arc should be no problem.
+%
+% \DescribeRoutine{mkarc}
+% This takes the center, starting and ending point (pair expressions) and
+% the angle, and returns the arc defined pretty much the way \file{plain.mf}
+% defines \mfc{quartercircle}.
+%
+% It would be easier to do something like we frequently do with
+% \mfc{fullcircle}: make an arc of unit radius, and then rotate, scale
+% and shift it into place. However, I would like to accomplish at least
+% the following: if an endpoint of the arc is among the parameters, or is
+% straightforwardly implied by them, then the corresponding endpoint of
+% the path created should test equal to that point. Shifting works OK, but
+% scaling and rotating cause roundoff differences.
+%
+% Note that \gbc{mkarc} has parameters that over-determine the arc. It
+% is only called by arc making commands that have calculated these
+% parameters. \gbc{mkarc}'s job is to ensure that the arc begins at
+% \gbc{from} and ends at \gbc{to} (exactly).
+% \begin{macrocode}
+vardef mkarc (expr center, from, to, sweep) =
+ save n, d; pair d;
+ n := ceiling (abs(sweep)/45);
+ d := (from - center) rotated (signof (sweep) 90);
+ from{d}
+ for j = 1 upto n-1 :
+ ..(from rotatedabout (center, j/n*sweep)){d rotated (j/n*sweep)}
+ endfor ..to{d rotated sweep}
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{arc}
+% The most basic: center of circle, starting point of arc, and angle
+% subtended. Another name for \gbc{arc} is \gbc{arccps}, (\gbc{cps} is
+% for ``center, point, sweep'').
+% \begin{macrocode}
+vardef arc (expr center, from, sweep) =
+ if (center = from) or (sweep = 0) :
+ from--from
+ else:
+ save to; pair to;
+ to := from rotatedabout (center, sweep);
+ mkarc (center, from, to, sweep)
+ fi
+enddef;
+def arccps = arc enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{arccenter}
+% For arcs greater than 90 degrees we will convert to the above basic
+% \gbc{mkarc}. Since two of the methods don't provide the center among the
+% parameters, we use the utility \gbc{arccenter} to locate that center,
+% given two points and the angle. This can fail (arithmetic overflow) if
+% the angle is too small relative to the distance between the points.
+% Therefore, we try not to call it for small angles (or angles near
+% multiples of 360).
+%
+% We find the center by solving equations representing two lines which
+% must be perpendicular to the circle. Which two lines we use depends on
+% the sweep. For accurate solutions we want the angle between the two
+% lines to be closer to 90 than to 0. \gbc{ang} is the angle we need to
+% rotate the chord \gbc{(to - from)} to be perpendicular to the circle at
+% \gbc{from}. \gbc{cd} is a vector in the direction of the chord. When
+% \gbc{ang} is close to $\pm90$, we use the lines perpendicular to the circle
+% at \gbc{from} and \gbc{to}. Otherwise we use the lines perpendicular
+% to the circle at \gbc{from} and perpendicular to the chord at its
+% midpoint. The latter is better when \gbc{ang} is between $-30$ and $30$
+% degrees.
+% \begin{macrocode}
+vardef arccenter (expr from, to, sweep) =
+ save ang, c;
+ pair c;
+ ang := 90 - (sweep mod 360)/2; % -90 < ang <= 90
+ if (abs(ang) = 90) or (from = to) :
+ GBmsg "The central point of this arc is undefined. " &
+ "Using midpoint of chord instead.";
+ 0.5[from, to]
+ else:
+ save cd; pair cd; cd := to - from;
+ c = from + whatever*(cd rotated ang);
+ if abs(ang) < 30 :
+ c = (0.5)[from, to] + whatever*(cd rotated 90);
+ else:
+ c = to + whatever*(-cd rotated -ang);
+ fi
+ c
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{midarc}
+% This finds the midpoint of the arc determined by two points and an
+% angle. It work because the angle subtended at \gbc{from} by an arc of
+% length \gbc{sweep/2} is \gbc{sweep/4}. We use it for small angles, as
+% we can then draw the arc without having to find its center.
+% \begin{macrocode}
+vardef midarc (expr from, to, sweep) =
+ save m, cd; pair m, cd;
+ cd := to - from;
+ m = from + whatever*( cd rotated (-sweep/4));
+ m = 0.5[from, to] + whatever*(cd rotated 90);
+ m
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{arcpps}
+% In this form we are given two points and the angle of the arc between
+% them. If the points are equal or the sweep makes the arc undefined, we
+% return a line segment. If the sweep is less than 90 degrees we use the
+% idea from the code of \mfc{quartercircle}, except, when the sweep is
+% greater than 45 degrees we let \MF{} find the midpint \gbc{m} of the
+% arc. Otherwise, we get the center of the circle and call \gbc{mkarc}.
+% \begin{macrocode}
+vardef arcpps (expr from, to, sweep) =
+ if ((sweep mod 360) = 0) or (from = to) :
+ GBmsg "Undefined arc. A line segment will be used instead.";
+ from--to
+ elseif abs(sweep) <= 90 :
+ save cd; pair cd; cd := to - from;
+ if abs(sweep) <= 45 :
+ from{cd rotated (-sweep/2)}..to{cd rotated (sweep/2)}
+ else:
+ from{cd rotated (-sweep/2)}..midarc(from, to, sweep){cd}
+ ..to{cd rotated (sweep/2)}
+ fi
+ else:
+ save center; pair center;
+ center := arccenter (from, to, sweep);
+ mkarc (center, from, to, sweep)
+ fi
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{arcplr}
+% This one takes the center and polar coordinates of the ends relative to
+% the center. We just call \gbc{mkarc} with the obviously computed
+% endpoints and sweep.
+% \begin{macrocode}
+vardef arcplr (expr center, frtheta, totheta, rad) =
+ if rad = 0 :
+ center -- center
+ else:
+ save from, to; pair from, to;
+ from := center + rad*dir frtheta;
+ to := center + rad*dir totheta;
+ if frtheta = totheta :
+ from--to
+ else:
+ mkarc (center, from, to, totheta - frtheta)
+ fi
+ fi
+enddef;
+% \end{macrocode}
+%
+% \DescribeRoutine{arcalt}
+% This one is the same as above, but with the same argument order as
+% \gbc{sector}.
+% \begin{macrocode}
+vardef arcalt (expr center, radius, anglefrom, angleto) =
+ arcplr (center, anglefrom, angleto, radius)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{arcppp}
+% This last one finds the arc connecting three points in the order given.
+% It works by calling \gbc{arcpps} twice, using first the sweep from
+% \gbc{first} to \gbc{second}, and then the sweep from \gbc{second} to
+% \gbc{third}. Each of these is twice the opposite angle of the triangle
+% formed from these points, and calculated by \gbc{cornerangle}.
+% \begin{macrocode}
+vardef arcppp (expr first, second, third) =
+ arcpps (first, second, 2*cornerangle (third, first, second)) &
+ arcpps (second, third, 2*cornerangle (first, second, third))
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{ellipse}
+% \DescribeRoutine{circle}
+% We get an ellipse by x-scaling and y-scaling a unit circle, rotating it
+% and then shifting it into position. All parameters are coordinate
+% independent expressions, with obvious meaning (\gbc{center} is a pair, the
+% rest numeric). \gbc{circle} is similar, but we only scale and shift.
+% \begin{macrocode}
+vardef ellipse (expr center, radx, rady, angle) =
+ fullcircle xscaled (2*radx) yscaled (2*rady) rotated angle
+ shifted center
+enddef;
+vardef circle (expr center, rad) =
+ fullcircle scaled (2*rad) shifted center
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{circlecp}
+% \DescribeRoutine{circleppp}
+% \DescribeRoutine{circlepps}
+% The next three implement different ways of specifying a circle. The
+% first produces the circle with a given center passing through a given
+% point. The second produces the circle passing through three given
+% points. The third produces the circle passing through two given points
+% in such a way that the arc from the first to the second has a given
+% angle.
+% \begin{macrocode}
+vardef circlecp (expr center, point) =
+ mkarc (center, point, point, 360) & cycle
+enddef;
+vardef circleppp (expr one, two, three) =
+ save ang; numeric ang[];
+ ang0 := cornerangle(three, one, two);
+ ang1 := cornerangle(one, two, three);
+ ang2 := cornerangle(two, three, one);
+ arcpps (one, two, 2ang0) & arcpps (two, three, 2ang1) &
+ arcpps (three, one, 2ang2) & cycle
+enddef;
+vardef circlepps (expr one, two, sweep) =
+ save ang, full; numeric ang[], full;
+ full := signof (sweep) 360;
+ ang1 := sweep mod (full);
+ ang2 := full - ang1;
+ arcpps (one, two, ang1) & arcpps (two, one, ang2) & cycle
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{pathcenter}
+% This finds the center of a circle. For other paths, the point found
+% may be meaningless (but it will also obtain the center of an arc or a
+% rectangle). It takes three supposedly distinct points on the path and
+% finds the intersection of the perpendicular bisectors of two chords.
+% \begin{macrocode}
+vardef pathcenter expr p =
+ save a, cntr, n; pair cntr, a[];
+ n := length p;
+ a1 = pnt 0 (p);
+ a3 = pnt [n/2] (p);
+ if cycle p :
+ a2 = pnt [n/4] (p);
+ a4 = pnt [3n/4] (p);
+ else:
+ a2 := a3;
+ a4 := pnt[n] (p);
+ fi
+ cntr = .5[a1, a3] + whatever*((a3 - a1) rotated 90);
+ cntr = .5[a2, a4] + whatever*((a4 - a2) rotated 90);
+ cntr
+enddef;
+
+% \end{macrocode}
+% \DescribeRoutine{circumcircle}
+% \DescribeRoutine{incircle}
+% \DescribeRoutine{excircle}
+% \DescribeRoutine{ninepointcircle}
+% These four create the relevant circles from a given triangle. The
+% triangle is specified as a path expression, so they produce results for
+% any path, but make sense only for a cyclic triangular path.
+% \begin{macrocode}
+vardef circumcircle expr t =
+ circleppp (pnt0 (t), pnt1 (t), pnt2 (t))
+enddef;
+
+vardef incircle expr t =
+ save A, B, C; pair A, B, C;
+ A := pnt0 (t);
+ B := pnt1 (t);
+ C := pnt2 (t);
+ % Find the tangent points on the sides. E.g., a is the common
+ % distance from A to the tangent points on the adjacent sides.
+ save a, b, c;
+ a + b = abs (B-A);
+ b + c = abs (C-B);
+ a + c = abs (A-C);
+ circleppp (A + a*unitvector (B-A),
+ B + b*unitvector (C-B),
+ C + c*unitvector (A-C))
+enddef;
+
+vardef excircle expr n of t =
+ save A, B, C; pair A, B, C;
+ A := pnt[n] (t);
+ B := pnt[n + 1] (t); % wraps around
+ C := pnt[n + 2] (t);
+ save a, b, c;
+ a - b = abs (B-A);
+ b + c = abs (C-B);
+ a - c = abs (C-A);
+ circleppp (A + a*unitvector(B-A),
+ B + b*unitvector(C-B),
+ C + c*unitvector(C-A))
+enddef;
+
+vardef ninepointcircle expr t =
+ circleppp (medianpt 0 of t, medianpt 1 of t, medianpt 2 of t)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{circumcenter}
+% \DescribeRoutine{incenter}
+% \DescribeRoutine{excenter}
+% \DescribeRoutine{ninepointcenter}
+% \DescribeRoutine{barycenter}
+% These find various centers associated with a triangle. The last one is
+% made to work for any path.
+% \begin{macrocode}
+vardef circumcenter expr t = pathcenter circumcircle t enddef;
+vardef incenter expr t = pathcenter incircle t enddef;
+vardef excenter expr n of t = pathcenter excircle n of t enddef;
+vardef ninepointcenter expr t = pathcenter ninepointcircle t enddef;
+
+% Make this work for any path.
+% Divide as we go,
+% decrease chance of overflow.
+vardef barycenter expr t =
+ save n, m; n := length t; m := n + 1;
+ save xxx;
+ xxx : = pnt0 (t)/m for k = 1 upto n-1 : + pnt[k] (t)/m endfor;
+ if cycle t: xxx*(1 + 1/n)
+ else: xxx + pnt[n] (t)/m
+ fi
+enddef;
+% \end{macrocode}
+%
+% \DescribeRoutine{sector}
+% \gbc{sector} produces the closed path consisting of a straight line
+% of length \gbc{rad} from \gbc{center} in the direction \gbc{frtheta},
+% thence along an arc of the circle centered at \gbc{center} to angle
+% \gbc{totheta}, and then along the straight line back to \gbc{center}.
+% \begin{macrocode}
+vardef sector (expr center, rad, frtheta, totheta) =
+ center -- arcalt (center, rad, frtheta, totheta) -- cycle
+enddef;
+
+% \end{macrocode}
+%
+%
+% \section{Plotting of functions}
+%
+% In these macros, if the boolean argument \gbc{smooth} is true then the
+% path returned will be a B\'ezier, otherwise it will be a polyline. The
+% parameter is simply passed to \gbc{mkpath}. If a \gbc{tens} parameter
+% exists, then the smooth version will have that value of tension,
+% otherwise the value of \gbc{default_tension} is used.
+%
+% All of these macros call \gbc{mkfcn}.
+%
+% \DescribeRoutine{mkfcn}
+% In this command the text parameter \gbc{pf} should be the name of a
+% function of some sort that can take a numeric value in parentheses and
+% return a pair expression. The parameters \gbc{bmin}, \gbc{bmax} and
+% \gbc{bst} determine a sequence of numeric values starting at \gbc{bmin},
+% stepping by \gbc{bst} and ending with \gbc{bmax}. These are fed to
+% \gbc{pf} and the resulting pairs stored in an array. Then
+% \gbc{mksmooth} is called with the tension \gbc{tens} and the name of the
+% array.
+%
+% For stability, we don't actually step by \gbc{bst}, but round
+% \gbc{(bmax-bmin)/bst} and step that many equal steps. We first adjust
+% the step size upward so the number of steps doesn't exceed
+% \gbc{infinity}. The path is forced to begin at \gbc{pf(bmin)} and
+% end at \gbc{pf(bmax)}
+% \begin{macrocode}
+vardef mkfcn (expr smooth, tens) (expr bmin, bmax, bst) (text pf) =
+ save _p; pair _p[]; _p := 0;
+ save _dx, _n, _r; numeric _dx, _n, _r;
+ if bmax = bmin : _n := 1;
+ else:
+ _r := bmax - bmin;
+ _dx := max (abs(bst), nottoosmall*abs(_r), epsilon);
+ _n := emax (round(abs(_r)/_dx), 1);
+ fi
+ for _i = 0 upto _n: _p[incr _p] := pf(bmin + _i/_n*_r); endfor
+ mkpath (smooth, tens, false, _p)
+enddef;
+% compatibility:
+def tfcn (expr smooth) = mkfcn (smooth, default_tension) enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{parafcn}
+% This is like \gbc{mkfcn}, but the text argument is not a pair
+% valued function, but rather a text parameter containing code that, when
+% copied literally into a vardef, defines a function in which \gbc{t} is
+% the argument, and which returns a pair.
+%
+% Older files are supported with a definition of \gbc{parafcn} that calls
+% \gbc{tparafcn} with \gbc{default_tension}. I should have made this easier
+% by reversing the smoothness and tension arguments, but for backward
+% compatibility I have to leave it thus. Other commands implement \mfpic's
+% tension options: \gbc{function} and \gbc{plrfcn}. They also have forms
+% that accept a tension argument (\gbc{tfunction} and \gbc{tplrfcn}) and
+% call them with the default tension.
+% \begin{macrocode}
+def parafcn (expr smooth) = tparafcn (smooth, default_tension) enddef;
+vardef tparafcn (expr sm, tn) (expr bmin, bmax, bst) (text pf) =
+ save _fp; vardef _fp (expr t) = pf enddef;
+ mkfcn (sm, tn) (bmin, bmax, bst) (_fp)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{xfcn}
+% This first converts its final argument, which should be a numeric
+% valued function \gbc{f}, to a pair valued function \gbc{(x, f(x))}, then
+% calls \gbc{mkfcn} to return the path that should be the graph of $f(x)$.
+% \begin{macrocode}
+vardef xfcn (expr smooth) (expr xmin, xmax, st) (text _fx) =
+ save _fp; vardef _fp (expr _x) = (_x, _fx(_x)) enddef;
+ mkfcn (smooth, default_tension) (xmin, xmax, st) (_fp)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{function}
+% This is to \gbc{xfcn} as \gbc{parafcn} is to \gbc{mkfcn}: it
+% takes a text argument and copies it into a vardef so as to define a pair
+% valued function with a literal \gbc{x} as the argument.
+%
+% \DescribeRoutine{btwnfcn}
+% This is mainly for the sake of simpler \mfpic{} output, implementing
+% the \cs{btwnfcn} macro.
+% \begin{macrocode}
+def function (expr smooth) = tfunction (smooth, default_tension) enddef;
+vardef tfunction (expr smooth, tens) (expr xmin, xmax, st) (text _fx) =
+ save _fp; vardef _fp (expr x) = (x, _fx) enddef;
+ mkfcn (smooth, tens) (xmin, xmax, st) (_fp)
+enddef;
+
+def btwnfcn (expr sm) = tbtwnfcn (sm, default_tension) enddef;
+vardef tbtwnfcn (expr sm, tn)(expr xlo, xhi, st)(text _fx)(text _gx) =
+ tfunction (sm, tn) (xlo, xhi, st) (_fx) --
+ ( reverse tfunction (sm, tn) (xlo, xhi, st) (_gx) ) -- cycle
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{rfcn}
+% This takes the name of a function \gbc{f} which is a numeric
+% valued function of a numeric parameter. It interprets it as a polar
+% curve $(\theta, f(\theta))$, converts that to a curve in rectangular
+% coordinates and calls \gbc{mkfcn} on it.
+% \begin{macrocode}
+vardef rfcn (expr smooth) (expr tmin, tmax, st) (text ft) =
+ save _fq; vardef _fq (expr t) = (ft(t)) * (dir t) enddef;
+ mkfcn (smooth, default_tension) (tmin, tmax, st) (_fq)
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{plrfcn}
+% This is to \gbc{rfcn} as \gbc{parafcn} is to \gbc{mkfcn}: the
+% text argument should be code that can be copied literally into a
+% \mfc{vardef} creating a numeric function with a literal \gbc{t} as the
+% parameter (representing $\theta$).
+% \begin{macrocode}
+def plrfcn (expr smooth) = tplrfcn (smooth, default_tension) enddef;
+vardef tplrfcn (expr smooth, tens) (expr tmin, tmax, st) (text ft) =
+ save _fq; vardef _fq (expr t) = (ft) * (dir t) enddef;
+ mkfcn (smooth, tens) (tmin, tmax, st) (_fq)
+enddef;
+
+% \end{macrocode}
+%
+%
+% \section{Pie charts and bar charts}
+%
+% \DescribeRoutine{piechart}
+% The \gbc{piechart} command calculates the wedges of a pie from the text
+% parameter \gbc{data}. It should be a list of positive numerics, and the
+% result will be one wedge for each datum, the area of the wedge being
+% proportional to the corresponding datum. The wedge for each datum has
+% its point at \gbc{cent} and the wedge for the first datum begins at
+% angle \gbc{ang}. Each wedge is clockwise from the preceding one if
+% \gbc{sign = -1}, otherwise anticlockwise. The radius of the pie is
+% \gbc{rad}.
+%
+% After the calculations, the wedges (closed sectors) are stored in the
+% array \gbc{piewedge[]} with the numeric \gbc{piewedge} holding the number
+% of wedges. The center is saved in \gbc{piecenter}, the directions of the
+% wedges (the bisecting rays) are stored in \gbc{piedirection[]}, the
+% starting angles of the wedges in \gbc{pieangle[]}
+% \begin{macrocode}
+vardef piechart (expr sign, ang, cent, rad) (text data) =
+ save _sum, _tot;
+ numeric piewedge; piewedge := 0;
+ numeric pieangle, pieangle[]; pieangle0 := 0;
+ for _val = data :
+ pieangle[incr piewedge] := pieangle[piewedge - 1] + _val;
+ endfor
+ _tot := pieangle[piewedge];
+ pair piecenter; piecenter := cent;
+ path piewedge[];
+ numeric piedirection; pair piedirection[];
+ pieangle[piewedge + 1] = ang + sign*360;
+ for _n = piewedge downto 1 :
+ pieangle[_n] := ang + sign*pieangle[_n - 1]/_tot*360;
+ piewedge[_n] =
+ sector(cent, rad, pieangle[_n], pieangle[_n+1]);
+ piedirection[_n] := dir(0.5[ pieangle[_n], pieangle[_n+1] ]);
+ endfor
+ piedirection := pieangle := piewedge;
+enddef;
+
+% \end{macrocode}
+%
+% \DescribeRoutine{barchart}
+% I was told that there are better ways (than piecharts) to represent
+% quantitative data. Perhaps bar charts are better. \gbc{barchart}
+% calculates the bars from the text parameter, \gbc{data}. These bars are
+% vertical \gbc{vert} is true, otherwise horizontal.
+%
+% \gbc{start} is the location (on the appropriate axis) of the start of
+% the first bar. \gbc{sep} is the separation between bar centers. \gbc{r}
+% is the ratio of the width of the bars to their separation.
+%
+% After the calculations, the array of paths \gbc{chartbar[]} holds the
+% rectangles, \gbc{barend[]} holds their rightmost or topmost
+% coordinates (which is just the items in \gbc{data} or their y-parts),
+% \gbc{barbegin[]} holds their leftmost or bottommost coordinates (either
+% 0 or the x-parts of the data), \gbc{barstart[]} holds the appropriate
+% coordinate of the leading edge of the bar, and \gbc{barwd = r*sep}.
+%
+% If the data are pair data, this command uses the x-part as the beginning
+% of the bar and the y-part as the end. Thus Gantt diagrams can be
+% created. We keep \gbc{barlength} for backward compatibility (formerly
+% all data had to be numeric and bars went from 0 to \gbc{barlength[]}).
+% \gbc{barlength[]} was made available to help place some label or symbol
+% at the end of a bar and existing code might break if we omitted it.
+% \begin{macrocode}
+def barchart (expr start, sep, r, vert)(text data) =
+ numeric barbegin, barbegin[],
+ barend, barend[],
+ barlength, barlength[],
+ barstart, barstart[],
+ chartbar, barwd;
+ path chartbar[];
+ chartbar := 0; barwd := r*sep;
+ for _itm = data :
+ barend[incr chartbar] := if pair _itm: ypart _itm else: _itm fi;
+ barbegin[chartbar] := if pair _itm: xpart _itm else: 0 fi;
+ endfor
+ barbegin := barend := barlength := barstart := chartbar;
+ for _n = 1 upto chartbar :
+ barstart[_n] := start + sep*(_n-1);
+ barlength[_n] := barend[_n];
+ chartbar[_n] := rect ((barbegin[_n], 0), ( barend[_n], barwd) )
+ shifted (0, barstart[_n]) if vert: xyswap fi;
+ endfor
+enddef;
+
+% \end{macrocode}
+%
+%^^A Overlays - taken from MFbook, p 295. (Bruce Leban)
+%
+% \section{Overlays}
+%
+% This final code predates me. I've never seen it used and don't know what
+% its for. For the \MP{} version I just tried to make sure everything was
+% defined in \MP{} or \file{plain.mp} and otherwise left it alone.
+% \begin{macrocode}
+picture totalpicture;
+boolean totalnull, currentnull;
+def clearit =
+ currentpicture := totalpicture := nullpicture;
+ currentnull := totalnull := true;
+enddef;
+
+def keepit =
+%<MF> mono (currentpicture);
+ addto totalpicture also currentpicture;
+ currentpicture := nullpicture;
+ totalnull := currentnull;
+ currentnull := true;
+enddef;
+
+def addto_currentpicture =
+ currentnull := false;
+ addto currentpicture
+enddef;
+
+def mergeit (text do) =
+ if totalnull :
+ do currentpicture
+ elseif currentnull :
+ do totalpicture
+ else:
+ begingroup
+ save _v_; picture _v_;
+ _v_ := currentpicture;
+%<MF> mono (_v_);
+ addto _v_ also totalpicture;
+ do _v_
+ endgroup
+ fi
+enddef;
+
+% \end{macrocode}
+% This apparently redundant definition (\gbc{shipit} = \gbc{shipit_}) is
+% so that \mfpic{} can turn shipping off and back on by redefining
+% \gbc{shipit} to either \gbc{shipit_} or \mfc{relax}.
+% \begin{macrocode}
+def shipit_ =
+ mergeit (shipout)
+enddef;
+def shipit = shipit_ enddef;
+
+%<*MF>
+def showit_ =
+ mergeit (show_)
+enddef;
+def show_ suffix v =
+ display v inwindow currentwindow
+enddef;
+
+%</MF>
+% \end{macrocode}
+%
+% Here we initialize \gbc{gcode} (which current versions of mfpic do not use)
+% for hacked \mfpic{} files that require it. And that's all.
+% \begin{macrocode}
+numeric gcode; gcode := 0;
+
+%<MF>% end grafbase.mf
+%<MP>% end grafbase.mp
+%</MF|MP>
+% \end{macrocode}
+%
+% The following code was borrowed from the the standard \LaTeX{} graphics
+% package (\file{dvipsname.def} by David Carlisle and Sebastian Rahtz). In
+% fact it was mostly generated automatically by some editor macros that
+% replaced \prog{graphics} package code with the \grafbase{} code.
+%
+%^^A This file may be distributed under the terms of the LaTeX Project Public
+%^^A License, as described in \file{lppl.txt} in the base LaTeX
+%^^A distribution, either version 1.0 or, at your option, any later version.
+%
+% Declare all the dvips color names to be color variables:
+% \begin{macrocode}
+%<*dvips>
+color Apricot, Aquamarine, Bittersweet, Black, Blue, BlueGreen,
+BlueViolet, BrickRed, Brown, BurntOrange, CadetBlue, CarnationPink,
+Cerulean, CornflowerBlue, Cyan, Dandelion, DarkOrchid, Emerald,
+ForestGreen, Fuchsia, Goldenrod, Gray, Green, GreenYellow, JungleGreen,
+Lavender, LimeGreen, Magenta, Mahogany, Maroon, Melon, MidnightBlue,
+Mulberry, NavyBlue, OliveGreen, Orange, OrangeRed, Orchid, Peach,
+Periwinkle, PineGreen, Plum, ProcessBlue, Purple, RawSienna, Red,
+RedOrange, RedViolet, Rhodamine, RoyalBlue, RoyalPurple, RubineRed,
+Salmon, SeaGreen, Sepia, SkyBlue, SpringGreen, Tan, TealBlue, Thistle,
+Turquoise, Violet, VioletRed, White, WildStrawberry, Yellow,
+YellowGreen, YellowOrange;
+
+% \end{macrocode}
+% The function \gbc{cmyk} (which converts a CMYK quadruple to \MP's rgb
+% triple) is defined in \file{grafbase.mp}, which should be input before
+% \file{dvipsnam.mp}:
+% \begin{macrocode}
+Apricot = cmyk( 0, 0.32, 0.52, 0);
+Aquamarine = cmyk(0.82, 0, 0.30, 0);
+Bittersweet = cmyk( 0, 0.75, 1, 0.24);
+Black = cmyk( 0, 0, 0, 1);
+Blue = cmyk( 1, 1, 0, 0);
+BlueGreen = cmyk(0.85, 0, 0.33, 0);
+BlueViolet = cmyk(0.86, 0.91, 0, 0.04);
+BrickRed = cmyk( 0, 0.89, 0.94, 0.28);
+Brown = cmyk( 0, 0.81, 1, 0.60);
+BurntOrange = cmyk( 0, 0.51, 1, 0);
+CadetBlue = cmyk(0.62, 0.57, 0.23, 0);
+CarnationPink = cmyk( 0, 0.63, 0, 0);
+Cerulean = cmyk(0.94, 0.11, 0, 0);
+CornflowerBlue = cmyk(0.65, 0.13, 0, 0);
+Cyan = cmyk( 1, 0, 0, 0);
+Dandelion = cmyk( 0, 0.29, 0.84, 0);
+DarkOrchid = cmyk(0.40, 0.80, 0.20, 0);
+Emerald = cmyk( 1, 0, 0.50, 0);
+ForestGreen = cmyk(0.91, 0, 0.88, 0.12);
+Fuchsia = cmyk(0.47, 0.91, 0, 0.08);
+Goldenrod = cmyk( 0, 0.10, 0.84, 0);
+Gray = cmyk( 0, 0, 0, 0.50);
+Green = cmyk( 1, 0, 1, 0);
+GreenYellow = cmyk(0.15, 0, 0.69, 0);
+JungleGreen = cmyk(0.99, 0, 0.52, 0);
+Lavender = cmyk( 0, 0.48, 0, 0);
+LimeGreen = cmyk(0.50, 0, 1, 0);
+Magenta = cmyk( 0, 1, 0, 0);
+Mahogany = cmyk( 0, 0.85, 0.87, 0.35);
+Maroon = cmyk( 0, 0.87, 0.68, 0.32);
+Melon = cmyk( 0, 0.46, 0.50, 0);
+MidnightBlue = cmyk(0.98, 0.13, 0, 0.43);
+Mulberry = cmyk(0.34, 0.90, 0, 0.02);
+NavyBlue = cmyk(0.94, 0.54, 0, 0);
+OliveGreen = cmyk(0.64, 0, 0.95, 0.40);
+Orange = cmyk( 0, 0.61, 0.87, 0);
+OrangeRed = cmyk( 0, 1, 0.50, 0);
+Orchid = cmyk(0.32, 0.64, 0, 0);
+Peach = cmyk( 0, 0.50, 0.70, 0);
+Periwinkle = cmyk(0.57, 0.55, 0, 0);
+PineGreen = cmyk(0.92, 0, 0.59, 0.25);
+Plum = cmyk(0.50, 1, 0, 0);
+ProcessBlue = cmyk(0.96, 0, 0, 0);
+Purple = cmyk(0.45, 0.86, 0, 0);
+RawSienna = cmyk( 0, 0.72, 1, 0.45);
+Red = cmyk( 0, 1, 1, 0);
+RedOrange = cmyk( 0, 0.77, 0.87, 0);
+RedViolet = cmyk(0.07, 0.90, 0, 0.34);
+Rhodamine = cmyk( 0, 0.82, 0, 0);
+RoyalBlue = cmyk( 1, 0.50, 0, 0);
+RoyalPurple = cmyk(0.75, 0.90, 0, 0);
+RubineRed = cmyk( 0, 1, 0.13, 0);
+Salmon = cmyk( 0, 0.53, 0.38, 0);
+SeaGreen = cmyk(0.69, 0, 0.50, 0);
+Sepia = cmyk( 0, 0.83, 1, 0.70);
+SkyBlue = cmyk(0.62, 0, 0.12, 0);
+SpringGreen = cmyk(0.26, 0, 0.76, 0);
+Tan = cmyk(0.14, 0.42, 0.56, 0);
+TealBlue = cmyk(0.86, 0, 0.34, 0.02);
+Thistle = cmyk(0.12, 0.59, 0, 0);
+Turquoise = cmyk(0.85, 0, 0.20, 0);
+Violet = cmyk(0.79, 0.88, 0, 0);
+VioletRed = cmyk( 0, 0.81, 0, 0);
+White = cmyk( 0, 0, 0, 0);
+WildStrawberry = cmyk( 0, 0.96, 0.39, 0);
+Yellow = cmyk( 0, 0, 1, 0);
+YellowGreen = cmyk(0.44, 0, 0.74, 0);
+YellowOrange = cmyk( 0, 0.42, 1, 0);
+
+% End of file `dvipsnam.mp'.
+%</dvips>
+% \end{macrocode}
+% \clearpage
+%\Finale
diff --git a/Master/texmf-dist/source/generic/mfpic/mfpic.dtx b/Master/texmf-dist/source/generic/mfpic/mfpic.dtx
new file mode 100644
index 00000000000..1789f6e9146
--- /dev/null
+++ b/Master/texmf-dist/source/generic/mfpic/mfpic.dtx
@@ -0,0 +1,5045 @@
+% \iffalse
+% Copyright 2002--2003, Daniel H. Luecking
+%
+% Mfpic consists of the 3 files mfpic.dtx, grafbase.dtx and mfpic.ins
+% and the 5 files they generate: mfpic.tex, mfpic.sty, grafbase.mf,
+% grafbase.mp, and dvipsnam.mp.
+%
+% Mfpic may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License, either version 1.2 of this license or (at
+% your option) any later version. The latest version of this license is in
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.2 or later is part of all distributions of LaTeX version
+% 1999/12/01 or later.
+%
+% Documentation, examples, and ancillary files are separate and not
+% covered by this license. See readme.1st for a complete list. See
+% individual files for any copyright and license restrictions.
+%
+% With respect to the proposed draft LPPL-1.3: mfpic has maintenance
+% status "maintained". The Current Maintainer is Daniel H. Luecking. There
+% are several Base Interpreters: TeX, LaTeX, MetaPost and Metafont.
+%
+%<*driver>
+\documentclass[draft]{ltxdoc}
+
+\def\fileversion{0.7a beta}
+\def\filedate{2004/04/16}
+
+\addtolength{\textwidth}{.5878pt}
+
+\def\mytt{\mdseries\ttfamily}
+\renewcommand\marg[1]{{\mytt \{#1\}}}
+\renewcommand\oarg[1]{{\mytt [#1]}}
+\renewcommand\parg[1]{{\mytt (#1)}}
+\renewcommand{\meta}[1]{{$\langle$\rmfamily\itshape#1$\rangle$}}
+\DeclareRobustCommand\cs[1]{{\mytt\char`\\#1}}
+\def\prog#1{{\mdseries\scshape #1}}
+\def\grafbase{\prog{grafbase}}
+\def\mfpic{\prog{mfpic}}
+\def\Mfpic{\prog{Mfpic}}
+\def\MF{\prog{meta\-font}}
+\def\MP{\prog{meta\-post}}
+\def\CMF{\prog{Meta\-font}}
+\def\CMP{\prog{Meta\-post}}
+\def\opt#1{{\sffamily\upshape#1}}
+\def\mfc#1{{\mytt#1}}
+\let\env\mfc
+\let\file\mfc
+\let\gbc\mfc
+\renewcommand\{{\char`\{}
+\renewcommand\}{\char`\}}
+\renewcommand\|{${}\mathrel{|}{}$}
+
+\makeatletter
+\newcommand\bsl{{\mytt\@backslashchar}}
+% Stupid lists!
+\def\@listi{\leftmargin\leftmargini
+ \parsep \z@ \@plus\p@ \@minus\z@
+ \topsep 4\p@ \@plus\p@ \@minus2\p@
+ \itemsep\parsep}
+\let\@listI\@listi \@listi
+\renewcommand\labelitemi{\normalfont\bfseries \textendash}
+\renewcommand\labelitemii{\textasteriskcentered}
+\renewcommand\labelitemiii{\textperiodcentered}
+\leftmargini\parindent
+% Stupid index!
+\def\IndexParms{%
+ \parindent \z@ \columnsep 15pt
+ \parskip 0pt plus 1pt
+ \rightskip 5pt plus2em \mathsurround \z@
+ \parfillskip=-5pt \small
+ % less hanging:
+ \def\@idxitem{\par\hangindent 20pt}%
+ \def\subitem{\@idxitem\hspace*{15pt}}%
+ \def\subsubitem{\@idxitem\hspace*{25pt}}%
+ \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}}
+\makeatother
+
+\def\pdfTeX{\textrm{pdf\kern.04em\TeX}}
+\def\pdfLaTeX{\textrm{pdf\kern.06em\LaTeX}}
+\def\ConTeXt{\textrm{Con\kern-.16em\TeX\kern-0.06em t}}
+\def\PiCTeX{\textrm{P\kern-.13em\lower.3ex\hbox{I}C\TeX}}
+
+\title{The \mfpic{} package\thanks{This file has version number
+ \fileversion, last revised \filedate. The code described here
+ was developed by several people, notably Thomas Leathrum,
+ Geoffrey Tobin and Dan Luecking. Dan wrote this documentation.}}
+\author{Dan Luecking}
+\date{\filedate}
+\DisableCrossrefs
+\CodelineIndex
+\AlsoImplementation
+
+\begin{document}
+ \DeleteShortVerb{\|}
+ \DocInput{mfpic.dtx}
+\end{document}
+%</driver>
+%\fi
+%
+% \CheckSum{4392}
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \catcode`\_=12
+% \maketitle
+%
+% \begin{abstract}
+% An environment, \env{mfpic}, is defined, within which commands can
+% be used for drawing pictures, especially graphs of mathematical
+% functions. These commands actually write code to an external file
+% which can be processed through \MF{} or \MP{} (depending on package
+% options) to produce the picture. The picture is then included on a
+% second pass through \TeX.
+%
+% This file documents the source code. See \file{mfpicdoc.tex} for the
+% user documentation.
+% \end{abstract}
+%
+% \StopEventually{\PrintIndex}
+% \tableofcontents
+%
+%
+% \section{Introductory setup}\label{intro}
+%
+% \Mfpic{} is designed to work with plain \TeX, \LaTeX, \pdfTeX, and
+% \pdfLaTeX.
+%
+% \subsection{Versions numbers, category codes, etc.}\label{category}
+%
+% Almost all the various category code settings we do were prompted by
+% an \mfpic{} user who had sent a bug report and had to send along his
+% modified version of \file{mfpic.tex}. It had been modified so that
+% \cs{message}\,s and \cs{write}\,s would do the right thing in latex
+% files where various punctuation were made active (e.g., with
+% \file{french.sty}).
+%
+% \DescribeMacro{\mfpfileversion}
+% \DescribeMacro{\mfpfiledate}
+% \DescribeMacro{\mfpicversion}
+% We keep track of version numbers here. We use \cs{mfpfileversion}
+% because \cs{fileversion} is used by very many \LaTeX{} packages.
+% This is important, because later we write the version information to the
+% output file, The \cs{mfpicversion} is 100 times the numeric part of the
+% version. The output file can compare this number with the corresponding
+% value in \file{grafbase} and detect installations where there is a
+% mismatch.
+% \begin{macrocode}
+%<*tex>
+{\catcode\lq\.12 \catcode\lq\/12%
+\gdef\mfpfileversion{0.7a beta}%
+\gdef\mfpfiledate{2004/04/16}%
+\gdef\mfpicversion{70}}%
+\ifx\MFPicpackagE\UndEfInEd\else\expandafter\endinput\fi%
+% \end{macrocode}
+%
+% A bug in older versions of some support files is triggered by the macro
+% \cs{+}, which is an \cs{outer} macro in plain \TeX. Here we save the
+% current definition and then give it a nonouter meaning.
+% \begin{macrocode}
+\let\mfpsaveplus\+%
+\let\+\tabalign%
+% \end{macrocode}
+%
+% \DescribeMacro{\MFPrestorecode}
+% We now get rid of unusually catcoded punctuation, space and EOL.
+% We save all the current category codes in the macro \cs{MFPicpackagE}
+% and restore them at the end by executing this command.
+% We try to assume only: that letters, numbers,
+% `\texttt\bsl', `\texttt\{', `\texttt\}', `\texttt\#' and
+% `\texttt\%' have the usual categories. Styles (e.g., \prog{french})
+% that make punctuation active foul up \cs{write}\,s of MF/MP code. This can
+% still occur in user-generated \cs{write}\,s, so maybe some code should be
+% added in \cs{mfpic} or \cs{mfsrc} command too.
+% \begin{macrocode}
+\edef\MFPrestoreequal{\catcode61\space\the\catcode61\relax}%
+\catcode61 12\relax%
+\edef\MFPrestorespace{\catcode32=\the\catcode32\relax}%
+\catcode32=10\relax%
+\edef\MFPrestoreEOL{\catcode13=\the\catcode13\relax}%
+\catcode13=5\relax
+\edef\MFPrestorelq{\catcode96=\the\catcode96\relax}%
+\catcode96=12
+\def\MFPrestorecode#1{\catcode`\string#1=\the\catcode`#1\relax}%
+% \end{macrocode}
+%
+% \DescribeMacro{\MFPicpackagE}
+% This will be invoked at the end of the file to restore all the catcodes.
+% This will fail if some of these characters have really bad codes
+% (comment or escape, for example) but that would likely be the case only
+% if {\tt\bsl} or {\tt\%} have some different codes and then everything
+% above here would fail.
+% \begin{macrocode}
+\edef\MFPicpackagE{%
+ \MFPrestorecode{@}\MFPrestorecode{-}%
+ \MFPrestorecode{:}\MFPrestorecode{;}%
+ \MFPrestorecode{.}\MFPrestorecode{,}%
+ \MFPrestorecode{!}\MFPrestorecode{?}%
+ \MFPrestorecode{(}\MFPrestorecode{)}%
+ \MFPrestorecode{[}\MFPrestorecode{]}%
+ \MFPrestorecode{'}\MFPrestorecode{/}%
+ \MFPrestorecode{"}\MFPrestorecode{*}%
+ \MFPrestorecode{$}\MFPrestorecode{+}%
+ \MFPrestorecode{_}\MFPrestorecode{>}%
+ \MFPrestorecode{<}\MFPrestorecode{~}%
+ \MFPrestorelq\MFPrestoreEOL\MFPrestorespace
+ \MFPrestoreequal\catcode 10=\number\catcode10}%
+% \end{macrocode}
+%
+% Set everything to normal except \texttt @=letter, \mfc{_}=other, and
+% \texttt \textasciitilde=other. Do this by putting the settings in a
+% macro and invoking the macro. That makes it possibly to redo the
+% settings inside some other macro, should that ever become necessary.
+% Characters 10 and 13 are \verb|^^J| and \verb|^^M|, control-J and
+% control-M.
+%
+% \begin{macrocode}
+\catcode`\@=11
+\ifx\@makeother\UndEfInEd \def\@makeother#1{\catcode`#1=12\relax}\fi
+\def\mfp@sanitize{%
+\catcode10=12\catcode13=5\catcode`\$=3\catcode`\ =10
+\@makeother\:\@makeother\;\@makeother\.\@makeother\,%
+\@makeother\!\@makeother\?\@makeother\(\@makeother\)%
+\@makeother\[\@makeother\]%
+\@makeother\'\@makeother\/\@makeother\"\@makeother\*%
+\@makeother\_\@makeother\`\@makeother\+\@makeother\=%
+\@makeother\>\@makeother\<\@makeother\~\@makeother\-}%
+\mfp@sanitize
+\edef\restorenewlinechar{\newlinechar=\number\newlinechar\relax}%
+\chardef\mfp@ctrlJ10 \chardef\mfp@ctrlM13
+\newlinechar\mfp@ctrlJ\def\@nl{^^J}%
+% \end{macrocode}
+%
+% \subsection{Debugging and messages}\label{debug}
+%
+% \DescribeMacro{\ifmfpicdebug}
+% \DescribeMacro{\mfpicdebug}
+% To turn on debugging before option processing, the user must make sure
+% \cs{mfpicdebug} is defined. \cs{mfp@DBlog} writes it contents to the
+% log file only if debugging is on.
+% \begin{macrocode}
+\newif\ifmfpicdebug
+\ifx\mfpicdebug\UndEfInEd \mfpicdebugfalse
+\else \mfpicdebugtrue
+\fi
+\def\mfp@DBlog#1{%
+ \ifmfpicdebug{\let\@msgbreak\mfp@errbrk\wlog{Mfpic debug: #1}}\fi}%
+% \end{macrocode}
+% Various kinds of messages to the screen and log file. \cs{mfp@msg} is only
+% used in the definition of the others and to write a blank line. We
+% always use the second, which identifies the source of the message, or
+% the third, which adds the word `warning'. The fourth is for errors
+% and provides for help if a user presses `\texttt h' in response to the
+% message. The bit with the spaces is to get a hanging indentation with
+% text properly aligned on screen.
+% \begin{macrocode}
+\def\mfp@msg#1{{\newlinechar\mfp@ctrlJ\immediate\write16{#1}}}%
+\def\@msgbreak{^^J}%
+\def\mfp@spaces{\space\space\space\space\space\space}%
+%
+\def\mfp@msgbrk{^^J\mfp@spaces\space}%
+\def\mfp@errbrk{\mfp@msgbrk\mfp@spaces}%
+\def\mfp@warnbrk{\mfp@errbrk\space\space}%
+%
+\def\Mfpic@msg#1{{\let\@msgbreak=\mfp@msgbrk
+ \mfp@msg{Mfpic: #1 }}}%
+\def\Mfpic@warn#1{{\let\@msgbreak=\mfp@warnbrk
+ \mfp@msg{^^JMfpic warning: #1}}}%
+\def\mfp@errmsg#1#2{{\newlinechar\mfp@ctrlJ
+ \let\@msgbreak\mfp@errbrk
+ \errhelp{#2}\errmessage{Mfpic error: #1}}}%
+% \end{macrocode}
+%
+% In \TeX{} 3.x we can identify the line being processed when a message is
+% issued. We do not support \TeX{} 2.x. The command \cs{@mfplineno} is
+% for information written into the output file.
+% \begin{macrocode}
+\def\@online{ on line \number\inputlineno}%
+\def\@mfplineno{line \number\inputlineno\space in TeX source}%
+% \end{macrocode}
+%
+% \subsection{Detecting the format}\label{format}
+%
+% To detect its environment, \mfpic{} needs to test whether certain
+% commands are defined. The \cs{@xp} is usually used to `expand away'
+% the rest of a conditional. \cs{@XP} does this from two levels deep in
+% a conditional. (We use \cs{@xp}\cs{@XP}\cs{@xp} later to expand
+% away from three levels.) Since it uses \cs{@firstoftwo} and
+% \cs{@secondoftwo}, we cannot use it to check their existence.
+% \begin{macrocode}
+\ifx\@firstoftwo\UndEfInEd \long\def\@firstoftwo#1#2{#1}\fi
+\ifx\@secondoftwo\UndEfInEd \long\def\@secondoftwo#1#2{#2}\fi
+\let\@xp\expandafter
+\def\@XP{\@xp\@xp\@xp}%
+\def\mfp@ifdefined#1{%
+ \ifx#1\UndEfInEd \@xp\@secondoftwo
+ \else\ifx#1\relax \@XP\@secondoftwo
+ \else \@XP\@firstoftwo
+ \fi\fi}%
+\mfp@ifdefined\@firstofone{}{\long\def\@firstofone#1{#1}}%
+% \end{macrocode}
+%
+% We test for the format. If all tests fail we assume plain\TeX{} or
+% something compatible. Mainly this is needed to support \LaTeX. I've done
+% a few things to work around \ConTeXt, but its been a moving target and
+% \mfpic{} didn't work in \ConTeXt{} the last time I tried.
+%
+% Here we see if \cs{documentstyle} is defined, and then make sure
+% we are not in \AmSTeX{}. Probably there is a better command to test,
+% and perhaps we should just test whether the functionality required is
+% present, but I'm not really sure how best to do either of those.
+% \begin{macrocode}
+\newif\if@mfp@latex \@mfp@latexfalse
+\mfp@ifdefined\documentstyle
+ {{\def\x{AmS-TeX}%
+ \ifx \fmtname\x \mfp@DBlog{AmS-TeX detected.}%
+ \else
+ \global\@mfp@latextrue \mfp@DBlog{LaTeX detected.}%
+ \fi}}%
+ {\mfp@DBlog{Neither LaTeX2e nor LaTeX209 nor AmS-TeX.}}%
+% \end{macrocode}
+%
+% We are in \LaTeXe{}, as opposed to \LaTeX2.09, if \cs{documentclass}
+% is defined.
+% \begin{macrocode}
+\newif\if@mfp@latexe \@mfp@latexefalse
+\mfp@ifdefined\documentclass
+ {\@mfp@latexetrue \mfp@DBlog{LaTeX2e detected.}}%
+ {\mfp@DBlog{Not LaTeX2e.}}%
+% \end{macrocode}
+%
+% We now test \cs{pdfoutput} to see if pdf support is needed.
+% \begin{macrocode}
+\newif\if@mfp@pdf \@mfp@pdffalse
+\mfp@ifdefined\pdfoutput
+ {\mfp@DBlog{PdfTeX detected...}%
+ \ifcase\pdfoutput
+ \mfp@DBlog{...with dvi output.}%
+ \else
+ \@mfp@pdftrue \mfp@DBlog{...with PDF output.}%
+ \fi}%
+ {\mfp@DBlog{Not pdfTeX.}}%
+% \end{macrocode}
+%
+% \subsection{Blank line and spacing hacks}\label{spacing}
+%
+% In order for commands to always read their arguments correctly,
+% we need EOLs to have their normal category codes, but then a
+% blank line will end a paragraph, and we would like blank lines to be
+% ignored inside an \env{mfpic} environment. Therefore we turn off
+% \cs{par} inside that environment, and then need(?) to turn it back on
+% inside \cs{tlabel} and \cs{tcaption}. \cs{@@par} (in \LaTeX) and
+% \cs{endgraf} (in plain \TeX) should equal the primitive \cs{par}.
+% \begin{macrocode}
+\if@mfp@latex \else \let\@@par\endgraf \fi
+\def\mfp@restorepar{\let\par\@@par}%
+% \end{macrocode}
+%
+% Some \mfpic{} commands end with \cs{ignorespaces}. For some others a
+% better choice is the \LaTeX{} strategy of conditionally ignoring spaces.
+% \begin{macrocode}
+\if@mfp@latex\else
+ \def\@namedef#1{\@xp\def\csname #1\endcsname}%
+ \def\@nameuse#1{\csname #1\endcsname}%
+\fi
+\mfp@ifdefined\@bsphack{}%
+ {\@nameuse{newskip}\@savsk
+ \@nameuse{newcount}\@savsf
+ \def\@bsphack{\relax
+ \ifhmode \@savsk\lastskip \@savsf\spacefactor \fi}%
+ \def\@esphack{\relax
+ \ifhmode \spacefactor\@savsf
+ \ifdim\@savsk>\z@ \ignorespaces
+ \fi\fi}}%
+% \end{macrocode}
+%
+% We sometimes (either by accident or by choice) redefine things defined
+% in some formats. For the accidental redefinitions we want to be told,
+% and since we cannot assume \LaTeX{} with its \cs{newcommand}, we define
+% a simple check and print a warning when it happens.
+% \begin{macrocode}
+\mfp@DBlog{Defining test for previous definitions of macros.}%
+\mfp@ifdefined\mfp@testdef
+ {\Mfpic@warn{%
+ Hey! How can \string\mfp@testdef\space already be defined? %
+ \@msgbreak I'll redefine it anyway!}}%
+ {}%
+\def\mfp@testdef#1{%
+ \ifx#1\UndEfInEd
+ \else\ifx#1\relax
+ \Mfpic@warn{\string #1 was previouly defined to be \string\relax.}%
+ \else
+ \Mfpic@warn{\string #1 is already defined!}%
+ \fi\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\newdef}
+% \DescribeMacro{\newlet}
+% Is the proposed definer of new definitions itself not new? Well,
+% we'd like a warning, but go ahead and define it anyway. All
+% \cs{newdef} does is check whether the macro being defined is already
+% defined, raise a warning (but \emph{not} an error) and define it
+% anyway. We do something similar with \cs{let}.
+% \begin{macrocode}
+\mfp@testdef\newdef
+\mfp@testdef\newlet
+\def\newdef#1{\mfp@testdef#1\def#1}%
+\newdef\newlet#1{\mfp@testdef#1\let#1}%
+% \end{macrocode}
+%
+%
+% \section{Configuring \mfpic{} behavior}\label{configuring}
+%
+% \subsection{Options}\label{options}
+%
+% \DescribeMacro{ifmfpmpost}
+% I have decided to make this a user-level macro so that a user can
+% write code that behaves one way for \MP{} and another for \MF. However
+% the commands to change the setting are private.
+%
+% Our switch to turn \MP{} support on or off needs to be global, so it
+% can't be a normal \cs{newif}.
+% \begin{macrocode}
+\global\let\ifmfpmpost\iffalse
+\newdef\mfp@mposttrue {\global\let\ifmfpmpost\iftrue}%
+\newdef\mfp@mpostfalse{\global\let\ifmfpmpost\iffalse}%
+\newdef\mfp@ifmpost{%
+ \ifmfpmpost\@xp\@firstoftwo\else\@xp\@secondoftwo\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\usemetafont}
+% We make a user-level commands for switching to the appropriate drawing
+% program. This is necessary for plain\TeX, but also used internally by
+% \mfpic. \CMF{} is the default. This command needs to not only clear the
+% boolean \cs{ifmfpmpost}, but also restore the default graphics inclusion
+% commands. Actually, it doesn't \emph{need} to unless \cs{usemetapost}
+% was previously issued to change the default. This would normally not
+% happen unless the user wanted to close the current graph file and open a
+% new one for \MF.
+%
+% \MP{} support requires macros for including EPS graphics. What works
+% best depends on the format, so we delay the definition of
+% \cs{usemetapost} until the \LaTeX{} options section, but we define the
+% error message here.
+% \begin{macrocode}
+\newdef\usemetafont{\mfp@mpostfalse
+ \def\preparemfpicgraphic##1{}%
+ \def\setmfpicgraphic##1{\@graphfont\char\mfp@count}%
+ \def\getmfpicoffset##1{}}%
+\newdef\MPtoolate@error{%
+ \mfp@errmsg {Command \string\usemetapost\space too late.}%
+ {It is too late to select the metapost option.^^J%
+ It must be selected before the \opengraphsfile command.^^J%
+ If you proceed, the metafont option will be assumed.}}%
+% \end{macrocode}
+%
+% Some options need an open \file{.mf} or \file{.mp} file before they
+% can do anything. This means the \cs{opengraphsfile} command must have
+% been issued but not \cs{closegraphsfile}. Since those commands define and
+% undefine \cs{mfp@filename}, we use that as our test.
+% \begin{macrocode}
+\newdef\@ifmfpfileisopen{\mfp@ifdefined\mfp@filename}%
+% \end{macrocode}
+%
+% \DescribeMacro{\setmfvariable}
+% \DescribeMacro{\setmpvariable}
+% A useful abbreviation for a common requirement: declaring and setting
+% a \MF{} variable. I have decided to change it to a user level macro for
+% power users. \cs{setmpvariable} is another name for it. It takes three
+% arguments: the type of variable, the variable itself, and its value.
+% Example: \cs{setmfvariable}\marg{numeric}\marg{shadewd}\marg{.7pt}.
+% Since it \mfc{save}\,s the variable, it must not have a suffix. This is
+% not a big problem since mostly it is for internal use. We document
+% that fact for power users and advise ordinary users on the naming of
+% \MF{} variables.
+%
+% \DescribeMacro{\setmfboolean}
+% \DescribeMacro{\setmfnumeric}
+% \DescribeMacro{\setmfcolor}
+% Abbreviations for the most common internal uses. In the case of \MF,
+% color is the same numeric, but in \MP{} it is a separate variable type.
+% \begin{macrocode}
+\newdef\setmfvariable#1#2#3{%
+ \@ifmfpfileisopen{\mfcmd{setvariable (#1) (#2) (#3)}}{}}%
+\newlet\setmpvariable\setmfvariable
+\newdef\setmfboolean#1#2{\setmfvariable{boolean}{#1}{#2}}%
+\newdef\setmfnumeric#1#2{\setmfvariable{numeric}{#1}{#2}}%
+\newdef\setmfcolor#1#2{\setmfvariable{color}{#1}{#2}}%
+% \end{macrocode}
+%
+% The command \cs{setmfvariable} arranges for the value of
+% that variable to be localized to each figure if set inside one, but
+% it is global otherwise. We have to be careful that \TeX{} and \MF{}
+% stay in sync, as they have different understandings as to what is
+% global and what is not. So we define a switch that will be set at the
+% start of an \env{mfpic} environment to test if a command is issued
+% inside one.
+%
+% We also define here \texttt{true} and \texttt{false} as macros. These
+% are strings we need to write to the output frequently.
+% \begin{macrocode}
+\let\ifin@mfpicenv\iffalse
+\newdef\mfp@local{\relax\ifin@mfpicenv\else\global\fi}%
+\newdef\mf@T{true}%
+\newdef\mf@F{false}%
+\newdef\mfp@let{\mfp@local\let}%
+\newdef\mfp@def{\mfp@local\def}%
+% \end{macrocode}
+%
+% \DescribeMacro{\usecenteredcaptions}
+% \DescribeMacro{\nocenteredcaptions}
+% This (\opt{centeredcaptions}) is the simplest option. Other options
+% follow a similar pattern: user-level commands are defined for
+% turning on (and sometimes turning off) the option. Selection of
+% centered captions can be turned on or off at will throughout a
+% document.
+% \begin{macrocode}
+\newdef\usecenteredcaptions{\mfp@let\if@mfp@centcapt\iftrue}%
+\newdef\nocenteredcaptions {\mfp@let\if@mfp@centcapt\iffalse}%
+\nocenteredcaptions
+% \end{macrocode}
+%
+% This common code is repeated almost verbatim four times, so we define
+% the following abbreviation. The first two arguments are the commands
+% to turn the option on and off. The third and fourth are the \TeX{} and
+% \MF{} booleans to switch. In all cases, the default for the option is
+% \emph{off}, so we run \texttt{\#2} at the end.
+% \begin{macrocode}
+\newdef\mfp@makeoption#1#2#3#4{%
+ \newdef#1{\mfp@let#3\iftrue\setmfboolean{#4}\mf@T}%
+ \newdef#2{\mfp@let#3\iffalse\setmfboolean{#4}\mf@F}
+ #2}%
+% \end{macrocode}
+%
+% \DescribeMacro{\clipmfpic}
+% \DescribeMacro{\noclipmfpic}
+% The \opt{clip} option shows only what's inside the rectangle
+% given in the \cs{mfpic} command. It can be turned on or off for
+% each figure independently. The default is the old behavior: no
+% clipping.
+%
+% If the output file has not been opened, \cs{setmfboolean} does nothing.
+% But the \cs{opengraphsfile} code checks the boolean and writes the
+% appropriate code.
+% \begin{macrocode}
+\mfp@makeoption\clipmfpic\noclipmfpic\if@mfp@clip{clipall}%
+% \end{macrocode}
+%
+% \DescribeMacro{\usetruebbox}
+% \DescribeMacro{\notruebbox}
+% The \opt{truebbox} option lets \MP{} set the true bounding box (which
+% may differ from the numbers defined through \cs{mfpic}).
+%
+% We don't need to be too careful with the scope of truebbox. As
+% currently written, \TeX{} never needs to know the setting except to pass
+% the information on to \cs{opengraphsfile} if the option is set before
+% then. However, we treat it like most other settings, turning on or off
+% an appropriate \TeX{} boolean, in case it ever becomes necessary to know
+% the setting. It is local to any \env{mfpic}, global otherwise. The
+% default is to have \opt{truebbox} turned off.
+% \begin{macrocode}
+\mfp@makeoption\usetruebbox\notruebbox\if@mfp@truebbox{truebbox}%
+% \end{macrocode}
+%
+% Some options and commands require the \opt{metapost} option be in
+% effect. We define a generic error message for such cases. If a command
+% or option requires \MP, but the \opt{metapost} option is not set, the
+% option is ignored, or the command aborted.
+% \begin{macrocode}
+\newdef\noMP@error#1{%
+ \mfp@errmsg {Metafont does not support #1, use MetaPost.}%
+ {Metafont doesn't support #1. Perhaps you forgot to turn on^^J%
+ MetaPost support by using the metapost option or issuing the^^J%
+ command \usemetapost. For now, I will ignore it.}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\usemplabels}
+% \DescribeMacro{\nomplabels}
+% An option to let \MP{} create labels, \opt{mplabels} mostly just
+% switches between two versions of \cs{tlabel} so no \MP{} booleans
+% are set and so syncronization of scope is not an issue. The default
+% is the old behavior: labels are placed by \TeX. The actual setting is
+% delayed until \cs{opengraphsfile} so the order of these commands and
+% \cs{usemetapost} is not significant (before \cs{opengraphsfile}).
+%
+% Because of the frequent need to check this setting, we define
+% \cs{@ifmplabels} to execute one of two alternatives based on it.
+% \begin{macrocode}
+\newdef\usemplabels{\mfp@let\if@mfp@mplabels\iftrue
+ \@ifmfpfileisopen
+ {\mfp@ifmpost{}%
+ {\noMP@error{mplabels}\global\let\if@mfp@mplabels\iffalse}}{}}%
+\newdef\nomplabels{\mfp@let\if@mfp@mplabels\iffalse}%
+\newdef\@ifmplabels{%
+ \if@mfp@mplabels\@xp\@firstoftwo\else\@xp\@secondoftwo\fi}%
+\nomplabels
+% \end{macrocode}
+%
+% \DescribeMacro{\overlaylabels}
+% \DescribeMacro{\nooverlaylabels}
+% These control an option to defer adding labels (in \MP) until the end
+% of the picture. That means they don't get clipped or covered up by any
+% drawing elements. Neither of these commands affect \MF, but they write
+% to the output file anyway if issued after \cs{opengraphsfile}.
+% \begin{macrocode}
+\mfp@makeoption%
+ \overlaylabels\nooverlaylabels\if@mfp@overlabels{overlaylabels}%
+% \end{macrocode}
+%
+% \DescribeMacro{\clearsymbols}
+% \DescribeMacro{\noclearsymbols}
+% These determine whether the symbols drawn by \cs{plotsymbol} and
+% \cs{plotnodes} should have their interiors erased before being drawn.
+% \begin{macrocode}
+\mfp@makeoption%
+ \clearsymbols\noclearsymbols\if@mfp@clearsym{clearsymbols}%
+% \end{macrocode}
+%
+% \subsection{Graphic inclusion}\label{graphic}
+%
+% \DescribeMacro{\mfpicllx}
+% \DescribeMacro{\mfpiclly}
+% The code to include a figure has been divided into three parts. Under
+% \opt{metapost} we need to both include the figure and save the
+% bounding box coordinates of the lower left corner. Here we initialize
+% the macros that hold these coordinates.
+% \begin{macrocode}
+\def\mfpicllx{0}%
+\def\mfpiclly{0}%
+% \end{macrocode}
+%
+% \DescribeMacro{\preparemfpicgraphic}
+% Most EPS inclusion macros make the bounding box information available,
+% and so after the inclusion command we just save it in the above two
+% macros. However, \LaTeX's \cs{includegraphics} does not, so we have to
+% issue a command before the inclusion to force it to become available.
+% That command is \cs{preparemfpicgraphic}. Usually it does nothing,
+% but in the \LaTeXe{} case it locally redefines one of the graphics
+% packages internal macros.
+%
+% \DescribeMacro{\setmfpicgraphic}
+% This command includes the graphic. The \mfpic{} default (for the
+% \opt{metafont} option) is set by running \cs{usemetafont}.
+%
+% \DescribeMacro{\getmfpicoffset}
+% This one saves the lower left corner in the macros \cs{mfpicllx} and
+% \cs{mfpiclly}. In the case described above, that is accomplished by
+% the redefined internal command, so this command does nothing.
+%
+% The command \cs{@setmfpicgraphic} is a wrapper around the inclusion
+% code. It takes the name of the graphic file and passes it along to the
+% above three commands. Those three commands can be redefined by the
+% user for special circumstances. The user is then responsible to make
+% sure \cs{mfpicllx} and \cs{mfpiclly} are properly set when necessary.
+% Redefining one may necessitate redefining one or both of the others.
+%
+% The definition of these three is delayed to the option processing
+% section, except under the \MF{} default: \cs{usemetafont} defines them.
+% \begin{macrocode}
+\newdef\@setmfpicgraphic#1{%
+ \preparemfpicgraphic{#1}\setmfpicgraphic{#1}\getmfpicoffset{#1}}%
+\usemetafont
+% \end{macrocode}
+%
+% \DescribeMacro{\setfilename}
+% The user can also change \cs{setfilename} to modify the assumed
+% filenames of the graphics output by \MP. The default is to concatenate
+% the output file's basename with the picture number.
+% \begin{macrocode}
+\newdef\setfilename#1#2{#1.#2}%
+% \end{macrocode}
+%
+% \DescribeMacro{\ifmfpicdraft}
+% \DescribeMacro{\mfpicdraft}
+% \DescribeMacro{\mfpicfinal}
+% \DescribeMacro{\mfpicnowrite}
+% The \opt{draft}, \opt{final} and \opt{nowrite} options override
+% \mfpic's attempts to automatically detect whether the eps
+% files should be included. The \opt{final} option can also be used to
+% override a global draft option. Each of these sets the user level
+% if-command \cs{ifmfpicdraft}, which is retained for backward
+% compatibility. These settings are global since they are intended to
+% be set for the whole document. The four commands
+% \cs{@mfp@draft/finaltrue/false} are used to communicate with the
+% \cs{opengraphsfile} command, in case the user-level commands occur before
+% then.
+% \begin{macrocode}
+\newif\ifmfpicdraft
+\newif\if@mfp@draft
+\newif\if@mfp@final
+\newif\if@mfp@nowrite
+\newdef\mfpicdraft{%
+ \@ifmfpfileisopen{\global\mfpicdrafttrue}%
+ {\global\@mfp@drafttrue}}%
+\newdef\mfpicfinal{%
+ \@ifmfpfileisopen{\global\mfpicdraftfalse}%
+ {\global\@mfp@finaltrue}}%
+\newdef\mfpicnowrite{%
+ \@ifmfpfileisopen
+ {\mfp@errmsg
+ {Improper use of command \string\mfpicnowrite\@online.}%
+ {You must issue the command \mfpicnowrite prior to
+ \opengraphsfile. It will be ignored now.}}%
+ {\global\@mfp@nowritetrue}}%
+% \end{macrocode}
+%
+% \subsection{\CMP{} graphics and \LaTeX{} options}\label{latex}
+%
+% Code dependent on \LaTeXe. Mostly this is the option processing
+% facilities.
+% \begin{macrocode}
+\if@mfp@latexe
+ \ProvidesPackage{mfpic}[2004/04/16 v0.7a beta.]%
+ \DeclareOption{draft}{\mfpicdraft}%
+ \DeclareOption{final}{\mfpicfinal}%
+ \DeclareOption{nowrite}{\mfpicnowrite}%
+ \DeclareOption{metapost}{\mfp@mposttrue}%
+ \DeclareOption{metafont}{\usemetafont}%
+ \DeclareOption{centeredcaptions}{\usecenteredcaptions}%
+ \DeclareOption{clip}{\clipmfpic}%
+ \DeclareOption{truebbox}{\usetruebbox}%
+ \DeclareOption{mplabels}{\usemplabels}%
+ \DeclareOption{overlaylabels}{\overlaylabels}%
+ \DeclareOption{clearsymbols}{\clearsymbols}%
+ \DeclareOption{debug}{\mfpicdebugtrue}%
+ \DeclareOption*{%
+ \@ifpackageloaded{graphics}%
+ {\Mfpic@warn{Unrecognized option \CurrentOption.}}%
+ {\Mfpic@msg{Passing option \CurrentOption\space to %
+ graphics package.}%
+ \PassOptionsToPackage{\CurrentOption}{graphics}}}%
+% \end{macrocode}
+% If \file{mfpic.cfg} exists, it will be input at this point. Then,
+% we \cs{ProcessOptions}, using the *-form because it allows package
+% options to take precedence over global options. Thus \mfpic's
+% \opt{final} option can counteract the \mfpic-specific side effects of a
+% global \opt{draft} option.
+% \begin{macrocode}
+ \InputIfFileExists{mfpic.cfg}{}{}%
+ \ProcessOptions*\relax
+% \end{macrocode}
+%
+% \DescribeMacro{\usemetapost}
+% Finally, one of the definitions of \cs{usemetapost}. The other is
+% for use outside \LaTeXe, when the \prog{graphics} package cannot be
+% assumed to be available.
+% \begin{macrocode}
+ \def\usemetapost{%
+ \@ifmfpfileisopen{\mfp@mpostfalse\MPtoolate@error}%
+ {\mfp@mposttrue \RequirePackage{graphics}%
+% \end{macrocode}
+%
+% Unlike all the other eps inclusion macros, \cs{includegraphics} does
+% not make the bounding box coordinates available: \cs{Gin@llx} and the
+% others are defined, but are local to a group surrounding the internals
+% of \cs{includegraphics}. We locally modify one graphics package internal
+% macro to globally save the information we need. Here we save the
+% original definition and define our replacement. This definitely needs
+% to come after the above \cs{RequirePackage} command.
+% \begin{macrocode}
+ \global\let\mfp@save@parse@bb\Gread@parse@bb
+ \gdef\mfp@parse@bb##1 ##2 ##3 ##4 ##5\\{%
+ \mfp@save@parse@bb##1 ##2 ##3 ##4 ##5\\%
+ \xdef\mfpicllx{\Gin@llx}\xdef\mfpiclly{\Gin@lly}}%
+% \end{macrocode}
+%
+% The \prog{graphics} package (as opposed to the \prog{graphicx} package)
+% is far too dependent on actual extensions. Since we don't want to
+% force our users to rename all the graphics output by \MP, we have to
+% force \cs{includegraphics} to treat the current extension (some number)
+% as if it were `{\tt eps}' or `{\tt mps}' according to the context. We
+% decide which at this point.
+% \begin{macrocode}
+ \if@mfp@pdf \gdef\mfp@Gtype{mps}%
+ \else \gdef\mfp@Gtype{eps}%
+ \fi
+% \end{macrocode}
+%
+% The code we add to \cs{setmfpicgraphic} replaces \cs{Gread@parse@bb} with
+% our own version.
+% \begin{macrocode}
+ \gdef\preparemfpicgraphic##1{%
+ \let\Gread@parse@bb\mfp@parse@bb}%
+ \gdef\getmfpicoffset##1{}%
+ \gdef\setmfpicgraphic##1{\includegraphics{##1}}}}%
+% \end{macrocode}
+%
+% \cs{ProcessOptions} doesn't allow \cs{RequirePackage}\marg{graphics},
+% so the above and the following were not simply put inside
+% \cs{DeclareOption}\marg{metapost}. The \cs{AtEndDocument} command will
+% close the output file if the user forgot.
+% \begin{macrocode}
+ \mfp@ifmpost{\usemetapost}{}%
+ \AtEndDocument{\@closegraphsfile}%
+% \end{macrocode}
+%
+% Now those cases outside \LaTeXe{} that we try to support.
+% \begin{macrocode}
+\else
+ \Mfpic@msg{\mfpfiledate\space v\mfpfileversion.}%
+% \end{macrocode}
+%
+% \DescribeMacro{\usemetapost}
+% The definition of \cs{usemetapost} depends on the setting of
+% \cs{if@mfp@pdf}: \file{epsf.tex} is used for regular \TeX{} and
+% \file{supp-pdf.tex} for \pdfTeX.
+% \begin{macrocode}
+ \if@mfp@pdf
+ \def\usemetapost{%
+ \@ifmfpfileisopen{\mfp@mpostfalse\MPtoolate@error}%
+ {\mfp@mposttrue
+ \mfp@ifdefined\convertMPtoPDF{}{\input supp-pdf\relax}%
+% \end{macrocode}
+% The command \cs{convertMPtoPDF} takes the filename and and two
+% scaling factors. It parses the files PS contents to PDF code. It leaves
+% the bounding box info in macros \cs{MPllx}, etc.
+% \begin{macrocode}
+ \gdef\setmfpicgraphic##1{\convertMPtoPDF{##1}{1}{1}}%
+ \gdef\getmfpicoffset##1{%
+ \xdef\mfpicllx{\MPllx}\xdef\mfpiclly{\MPlly}}}}%
+ \else
+% \end{macrocode}
+% The final case is the generic plain\TeX, \AmSTeX, or \LaTeX2.09. Our
+% code uses the macros from \file{epsf.tex}, which should be present in
+% every installation that includes \prog{dvips}. The command
+% \cs{epsfbox} takes the filename, writes a \cs{special} for
+% \prog{dvips} (and other programs) and saves the bounding box
+% coordinates in \cs{epsfllx}, etc.
+% \begin{macrocode}
+ \def\usemetapost{%
+ \@ifmfpfileisopen{\mfp@mpostfalse\MPtoolate@error}%
+ {\mfp@mposttrue
+ \mfp@ifdefined\epsfbox {}{\input epsf\relax}%
+ \gdef\setmfpicgraphic##1{\epsfbox{##1}}%
+ \gdef\getmfpicoffset##1{%
+ \xdef\mfpicllx{\epsfllx}\xdef\mfpiclly{\epsflly}}}}%
+ \fi
+\fi
+% \end{macrocode}
+%
+%
+% \section{Optional parameter handling}\label{optional}
+%
+% We borrow \LaTeX's \cs{@ifnextchar} to have the advantage of
+% skipping spaces and EOLs, but we skip \cs{relax} as well. The reason for
+% this last is that an EOL will be set equal to \cs{relax} in certain
+% contexts and we want option handling to work the same there as
+% elsewhere. This could be a mistake, since \cs{relax} is a common method
+% to halt such things. However, there should be no occasion in an
+% \env{mfpic} environment where one would want a `\texttt[' to follow a
+% command and \emph{not} be an optional argument. In text label commands
+% we restore the meaning of blank lines, and EOLs ought to be normal.
+%
+% The first argument of \cs{mfp@ifnextchar} is the token being checked. It
+% doesn't have to be a character and we sometimes use \cs{mfp@ifnextchar}
+% to check whether a certain command follows. However, it is usually
+% `\texttt['. The next argument is the code to run if that character is
+% present, the last is code to use if the character is not present. The
+% first argument must end with code that handles the character.
+%
+% The reason for the \cs{long} in the code when the next token is
+% \cs{relax} is that it may be \cs{par} which has been \cs{let} equal to
+% \cs{relax} in \env{mfpic} environments.
+% \begin{macrocode}
+\mfp@DBlog{Handlers for optional parameters.}%
+\long\def\mfp@ifnextchar#1#2#3{%
+ \let\mfptmp@d=#1\def\mfptmp@a{#2}%
+ \def\mfptmp@b{#3}\mfp@checknext}%
+\def\mfp@checknext{\futurelet\@let@token\mfp@ifnch}%
+\def\mfp@ifnch{%
+ \ifx\@let@token\@sptoken
+ \let\mfptmp@c\eatspace@checknext
+ \else\ifx\@let@token\relax
+ \long\def\mfptmp@c##1{\mfp@checknext}%
+ \else\ifx\@let@token\mfptmp@d
+ \let\mfptmp@c\mfptmp@a
+ \else
+ \let\mfptmp@c\mfptmp@b
+ \fi\fi\fi\mfptmp@c}%
+\begingroup
+ \def\:{\global\let\@sptoken= }\: %
+ \def\:{\eatspace@checknext}\@xp\gdef\: {\mfp@checknext}%
+\endgroup
+% \end{macrocode}
+%
+% I've taken to making an empty optional argument the default for a lot
+% of commands. I wanted to make it possible to have the same result for
+% empty brackets (i.e., \texttt{[]}) as for omitted brackets.
+% The following helps check for emptyness. It uses a simple \cs{if} so
+% that \texttt{\#1} will be expanded. I use a non-active
+% \texttt{\textasciitilde} to test for emptyness because, even if a tilde
+% should accidentally occur in \texttt{\#1}, it will most likely be active
+% and expand to something else. In fact, in plain \TeX,
+% \cs{mfp@ifempty}\marg{\textasciitilde} will compare
+% \texttt{\textasciitilde} to \cs{penalty} and in \LaTeX{} to
+% \cs{unhbox}.
+%
+% The \cs{@ifmtarg} macro is borrowed from \file{ifmtarg.sty}.
+% It is used when a space should count as empty, but expansion isn't
+% wanted.
+% \begin{macrocode}
+\newdef\mfp@ifempty#1{%
+ \if~#1~\@xp\@firstoftwo\else\@xp\@secondoftwo\fi}%
+\begingroup
+\catcode`Q=3
+\long\gdef\@ifmtarg#1{\@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil}%
+\long\gdef\@xifmtarg#1#2Q#3#4#5\@nil{#4}%
+\endgroup
+\newdef\@ifmtsub#1#2{\@ifmtarg{#1}{#2}{#1}}%
+\newdef\mfp@mtsub#1#2{\mfp@ifempty{#1}{#2}{#1}}%
+% \end{macrocode}
+%
+% The following is a historical holdover. Originally all optional arguments
+% were handled through \cs{do@ptparam}. Then there arose cases that did not
+% fit its assumptions and I wrote \cs{alt@ptparam}. Then, it became more
+% efficient to have \cs{mfp@ifnextchar} (defined above) and now
+% this command is defined in terms of it.
+%
+% The first argument of \cs{do@ptparam} is the command to use and the
+% second is a default value of the optional argument. The command must be
+% defined, and it must be a command whose first argument is delimited by
+% `{\tt[}' and `{\tt]}'. Currently this is no longer used: all commands
+% use one of the variants below.
+% \begin{macrocode}
+\newdef\do@ptparam#1#2{\mfp@ifnextchar[{#1}{#1[#2]}}%
+% \end{macrocode}
+%
+% These are variations on the above. In \cs{simple@opt}, if an optional
+% argument is present, we check to see if it is empty and substitute the
+% default if it is. This was so named because I intended that it be used
+% only if the optional argument required no further parsing (because it
+% turned the argument into a nondelimited one). But now we use it even
+% then and the few commands that require further parsing handle it more or
+% less ad hoc.
+%
+% \cs{null@opt} is a convenient abbreviation for a common case: the
+% default option is null.
+% \begin{macrocode}
+\newdef\simple@opt#1#2{%
+ \mfp@ifnextchar[{\process@opt{#1}{#2}}{#1{#2}}}%
+\newdef\process@opt#1#2[#3]{%
+ \mfp@ifempty{#3}{#1{#2}}{#1{#3}}}%
+\newdef\null@opt#1{\mfp@ifnextchar[{#1}{#1[]}}%
+% \end{macrocode}
+%
+% Quite a few \mfpic{} commands stuff several parameters into a
+% single optional argument. Generally, these commands can be coded to
+% proceed gracefully if the last parameter is missing (substituting a
+% default). However, if more than that are missing, \TeX{} gobbles the
+% closing bracket and produces pretty inscrutable error mesages. This
+% (adding extra information in one optional argument) was, in retrospect,
+% a bad design decision that was made for backward compatibility and
+% (originally) to minimize the changes in existing commands.
+% Unfortunately we are stuck with it for at least the near future.
+%
+% We use the following utility to check for empty optional parameters.
+% \begin{itemize}
+% \item {\tt\#1} is the parameter to test (passed by some other macro)
+% \item {\tt\#2} is what to use if {\tt\#1} is empty.
+% \item {\tt\#3} is the command being passed the optional argument
+% \end{itemize}
+% We use a \cs{mfp@ifempty} so \texttt{\#1} will get expanded (often we
+% pass arguments as macros). After the above revamping of optional
+% argument handling, we ended up needing this code only once.
+% \begin{macrocode}
+\newdef\do@mtparam#1#2#3{\mfp@ifempty{#1}{#3[#2]}{#3[#1]}}%
+% \end{macrocode}
+%
+%
+% \section{Writing to the \file{.mf} or \file{.mp} file}\label{writing}
+%
+% \subsection{Preserving linebreaks}\label{linebreaks}
+%
+% Some macros can take quite long arguments (we call them
+% \cs{@listmac}\,s), especially if they are automatically generated by
+% some program. While the output file need not ever be looked at, there
+% can be a problem with lines too long for the \MF{} executable's line
+% buffer. Plus, for debugging, we might want to examine the file \mfpic{}
+% writes. We therefore try to get at least the list macros to preserve
+% linebreaks on output.
+%
+% \DescribeMacro{\mfpicobeylines}
+% We make use of the \TeX{} property that expandable commands are
+% expanded inside \cs{write} commands, but unexpandable commands and
+% characters are written verbatim (almost). If this were the only
+% consideration, nothing would need to be done. But characters with
+% catagory code 5 (end-of-line) are converted to spaces upon reading, so
+% we have to change the category of the \cs{endlinechar}, or we have
+% change the \cs{endlinechar} to a character in a different category.
+% We do the former, because the line a macro starts on will already have
+% the end-of-line character added, but its category will not yet be
+% established. We need a category that \TeX{} will not \emph{ignore},
+% but that nevertheless has no (or minimal) side effects if encountered in
+% a \TeX{} file. We therefore make it active, but \cs{let} it equal to
+% \cs{relax}. This makes the end-line-character unexpandable.
+% \begin{macrocode}
+\mfp@DBlog{Direct output to Metafont/Post file.}%
+\begingroup
+ \catcode\mfp@ctrlM\active%
+ \gdef\@activectrlM{^^M}%
+ \gdef\mfpicobeylines{\catcode\mfp@ctrlM\active\let^^M\relax}%
+\endgroup
+% \end{macrocode}
+%
+% The choice \cs{relax} seems to be actually a slightly better choice
+% than \cs{endgraf} (which we used to use, and which equals the
+% unexpandable primative \cs{par}) because \cs{relax} is permitted before
+% the opening brace in the syntax of \meta{general text} (for token
+% variable assignments, \cs{write}, \cs{message}, and the like) as well as
+% being skipped in mfpic's version of \cs{@ifnextchar}.
+%
+% \DescribeMacro{\preservelines}
+% The character assigned to \cs{endlinechar} is added to the end of all
+% lines read in by \TeX. The character assigned to \cs{newlinechar}
+% will produce a newline when it occurs in a \cs{write}. Our
+% \cs{preservelines} ensures these are the same and makes the above
+% changes in category.
+% \begin{macrocode}
+\newdef\preservelines{\newlinechar\mfp@ctrlM
+ \endlinechar\newlinechar \mfpicobeylines}%
+% \end{macrocode}
+%
+% \DescribeMacro{\unpreservelines}
+% This is no longer used and may some day be removed. Grouping is
+% enough to isolate effects of \cs{preservelines}. The command
+% \cs{unpreservelines} simply restores the catcode of control-M to the
+% control-M to the usual in formats consistent with plain \TeX. If we
+% really wanted to reverse the effects of \cs{preservelines}, we'd have to
+% save and restore the four items changed: the values of \cs{newlinchar}
+% and \cs{endlinechar}, the category of control-M, and the definition of
+% an active control-M.
+% \begin{macrocode}
+\newdef\unpreservelines{\catcode\mfp@ctrlM=5 }%
+% \end{macrocode}
+%
+% \DescribeMacro{\mfsrc}
+% \DescribeMacro{\mfcmd}
+% \DescribeMacro{\mflist}
+% We want these to issue \cs{preservelines} before the text is read
+% (and category codes assigned). Also we often want to add a few items to
+% the argument (figure macros append a semi-colon, list macros surround
+% with parentheses), so we isolate the common starting code in
+% \cs{@mfwrite}, and then invoke the appropriate continuation command.
+% The ending code is in \cs{@mfsrc}. The \cs{begingroup} in
+% \cs{@mfwrite} matches the \cs{endgroup} in \cs{@mfsrc}. The group
+% isolates the changes to EOLs. We also equate \cs{@nl} to an active
+% control-M so that it can be used for line breaks in cases where it is
+% inconvenient to make EOLs active (in the replacement text of
+% \cs{opengraphsfile} and \cs{@mfpic}, for example).
+% \begin{macrocode}
+\newdef\mfsrc {\@mfwrite\@mfsrc\mfsrc}%
+\newdef\mfcmd {\@mfwrite\@mfcmd}%
+\newdef\mflist{\@mfwrite\@mflist}%
+\newdef\@mfwrite{\begingroup
+ \preservelines \let\@nl\@activectrlM}%
+% \end{macrocode}
+%
+% The macro \cs{@mfsrc} does the job of writing to files. The output
+% stream \cs{mfp@out} is declared later. The other two commands invoke
+% \cs{@mfsrc} on a slightly modified argument. The first argument to
+% \cs{@mfsrc} is the command that called it (for the error message), the
+% second is the code to write.
+% \begin{macrocode}
+\newdef\@mfsrc#1#2{%
+ \@ifmfpfileisopen{\immediate\write\mfp@out{#2}}%
+ {\nooutputfileerror{#1}}\endgroup}%
+\newdef\@mfcmd#1{\@mfsrc\mfcmd{#1;}}%
+\newdef\@mflist#1{\@mfsrc\mflist{(#1);}}%
+% \end{macrocode}
+%
+% \subsection{Initializing the output file}\label{output}
+%
+% Category 12 characters percent, sharp and backslash signs for the
+% \file{.mf} file. The command \cs{mf@d} is used to write a line of
+% dashes above and below each figure to make them stand out when debugging
+% the file. This might be removed in the final distribution.
+% \begin{macrocode}
+\newdef\mfp@gobble#1{}%
+\edef\mf@p{\@xp\mfp@gobble\string\%}% percent (%)
+\edef\mf@s{\@xp\mfp@gobble\string\#}% sharp (#)
+\edef\mf@b{\@xp\mfp@gobble\string\\}% backslash (\)
+\newdef\mf@d{--------------}%
+% \end{macrocode}
+%
+% Used to mark ends of things, \cs{mfp@delim} should never be expanded,
+% but we give it a definition for debugging purposes:
+% \begin{macrocode}
+\newdef\mfp@delim{%
+ \mfp@errmsg {Misplaced \string\mfp@delim.}%
+ {If you get this message but did not (mis)use the command^^J%
+ \mfp@delim, please report this to the mfpic maintainer.}}%
+% \end{macrocode}
+%
+% The current date and time stamp will be written to the \file{.mf} file.
+% We calculate it here and store the result in these macros. The commands
+% \cs{normalyear} and \cs{normalmonth} are part of \ConTeXt, where they
+% have been equated to the primitive commands \cs{year} and \cs{month}
+% (which are then redefined).
+% \begin{macrocode}
+{\mfp@ifdefined\normalmonth
+ {\let\month\normalmonth\let\year\normalyear}{}%
+ \xdef\mfp@today{\number\year/\ifnum\month<10 0\fi\number\month/%
+ \ifnum\day<10 0\fi\number\day}%
+ \count2=\time \divide\count2 by 60
+ \xdef\mfp@now{\ifnum\count2<10 0\fi\number\count2:}%
+ \multiply\count2 by -60 \advance\count2 \time
+ \xdef\mfp@now{\mfp@now\ifnum\count2<10 0\fi\number\count2 }}%
+% \end{macrocode}
+%
+% These registers are allocated:
+% \begin{itemize}
+% \item \cs{mfp@out} Write stream for the \file{.mf} or \file{.mp} file.
+% \item \cs{mfp@graph} Read stream used to test existence of files and
+% for reading datafiles.
+% \item \cs{mfp@count} Number for next \env{mfpic} environment.
+% \item \cs{mfp@linetype} Current line style in multi-curve data plots.
+% \item \cs{mfp@n} Scratch counter, so far used only in writing data to
+% the \file{.mf} file.
+% \item \cs{mfp@sequence} Counter incremented with every datapoint written
+% from a file to implement the feature that a list of numeric data can be
+% plotted against its sequence position.
+% \item \cs{mfp@toks} Temporary token register.
+% \item \cs{every@tlabel} Tokens inserted at every \cs{tlabel}.
+% \item \cs{mfp@verbtex} A temporary token list used by \cs{mfpverbtex}.
+% \item \cs{mfp@commonverbatimtex} Tokens written at the start of every
+% output file inside a \mfc{verbatimtex} group.
+% \end{itemize}
+% \begin{macrocode}
+\mfp@DBlog{Declarations used with data and graphs files.}%
+\newwrite\mfp@out
+\newread\mfp@graph
+\newlet\mfp@data\mfp@graph
+\newcount\mfp@count
+\newcount\mfp@linetype
+\newcount\mfp@n
+\newcount\mfp@sequence
+\newtoks\mfp@toks
+\newtoks\every@tlabel
+\newtoks\mfp@verbtex
+\newtoks\mfp@commonverbatimtex
+\every@tlabel{}%
+% \end{macrocode}
+%
+% We store most of the \mfc{verbatimtex} block that \mfpic{} relies on in
+% the token register \cs{mfp@commonverbatimtex}. We do that because it
+% relies on a couple of catcode changes and we want to be in a situation
+% where we have that under control. Each line will end with an active
+% ctrl-M, which is transformed by \cs{mfsrc} into a newline.
+% \begin{macrocode}
+\begingroup
+ \let\newtoks\relax
+ \@makeother\%\@makeother\#\preservelines
+ \global\mfp@commonverbatimtex=
+ {\def\MFPtext#1{%
+ \vbox{\def\\{\cr}\MFPcfont\everylabel
+ \halign{##\hfil\cr#1\crcr}}}%
+ }\endgroup
+% \end{macrocode}
+%
+% \DescribeMacro{\opengraphsfile}
+% This is the main command to set up the output file. It also aims to
+% check whether \MF{} or \MP{} has already been run on the output file,
+% thereby determining whether the graphics can be included. It does this
+% by checking for the existence of one of the products of these programs.
+% In the case of \MF{} it looks for a \file{.tfm} file; in the case of
+% \MP{} it looks for the first output graphic.
+%
+% The name of the output file is its only parameter, and it appends
+% the extension \file{.mf} or \file{.mp} depending on the whether option
+% \opt{metafont} or \opt{metapost} was chosen.
+% \begin{macrocode}
+\mfp@DBlog{Macros to open and close graphs files.}%
+\newdef\opengraphsfile#1{\@bsphack
+% \end{macrocode}
+% A command can determine if it occurs after \cs{opengraphsfile} but
+% before \cs{closegraphsfile} by testing whether \cs{mfp@filename} is defined.
+% \begin{macrocode}
+ \@ifmfpfileisopen%
+ {\Mfpic@warn
+ {An attempt has been made to open a graph file, #1,
+ \@msgbreak while another, \mfp@filename, is still open.
+ \@msgbreak Closing \mfp@filename.}%
+ \@closegraphsfile}%
+ {}%
+ \xdef\mfp@filename{#1}%
+% \end{macrocode}
+% The value of \cs{mfp@count} should be the number of the first figure.
+% We use the existence of that figure as a signal that there are graphics
+% to be included.
+% \begin{macrocode}
+ \mfp@ifmpost{%
+ \openin\mfp@graph=\setfilename{\mfp@filename}{\number\mfp@count}%
+ \relax
+ \ifeof\mfp@graph \mfp@msg{}%
+ \Mfpic@msg
+ {No file \setfilename{\mfp@filename}{\number\mfp@count}.^^J}%
+ \global\mfpicdrafttrue
+ \else
+ \global\mfpicdraftfalse
+ \fi
+% \end{macrocode}
+% Type out the \MP-specific portion of a reminder to process the
+% output. Then on to the \MF{} case.
+% \begin{macrocode}
+ \if@mfp@nowrite \else
+ \immediate\openout\mfp@out=\mfp@filename.mp\relax
+ \Mfpic@msg{Don't forget to process \mfp@filename.mp! %
+ \@msgbreak (Apply metapost to \mfp@filename.mp.)}%
+ \fi
+ }{% metafont
+% \end{macrocode}
+% Under the \opt{metafont} option, we check for the \file{.tfm} file.
+% We do not simply try to load the font because that might trigger
+% some \prog{maketfm} script which could be disastrous at this point,
+% when the \file{.mf} file is in an uncertain state. We open the
+% \file{.tfm} for input, and check \cs{ifeof}, as we did in the
+% \MP{} graphic case.
+% \begin{macrocode}
+ \openin\mfp@graph=\mfp@filename.tfm\relax
+ \ifeof\mfp@graph \mfp@msg{}%
+ \Mfpic@msg{No file \mfp@filename.tfm .^^J}%
+ \global\let\@graphfont=\mfp@dummy
+ \global\mfpicdrafttrue
+% \end{macrocode}
+% If it does exist, we load the font and in either case type out the
+% \MF{} specific portion of our reminder.
+% \begin{macrocode}
+ \else
+ \global\font\@graphfont=\mfp@filename\relax
+ \global\mfpicdraftfalse
+ \fi
+ \if@mfp@nowrite \else
+ \immediate\openout\mfp@out=\mfp@filename.mf\relax
+ \Mfpic@msg{Don't forget to process \mfp@filename.mf! %
+ \@msgbreak (Apply metafont to \mfp@filename.mf, %
+ then gftopk to the resulting gf file.)}%
+ \fi
+ }%
+% \end{macrocode}
+% The input stream used for testing is closed and the
+% unspecific portion of the reminder is typed out, then
+% the above settings of \cs{ifmfpicdraft} are overridden if the user has
+% explicitly chosen the \opt{draft} or \opt{final} option. The
+% \opt{nowrite} option merely disables the \cs{@mfsrc} command.
+% \begin{macrocode}
+ \closein\mfp@graph
+ \if@mfp@nowrite\else
+ \Mfpic@msg{Then reprocess this file (\jobname).^^J}%
+ \fi
+ \if@mfp@draft\global\mfpicdrafttrue\fi
+ \if@mfp@final\global\mfpicdraftfalse\fi
+ \if@mfp@nowrite\gdef\@mfsrc##1##2{}\fi
+% \end{macrocode}
+% The first two lines of the output file are comments identifying the
+% file, the \mfpic{} version, the tex source file, and the date.
+% Then we let \grafbase{} know the \mfpic{} version creating the file.
+% After that we set the \mfc{mode}, the \mfc{mag} (both ignored by \MP),
+% and arrange for \grafbase{} macros to be loaded. The current
+% \grafbase{} checks the \gbc{mfpicversion}: if it is unknown, or not
+% equal to the value of \gbc{grafbaseversion}, a diagnostic message is
+% printed.
+% \begin{macrocode}
+ \mfsrc{%
+ \mf@p\space\mfp@filename.m\mfp@ifmpost{p}{f}, %
+ generated by Mfpic, v\mfpfileversion\space\mfpfiledate,\@nl
+ \mf@p\space from TeX source "\jobname" %
+ on \mfp@today\space at \mfp@now\@nl
+ numeric mfpicversion; mfpicversion:=\mfpicversion;\@nl
+ if unknown mode: mode := localfont; fi\@nl
+ if unknown mag: mag := \number\mag/1000; fi\@nl
+ if unknown grafbase: input grafbase; fi\@nl\@nl
+% \end{macrocode}
+% Then a comparison of the version of this file, stored in
+% \cs{mfpicversion} with the version stored in the \grafbase{} variable
+% \mfc{grafbaseversion}. This should catch mismatches the previous test
+% would miss.
+% \begin{macrocode}
+ if unknown grafbaseversion: grafbaseversion := 0; fi\@nl
+ if grafbaseversion <> mfpicversion :\@nl
+ GBmsg "Bad mfpic installation: mfpic and grafbase %
+ versions do not match.";\@nl
+ fi\@nl}%
+% \end{macrocode}
+% For \opt{metapost} we need to load some color macros also, and write
+% some setup for text labels (even if \cs{nomplabels}, because
+% \cs{usemplabels could be turned on later}). \MF{} now can also handle
+% the definitions in \file{dvipsnam.mp} but it seems a waste to load all
+% those definitions just to get a few more grayscales (even given \MF{}
+% can find that file).
+% \begin{macrocode}
+ \mfp@ifmpost
+ {\mfsrc{%
+ if unknown Apricot: input dvipsnam.mp; fi\@nl
+ verbatimtex\@nl
+ \the\mfp@commonverbatimtex\@nl
+ \def\noexpand\everylabel{\the\every@tlabel}\@nl
+ \if@mfp@verbtex \the\mfp@verbtex\@nl \fi
+ etex;\@nl}%
+ \global\@mfp@verbtexfalse\mfp@verbtex{}%
+% \end{macrocode}
+% Finally, we write information to the output file, and/or set switches
+% based on the options as they are currently known. The \cs{usemplabels}
+% was delayed until now so that the order of it and \cs{usemetapost}
+% before now would not matter. The other five are issued now because they
+% might require a write to the output file.
+% \begin{macrocode}
+ \@ifmplabels{\usemplabels}{}%
+ \if@mfp@truebbox \usetruebbox \fi
+ \if@mfp@overlabels \overlaylabels \fi}{}%
+ \if@mfp@clip \clipmfpic \fi
+ \if@mfp@clearsym \clearsymbols \fi
+ \if@shipping\else\stopshipping\fi
+ \@esphack}%
+% \end{macrocode}
+%
+% \DescribeMacro{\closegraphsfile}
+% This finishes off the output files and undefines \cs{mfp@filename}.
+% We define an error message free version \cs{@closegraphsfile} for
+% internal use. We unconditionally undefine \cs{mfp@filename} just in
+% case.
+% \begin{macrocode}
+\newdef\closegraphsfile{%
+ \@ifmfpfileisopen{}{\nooutputfileerror\closegraphsfile}%
+ \@closegraphsfile \global\let\mfp@filename\UndEfInEd}%
+\newdef\@closegraphsfile{%
+ \@ifmfpfileisopen
+ {\if@mfp@nowrite \else
+ \mfsrc{\@nl end.}\immediate\closeout\mfp@out
+ \fi}{}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\nooutputfileerror}
+% We define a generic error message for macros that need an output file
+% to write to. \cs{mfsrc} uses it, as does \cs{closegraphsfile}.
+% \cs{mfpic} also uses it even though all its writes take place through
+% \cs{mfsrc}. This avoids potentially hundreds of error messages.
+% \begin{macrocode}
+\def\nooutputfileerror#1{%
+ \mfp@errmsg {No output file has been opened.}%
+ {You have tried to used a command, #1, that requires an output^^J%
+ file to be opened with the \opengraphsfile command, which^^J%
+ was either not issued or was not successful.}}%
+% \end{macrocode}
+%
+%
+% \section{\Mfpic{} dimensions}\label{dimensions}
+%
+% A number of packages, especially figure drawing packages, allocate a
+% great many dimension registers. The most familiar example is \PiCTeX{}
+% which is at least partially responsible for most ``No room for a new
+% \cs{dimen}'' error messages. \Mfpic{} also needs many dimension
+% values, but some are set by macros that simply write the value to the
+% \file{.mf} file and do not use any registers. A few are stored in
+% \TeX{} registers, but most are stored using a trick with font
+% dimensions.
+% \begin{macrocode}
+\mfp@DBlog{Using dummy font's dimensions, to spare TeX registers.}%
+% \end{macrocode}
+% While most fonts have relatively few font dimensions (twenty-two is a
+% common number), it turns out that if one loads a font and immediately
+% assigns a value to \cs{fontdimen}~$n$, Then \TeX{} acts as if the font
+% has \cs{fontdimen}\,s 0 through $n$ available. They can be assigned
+% dimension values just like \TeX{} dimension registers.
+%
+% Virtually all \TeX{} systems have a \file{dummy.tfm}, which contains
+% no characters (it is used for syntax checking by some packages and
+% classes). Since this trick will only work if we are the first to
+% load the font (the \AmSTeX{} document style \file{amsppt.sty} loads
+% the dummy font), we use another trick, which is to load it scaled to
+% some unlikely value, which \TeX{} treats as a new font.
+% \begin{macrocode}
+\font\mfp@dummy=dummy scaled 1042
+\fontdimen100\mfp@dummy=0pt
+% \end{macrocode}
+%
+% Some versions of \file{dummy.tfm} have values already assigned to font
+% dimensions 0 through 22. It would probably not hurt to use those, but
+% we'll be cautious and use only font dimensions 23 and up, making 78
+% available.
+%
+% We use an auxiliary count register to keep track of new font dimens.
+% \begin{macrocode}
+\newcount\mfp@fdc
+\mfp@fdc=22
+% \end{macrocode}
+% \DescribeMacro{\newfdim}
+% We define a macros that mimics the behavior of \cs{newdimen}, for
+% allocating font dimension numbers. It increments \cs{mfp@fdc} and
+% defines its argument \texttt{\#1} to expand to an assignment of the
+% current \cs{fontdimen}.
+% \begin{macrocode}
+\newdef\newfdim#1{%
+ \global\advance\mfp@fdc 1
+ \xdef#1{\fontdimen\number\mfp@fdc\mfp@dummy}%
+ \wlog{\string#1=\string\fontdimen\number\mfp@fdc\mfp@dummy}}%
+% \end{macrocode}
+% The definition (\cs{xdef}) is global since font dimension
+% assignments are always global anyway. \TeX{} will not accept font
+% dimensions in its syntax for the dimension arithmetic commands
+% \cs{advance}, \cs{multiply} and \cs{divide}. In the rare cases where we
+% need to do this we assign the value to a temporary register and
+% calculate with it. It is, however OK to use them with a numeric factor.
+%
+% We allocate a couple of boxes. At the end of an \mfpic{}
+% environment, \cs{@wholegraph} is loaded with the picture (possibly
+% null) as it exists then. Inside the environment, when text labels are
+% processed, \cs{@textbox} holds this text temporarily so it can be
+% measured, moved about, etc. We also define abbreviations for the
+% frequent commands that specify the dimensions of \cs{@textbox}
+% \begin{macrocode}
+\mfp@DBlog{A box register for whole labeled graph, %
+ and a temporary one.}%
+\newbox\@wholegraph
+\newbox\@textbox
+\newdef\tb@ht{\ht\@textbox}% height,
+\newdef\tb@dp{\dp\@textbox}% depth and
+\newdef\tb@wd{\wd\@textbox}% width of the text label.
+% \end{macrocode}
+%
+% When labels are processed, they are accumulated in the box
+% \cs{@alltlabels}. We allocate it, and four \cs{newfdim}\,s for the
+% location of the four sides.
+% \begin{macrocode}
+\newbox\@alltlabels
+\newfdim\@tlabelstop
+\newfdim\@tlabelsbot
+\newfdim\@tlabelsleft
+\newfdim\@tlabelsright
+% \end{macrocode}
+%
+% It can be argued that dimensions not needed by \TeX{} should be stored
+% in the output file rather than allocating (font) dimensions. These are
+% everything below from \cs{pointsize} through \cs{symbolspace},
+% inclusive. This would make syncronictity between \TeX{} and \MF{} easier
+% to maintain. Those that are needed by \TeX{} are then few enough to be
+% regular \cs{dimen} registers, making them automatically local to each
+% \env{mfpic} environment. Unfortunately, changing to such a scheme could
+% break some past \mfpic{} files. It would also require recoding every
+% command that now writes one of these dimensions to the output.
+%
+% One of these (\cs{@graphright}) is unused, except for debugging.
+% We could also code around \cs{@graphwd} because it is always
+% \cs{wd}\cs{@wholegraph}. ^^A Is this true? Check it out.
+% \begin{macrocode}
+\mfp@DBlog{Internal dimension parameters for graph dimensions...}%
+\newfdim\@graphwd
+\newfdim\@graphright
+\newfdim\@graphleft
+\newfdim\@graphtop
+\newfdim\@graphbot
+\mfp@DBlog{...and dimension parameters for tlabel positioning.}%
+\newfdim\tb@raise
+\newfdim\tb@moveright
+\newfdim\tb@totalht
+% \end{macrocode}
+%
+% The following are for label adjustments. The first two are used to
+% implement the feature that all labels can be simultaneously shifted an
+% equal amount. The last is for the feature that the label can be a
+% certain distance separated from the point where it is placed.
+% \begin{macrocode}
+\newfdim\tlabel@hadj
+\newfdim\tlabel@vadj
+\newfdim\tlabel@sep
+\tlabel@hadj=0pt
+\tlabel@vadj=0pt
+\tlabel@sep=0pt
+% \end{macrocode}
+%
+% The following are default parameters for various graphics commands that
+% take an optional argument for the size of something. We allocate them,
+% and then initialize them.
+% \begin{macrocode}
+\mfp@DBlog{User level dimension parameters, with default settings.}%
+\newfdim\mfpicunit % unit of length
+\newfdim\pointsize % diameter of circle
+\newfdim\shadespace % spacing of shade dots
+\newfdim\polkadotspace % spacing of polkadots
+\newfdim\hatchspace % spacing of lines
+\newfdim\headlen % size of arrowhead (\arrow)
+\newfdim\axisheadlen % size of arrowhead (x, y axes)
+\newfdim\sideheadlen % size of arrowhead (border axes)
+\newfdim\hashlen % length of marks on axes
+\newfdim\dashlen % length of dashes (\dashed)
+\newfdim\dashspace % space between dashes
+\newfdim\dotsize % size of dots (\dotted)
+\newfdim\dotspace % space between dots
+\newfdim\symbolspace % space between symbols (\plot)
+%
+\mfpicunit=1pt
+\pointsize=2pt
+\shadespace=1pt
+\polkadotspace=10pt
+\hatchspace=3pt
+\headlen=3pt
+\axisheadlen=5pt
+\sideheadlen=0pt
+\hashlen=4pt
+\dashlen=4pt
+\dashspace=4pt
+\dotsize=0.5pt
+\dotspace=3pt
+\symbolspace=5pt
+% \end{macrocode}
+%
+% Font dimensions are global, and so not restricted to an \env{mfpic}
+% environment even when assigned inside one. This would require the
+% user to restore a value every time one picture needed a different
+% value from the rest. To avoid requiring this, the following macro is
+% used to save all values of these dimensions at the start of a picture,
+% and to restore the saved values at the end. (Some internal dimensions
+% (\cs{@graph...}, for example) don't need saving since they are reset
+% with each picture.)
+% \begin{macrocode}
+\newdef\save@mfpicdimens{%
+ \edef\restore@mfpicdimens{%
+ \mfpicunit =\the\mfpicunit
+ \pointsize =\the\pointsize
+ \shadespace =\the\shadespace
+\polkadotspace =\the\polkadotspace
+ \hatchspace =\the\hatchspace
+ \headlen =\the\headlen
+ \axisheadlen =\the\axisheadlen
+ \sideheadlen =\the\sideheadlen
+ \hashlen =\the\hashlen
+ \dashlen =\the\dashlen
+ \dashspace =\the\dashspace
+ \dotsize =\the\dotsize
+ \dotspace =\the\dotspace
+ \symbolspace =\the\symbolspace
+ \tlabel@hadj =\the\tlabel@hadj
+ \tlabel@vadj =\the\tlabel@vadj
+ \tlabel@sep =\the\tlabel@sep}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\mfpframesep}
+% \DescribeMacro{\mfpframethickness}
+% \DescribeMacro{\mfpicheight}
+% \DescribeMacro{\mfpicwidth}
+% \DescribeMacro{\mfpiccaptionskip}
+% Here are the few dimension registers we do allocate. The first two are
+% scratch registers, the next two govern frames, and the last two are set
+% after each picture to that pictures size. A \cs{vskip} of
+% \cs{mfpiccaptionskip} is placed between figure and caption by
+% \cs{tcaption}.
+% \begin{macrocode}
+\newdimen\mfp@scratch
+\newdimen\mfp@scratchB
+\newdimen\mfpframesep
+\newdimen\mfpframethickness
+\newdimen\mfpicheight
+\newdimen\mfpicwidth
+\newskip\mfpiccaptionskip
+\mfpframethickness0.4pt
+\mfpframesep2pt
+\mfpiccaptionskip=\medskipamount
+% \end{macrocode}
+%
+%
+% \section{Helper macros}\label{helper}
+%
+% \DescribeMacro{\mfpicnumber}
+% We make a user-level macro for setting the number of the next graph.
+% The purpose of this is so that the output file can be used as a font,
+% setting the figure numbers to the ascii codes of printable characters.
+% Then creating a composite figure is as easy as changing fonts:
+% \marg{\cs{pic} ABABAAB}. The motivation came from a discussion on
+% \texttt{comp.text.tex} started by someone who wanted to input a sequence
+% of 0's and 1's and get a corresponding sequence of black and white
+% squares.
+% \begin{macrocode}
+\def\mfpicnumber#1{\global\mfp@count=#1\relax}%
+% \end{macrocode}
+%
+% \DescribeMacro{\mfpaddto}
+% When placing text at intervals on an axis, we need to automatically
+% calculate coordinates to feed to the \cs{tlabel} command. The
+% following is a utility macro to add two real numbers. It is currently
+% used only in the \cs{axislabels} command, so it needn't be globally
+% defined, but it might be handy in the future.
+% \begin{itemize}
+% \item[] \texttt{\#1} is a \emph{macro} that expands to some number.
+% \item[] \texttt{\#2} is a number to add to it.
+% \end{itemize}
+% The result is stored again in \texttt{\#1}, overwriting the old value.
+%
+% \DescribeMacro{\mfpmultiply}
+% For my personal use (or for power users), this is the multiplicative
+% version, with the same syntax and behavior.
+% \begin{macrocode}
+\newdef\mfpaddto#1#2{\mfp@scratch=#1pt\advance\mfp@scratch#2pt
+ \edef#1{\mfp@strippt\mfp@scratch}}%
+\newdef\mfpmultiply#1#2{\mfp@scratch=#1pt \mfp@scratch#2\mfp@scratch
+ \edef#1{\mfp@strippt\mfp@scratch}}%
+\begingroup
+ \@makeother P\@makeother T\lowercase{\gdef\mfp@factor#1PT{#1}}%
+\endgroup
+\newdef\mfp@strippt{\@xp\mfp@factor\the}%
+% \end{macrocode}
+%
+% A few user-level utilities.
+%
+% \DescribeMacro{\pointdef}
+% A point defining macro, suggested by a user.
+% \begin{itemize}
+% \item[] \texttt{\#1} is a symbolic name for a point, only letters.
+% \item[] \texttt{\#2} and \texttt{\#3} are the coordinates.
+% \item[] Usage: \cs{pointdef}\marg{A}\parg{2,5} makes \cs{A} expand
+% to \texttt{(2,5)}, \cs{Ax} to \texttt{2}, and \cs{Ay} to
+% \texttt{5}.
+% \end{itemize}
+% \begin{macrocode}
+\newdef\pointdef#1(#2,#3){%
+ \@namedef{#1}{(#2,#3)}\@namedef{#1x}{#2}\@namedef{#1y}{#3}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\pairarray}
+% \DescribeMacro{\numericarray}
+% The first enables the simultaneous definition of \MF{} pair variables
+% \mfc{A1}, \mfc{A2}, etc, \mfc{A[n]} by writing,
+% \cs{pairarray}\marg{A}\marg{\meta{list}}, the list being a list of
+% $n$ ordred pairs. Numeric variables can be created similarly with the
+% second command.
+% \begin{macrocode}
+\newdef\pairarray#1{%
+ \mfcmd{save #1}\mfsrc{textpairs (#1)}\mfp@writedata}%
+\newdef\numericarray#1{\mfcmd{save #1; numeric #1; numeric #1[]}%
+ \mfsrc{list (#1)}\mfp@writedata}%
+% \end{macrocode}
+%
+% \DescribeMacro{\lightershade}
+% \DescribeMacro{\darkershade}
+% Shade adjustment macros. They just multiply or divide \cs{shadespace}
+% by 1.2.
+% \begin{macrocode}
+\newdef\lightershade{\shadespace=1.2\shadespace}%
+\newdef\darkershade{\shadespace=.833333\shadespace}%
+% \end{macrocode}
+%
+% \DescribeMacro{\dashlineset}
+% \DescribeMacro{\dotlineset}
+% The following arrange for contrastive dashed lines. \cs{dashlineset}
+% just resets the default parameters that the \cs{dashed} macro uses,
+% \cs{dotlineset} sets these parameters so that \cs{dashed} produces
+% something almost dotted.
+% \begin{macrocode}
+\newdef\dashlineset{\dashlen=4pt \dashspace=4pt}%
+\newdef\dotlineset{\dashlen=1pt \dashspace=2pt}%
+% \end{macrocode}
+%
+% \DescribeMacro{\ifpointfill}
+% With the commands \cs{pointfilltrue} or \cs{pointfillfalse} the user
+% can specify points drawn with the \cs{point} command to be either
+% filled in or not.
+% \begin{macrocode}
+\let\ifpointfill\iftrue
+\newdef\pointfilltrue{\mfp@let\ifpointfill\iftrue}%
+\newdef\pointfillfalse{\mfp@let\ifpointfill\iffalse}%
+% \end{macrocode}
+%
+%
+% \section{Macros to implement prefix commands}\label{prefix}
+%
+% \Mfpic{} prefix macros change the behavior of the figure macros.
+% Normally we want \cs{circle}\marg{...} to draw the solid outline of a
+% circle. So normally \cs{circle}\marg{...} will write a drawing command
+% followed by a path expression giving the circle to draw. But
+% \cs{dashed}\cs{circle}\marg{...} should write a \emph{dashing} command
+% and \emph{omit} the drawing command. Thus, \emph{rendering} macros
+% like \cs{dashed} need to set a switch, and figure macros like
+% \cs{circle} need to test that switch.
+%
+% Similar considerations hold for prefix macros that transform the
+% figure. The logic is that, at the \MF{} level, every figure macro
+% is syntactically a path expression. Every prefix accepts a path
+% expression as input and has a path as its return value, so a
+% combination prefix + path expression is again a path expression.
+% Prefixes may also have side effects, such as adding some ink to the
+% current picture. Such prefixes are called \emph{rendering} macros.
+% Rendering macros normally return the same path as their argument, but
+% there are macros that modify the path. Some applying a linear
+% transform, some close an open path, some return a subpath. These we call
+% \emph{modification} macros.
+%
+% This scheme is quite simple, but unfortunately too simple. To avoid
+% having to explicitly type a rendering prefix every time, we need
+% the above mentioned ability to pass information to the figure macros.
+% Moreover, \MF{} abhors an `isolated expression', so the first prefix
+% has to write something with a different syntax, and pass the info that
+% it has already done so on to later prefixes, who need to test that
+% info.
+% \begin{macrocode}
+\mfp@DBlog{Tests to control multiple prefix commands.}%
+% \end{macrocode}
+%
+% Every prefix macro needs to know if it is the first or a later one.
+% They test this \cs{if} command and also set it to false. The
+% figure macros, which are last in the chain, close by resetting it true.
+% \begin{macrocode}
+\newif\if@startfig\@startfigtrue
+% \end{macrocode}
+%
+% If a prefix is a rendering prefix, it writes the rendering code
+% and sets the following switch to false, letting the figure macro know
+% it needn't invoke the default rendering,
+% Figure macros close by resetting it true. Some modification macros don't
+% touch it at all (the \cs{@modmac}\,s) others just test it
+% (\cs{@closmac}\,s).
+% \begin{macrocode}
+\newif\if@imrend\@imrendtrue
+% \end{macrocode}
+%
+% The following macro is always (and only) invoked by the first prefix
+% macro. It writes the code that prevents an isolated expression. It
+% stores the following path expression in the variable \gbc{curpath}. Thus
+% every combination of prefixes followed by a figure macro is
+% syntactically a \MF{} variable assignment command.
+% \begin{macrocode}
+\newdef\store@path{\mfsrc{\@nl store (curpath)}}%
+% \end{macrocode}
+%
+% Every prefix and figure macro has to invoke \cs{@firststage}, since
+% each is potentially the first in the sequence. If
+% \cs{if@startfig} is true, it writes the storing command, sets
+% \cs{@startfigfalse}, and says that rendering is needed. (The
+% rendering macros immediately cancel that switch.)
+% \begin{macrocode}
+\newdef\@firststage{\relax
+ \if@startfig \store@path \@imrendtrue \@startfigfalse\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\@rendmac}
+% Every rendering macro invokes this command. After the first-stage code
+% it writes its rendering command (via \cs{mfsrc}) and passes on the info
+% that rendering is no longer required of the figure macro.
+% \begin{macrocode}
+\newdef\@rendmac{\@firststage \@imrendfalse \mfsrc}%
+% \end{macrocode}
+%
+% \DescribeMacro{\@modmac}
+% It is possible we should call this something else, as only \cs{arrow}
+% and \cs{reverse} use \cs{@modmac}. Other modifications cause the
+% modified path to be drawn as if (modifier+figure) were a solitary figure
+% macro. This would be pointless for a reversed path or a path with
+% arrowhead added, as presumably the original path would already be drawn.
+% Moreover, it can be argued (for \MP{} at least) that the arrowhead
+% should be drawn on top of the shaft. This is the only significant effect of
+% coding \cs{arrow} and \cs{reverse} as \cs{@modmac}\,s.
+%
+% It simply invokes the common first-stage code and writes its \MF{} code.
+% \begin{macrocode}
+\newdef\@modmac{\@firststage \mfsrc}%
+% \end{macrocode}
+%
+% \DescribeMacro{\@closmac}
+% Other modification macros were added later, and it turned out that
+% they needed the same treatment as the closure macros that already
+% existed. Therefore, most modification macros invoke \cs{@closmac}. The
+% \emph{figure} macros proceed as follows: they invoke the \cs{@firststage}
+% code, then write a rendering macro if necessary, then make
+% \cs{@starfigtrue} (for the next figure), then write \MF{} code that
+% defines the path. These modification macros do only the first two,
+% counting on the figure macro to follow to invoke the last two. The idea
+% is that {closure + figure} should act the same as if the path it defines
+% were encoded as a single figure command.
+%
+% The \cs{@modmac} and \cs{@closmac} macros differ only when there are
+% no preceeding rendering macros. In that case it is as if \cs{draw} (or
+% more generally \cs{@render}) precedes the \cs{@closmac} macro. That
+% drawing happens \emph{in addition to} any rendering macros that follow.
+% This implicitly added \cs{draw} is not present for \cs{@modmac} macros,
+% unless it is added by the following figure macro itself.
+% \begin{macrocode}
+\newdef\@closmac{\@firststage \if@imrend\@xp\@render\fi \mfsrc}%
+% \end{macrocode}
+%
+% \DescribeMacro{\setrender}
+% As mentioned above, when a figure macro is invoked without a
+% rendering prefix, it will invoke some default. That default is stored
+% in the macro \cs{@render}, which can be changed for special effects.
+% Initially we define it as \cs{draw} to draw solid paths, but provide a
+% command for the user to change it.
+% \begin{macrocode}
+\newdef\@render{\draw[]}%
+\newdef\setrender#1{\mfp@def\@render{#1}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\@figmac}
+% A figure macro will invoke the common first-stage code, then check
+% if rendering is needed. If so, it issues the \cs{@render} command.
+% It also resets the startfig switche. Since a figure macro completes
+% an assignment command in \MF, we use \cs{mfcmd}, which places a
+% semicolon at the end of the code it writes. We define the first part
+% (all but the writing) as a separate command because there are a few cases
+% where we need to delay that writing.
+% \begin{macrocode}
+\newdef\@figmacstart{%
+ \@firststage \if@imrend\@xp\@render\fi \@startfigtrue}%
+\newdef\@figmac{\@figmacstart\mfcmd}%
+% \end{macrocode}
+%
+% \DescribeMacro{\@listmac}
+% The list macros take as their last argument a list of $(x,y)$ pairs.
+% That list can either be typed directly into
+% the \TeX{} source file (inside braces, separated by commas) or be
+% present in an external datafile. Either way, the data is written
+% as a list of \MF{} pairs within an enclosing pair of
+% parentheses. Since these are all figure macros, \cs{@listmac} starts out
+% just like \cs{@figmac}, but it writes only part of its arguments, the
+% last one being handled by \cs{mfp@writedata}.
+%
+% \cs{mfp@writedata} looks ahead to see if the token \cs{datafile}
+% follows, if it does \cs{mfp@writefile} is invoked, which gobbles
+% the \cs{datafile} token and processes the filename that should follow it.
+% Otherwise, \cs{mflist} is invoked to write the list in braces
+% that should follow.
+%
+% \cs{mfp@writedata} is also used by non-figure macros such as the axis
+% marks macros, plus \cs{piechart} and \cs{barchart}.
+% \begin{macrocode}
+\newdef\@listmac#1{\@figmacstart\mfsrc{#1}\mfp@writedata}%
+\newdef\mfp@writedata{%
+ \mfp@ifnextchar\datafile{\mfp@writefile}{\mflist}}%
+\newdef\mfp@writefile\datafile#1{\@processdatafile{#1}{\mfp@rwdata}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\mftitle}
+% \DescribeMacro{\tmtitle}
+% These go here because they didn't seem to go anywhere else. The are
+% mainly for debugging the example files. \cs{getmfp@toks} assigns the
+% following group to a token register and then invokes its argument.
+% \cs{mftitle} and \cs{tmtitle} use this to write the code into
+% the string argument of the \grafbase{} command \gbc{mftitle}.
+% \cs{mftitle} does only that, while \cs{tmtitle} also writes the argument
+% to the \file{.log} file and typesets it in the document.
+%
+% We write the argument as a token list because that is the the easiest
+% verbatim-like way to do it.
+% \begin{macrocode}
+\newif\if@mfpswitch
+\newdef\mftitle{\@bsphack\@mfpswitchtrue\mfp@gettoks\mf@title}%
+\newdef\tmtitle{\mfp@gettoks\tm@title}%
+\newdef\mfp@gettoks#1{\afterassignment#1\mfp@toks=}%
+\newdef\tm@title{\@mfpswitchfalse\mf@title
+ \wlog{\the\mfp@toks}{\the\mfp@toks}}%
+\newdef\mf@title{\mfsrc{}%
+ \immediate\write\mfp@out{mftitle "\the\mfp@toks";}%
+ \if@mfpswitch\@esphack\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\noship}
+% \DescribeMacro{\stopshipping}
+% \DescribeMacro{\resumeshipping}
+% To turn off character shipping for duration of innermost enclosing
+% group (eg, \env{mfpic} environment). As far as I know it has never been
+% tested with \MP. (It hasn't been tested recently even in \MF.) The \MF{}
+% code prevents the figure from being added to the font, the \TeX{} switch
+% \texttt{shipping} is checked before \cs{endmfpic} attempts to add the
+% (nonexistent) figure to the document.
+% \begin{macrocode}
+\newdef\stopshipping{\mfp@let\if@shipping\iffalse
+ \@ifmfpfileisopen{\mfcmd{save shipit;def shipit = relax enddef}}{}}%
+\newdef\resumeshipping{\mfp@let\if@shipping\iftrue
+ \@ifmfpfileisopen{\mfcmd{save shipit;def shipit = shipit_ enddef}}{}}%
+\newlet\noship\stopshipping
+\resumeshipping
+% \end{macrocode}
+%
+%
+% \section{Macros for getting data from files}\label{rwdata}
+%
+% The following command contains the common code to open a data file for
+% reading. The first parameter is the filename, the second is what to do
+% if it exists and is nonempty. We first try to \cs{openin} the file and
+% issue an error message if that fails. Then we skip any initial blank
+% lines and comments and complain if that takes us to the end of the
+% file. Otherwise we execute the command specified. Afterwards, since
+% each \cs{plotdata} command in a given \env{mfpic} environment
+% starts with the linetype at which the previous one ended, we allow the
+% value of \cs{mfp@linetype} to survive the group. If \texttt{\#2} is
+% not \cs{plotdata}, this is harmless (I hope).
+% \begin{macrocode}
+\newdef\@processdatafile#1#2{%
+ \openin\mfp@data=#1\relax
+ \ifeof\mfp@data \nodatafileerror{#1}%
+ \else
+ \begingroup
+ \mfp@resetwhitespace \mfp@setcomment
+ \skipBlanksandComments
+ \ifeof\mfp@data \emptydatafileerror{#1}\else #2\fi
+ \global\mfp@n=\mfp@linetype
+ \endgroup
+ \mfp@linetype=\mfp@n
+ \fi
+ \closein\mfp@data}%
+% \end{macrocode}
+%
+% \DescribeMacro{\nodatafileerror}
+% \DescribeMacro{\emptydatafileerror}
+% These are error messages for missing or empty data files:
+% \begin{macrocode}
+\newdef\nodatafileerror#1{%
+ \mfp@errmsg{No data file: #1 .}%
+ {The data file you tried to plot can't be found.}}%
+\newdef\emptydatafileerror#1{%
+ \mfp@errmsg{Empty data file: #1 .}%
+ {The file you tried to plot contains only empty lines and comments.}}%
+% \end{macrocode}
+%
+% When reading files it is important that white space in the files
+% always have the same meaning for \TeX{}. This utility resets spaces,
+% tabs and EOLs to the standard categories.
+% \begin{macrocode}
+\newdef\mfp@resetwhitespace{%
+ \catcode`\^^M=5 \catcode`\ =10 \catcode`\^^I=10 }%
+% \end{macrocode}
+%
+% \DescribeMacro{\skipcomments}
+% This does what it says, skipping comments in a data file. It reads a
+% line from a previously opened file (input stream \cs{mfp@data}) and
+% compares it to \cs{@empty}. It calls itself when they are equal (a
+% comment line). When this macro finishes, \cs{mfp@temp} contains either
+% \cs{par} (blank line or EOF) or real data.
+% \begin{macrocode}
+\mfp@ifdefined\@empty{}{\def\@empty{}}%
+\newdef\skipcomments{\read\mfp@data to \mfp@temp
+ \ifx\mfp@temp\@empty \@xp\skipcomments\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\skipBlanksandComments}
+% This command first skips comments. After that \cs{mfp@temp} can contain
+% \cs{par}, indicating either EOF or a blank line, or something else.
+% In the first case (EOF) the macro terminates, in the second case (blank)
+% it calls itself again, in the third case it also terminates, having
+% presumably found real data.
+%
+% When this is called, a file should already be open (by
+% \cs{@processdatafile}) using the handle \cs{mfp@data}.
+%
+% The macro \cs{@XP} causes two macros after the next token to be
+% expanded, removing the two \cs{fi}\,s (and so avoiding deep nesting).
+% \begin{macrocode}
+\newdef\skipBlanksandComments{\skipcomments
+ \ifeof\mfp@data
+ \else\ifx\mfp@temp\mfp@par \@XP\skipBlanksandComments
+ \fi\fi}%
+% \end{macrocode}
+%
+% The following two commands, \cs{mfp@rwdata} and \cs{mfp@rwdataloop}
+% perform the work of writing the file (read stream \cs{mfp@data} opened
+% by \cs{@processdatafile}).
+%
+% The counter \cs{mfp@n} is used to keep track of how many lines of the
+% data file have been written to one line of the output. The token
+% \cs{sequence} in a \cs{using} specification will expand to the value of
+% the counter \cs{mfp@sequence}.
+%
+% When this first macro is called, a non-blank line has been read to the
+% macro \cs{mfp@temp}, to which we now add a space. The macro
+% \cs{mfp@buffer} is what will be written to the output file as soon as it
+% is long enough. We initialize it by defining it to be an open
+% parenthesis followed by the result of applying \cs{parse@data} to the
+% contents of \cs{mfp@temp}. Then we call \cs{mfp@rwdataloop}, which does
+% the actual reading and writing.
+% \begin{macrocode}
+ \def\mfp@rwdata{\mfp@n=1 \mfp@sequence=1
+ \def\sequence{\number\mfp@sequence}%
+ \edef\mfp@temp{\mfp@temp\space}%
+ \edef\mfp@buffer{(\@xp\parse@data\mfp@temp\mfp@delim}%
+ \mfp@rwdataloop}%
+% \end{macrocode}
+%
+% At this point, the buffer has been started with the first datum, so we
+% read another line. If that is blank, we write the buffer (and the closing
+% parenthesis and a semicolon) and terminate the loop. Otherwise we go
+% through a loop:
+% \begin{enumerate}
+% \item Increment the sequence counter,
+% \item add a comma to the buffer,
+% \item test whether the buffer is `full', and
+% \item add the datum to the buffer. If the buffer is full in step~3, it is
+% written to the output and cleared before going to step~4.
+% \end{enumerate}
+% \cs{mfp@rwdataloop} loops by calling itself at the end. Whenever
+% \cs{mfp@temp} is empty (comment line read), (1)--(4) are skipped and
+% another line read.
+% \begin{macrocode}
+ \def\mfp@rwdataloop{%
+ \read\mfp@data to \mfp@temp
+ \ifx\mfp@temp\mfp@par
+ \mfcmd{\mfp@buffer)}%
+ \else
+ \ifx\mfp@temp\@empty % comment line, read another
+ \else
+ \edef\mfp@temp{\mfp@temp\space}%
+ \advance\mfp@sequence1
+ \edef\mfp@buffer{\mfp@buffer\mfp@join}%
+ \ifnum\mfp@n<\mfpdataperline\relax
+ \advance\mfp@n1
+ \else
+ \mfsrc{\mfp@buffer}%
+ \mfp@n=1
+ \def\mfp@buffer{}%
+ \fi
+ \edef\mfp@buffer{\mfp@buffer
+ \@xp\parse@data\mfp@temp\mfp@delim}%
+ \fi
+ \@xp\mfp@rwdataloop
+ \fi}%
+% \end{macrocode}
+%
+%
+% \section{Various \CMF{} Settings.}\label{MFsettings}
+%
+% \DescribeMacro{\drawpen}
+% \DescribeMacro{\pen}
+% \DescribeMacro{\penwd}
+% Macros that write changes in default \grafbase{} variables now use the
+% construct ``\gbc{save x; <type> x; x := <value>;}'' (via a call to
+% \cs{setmfvariable}). This makes changes local if inside a given \env{mfpic}
+% environment, global if outside. An exception is \gbc{penwd} which, as an
+% internal variable uses `\gbc{interim}' instead (via the \grafbase{}
+% command \gbc{resizedrawpen}). Both \cs{drawpen} and \cs{pen} have been
+% used in the past, while \cs{penwd} is more consistent with other
+% commands, so we keep all three.
+% \begin{macrocode}
+\newdef\drawpen#1{\mfcmd{\@nl resizedrawpen (#1)}}%
+\newlet\pen=\drawpen \newlet\penwd=\drawpen
+% \end{macrocode}
+%
+% \DescribeMacro{\shadewd}
+% The \cs{shade} macro works in \MF{} by adding many copies of the small
+% picture \gbc{shadedot} to the figure, in \MP{} the parameters
+% \gbc{shadewd} and \cs{shadespace} are simply used to calculate a level
+% of gray and a color fill is used.
+%
+% \DescribeMacro{\polkadotwd}
+% However, both \MF{} and \MP{} handle polkadots the same. The only
+% difference is \MF's need for fitting to a pixel grid. But that is
+% handled in \grafbase.
+% \begin{macrocode}
+\newdef\shadewd#1{\setmfnumeric{shadewd}{#1}}%
+\newdef\polkadotwd#1{\setmfnumeric{polkadotwd}{#1}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\hatchwd}
+% The thickness of lines in the hatching fill.
+% \begin{macrocode}
+\newdef\hatchwd#1{\setmfnumeric{hatchwd}{#1}%
+ \setmfvariable{pen}{hatchpen}{pencircle scaled hatchwd}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\dashpattern}
+% A dash pattern consists (internal to \MF) of three arrays. The
+% \grafbase{} command \gbc{dashpat} accepts a name, and a sequence of
+% numbers representing the sizes of dashes and spaces, and builds these
+% arrays.
+% \begin{macrocode}
+\newdef\dashpattern#1#2{\mfcmd{save #1; dashpat (#1) (#2)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\settension}
+% This sets the default tension for \cs{curve} commands, as well as for
+% any command that takes an optional argument of the form
+% \oarg{s\meta{tens}}. This includes \cs{function}, \cs{plrfcn},
+% \cs{fcncurve}, \cs{datafile}, \cs{plotdata} and others. It also sets the
+% default tension for \cs{sclosed} and \cs{bclosed}. The value should be
+% at least $3/4$.
+% \begin{macrocode}
+\newdef\settension#1{\setmfnumeric{default_tension}{#1}}%
+% \end{macrocode}
+%
+%
+% \section{Settings for text label placement in
+% figures}\label{labelsettings}
+%
+% \cs{tlabel}\,s are `justified' by placing a particular point of the
+% text at the location specified. The \cs{tlabel} command accepts an
+% optional argument containing two letters. There are 4 possibilities
+% for the first and three for the second. It turns out to be easier to
+% process these if we have a command that converts these to numbers, and
+% then \cs{ifcase} can be used. There is a third part of the optional
+% argument usable only in \MP{}: a number indicating degrees of rotation.
+%
+% \DescribeMacro{\tlabeljustify}
+% The multi-part definition of \cs{tlabeljustify} is to guard
+% against confusing error messages if some part of this optional argument
+% is empty. The code assumes that if there are only 2, 1 or no parts, then
+% later parts should be left unchanged. The rotation part is empty by
+% default (rather than 0), because some commands will emit a warning if
+% a nonempty rotation exists without \opt{mlabels}.
+%
+% The result of \cs{tlabeljustify} is that \cs{tl@vpos} is set equal to
+% $-1$ if the first letter is (default) \texttt{B} (for Baseline), and
+% 0--2 if it is \texttt{b} (bottom), \texttt{c} (center) or \texttt{t}
+% (top). Similarly, \cs{tl@hpos} is set equal to $-1$ if the second
+% letter is (default) \texttt{l} (for left), and 0 or 1 if it is
+% \texttt{c} (center) or \texttt{r} (right).
+%
+% The rotation part is just saved in \cs{tlabel@rot}. This is now true
+% even without \opt{mplabels} in case it is turned on later. It is
+% ignored by \cs{tlabel} without \opt{mplabels}, but a warning is issued
+% here anyway.
+% \begin{macrocode}
+\newcount\tl@vpos \newcount\tl@hpos
+\tl@vpos=-1 \tl@hpos=-1
+\newdef\tlabel@rot{}%
+%
+\newdef\tlabeljustify#1{%
+ \mfp@ifempty{#1}{}{\mfp@justify#1\mfp@delim}}%
+\def\mfp@justify#1#2\mfp@delim{\mfp@local\mfp@vconv{#1}%
+ \mfp@ifempty{#2}{}{\@mfp@justify#2\mfp@delim}}%
+\newdef\@mfp@justify#1#2\mfp@delim{%
+ \mfp@local\mfp@hconv{#1}\mfp@local\edef\tlabel@rot{#2}
+ \@ifmplabels{}%
+ {\mfp@ifempty{#2}{}%
+ {\Mfpic@warn{Rotation of labels is not supported without the
+ mplabels\@msgbreak option. Rotation may be ignored\@online .}}}}%
+\newdef\mfp@vconv#1{%
+ \if B#1\tl@vpos=-1 \else
+ \if b#1\tl@vpos= 0 \else
+ \if c#1\tl@vpos= 1 \else
+ \if t#1\tl@vpos= 2 \else
+ \tl@vpos=-1 \mfp@justifyerror
+ \fi\fi\fi\fi}%
+\newdef\mfp@hconv#1{%
+ \if l#1\tl@hpos=-1 \else
+ \if c#1\tl@hpos= 0 \else
+ \if r#1\tl@hpos= 1 \else
+ \tl@hpos=-1 \mfp@justifyerror
+ \fi\fi\fi}%
+\newdef\mfp@justifyerror{%
+ \mfp@errmsg{Invalid justification parameter for text label.}%
+ {The optional argument for a text label must be^^J%
+ one of B, b, c or t^^J
+ followed by l or r or c,^^J%
+ followed by an angle (optionally).}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\tlpathjustify}
+% This acts just like \cs{tlabeljustify} from the user's point of view.
+% Since it is only for users, and not used internally, it merely defines
+% three macros that \cs{@@@tlpath} passes on to \cs{tlabeljustify} when no
+% justification parameter is present.
+% \begin{macrocode}
+\newdef\tlpathjustify#1{%
+ \mfp@ifempty{#1}{}{\tlp@justify#1\mfp@delim}}%
+\newdef\tlp@justify#1#2\mfp@delim{\mfp@def\tlpath@v{#1}%
+ \mfp@ifempty{#2}{}{\tlp@@justify#2\mfp@delim}}%
+\newdef\tlp@@justify#1#2\mfp@delim{%
+ \mfp@def\tlpath@h{#1}\mfp@def\tlpath@r{#2}}%
+\tlpathjustify{cc}%
+% \end{macrocode}
+%
+% \DescribeMacro{\tlabelsep}
+% \DescribeMacro{\tlabeloffset}
+% \cs{tlabelsep} takes an absolute length as its argument and sets
+% parameters that determine by how much a label is separated from the
+% point it is placed at. This is in case something is drawn at that point,
+% such as a dot or a hash mark on an axis.
+%
+% \cs{tlabeloffset}, on the other hand, takes a pair of dimensions,
+% representing offsets. This is mainly so that, if labels seem to be off,
+% they can all be shifted with one command.
+%
+% Both these values are written to the \MF{} file for the sake of the
+% commands that draw rectangles or ovals around labels.
+% \begin{macrocode}
+\newdef\tlabelsep#1{\mfp@local\tlabel@sep=#1\relax
+ \setmfnumeric{label_sep}{\the\tlabel@sep}}%
+\newdef\tlabeloffset#1#2{%
+ \mfp@local\tlabel@hadj=#1\relax \mfp@local\tlabel@vadj=#2\relax
+ \setmfvariable{pair}{label_adjust}%
+ {(\the\tlabel@hadj,\the\tlabel@vadj)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\everytlabel}
+% Every line of a multiline label is written inside a group, so
+% adjustments to baselineskip and other things are difficult or impossible.
+% Therefore, \cs{everytlabel} is provided to define tokens to be inserted
+% before the label code, outside these groups. It is not itself a token
+% variable, so that that it can write the tokens to the \MP{} file once,
+% instead of at every label.
+% \begin{macrocode}
+\newdef\everytlabel{\afterassignment\@everytlabel
+ \mfp@local\every@tlabel}%
+\newdef\@everytlabel{%
+ \mfp@ifmpost
+ {\@ifmfpfileisopen
+ {\mfcmd{verbatimtex\@nl
+ \def\noexpand\everylabel{\the\every@tlabel} etex}}%
+ {}}%
+ {}}%
+% \end{macrocode}
+%
+%
+% \section{Other settings}\label{othersettings}
+%
+% \DescribeMacro{\headshape}
+% This sets the arrowhead shape. The parameters are: the ratio of width
+% to length, the tension (see \file{grafbase.dtx}) and a boolean
+% (\gbc{true} or \gbc{false}) to say whether the the head is filled, or
+% only the barbs are drawn. (In retrospect, it would have been more
+% consistent with other commands to have one \TeX{} parameter with commas
+% separating the components.)
+% \begin{macrocode}
+\newdef\headshape#1#2#3{\mfcmd{\@nl headshape (#1, #2, #3)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\mfpdefinecolor}
+% \prog{Mfpic} supports color under \MP{} by writing all color
+% definitions to the output \file{.mp} file. In order to support a
+% \LaTeX-like color syntax, all the color models allowed by the color
+% package correspond to a \grafbase{} function that returns a \MP{}
+% color value. For example, \gbc{cmyk(.3,.3,0,.7)} returns \gbc{(0,0,.3)},
+% a very dark blue. This can be set by
+% \cs{mfpdefinecolor}\marg{vdblue}\marg{cmyk}\marg{.3,.3,0,.7}.
+%
+% \DescribeMacro{\fillcolor}
+% \DescribeMacro{\drawcolor}
+% \DescribeMacro{\headcolor}
+% \DescribeMacro{\hatchcolor}
+% \DescribeMacro{\pointcolor}
+% \DescribeMacro{\tlabelcolor}
+% \DescribeMacro{\backgroundcolor}
+% To support the syntax
+% \cs{fillcolor}\oarg{\meta{model}}\marg{\meta{parameters}}, we just
+% call \cs{@mfpcolor} with the \grafbase{} color variable name
+% \gbc{fillcolor}.
+% \begin{macrocode}
+\newdef\mfpdefinecolor#1#2#3{\setmfcolor{#1}{#2(#3)}}%
+\newdef\fillcolor{\@mfpcolor{fillcolor}}%
+\newdef\drawcolor{\@mfpcolor{drawcolor}}%
+\newdef\headcolor{\@mfpcolor{headcolor}}%
+\newdef\hatchcolor{\@mfpcolor{hatchcolor}}%
+\newdef\pointcolor{\@mfpcolor{pointcolor}}%
+\newdef\tlabelcolor{\@mfpcolor{tlabelcolor}}%
+\newdef\backgroundcolor{\@mfpcolor{background}}%
+\newdef\@mfpcolor#1{%
+ \mfp@ifnextchar[{\mfp@color{#1}}{\setmfcolor{#1}}}%
+\newdef\mfp@color#1[#2]#3{\setmfcolor{#1}{#2(#3)}}%
+% \end{macrocode}
+%
+% When \cs{plotdata} is used to draw several graphs from one file, each
+% sequence of non-blank lines corresponds to a different curve with a
+% different style of rendering. The user has the option to cycle through
+% different dashing patterns, different colors, or different symbols.
+%
+% Internally, \cs{plotdata} issues the command \cs{mfp@setstyle} (which
+% can be defined to be any rendering macro), followed by a path defining
+% command such as \cs{curve} or \cs{polyline}, followed by a command
+% that reads the data and writes it in a suitable format. The following
+% commands essentially allow the user to select the rendering macro.
+% They start by resetting \cs{mfp@linetype}, the count register that keeps
+% track of how many curves have been drawn, then they define
+% \cs{mfp@setstyle}.
+%
+% \DescribeMacro{\dashedlines}
+% \cs{dashedlines} uses the rendering prefix \cs{gendashed} with 6
+% different dashing patterns \gbc{dashtype0} through \gbc{dashtype5}.
+% These are actually selected in \MF{} through the command
+% \gbc{getdashpat}. This takes care of cycling back to
+% \gbc{dashtype0} when the number of available dash patterns is exceeded.
+% Dashed lines is the default.
+% \begin{macrocode}
+\newdef\dashedlines{\mfp@local\mfp@linetype0
+ \mfp@def\mfp@setstyle{\gendashed{getdashpat\number\mfp@linetype}}}%
+\dashedlines
+% \end{macrocode}
+%
+% \DescribeMacro{\coloredlines}
+% This uses \cs{draw} with an optional color parameter set
+% to \gbc{colortype0} through (by default) \gbc{colortype 7}. These are
+% color variables defined by \grafbase{}. It also issues a warning if
+% \MF{} is being used. As with \cs{dashedlines}, a \MP{} command
+% \gbc{getcolor} selects these colors.
+% \begin{macrocode}
+\newdef\coloredlines{%
+ \mfp@ifmpost
+ {\mfp@local\mfp@linetype0
+ \mfp@def\mfp@setstyle{\draw [getcolor\number\mfp@linetype]}}%
+ {\Mfpic@warn{You can't use \string\coloredlines\space in
+ Metafont.\@msgbreak Using \dashedlines instead}%
+ \dashedlines}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\pointedlines}
+% This makes a sort of dotted line, except the dots are actually different
+% symbols. It uses the rendering macro \cs{plot} with a parameter cycling
+% through 9 different symbols.
+% \begin{macrocode}
+\newdef\pointedlines{\mfp@local\mfp@linetype0
+ \mfp@def\mfp@setstyle{\plot{getsymbol\number\mfp@linetype}}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\datapointsonly}
+% \cs{datapointsonly} uses symbols like \cs{pointedlines}, but places
+% them only at the data points from the file. It uses the rendering macro
+% \cs{plotnodes} with a parameter cycling through the same 9 symbols.
+% \begin{macrocode}
+\newdef\datapointsonly{\mfp@local\mfp@linetype0
+ \mfp@def\mfp@setstyle{\relax
+ \plotnodes{getsymbol \number\mfp@linetype}}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\reconfigureplot}
+% This command allows the user to set the dashes, colors and symbols used
+% by the \cs{plotdata} command. The first argument is the plotting method
+% to be changed (\texttt{dashes}, \texttt{colors}, or \texttt{symbols})
+% and the second argument is a comma separated list of appropriate type
+% variables for \cs{plotdata} to cycle through. For example,
+% \cs{reconfigureplot}\marg{dashes} takes a list of dashing patterns
+% (previously defined by the \cs{dashpattern} command) separated by
+% commas. It writes a command instructing \MF{} to redefine the arrays
+% \mfc{dashtype0}, \mfc{dashtype1}, etc., used with \cs{gendashed} when
+% \cs{dashedlines} is in effect. The number of patterns is counted by \MF,
+% which also handles the mod-ing operation now.
+%
+% \cs{reconfigureplot}\marg{colors} takes a list of colors (expressions or
+% color names previously defined) separated by commas. It redefines
+% \gbc{colortype0}, etc., used with \cs{plotdata} when \cs{coloredlines}
+% is in effect.
+%
+% \cs{reconfigureplot}\marg{symbols} takes a list of symbols (\MF{} path
+% expressions, one of the symbols available to \cs{plotsymbol}, or path
+% names defined by \cs{store}) separated by commas. It redefines
+% \gbc{pointtype0}, etc., used by \cs{plotdata} when \cs{pointedlines} or
+% \cs{datapointsonly} is in effect.
+%
+% \DescribeMacro{\defaultplot}
+% This restores \mfpic's predefined defaults for dash patterns, colors and
+% symbols in \cs{plotdata}. The one argument is one of the words
+% \texttt{dashes}, \texttt{colors}, or \texttt{symbols}, indicating which
+% plotting method is to be restored.
+% \begin{macrocode}
+\newdef\reconfigureplot#1{\mfsrc{setdata#1}\mfp@writedata}%
+\newdef\defaultplot#1{\mfcmd{default#1}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\mfplinetype}
+% \DescribeMacro{\mfplinestyle}
+% The user-level commands \cs{mfplinetype} and \cs{mfplinestyle} allow the
+% user to set the starting value of \cs{mfp@linetype}. The default is to
+% start at $0$. The names ``linestyle'' and ``linetype'' come from
+% an analogous system of changing rendering in \prog{gnuplot}.
+% \begin{macrocode}
+\newdef\mfplinetype#1{\mfp@local\mfp@linetype=#1}%
+\newlet\mfplinestyle\mfplinetype
+\mfplinetype{0}%
+% \end{macrocode}
+%
+% \prog{Mfpic} has 6 possible axes, the x- and y-axes pass through the
+% origin, $(0,0)$, the four border axes are at the edges of the graph
+% space, possibly offset from it by some amount. These four commands hold
+% the amount of that offset in graph units, the default being 0.
+% \begin{macrocode}
+\newdef\mfp@lshift{0}%
+\newdef\mfp@bshift{0}%
+\newdef\mfp@rshift{0}%
+\newdef\mfp@tshift{0}%
+% \end{macrocode}
+%
+% \DescribeMacro{\axismargin}
+% \DescribeMacro{\setaxismargins}
+% \DescribeMacro{\setallaxismargins}
+% These are the user-level command for setting the above offsets. The
+% first argument to \cs{axismargin} is one of the letters l, b, r, or t to
+% select the axis and the second is the offset in graph units. A positive
+% offset represents an inward shift, which is why we call them
+% \emph{margins}. The arguments of \cs{setaxismargins} are four offsets
+% for the axes (in the above order, which is anticlockwise, starting
+% with the left). \cs{setallaxismargins} takes one offset and applies it
+% to all axes.
+%
+% The values are passed on to \MF{} in the variables \gbc{laxis},
+% \gbc{baxis}, \gbc{raxis}, and \gbc{taxis}. They are also needed by the
+% \cs{axislabels} command so they are saved in macros.
+% \begin{macrocode}
+\newdef\axismargin#1#2{\setmfnumeric{#1axis}{#2}%
+ \mfp@local\@namedef{mfp@#1shift}{#2}}%
+\newdef\setaxismargins#1#2#3#4{\axismargin l{#1}\axismargin b{#2}%
+ \axismargin r{#3}\axismargin t{#4}}%
+\newdef\setallaxismargins#1{\setaxismargins{#1}{#1}{#1}{#1}}%
+% \end{macrocode}
+%
+% The following converts axis letters to a numeric, making conditionals for
+% axes simpler to code (\cs{ifcase} versus the six nested \cs{if}\,s we
+% see here.) Plus we get to define the error message only once. The
+% first argument is the letter and the second argument is the calling
+% command (for the error message).
+% \begin{macrocode}
+\newcount\mfp@axisnum
+\def\get@axisnum#1#2{%
+ \if x#1\relax \mfp@axisnum0
+ \else\if y#1\relax \mfp@axisnum1
+ \else\if l#1\relax \mfp@axisnum2
+ \else\if b#1\relax \mfp@axisnum3
+ \else\if r#1\relax \mfp@axisnum4
+ \else\if t#1\relax \mfp@axisnum5
+ \else
+ \mfp@errmsg {Invalid axis letter "#1".}%
+ {The command #2 requires an axis to be designated by one of^^J%
+ the following letters: x, y, l, b, r, or t. If you proceed, ^^J%
+ x will be assumed.}%
+ \fi\fi\fi\fi\fi\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\setaxismarks}
+% \DescribeMacro{\setxmarks}
+% \DescribeMacro{\setymarks}
+% \DescribeMacro{\setbordermarks}
+% \DescribeMacro{\setallbordermarks}
+% The tick marks (or hash marks) on the axes can be in three possible
+% positions: centered on the axes, all on one side, or all on the other
+% side. The default for the x- and y-axes is centered, for the border axes
+% it is inside. For changing this we provide the \cs{setaxismarks} command,
+% whose first argument is the axis letter, and whose second argument is
+% one of the words \texttt{inside}, \texttt{outside}, \texttt{centered},
+% \texttt{ontop}, \texttt{onbottom}, \texttt{onleft}, or \texttt{onright}.
+% \begin{macrocode}
+\newdef\setaxismarks#1#2{\setmfnumeric{#1tick}{#2}}%
+\newdef\setxmarks#1{\setaxismarks x{#1}}%
+\newdef\setymarks#1{\setaxismarks y{#1}}%
+\newdef\setbordermarks#1#2#3#4{\setaxismarks l{#1}\setaxismarks b{#2}%
+ \setaxismarks r{#3}\setaxismarks t{#4}}%
+\newdef\setallbordermarks#1{\setbordermarks{#1}{#1}{#1}{#1}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\smoothdata}
+% \DescribeMacro{\unsmoothdata}
+% The \cs{datafile} and \cs{plotdata} commands originally just created
+% polygonal paths, but users requested the ability to draw smooth ones.
+% Originally only the commands below (\cs{smoothdata} and
+% \cs{unsmoothdata}) were written to do this. Later, these file
+% manipulation commands were given optional arguments to achieve the same
+% effect, so now the commands below just set the defaults for the optional
+% parameter, storing them in the macros \cs{mfp@smoothness} and
+% \cs{mfp@tension}. The latter can be used to adjust the tension of the
+% \MF{} path if smoothness is `s'. Default tension is now empty rather
+% than 1 so we can implement a scheme to change the actual default used.
+% \begin{macrocode}
+\newdef\smoothdata{\null@opt\@smoothdata}%
+\newdef\@smoothdata[#1]{\mfp@def\mfp@smoothness{s}%
+ \mfp@def\mfp@tension{#1}}%
+\newdef\unsmoothdata{\mfp@def\mfp@smoothness{p}%
+ \mfp@def\mfp@tension{}}%
+\unsmoothdata% default
+% \end{macrocode}
+%
+% \DescribeMacro{\using}
+% \DescribeMacro{\usingpairdefault}
+% \DescribeMacro{\usingnumericdefault}
+% These commands control how we interpret data in a file.
+% The command \cs{using} is named after a keyword in \prog{gnuplot}. It
+% controls which datum is plotted against which by \cs{plotdata} and
+% \cs{datafile}. The default is to read the first two space separated
+% words on a line as the x- and y-coordinate of a point. To allow that
+% there might be more data on a line, it is also assumed that the second
+% word is followed by a space and the rest of the line is read as a third
+% parameter that is not used. In case there are only two words,
+% \mfpic{} will always add a space on the end and then the third
+% parameter will be empty.
+%
+% The \cs{parse@data} command reads its argument as delimited
+% parameters, and the \cs{using} command tells what those delimiters are.
+% For example, in the first part of
+% \cs{using}\marg{\#1 \#2 \#3}\marg{(\#1,\#2)}, we are telling
+% \cs{parse@data} that everything on a line up to the first space is the
+% first parameter, and everything up to the second space is the second
+% parameter and the rest of the line is the third parameter. In the second
+% part we are telling it that what we write to the output is a pair in
+% parentheses with the first two parameters separated by a comma. This
+% example is the default as we see here in \cs{usingpairdefault}. This
+% command can be issued by a user to return to that default. The user can
+% also issue \cs{usingnumericdefault} to write the first space separated
+% word as a single numeric. This is for commands like \cs{piechart}.
+%
+% \DescribeMacro{\mfpdataperline}
+% \cs{mfpdataperline} is a user level macro that controls the maximum
+% number of points that will be written to a single line in the output.
+% \begin{macrocode}
+\newdef\using#1#2{\mfp@def\parse@data#1\mfp@delim{#2}}%
+\newdef\usingpairdefault{\using{##1 ##2 ##3}{(##1,##2)}}%
+\newdef\usingnumericdefault{\using{##1 ##2}{##1}}%
+\usingpairdefault
+\newdef\mfpdataperline{5}%
+% \end{macrocode}
+%
+% The following macros are used internally by \cs{datafile} and \cs{plotdata}.
+% A comment line is read by \TeX{} as empty so we need an empty macro to
+% test against, and a blank line is read as \cs{par} (not the primitive
+% \cs{par}, but the literal token \cs{par}, so it tests as equal to
+% \cs{mfp@par}. Early versions of \cs{plotdata} wrote a literal \MF{} path
+% expression to the output file and \cs{mfp@join} created the \mfc{--}
+% between points. Now we write one of the \grafbase{} list-to-path
+% commands followed by a comma separated list of points, so \cs{mfp@join}
+% has morphed into a comma.
+% \begin{macrocode}
+\newdef\mfp@par{\par}%
+\newdef\mfp@join{,}%
+% \end{macrocode}
+%
+% \DescribeMacro{\makepercentother}
+% \DescribeMacro{\makepercentcomment}
+% \DescribeMacro{\mfpdatacomment}
+% The user can change the comment character for data files with
+% something like \cs{mfpdatacomment}\marg{\cs{\#}}. This also changes the
+% percent character to category `other'. We can also use the percent sign
+% as part of the numeric data by sandwiching the \cs{using} command
+% between \cs{makepercentother} and \cs{makepercentcomment}. Every file
+% reading command issues \cs{mfp@setcomment} before reading. The count
+% register \cs{@datacomment} hold the ASCII code of the current comment
+% character, the default being the percent sign.
+% \begin{macrocode}
+\newcount\@datacommentchar \@datacommentchar`\%
+\newdef\makepercentother{\@makeother\%}%
+\newdef\makepercentcomment{\catcode`\%=14 }%
+\newdef\mfpdatacomment#1{\mfp@local\@datacommentchar`#1}%
+\newdef\mfp@setcomment{\makepercentother\catcode\@datacommentchar14 }%
+% \end{macrocode}
+%
+% \DescribeMacro{\fdef}
+% The following is for defining functions to be used in \cs{function}
+% through \cs{plrregion}. The first argument is the name of the function,
+% the second is its variable, the last is the \MF{} code. Obviously its
+% use requires a knowledge of the \MF{} language. The function produced is
+% a \mfc{vardef}, and can contain almost arbitrary \MF{} code, but must
+% end with an expression. Normally it must be a numerical expression, to
+% be use in \cs{function}, or a pair expression so it can be used alone in
+% the last argument of \cs{parafcn}.
+%
+% We apply \cs{@makeother} to \texttt{\#} so it doesn't get doubled. The
+% \texttt{\#} is frequent in vardefs among the \MF{} gurus.
+% \begin{macrocode}
+\newdef\fdef{\begingroup\@makeother\#\preservelines\@fdef}%
+\newdef\@fdef#1#2#3{\mfcmd{\@nl save #1;\@nl
+ vardef #1 (expr #2) = \@nl #3\@nl enddef}\endgroup}%
+% \end{macrocode}
+%
+% The following is executed last inside \cs{@mfpic@graf@macs}. It is a
+% hook for adding new definitions. It is initialized to empty, and add-on
+% packages can add to it.
+% \begin{macrocode}
+\newdef\mfp@additions{}%
+% \end{macrocode}
+%
+%
+% \section{The main graphics macros}\label{main}
+%
+% In order to avoid redefining commands of other packages and in order
+% to avoid having other packages redefine \mfpic{} commands, all mfpic
+% commands that cannot be used outside the \env{mfpic} environment are
+% defined anew with every such environment. This is accomplished by having
+% the \cs{mfpic} command execute \cs{@mfpic@graf@macs}, which expands to
+% all those definitions. Grouping localizes the definitions, so outside
+% \env{mfpic} environments, these commands revert to being undefined, or
+% to there original definitions if they had any. As might be expected it
+% is quite long, over 300 lines of code at last count.
+% \begin{macrocode}
+\newdef\@mfpic@graf@macs{%
+% \end{macrocode}
+%
+% \subsection{Plotting data from files}\label{datafiles}
+%
+% \DescribeMacro{\plotdata}
+% Most of the \mfpic{} graphic commands take optional arguments. Most of
+% them follow the scheme below: \cs{@plotdata} takes a mandatory argument
+% enclosed in brackets, and does the work. \cs{plotdata} is simply defined
+% to test for an optional argument and pass it or a default to
+% \cs{@plotdata}. In this case, the default option is signaled by
+% passing empty brackets via \cs{null@opt}.
+%
+% \cs{@plotdata} follows the scheme of most of the data file processing
+% commands: it calls \cs{@processdatafile} with the name of the file (the
+% second parameter of \cs{@plotdata}) and another command, \cs{mfp@doplots},
+% which really does the work. The argument of \cs{mfp@doplots} is the
+% original optional parameter of \cs{plotdata}. This optional parameter is
+% the smoothness, which may be \oarg{s\meta{tension}} for a smooth path
+% or \oarg{p} for a polygonal path, or empty to select whatever default
+% was created by \cs{smoothdata}.
+% \begin{macrocode}
+ \newdef\plotdata{\null@opt\@plotdata}%
+ \newdef\@plotdata[##1]##2{\@processdatafile{##2}{\mfp@doplots{##1}}}%
+% \end{macrocode}
+%
+% \cs{mfp@doplots} is a self-looping macro. It issues the rendering
+% prefix (in \cs{mfp@setstyle}), increments the linetype, and writes the
+% path expression defined by the first set of data in the file (via
+% \cs{do@datafile}, which \emph{really} does the work and which stops at a
+% blank line). That part, when prefixed by \cs{@figmacstart}, functions
+% as a \cs{@figmac}. When finished with one figure, \cs{@if@enddata}
+% checks if there is another set of data in the file. If so,
+% \cs{mfp@doplots} calls itself again.
+%
+% The argument is the smoothness parameter(s), which it merely passes on.
+% There is no filename argument: since \cs{@processdatafile} has already
+% opened the input stream \cs{mfp@data} and subsequent macros will read
+% from it.
+% \begin{macrocode}
+ \def\mfp@doplots##1{\mfp@setstyle
+ \advance\mfp@linetype1 \@figmacstart
+ \do@datafile{##1}%
+ \@if@enddata{}{\mfp@doplots{##1}}}%
+% \end{macrocode}
+%
+% When two blank lines occur in succession, \cs{plotdata} is suppose to
+% stop. \cs{@ifenddata} is called when \cs{do@datafile} ends (one blank
+% line was found), it checks for another blank line (or end-of-file)
+% and, if it finds one, selects the first of the two alternatives that
+% follow.
+% \begin{macrocode}
+ \newdef\@if@enddata{% check for another blank line
+ \ifeof\mfp@data \@xp\@firstoftwo
+ \else
+ \skipcomments
+ \ifx\mfp@temp\mfp@par \@XP\@firstoftwo
+ \else \@XP\@secondoftwo
+ \fi
+ \fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\datafile}
+% \cs{datafile} defines a path connecting the points in a datafile. The
+% optional parameter is the smoothness, as in \cs{plotdata}. The other
+% parameter is the filename. \cs{@datafile} does the figure macro stuff,
+% opens the data file, and calls \cs{do@datafile} which does all the work.
+% \begin{macrocode}
+ \newdef\datafile{\null@opt\@datafile}%
+ \newdef\@datafile[##1]##2{\@figmacstart
+ \@processdatafile{##2}{\do@datafile{##1}}}%
+% \end{macrocode}
+%
+% I lied. Actually all \cs{do@datafile} does is handle any empty
+% optional parameter and call \cs{@do@datafile} to do the work.
+% \begin{macrocode}
+ \newdef\do@datafile##1{%
+ \do@mtparam{##1}{\mfp@smoothness\mfp@tension}\@do@datafile}%
+% \end{macrocode}
+%
+% And \cs{@do@datafile} is mainly just a wrapper, processing the optional
+% parameter (passed by either \cs{plotdata} or \cs{datafile}) which
+% selects what figure making code should be written. For
+% \oarg{s\meta{tension}} a \gbc{curve} command is used. For \oarg{p}, a
+% \gbc{polyline}. (The `\cs{mf@F}' means the curve is not closed).
+%
+% After that, \cs{mfp@rwdata} is called, which reads and writes the
+% data.
+% \begin{macrocode}
+ \newdef\@do@datafile[##1##2]{%
+ \mfsrc{%
+ \if s##1 \mfp@ifempty{##2}{curve }{tcurve (##2) }%
+ \else polyline
+ \fi (\mf@F)}\mfp@rwdata}%
+% \end{macrocode}
+%
+% \subsection{The prefix commands}\label{prefixcommands}
+%
+% \subsubsection{Storing and reusing a figure}\label{storing}
+%
+% \DescribeMacro{\store}
+% This stores an \mfpic{} path in a \MF{} path variable. The argument is
+% the variable name. It should be followed by an \mfpic{} figure macro
+% (such as \cs{rect}\marg{...}). The stored path can be reused via the
+% \cs{mfobj} command. This command is written as a \cs{@rendmac} even
+% though it does no rendering. This is so (1)~it will turn off implicit
+% rendering (any rendering must be explicitly written) and (2) it can be
+% placed anywhere within the prefix area. This is new behavior with
+% version 0.7. Prior to this it was required to place the path to be
+% stored as a second argument. Though that argument could contain other
+% prefixes in addition to the path, it was required that no other prefixes
+% precede \cs{store}. Note that \cs{store} takes a second argument but
+% it merely puts it back. This is so that the old syntax (with the figure
+% macro in braces) will continue to work.
+% \begin{macrocode}
+ \newdef\store##1##2{\@rendmac{stored (##1)}##2}%
+% \end{macrocode}
+%
+% \DescribeMacro{\mfobj}
+% \DescribeMacro{\mpobj}
+% This is the interface to use a \cs{store}-d object.
+% \cs{mfobj}\marg{\meta{name}} is a figure macro, and should act pretty
+% much exactly the same as if the figure macro that had been stored in the
+% variable were typed in its place. Its one argument, the variable name,
+% is read by \cs{@figmac}, which operates as described previously, either
+% implicitly rendering the path, or allowing it to be picked up by
+% preceding prefix macros.
+% \begin{macrocode}
+ \newlet\mfobj\@figmac
+ \newlet\mpobj\@figmac
+% \end{macrocode}
+%
+% \subsubsection{Subpaths}
+%
+% \DescribeMacro{\cutoffbefore}
+% This macro take one mandatory argument which is an object stored with
+% \cs{store}. It modifies the path it is prefixed to so that it starts
+% at its first point of intersection with the object, cutting off any
+% earlier part of the path.
+%
+% \DescribeMacro{\cutoffafter}
+% This is similar, except the modified path ends at the last point of
+% intersection between the following path and the object, cutting off
+% any later part of the path. It is internally the same as applying
+% \cs{cutoffbefore} to the reversed path and reversing the result.
+%
+% \DescribeMacro{\trimpath}
+% This trims off the specified amounts from the start and end of the
+% path. The amounts are two absolute dimensions, separated by commas.
+% They may be \TeX{} dimensions. If the first dimension is absent, it is
+% set to \texttt{0pt}, if the second is absent, it is set equal to the
+% first. (So if both are absent, nothing is trimmed.)
+% \begin{macrocode}
+ \newdef\cutoffafter##1{\@closmac{cutoffafter (##1)}}%
+ \newdef\cutoffbefore##1{\@closmac{cutoffbefore (##1)}}%
+ \newdef\trimpath##1{\@getdimens##1,,\mfp@delim
+ \@closmac{trimmedpath (\the\mfp@scratch, \the\mfp@scratchB)}}%
+ \newdef\@getdimens##1,##2,##3\mfp@delim{%
+ \mfp@scratch \@ifmtsub{##1}{\z@}\relax
+ \mfp@scratchB\@ifmtsub{##2}{\mfp@scratch}\relax}%
+% \end{macrocode}
+%
+% \DescribeMacro{\partpath}
+% \DescribeMacro{\subpath}
+% These produce a subpath of the following path. Each takes a mandatory
+% parameter containing two numbers separated by a comma. In
+% \cs{partpath}, these should be between 0 and 1 and produce a fraction
+% of the following path. In \cs{subpath}, these are absolute numbers between
+% 0 and the number of segments in the path, and it produces the equivalent of
+% \MF's \mfc{subpath} primitive.
+% \begin{macrocode}
+ \newdef\partpath##1{\@closmac{partialpath (##1)}}%
+ \newdef\subpath##1{\@closmac{gsubpath (##1)}}%
+% \end{macrocode}
+%
+% \subsubsection{Drawing a curve}\label{drawing}
+%
+% These are rendering macros that draw the curve in some fashion: solid,
+% dashed, colored, etc.
+%
+% \DescribeMacro{\draw}
+% \cs{draw} is the initial definition of \cs{@render}. It takes one
+% optional argument, a color. In \MF{}, where color are just numerics, if
+% it is ${}\ge 1$ (representing white) the path is subtracted from the
+% picture, otherwise it is drawn in black.
+%
+% \begin{macrocode}
+ \newdef\draw{\null@opt\@draw}%
+ \newdef\@draw[##1]{%
+ \@rendmac{\mfp@ifempty{##1}{drawn}{colordrawn (##1)}}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\dashed}
+% \cs{dashed} (as well as \cs{dotted}) takes one optional argument,
+% which should contain the length of the dashes (diameter of dots) and
+% the length of the spaces between, separated by a comma. The defaults
+% can be seen in the code below.
+% \begin{macrocode}
+ \newdef\dashed{\simple@opt\@dashed{\the\dashlen,\the\dashspace}}%
+ \newdef\@dashed##1{\@rendmac{DASHED (##1)}}%
+ \newdef\dotted{\simple@opt\@dotted{\the\dotsize,\the\dotspace}}%
+ \newdef\@dotted##1{\@rendmac{dotted (##1)}}%
+% \end{macrocode}
+%
+% \cs{gendashed} takes one mandatory argument, the name of a dash pattern
+% previously defined by \cs{dashpattern}
+% \begin{macrocode}
+ \newdef\gendashed##1{\@rendmac{gendashed (##1)}}%
+% \end{macrocode}
+%
+% \cs{plot} is like \cs{dotted}, except the dots are variously shaped
+% symbols. It takes one optional argument containing the size of the
+% symbol and the spacing, separated by a comma, and one mandatory
+% argument, the name of the symbol. This can in principal be any
+% expression of type \mfc{picture} or \mfc{path}. (In \MP, type
+% \mfc{string} is also permitted). For the size parameter to work
+% correctly, the symbol should be a path, and it should have 1 as it's
+% natural size. \Mfpic{} provides the predefined paths
+% \texttt{Triangle}, \texttt{Square}, \texttt{Circle}, \texttt{Star},
+% \texttt{Diamond}, \texttt{Plus}, \texttt{Cross} and \texttt{Asterisk}.
+% The first 5 have filled-in versions: \texttt{SolidTriangle}, etc.
+% \begin{macrocode}
+ \newdef\plot{\simple@opt\@plot{\the\pointsize, \the\symbolspace}}%
+ \newdef\@plot##1##2{\@rendmac{doplot (##2, ##1)}}%
+% \end{macrocode}
+%
+% Sometimes, rather than equally spaced dots or symbols, we would rather
+% have a symbol at each `node' of the following path. If the path is
+% created by a list macro, then usually each point in the list is a node
+% (but the spline paths are exceptions). For other figures, the nodes
+% can seem pretty random. For example, a \cs{circle} command without optional
+% argument produces a curve with 8 equally spaced nodes, but with optional
+% argument the nodes depend on how it is drawn and the size of any angle
+% parameter.
+%
+% \cs{plotnodes} has almost the same syntax as \cs{plot}, but since it
+% places the symbols only at the nodes of the path, there is no spacing
+% parameter in the optional argument.
+% \begin{macrocode}
+ \newdef\plotnodes{\simple@opt\@plotnodes{\the\pointsize}}%
+ \newdef\@plotnodes##1##2{\@rendmac{plotnodes (##2, ##1)}}%
+% \end{macrocode}
+%
+% \subsubsection{Closing a curve}\label{closing}
+%
+% \DescribeMacro{\sclosed}
+% \DescribeMacro{\bclosed}
+% \DescribeMacro{\lclosed}
+% \DescribeMacro{\cbclosed}
+% \DescribeMacro{\qbclosed}
+% \DescribeMacro{\uclosed}
+% These close a path defined by whatever figure macro follows it. The
+% first closes smoothly in the same manner that \cs{curve} creates a
+% smooth path, the second uses an ordinary \MF{} B\'ezier. These two have
+% an optional argument: the amount of tension to put in the connecting
+% link. Higher tension produces a linking segment with sharper turns near
+% the endpoints and a flatter path in between. This makes no sense with
+% \cs{lclosed}, \cs{qbclosed} or \cs{cbclosed}. The first always draws a
+% straight line and the other two requires a link explicitly determined by
+% the beginning and ending segments of the path: a cubic B-spline for
+% \cs{cbclosed} and a quadratic B-spline for \cs{qbclosed}. See
+% \cs{closedcspline} and \cs{closedqspline} described later.
+%
+% Due to a misunderstanding on my part, \cs{uclosed} was defined in a more
+% complicated manner than necessary, and actually produced exactly the
+% same path as \cs{bclosed}. So now they are just made to be equal.
+% \begin{macrocode}
+ \newdef\@closed##1##2{%
+ \@closmac{##1closed\mfp@ifempty{##2}{}{t (##2)}}}%
+ \newdef\bclosed{\null@opt\@bclosed}%
+ \newdef\@bclosed[##1]{\@closed b{##1}}%
+ \newdef\sclosed{\null@opt\@sclosed}%
+ \newdef\@sclosed[##1]{\@closed s{##1}}%
+ \newdef\lclosed{\@closed l{}}%
+ \newdef\cbclosed{\@closed{cb}{}}%
+ \newdef\qbclosed{\@closed{qb}{}}%
+ \newlet\uclosed\bclosed
+% \end{macrocode}
+%
+% \subsubsection{Filling a closed curve}\label{filling}
+%
+% The next few prefix macros fill the interior of the closed path that
+% follows with some sort of pattern. The path must be either already
+% closed (like that produced by \cs{rect} or \cs{circle}) or explicitly
+% closed with a closing prefix. A non-closed path will simply be drawn
+% with a solid line.
+%
+% \DescribeMacro{\tess}
+% \cs{tess} takes one mandatory argument, the name of a previously defined
+% tile, and fills with shifted copies of the tile.
+% \begin{macrocode}
+ \newdef\tess##1{\@rendmac{tess (##1)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\shade}
+% \DescribeMacro{\polkadot}
+% \cs{shade} and \cs{polkadot} take one optional parameter, the separation
+% between dots, defaulting to \cs{shadespace} (resp., \cs{polkadotspace}).
+% The size of the dots is set by issuing the command \cs{shadewd} (resp.,
+% \cs{polkadotwd}).
+% \begin{macrocode}
+ \newdef\shade{\simple@opt\@shade{\the\shadespace}}%
+ \newdef\@shade##1{\@rendmac{shade (##1)}}%
+ \newdef\polkadot{\simple@opt\@polkadot{\the\polkadotspace}}%
+ \newdef\@polkadot##1{\@rendmac{polkadot (##1)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\thatch}
+% \DescribeMacro{\lhatch}
+% \DescribeMacro{\rhatch}
+% \DescribeMacro{\xhatch}
+% The hatching macros mostly take two optional parameters, the
+% separation of the hatching lines (default \cs{hatchspace}) and their
+% color. One slight exception is \cs{thatch}, which is called by all the
+% others. Its first optional argument is the separation \emph{and} the
+% angle (default $0$) of the lines, separated by a comma. The other
+% hatching macros have a fixed angle. \cs{lhatch} has lines at a $-45$
+% degree angle (upper left to lower right), \cs{rhatch} produces the opposite
+% diagonal, and \cs{xhatch} does both sets of lines (cross hatching).
+% \begin{macrocode}
+ \newdef\thatch{\simple@opt\@thatch{\the\hatchspace,0}}%
+ \newdef\@thatch##1{\null@opt{\@@thatch{##1}}}%
+ \newdef\@@thatch##1[##2]{\@rendmac{%
+ \mfp@ifempty{##2}{thatch}{colorthatch (##2)} (##1)}}%
+ \newdef\lhatch{\simple@opt\@lhatch{\the\hatchspace}}%
+ \newdef\@lhatch##1{\@thatch{##1,-45}}%
+ \newdef\rhatch{\simple@opt\@rhatch{\the\hatchspace}}%
+ \newdef\@rhatch##1{\@thatch{##1,45}}%
+ \newdef\xhatch{\simple@opt\@xhatch{\the\hatchspace}}%
+ \newdef\@xhatch##1{\null@opt{\@@xhatch{##1}}}%
+ \newdef\@@xhatch##1[##2]{\@rendmac{%
+ \mfp@ifempty{##2}{xhatch}{colorxhatch (##2)} (##1)}}%
+ \newlet\hatch=\xhatch
+% \end{macrocode}
+%
+% Commands that might conceivably interfere with small bits of \TeX{}
+% code in labels have been renamed. Thus, instead of \cs{fill}, which is a
+% \LaTeX{} text mode command, we have \cs{gfill}. We also have \cs{gclear}
+% and \cs{gclip}. The `g' is for `graphic'. Later, commands that deal
+% with text (labels and captions), have `t' prepended to their more
+% natural name, thus \cs{tlabel} and \cs{tcaption}.
+%
+% \DescribeMacro{\gfill}
+% \DescribeMacro{\gclear}
+% \DescribeMacro{\gclip}
+% \cs{gfill} take one optional argument, the color with which to fill.
+% Under \MF{} the color must be a numeric (representing a level of gray)
+% or one of the color functions, which are defined in \file{grafbase.mf}
+% to return numeric values.
+%
+% \cs{gclear} will actually fill with the color \texttt{background} in \MP.
+% \cs{gclip} might seem to be the inverse of \cs{gclear} (clearing the
+% outside of a region), but in \MP{} the mechanism is completely
+% different. One wishes \MP{} had an `inverse clip' command to use
+% instead of filling with \gbc{background}. The figure macro following
+% these commands must be a closed path.
+% \begin{macrocode}
+ \newdef\gfill{\null@opt\@gfill}%
+ \newdef\@gfill[##1]{%
+ \@rendmac{\mfp@ifempty{##1}{filled}{colorfilled (##1)}}}%
+ \newdef\gclear{\@rendmac{unfilled}}%
+ \newdef\gclip{\@rendmac{Clip}}%
+% \end{macrocode}
+%
+% \subsubsection{Transforming a curve}\label{transforming}
+%
+% The following are transformation prefixes. They are all but one
+% implemented with \cs{@closmac} for reasons covered earlier. Most have a
+% mandatory argument, the parameters of the transformation. Because of the
+% implementation, one can insert rendering macros between a transformation
+% macro and the path being transformed, and they will apply to the
+% untransformed path.
+%
+% If the \env{mfpic} environment has different x and y scales, the
+% \cs{rotatepath} and \cs{reflectpath} compensates so that the result is
+% congruent to the original. The others do not because this is what users
+% seem to expect.
+% \begin{itemize}
+% \item \cs{reverse} and \cs{xyswappath} have no argument.
+% \item \cs{rotatepath} takes \marg{\meta{point},\meta{angle}}.
+% \item \cs{shiftpath} takes \marg{\meta{pair}}.
+% \item \cs{scalepath} takes \marg{\meta{center of scaling},\meta{factor}}.
+% \item \cs{xscalepath} takes \marg{\meta{x-center},\meta{factor}}.
+% \item \cs{yscalepath} takes \marg{\meta{y-center},\meta{factor}}.
+% \item \cs{slantpath} takes \marg{\meta{y-pivot},\meta{factor}}.
+% \item \cs{xslantpath} = \cs{slantpath}.
+% \item \cs{yslantpath} takes \marg{\meta{x-pivot},\meta{factor}}.
+% \item \cs{reflectpath} takes \marg{\meta{point1},\meta{point2}}, the
+% endpoints of a `mirror'.
+% \item \cs{transformpath} takes \marg{\meta{transformer}}, a \MF{}
+% `transformer' (see ``The \MF book'', page~212).
+% \end{itemize}
+%
+% All of them simply write the \grafbase{} command of nearly the same
+% name.
+% \begin{macrocode}
+ \newdef\reverse{\@modmac{reverse}}%
+ \newdef\xyswappath{\@closmac{xyswappedpath}}%
+ \newdef\rotatepath##1{\@closmac{rotatedpath (##1)}}%
+ \newdef\shiftpath##1{\@closmac{shiftedpath (##1)}}%
+ \newdef\scalepath##1{\@closmac{scaledpath (##1)}}%
+ \newdef\xscalepath##1{\@closmac{xscaledpath (##1)}}%
+ \newdef\yscalepath##1{\@closmac{yscaledpath (##1)}}%
+ \newdef\slantpath##1{\@closmac{xslantedpath (##1)}}%
+ \newlet\xslantpath\slantpath
+ \newdef\yslantpath##1{\@closmac{yslantedpath (##1)}}%
+ \newdef\reflectpath##1{\@closmac{reflectedpath (##1)}}%
+ \newdef\transformpath##1{\@closmac{transformedpath (##1)}}%
+% \end{macrocode}
+%
+% \subsubsection{Appending an arrowhead}\label{arrowhead}
+%
+% \DescribeMacro{\arrow}
+% The four macros beginning \cs{@h} are assigned default values at the
+% start and changed only if an option calls for it.
+% Each option starts with a letter (The initial letters of
+% `backset', `color', `length', or `rotate'), followed by a value
+% to assign to the corresponding variable (defaulting to \mfc{0pt},
+% \meta{empty}, \cs{the}\cs{headlen} and \gbc{0 deg}). Then \cs{arrow}
+% finishes with the invokation of \cs{@arrow}.
+% \begin{macrocode}
+ \def\arrow{\def\@hbackset{0}\def\@hcolour{}%
+ \edef\@hlength{\the\headlen}\def\@hrotate{0}%
+ \@arrow}%
+% \end{macrocode}
+%
+% \cs{@arrow} calls \cs{@arrowoption} if it finds an optional parameter.
+% After processing the parameter, \cs{@arrowoption} calls \cs{@arrow}
+% again. This loop will end when optional arguments run out. Then
+% \cs{@@arrow} finishes with the actual \MF{} code.
+% \begin{macrocode}
+ \newdef\@arrow{\mfp@ifnextchar[{\@arrowoption}{\@@arrow}}%
+ \newdef\@@arrow{%
+ \@modmac{%
+ \mfp@ifempty{\@hcolour}{headpath}{colorheadpath (\@hcolour)}%
+ \space(\@hlength, \@hrotate, \@hbackset)}}%
+% \end{macrocode}
+%
+% Since the \cs{arrow} command takes up to 4 optional arguments in any
+% order, we have this utility \cs{@arrowoption} which examines an option's
+% contents and assigns a value to an appropriate macro. Since rather nasty
+% error messages will result if the contents are empty, we test for this
+% and do nothing when there is nothing to process. \cs{@@arrowoption}
+% makes the appropriated definitions, then \cs{@arrow} is iterated to
+% catch another optional parameter.
+% \begin{macrocode}
+ \newdef\@arrowoption[##1]{%
+ \mfp@ifempty{##1}{}{\@@arrowoption##1\mfp@delim}\@arrow}%
+ \newdef\@@arrowoption##1##2\mfp@delim{%
+ \if l##1\relax \mfp@ifempty{##2}{}{\def\@hlength{##2}}%
+ \else\if r##1\relax \mfp@ifempty{##2}{}{\def\@hrotate{##2}}%
+ \else\if b##1\relax \mfp@ifempty{##2}{}{\def\@hbackset{##2}}%
+ \else\if c##1\relax \mfp@ifempty{##2}{}{\def\@hcolour{##2}}%
+ \else
+ \Mfpic@warn{Improper option to \string\arrow\@online .}%
+ \fi\fi\fi\fi}%
+% \end{macrocode}
+%
+% This ends the prefix macros.
+%
+% \subsection{Transforming the coordinate system}\label{coordinate}
+%
+% \DescribeMacro{\coords}
+% \DescribeMacro{\endcoords}
+% The following apply transforms to the \MF{} coordinate system, and
+% these can be localized with \cs{coords} $\ldots$ \cs{endcoords}. The
+% transforms apply when the curve is \emph{rendered} and have no effect
+% on paths merely stored with \cs{store} and \cs{patharr}. Moreover, if a
+% path is created with \cs{connect}, it is transformed as a whole.
+%
+% \DescribeMacro{\applyT}
+% These are implemented by \cs{applyT} which takes as its argument a \MF{}
+% `transformer'.
+%
+% These commands (except \cs{turn}, kept for backward compatibility) have
+% at most one argument, the parameters of the transformation. \cs{rotate}
+% rotates around the origin, \cs{rotatearound} rotates around a given
+% point, \cs{turn} takes the point as an optional argument.
+%
+% Transformations are applied in reverse of the order they appear in the
+% file (i.e., the most recent first).
+% \begin{macrocode}
+ \newdef\coords{\mfsrc{\@nl bcoords\@nl}}%
+ \newdef\endcoords{\mfsrc{\@nl ecoords\@nl}}%
+ \newdef\applyT##1{\mfsrc{\@nl hide(apply_t (##1))}}%
+ \def\rotate##1{\applyT{rotated ##1}}%
+ \newdef\rotatearound##1##2{%
+ \applyT{rotatedaround (##1, ##2)}}%
+ \newdef\turn{\simple@opt\@turn{(0,0)}}%
+ \newdef\@turn##1##2{\rotatearound{##1}{##2}}%
+ \newdef\reflectabout##1##2{%
+ \applyT{reflectedabout (##1, ##2)}}% line ##1--##2.
+ \let\mirror=\reflectabout
+ \newdef\shift##1{\applyT{shifted ##1}}% pair.
+ \def\scale##1{\applyT{scaled ##1}}% same scaling
+ \newdef\xscale##1{\applyT{xscaled ##1}}%
+ \newdef\yscale##1{\applyT{yscaled ##1}}%
+ \newdef\zscale##1{\applyT{zscaled ##1}}%
+ \newdef\xslant##1{\applyT{xslant ##1}}%
+ \newdef\yslant##1{\applyT{yslant ##1}}%
+ \newdef\zslant##1{\applyT{zslant ##1}}%
+ \newdef\boost##1{\applyT{boost ##1}}%
+ \newdef\xyswap{\applyT{xyswap}}%
+% \end{macrocode}
+%
+% \subsection{Axes and grids}\label{axes}
+%
+% \DescribeMacro{\axes}
+% \DescribeMacro{\xaxis}
+% \DescribeMacro{\yaxis}
+% An axis would normally not be thought of as a figure macro, because one
+% would not want to position them arbitrarily nor transform them. One
+% would also not want the hassle of having always to specify the origin,
+% etc. However, one would want to occasionally make them dotted or dashed
+% or colored.
+%
+% The original \cs{axes} was therefore not a figure macro. It always drew
+% both axes with solid lines. Later \cs{xaxis} and \cs{yaxis} were
+% introduced, which mimicked the behavior of \cs{axes}. For backward
+% compatibility, the old behavior is supported with the old commands. The
+% optional argument to \cs{axes}, \cs{xaxis} and \cs{yaxis} is the length
+% of the arrowhead, defaulting to \cs{the}\cs{axisheadlength}.
+% \begin{macrocode}
+ \newdef\xaxis{\simple@opt\@xaxis{\the\axisheadlen}}%
+ \newdef\yaxis{\simple@opt\@yaxis{\the\axisheadlen}}%
+ \newdef\axes{\simple@opt\@axes{\the\axisheadlen}}%
+ \newdef\@axes##1{\mfcmd{\@nl axes (##1)}}%
+ \newdef\@xaxis##1{\mfcmd{\@nl xaxis (##1)}}%
+ \newdef\@yaxis##1{\mfcmd{\@nl yaxis (##1)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\axis}
+% When border axes were added, all the code was revamped, and now we
+% create axes as figure macros. It also became clear there was so
+% much common code that it would be better to implement the syntax
+% \cs{axis}\marg{l}, etc., rather than have separate commands \cs{laxis},
+% etc. for all six possible axes. Therefore, only the x- and y-axes have
+% their own commands. The \cs{axis} command has one optional argument
+% (the arrowhead length) and one mandatory argument, a single letter
+% designating the axis to draw.
+%
+% The only complication is that the x- and y-axis have one default head
+% length, \cs{axisheadlength} (initially \texttt{5pt}), while the side
+% axes have a different default, \cs{sideheadlength} (initially \texttt{0pt}).
+% Therefore we don't know which default to use until the mandatory argument
+% is read. In \cs{@@axis}, we use \cs{get@axisnum} to check this
+% mandatory argument and convert it to a number \cs{mfp@axisnum}, which is
+% used to select the head length.
+% \begin{macrocode}
+ \newdef\axis{\null@opt\@axis}%
+ \newdef\@axis[##1]##2{\get@axisnum{##2}\axis
+ \mfp@ifempty{##1}%
+ {\edef\mfp@param{%
+ \ifnum\mfp@axisnum<2 \the\axisheadlen
+ \else \the\sideheadlen
+ \fi}\@@axis{\mfp@param}}{\@@axis{##1}}{##2}}%
+ \newdef\@@axis##1##2{\arrow[l##1]\@figmac{axisline.##2}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\doaxes}
+% \cs{doaxes} takes one optional argument, the arrowhead length, and one
+% mandatory argument, all the axes to draw. These should be just letters
+% with nothing separating them except optional spaces. \cs{doaxes} is
+% implemented via the self-looping macro \cs{do@axis}, which applies
+% one of two commands to the letter, depending on whether the optional
+% parameter was present (\cs{@axis}) or not (\cs{@@axis}).
+% \begin{macrocode}
+ \newdef\doaxes{\null@opt\@doaxes}%
+ \newdef\@doaxes[##1]##2{\def\mfp@axis{\@axis[##1]}%
+ \do@axis##2\mfp@delim}%
+ \newdef\do@axis##1{%
+ \ifx\mfp@delim##1\relax\else\mfp@axis{##1}\@xp\do@axis\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\axismarks}
+% \DescribeMacro{\xmarks}
+% \DescribeMacro{\ymarks}
+% \DescribeMacro{\lmarks}
+% \DescribeMacro{\bmarks}
+% \DescribeMacro{\rmarks}
+% \DescribeMacro{\tmarks}
+% Hash marks (or tick marks) on the axes are provided by the
+% \cs{axismarks} command (\cs{marks} was the original choice, but that
+% turned out to conflict with a primative of e\TeX). For brevity, therefore,
+% we also have separate commands \cs{xmarks}, etc. \cs{axismarks} has two
+% mandatory arguments: the letter for the axis, and a comma separated
+% list of numbers giving the positions on the axis. It functions as a list
+% macro (see previous discussion of types of macros) and so the list of
+% numbers can be prescribed by an external file
+% \cs{datafile}\marg{\meta{file}}. One must be sure to issue an
+% appropriate \cs{using} command to produce a numeric list in the output.
+% This is the main reason for the \cs{usingnumericdefault} command.
+%
+% I had a change of heart after the \cs{axis} command, and I made things
+% simpler to code here by putting the optional argument of \cs{axismarks}
+% after the first mandatory argument. I could justify this because I
+% expect most users will use the shorter versions that don't require the
+% first argument (that is, the expectation that optional arguments come
+% first is still satisfied). The optional argument is the length of the
+% marks. The position of the marks is controlled separately by the
+% \cs{setaxismarks} command, described previously.
+% \begin{macrocode}
+ \newdef\axismarks##1{\simple@opt{\@marks{##1}}{\the\hashlen}}%
+ \newdef\@marks##1##2{\mfsrc{\@nl ##1marks (##2)}\mfp@writedata}%
+ \newdef\xmarks{\axismarks x}%
+ \newdef\ymarks{\axismarks y}%
+ \newdef\lmarks{\axismarks l}%
+ \newdef\bmarks{\axismarks b}%
+ \newdef\rmarks{\axismarks r}%
+ \newdef\tmarks{\axismarks t}%
+% \end{macrocode}
+%
+% \DescribeMacro{\grid}
+% \DescribeMacro{\gridpoints}
+% \DescribeMacro{\lattice}
+% The first one is, I think, inaccurately named: the word `grid' calls
+% to mind a set of lines. It functions in a similar way: allowing a
+% visualization of the coordinates, but it actually produces dots. The
+% dots are located at the points whose coordinates are integer multiples
+% of two numbers, which are given in the single mandatory argument
+% separated by commas. The optional first argument is the diameter of the
+% dots this defaults to \texttt{0.5bp} (hard coded in \file{grafbase}).
+% Because of the name, I have provided two aliases: \cs{gridpoints}
+% (for consistency with \cs{gridlines}, below) and \cs{lattice}.
+%
+% \DescribeMacro{\gridlines}
+% Macro \cs{gridlines} takes the same mandatory argument and draws
+% horizontal and vertical lines intersecting at all the dots that
+% \cs{grid} would draw. Some packages (and \ConTeXt) define a \cs{grid}
+% command so we use \cs{def} here instead of \cs{newdef} or \cs{redef}.
+%
+% \DescribeMacro{\hgridlines}
+% \DescribeMacro{\vgridlines}
+% These two draw only the horizontal or vertical lines, and their
+% argument is the separation (in graph units) between successive lines.
+% \begin{macrocode}
+ \def\grid{\null@opt\@grid}%
+ \newdef\@grid[##1]##2{%
+ \mfcmd{\mfp@ifempty{##1}{grid}{vgrid (##1)} (##2)}}%
+ \newlet\gridpoints=\grid \newlet\lattice=\grid
+ \newdef\gridlines##1{\mfcmd{\@nl gridlines (##1)}}%
+ \newdef\vgridlines##1{\mfcmd{\@nl vgridlines (##1)}}%
+ \newdef\hgridlines##1{\mfcmd{\@nl hgridlines (##1)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\plrgrid}
+% \DescribeMacro{\plrgridpoints}
+% \DescribeMacro{\gridarcs}
+% \DescribeMacro{\gridrays}
+% \DescribeMacro{\plrpatch}
+% The command \cs{plrgrid} takes one mandatory argument which contains two
+% numbers separated by a comma. The first is a radius and the second an
+% angle. It draws circular arcs at integer multiples of the radius, and
+% radial lines at integer multiples of the angle. It fills the
+% picture rectangle and is clipped to that rectangle. \cs{plrgridpoints}
+% is similar but places only dots at the intersections of these arcs and
+% rays. It takes an optional argument for the size of the dots, normally
+% \cs{dotsize}. \cs{gridarcs} draws only the arcs, \cs{gridrays} only the
+% rays. These last two take only one parameter each: the radius separating
+% the arcs, and the angle separating the rays.
+%
+% \cs{plrpatch} draws: a circular arc at a starting
+% radius, then increments that radius by a step size and draws another
+% arc, etc., and finally draws an arc at the ending radius. It does a similar
+% thing for radial lines and angles. It takes one mandatory argument,
+% which contains 6 numbers separated by commas: starting radius, ending
+% radius, step size, starting angle, ending angle, step size.
+% \begin{macrocode}
+ \newdef\plrgrid##1{\mfcmd{\@nl polargrid (##1)}}%
+ \newdef\plrgridpoints{\simple@opt\@plrgp{\the\dotsize}}%
+ \newdef\@plrgp##1##2{\mfcmd{\@nl polargridpoints (##1, ##2)}}%
+ \newdef\gridarcs##1{\mfcmd{\@nl gridarcs (##1)}}%
+ \newdef\gridrays##1{\mfcmd{\@nl gridrays (##1)}}%
+ \newdef\plrpatch##1{\mfcmd{\@nl polarpatch (##1)}}%
+% \end{macrocode}
+%
+% \subsection{Visualizing points}\label{points}
+%
+% \DescribeMacro{\point}
+% \DescribeMacro{\plotsymbol}
+% \cs{point} draws a dot or a small circle. It takes one optional
+% argument, the diameter of the dot, and one mandatory argument, the ordered
+% pair (or comma separated list of them) at which to draw a dot. After
+% \cs{pointfillfalse}, the dots will be unfilled (i.e., small circles),
+% after \cs{pointfilltrue} (the default), they will be solid. Like the
+% grid macros, it is not a figure macro, but merely does its drawing and
+% is not subject to any prefix macros.
+%
+% In order to mark points with other than circles, we have the
+% \cs{plotsymbol} command, so-called because it uses the same symbols as
+% the \cs{plot} command (previously discussed). There is an optional
+% argument that gives the size of the symbol, a mandatory argument with
+% the name of the symbol, and a second mandatory argument which
+% is a comma separated list of ordered pairs for the locations.
+%
+% For both these commands, the default optional argument is
+% \cs{the}\cs{pointsize}.
+% \begin{macrocode}
+ \newdef\point{\simple@opt\@point{\the\pointsize}}%
+ \newdef\@point##1{%
+ \mfsrc{\@nl pointd (##1, \ifpointfill\mf@T\else\mf@F\fi)}%
+ \mfp@writedata}%
+ \newdef\plotsymbol{\simple@opt\@plotsymbol{\the\pointsize}}%
+ \newdef\@plotsymbol##1##2{%
+ \mfsrc{\@nl plotsymbol (##2, ##1)}\mfp@writedata}%
+% \end{macrocode}
+%
+% \DescribeMacro{\plottext}
+% In \MP{}, \TeX{} labels can be used in place of the symbols in
+% \cs{plotsymbol}. Moreover, multiple copies of text can be placed with
+% the \cs{tlabel} command (under \opt{mplabels}), as it supports a list of
+% points for the location parameter. For \MF{} we supply an alternative,
+% \cs{plottext}, which loops through the list of coordinates and issues
+% \cs{tlabel} commands. The text can be anything that works in \cs{tlabel}.
+%
+% It takes one optional argument, the justification of the text (as in the
+% \cs{tlabel command}, below---see also \cs{tlabeljustify}, above),
+% defaulting to \oarg{cc}. There are two mandatory arguments: the text,
+% and a comma separated list of ordered pairs. For consistency with
+% \cs{plotsymbol} (and because it works better), we now require the same
+% syntax for the points (i.e., no braces around individual points in the
+% list as are allowed in \cs{tlabel} commands).
+%
+% We start by handling the justification, resetting whitespace,
+% and loading the text into a token register. Then we read the list of
+% points with \cs{@@plottext}. Under \opt{mplabels} we process the whole
+% list with a single \cs{tlabel} command. Otherwise we prepare to loop
+% through the list of points. The \cs{begingroup} in \cs{@plottext} is
+% ended by the command called in \cs{@@plottext}.
+% \begin{macrocode}
+ \newdef\plottext{\simple@opt\@plottext{cc}}%
+ \newdef\@plottext##1{%
+ \begingroup
+ \mfp@resetwhitespace \tlabeljustify{##1}%
+ \@ifmplabels{\@makeother\#}{}%
+ \mfp@gettoks\@@plottext}%
+ \newdef\@@plottext##1{%
+ \@ifmplabels
+ {\mfp@setMPpos \def\mfp@points{##1}\@@@tlabel}%
+ {\@@@plottext##1,\mfp@delim}}%
+% \end{macrocode}
+% After reading the list of points and appending ending tokens, we
+% loop through them. The ending condition is that the next token is
+% \cs{mfp@delim}. Otherwise we read the coordinates as delimited macros,
+% and call \cs{@tlabel}, feeding it the coordinates and the text to
+% plot there (the \cs{begingroup} in \cs{x@plottext} matches the
+% \cs{endgroup} in \cs{@tlabel}). Then we recall \cs{@@@plottext} for
+% another loop. Since we have used two internal commands of \cs{tlabel}
+% code, we have to remember to check this if ever we rewrite \cs{tlabel}.
+% \begin{macrocode}
+ \newdef\@@@plottext{%
+ \mfp@ifnextchar\mfp@delim{\@firstoftwo\endgroup}{\x@plottext}}%
+ \newdef\x@plottext(##1,##2),{\begingroup
+ \@tlabel{##1}{##2}{\the\mfp@toks}\@@@plottext}%
+% \end{macrocode}
+%
+% \subsection{Figure macros}\label{figure}
+%
+% \subsubsection{Common geometric objects}\label{geometric}
+%
+% Finally we get to the real figure macros. These are implemented as
+% \MF{} paths that can be variously rendered, transformed, etc., with the
+% prefix macros.
+%
+% The first few (\cs{rect} through \cs{makesector}) are closed paths and
+% need not be prefixed with a closing macro before filling, etc.
+%
+% \DescribeMacro{\rect}
+% This takes one mandatory argument, the two diagonally opposite
+% corners of the rectangle separated by a comma, and draws the rectangle
+% with horizontal and vertical sides having these as two corners. The
+% direction of the path (which seldom makes a difference) is such that it
+% starts at the first specified point and moves horizontally first.
+% \begin{macrocode}
+ \newdef\rect##1{\@figmac{rect (##1)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\regpolygon}
+% There are four arguments. The first is the number of sides. The second
+% is the name of a variable to represent the vertices. The other
+% two should be equations locating two vertices or the center and one
+% vertex. If the name used is \gbc{Ver}, then the vertices will be
+% \gbc{Ver1}, \gbc{Ver2}, etc., numbering anticlockwise. The center is
+% \gbc{Ver0}. Case is significant. After the command, the points can be
+% referred to in other \mfpic{} commands (except text label commands
+% when \opt{mplabels} is not in effect).
+% \begin{macrocode}
+\newdef\regpolygon##1##2##3##4{%
+ \@figmac{regularpolygon(##1)(##2)(##3;##4;)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\circle}
+% This has one optional argument containing one of the letters
+% \texttt{t}, \texttt{p} (the default), \texttt{c}, or \texttt{s}. Its
+% purpose is to specify what kind of data is in the single mandatory
+% argument. These are a subset of the optional arguments that the \cs{arc}
+% commad (below) takes, and have almost the same meaning:
+% \begin{itemize}
+% \item \oarg{t}, the three point form needs three points (of course).
+% \item \oarg{p}, the polar form needs the center point and the radius.
+% This is the default when the optional argument is absent.
+% \item \oarg{c}, the center/point form needs the center and one point on
+% the circle.
+% \item \oarg{s}, the point-sweep form requires two points and the angle of
+% arc between them. The angle may be positive or negative. A
+% positive angle indicates the number of degrees anticlockwise from
+% the first point to the second. Negative means clockwise.
+% \end{itemize}
+%
+% Supplying \cs{arc} with the same parameters, or the appropriate superset
+% in the case of \oarg{p} and \oarg{c}, would produce a sub-arc of the
+% circle that \cs{circle} produces. This is the reason for giving
+% \cs{circle} these options: to make diagrams which show a circle and an
+% arc on it. (This can also be done with an ellipse by using a
+% transform on a circle and its arc.
+%
+% We use \cs{def} instead of \cs{newdef} or \cs{redef} because we know
+% \LaTeX{} has already defined a \cs{circle} command, but plain \TeX{} has
+% not. Instead of passing the default \texttt{p}, we pass a null
+% argument, causing the code to compare various letters to \cs{relax}
+% (always false) and then execute the default code.
+% \begin{macrocode}
+ \def\circle{\null@opt\circl@}%
+ \newdef\circl@[##1]##2{%
+ \if t##1\relax \@figmac{circleppp (##2)}%
+ \else\if c##1\relax \@figmac{circlecp (##2)}%
+ \else\if s##1\relax \@figmac{circlepps (##2)}%
+ \else \@figmac{circle (##2)}%
+ \fi\fi\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\ellipse}
+% \cs{ellipse} has one optional argument, an angle of rotation and one
+% mandatory argument, containing the center, the horizontal radius (before
+% rotation) and the vertical radius, separated by commas.
+% \begin{macrocode}
+ \newdef\ellipse{\simple@opt\@ellipse{0}}%
+ \newdef\@ellipse##1##2{\@figmac{ellipse (##2, ##1)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\sector}
+% This is the closed curve starting at the center of a circle, out
+% along a radius to the circumference of the circle, along an arc of the
+% circle, then back to the center. It has one mandatory argument
+% containing the center, the radius, and the two angles, separated by
+% commas.
+%
+% \DescribeMacro{\makesector}
+% Takes a following arc and draws the sector (even if the center point
+% is not known). It is really a prefix macro (closing an arc with two
+% straight lines), but the combination \cs{makesector}\cs{arc} acts like a
+% figure.
+% \begin{macrocode}
+ \newdef\sector##1{\@figmac{sector (##1)}}%
+ \newdef\makesector{\@closmac{makesector}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\arc}
+% A circular arc can be specified in several ways and we support most of
+% them. \cs{arc} takes an optional argument: a letter to indicate which
+% specification. It has one mandatory argument containing the data for
+% that specification, separated by commas.
+%
+% The available letters and the corresponding required data are:
+% \begin{itemize}
+% \item \oarg{t}, the three point form needs three ordered pairs.
+% \item \oarg{p}, the polar form needs the center point, two angles and
+% the radius.
+% \item \oarg{a}, the alternative polar form needs the center, the radius
+% and two angles.
+% \item \oarg{c}, the center-point-sweep form needs the center, the
+% starting point, and the angle.
+% \item \oarg{s}, the point-sweep form requires the starting point, the
+% ending point and the angle.
+% \end{itemize}
+%
+% The default optional argument is \oarg{s}. (I don't know why. It
+% certainly doesn't seem the most natural. I would have picked \oarg{a}.)
+% Like \cs{circle}, an empty argument is passed by default.
+% \begin{macrocode}
+ \newdef\arc{\null@opt\@arc}%
+ \newdef\@arc[##1]##2{%
+ \if t##1\relax \@figmac{arcppp (##2)}%
+ \else\if p##1\relax \@figmac{arcplr (##2)}%
+ \else\if a##1\relax \@figmac{arcalt (##2)}%
+ \else\if c##1\relax \@figmac{arccps (##2)}%
+ \else \@figmac{arcpps (##2)}%
+ \fi\fi\fi\fi}%
+% \end{macrocode}
+%
+% \DescribeMacro{\plr}
+% \DescribeMacro{\midpoint}
+% A little utility to convert a list of pairs into another list of
+% pairs, where the given list are assumed to be polar coordinates and the
+% results are their Cartesian counterparts. And one to calculate the
+% midpoint, given two points separated by a comma.
+% \begin{macrocode}
+ \newdef\plr##1{map (polar) (##1)}%
+ \newdef\midpoint##1{(0.5[##1])}%
+% \end{macrocode}
+%
+% \subsubsection{List macros}\label{list}
+%
+% The next several figure macros are all list macros. They draw a path
+% determined by a list of points. The list can be explicitly given as a
+% mandatory argument containing a comma-separated list of ordered pairs,
+% or it can be taken from an external datafile. This is true for
+% \cs{polyline} through \cs{turtle}. These macros differ only in
+% how the points determine the path. (The splines don't actually connect
+% the points given, but rather use the points in a different way to
+% determine a curve.) The list of points is not an argument of any of
+% these. It should follow, and is picked up and written to output by the
+% ending code of \cs{@listmac}. This is basic to list macros, and will not
+% be repeated for each one.
+%
+% \DescribeMacro{\polyline}
+% \DescribeMacro{\polygon}
+% The most basic, a polyline or polygonal path, \cs{polyline}
+% draws line segments from each point to the next. \cs{lines} is an
+% alias. \cs{polygon} does the same, except it closes the path by
+% connecting the last point to the first.
+%
+% In \cs{@polyline}, the argument is \mfc{true} or \mfc{false},
+% indicating whether the path is to be closed.
+% \begin{macrocode}
+ \newdef\polyline{\@polyline\mf@F}%
+ \newlet\lines=\polyline
+ \newdef\polygon{\@polyline\mf@T}%
+ \newdef\@polyline##1{\@listmac{polyline (##1)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\curve}
+% \DescribeMacro{\cyclic}
+% \cs{curve} draws a smooth curve connecting a list of points. it arranges
+% for the curve, at point $p\sb n$ to be traveling parallel to the direction
+% from $p\sb {n-1}$ to $p\sb {n+1}$ (except at the first and last point).
+%
+% \cs{cyclic} is similar, except the curve is closed, and at the first
+% point it also travels parallel to the direction from the previous point
+% (the last one listed) to the next.
+%
+% There is an optional argument, which is the tension. This is a number
+% greater than .75. The larger it is, the closer to a polyline one gets.
+% The default is 1 (set in \file{grafbase}) or more generally, the value
+% set by \cs{settension}.
+% \begin{macrocode}
+ \newdef\curve {\null@opt{\@curve\mf@F}}%
+ \newdef\cyclic{\null@opt{\@curve\mf@T}}%
+ \newdef\@curve##1[##2]{%
+ \@listmac{\mfp@ifempty{##2}{curve}{tcurve (##2)} (##1)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\fcncurve}
+% A `function curve' is the graph of a function of $x$. It should always
+% travel left to right. This is not guaranteed by the \cs{curve} macro,
+% above, even if the x-coordinates are listed in order. \cs{fcncurve} is
+% guaranteed to do this if the list of points has the x-coordinates so
+% ordered.
+%
+% The optional argument is called tension. Internally, it is not quite the
+% same as the tension argument to \cs{curve}, but it also governs how
+% closely the curve stays to the corresponding polyline. If the optional
+% argument is missing, this command uses $1.2$ (more precisely, it uses
+% $1.2$ times the value set with \cs{settension}). The above guarantee is
+% voided if the value used is less than $1$. However, most curves will
+% satisfy the guarantee with some lower values.
+% \begin{macrocode}
+ \newdef\fcncurve{\null@opt\@fcncurve}%
+ \newdef\@fcncurve[##1]{%
+ \@listmac{\mfp@ifempty{##1}{fcncurve}{functioncurve (##1)}}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\qspline}
+% \DescribeMacro{\closedqspline}
+% \DescribeMacro{\cspline}
+% \DescribeMacro{\closedcspline}
+% These are supposed to be types of splines, about which I know only a
+% little. The list or datafile that should follow each command should
+% contain not the points passed through, but instead the control data.
+% For quadratic B-splines the points create the path as follows: for
+% successive points $p\sb i, p\sb {i+1}$ in the list, the path passes through
+% the midpoint of the line segment connecting $p\sb i$ and $p\sb {i+1}$, tangent
+% to that line segment.
+%
+% Cubic splines determine the curve as follows: for successive points
+% $p\sb i, p\sb {i+1}$ in the list, the line segment connecting them is divided
+% into thirds with two points $q\sb i$ and $q\sb i'$. The curve then passes
+% through the midpoint of the segment from $q\sb {i-1}'$ to $q\sb i$ and tangent
+% to that segment.
+%
+% `Control' is obtained as follows: the farther apart the points $p\sb i$
+% and $p\sb {i+1}$ (quadratic) or $q\sb {i-1}'$ and $q\sb i$ (cubic) the
+% less the curvature of the curve at the midpoint.
+%
+% The `\texttt{q}' versions produce quadratic splines, the `\texttt{c}'
+% versions produce cubic splines.
+% \begin{macrocode}
+ \newdef\qspline{\@listmac{openqbs}}%
+ \newdef\closedqspline{\@listmac{closedqbs}}%
+ \newdef\cspline{\@listmac{opencbs}}%
+ \newdef\closedcspline{\@listmac{closedcbs}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\mfbezier}
+% \DescribeMacro{\closedmfbezier}
+% These produce the standard \MF{} cubic B\'ezier (the connection is
+% \mfc{..} unless the optional argument is used) with tension given by
+% an optional argument. A mandatory argument (not shown) contains the
+% list of points.
+%
+% \DescribeMacro{qbeziers}
+% \DescribeMacro{closedqbeziers}
+% These produce the equivalent of a sequence of \LaTeX{} \cs{qbezier}
+% commands. The mandatory argument will be a list of points alternating
+% between nodes and control points. Note that quadratic B\'eziers need
+% not be smooth at the nodes unless the control points line up. Our
+% plural name distinguishes it from the \LaTeX{} command.
+% \begin{macrocode}
+ \newdef\mfbezier{\null@opt{\@mfbezier\mf@F}}%
+ \newdef\closedmfbezier{\null@opt{\@mfbezier\mf@T}}%
+ \newdef\@mfbezier##1[##2]{%
+ \@listmac{\mfp@ifempty{##2}{bezier}{tbezier (##2)} (##1)}}%
+ \newdef\qbeziers{\@listmac{qbezier (\mf@F)}}%
+ \newdef\closedqbeziers{\@listmac{qbezier (\mf@T)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\turtle}
+% Many years ago there was a tool for teaching programming concepts to
+% young children. They could draw a figure on a screen by programming a
+% `turtle' with a sequence of turns and distances. The following is
+% similar. It has a mandatory argument containing a list of ordered pairs.
+% The first is the coordinates of the starting point, and each of the rest
+% is interpreted as a displacement from the current position, along which
+% a line segment is to be drawn. The terminal point of that segment is the
+% new current position
+% \begin{macrocode}
+ \newdef\turtle{\@listmac{turtle}}%
+% \end{macrocode}
+%
+% \subsubsection{Graphing functions}\label{functions}
+%
+% \DescribeMacro{\function}
+% \prog{Mfpic} provides the ability to plot the graph of any function that
+% can be defined in \MF. This is done with the \cs{function} command, a
+% figure macro which takes one optional parameter that selects
+% the smoothness of the \MF{} path produced. It can be \oarg{p}, which
+% draws a polyline path through selected points (much like \cs{polyline}),
+% or \oarg{s\meta{tension}} which selects a smooth path (much like
+% \cs{curve}\oarg{\meta{tension}}). The tension may be omitted and then
+% defaults to 1 (set in \file{grafbase}). The default is \oarg{s}.
+%
+% There are two mandatory arguments. The second is the function, which
+% must be written as a formula (strictly speaking, a \MF{} numerical
+% expression) containing only one variable, \texttt{x}. The first
+% mandatory argument contains three numbers separated by commas. They are,
+% in order, the starting value of \texttt{x}, the ending value, and the
+% step size.
+%
+% \DescribeMacro{\parafcn}
+% \cs{parafcn} is similar, except its formula must be an ordered pair of
+% formulas (strictly speaking, a \MF{} pair expression) in which
+% \texttt{t} is the only variable.
+%
+% \DescribeMacro{\plrfcn}
+% \cs{plrfcn} is similar, except its argument is a formula (a \MF{}
+% numeric expression) representing the radius, in which \texttt{t} is the
+% only variable, interpreted as the angle coordinate, $\theta$, in degrees.
+%
+% These three commands are so alike that all they do is set the name to
+% be written to the output and call the common code.
+% \begin{macrocode}
+ \newdef\function{\def\mfp@name{function}\mfp@fcn}%
+ \newdef\parafcn{\def\mfp@name{parafcn}\mfp@fcn}%
+ \newdef\plrfcn{\def\mfp@name{plrfcn}\mfp@fcn}%
+ \newdef\mfp@fcn{\simple@opt\@mfp@fcn{s}}%
+ \newdef\@mfp@fcn##1{\@@mfp@fcn##1\mfp@delim}%
+ \newdef\@@mfp@fcn##1##2\mfp@delim##3##4{%
+ \@figmac{\mfp@ifempty{##2}{}{t}\mfp@name\space
+ (\if p##1\mf@F\else\mf@T\fi \mfp@ifempty{##2}{}{, ##2})
+ (##3) (##4)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\btwnfcn}
+% The region between two functions \cs{btwnfcn} is a figure macro. It is
+% mostly intended for shading or other filling operations so it is already
+% closed and, by default, it is not `smooth'. Its parameters are the
+% same as those of \cs{function} (above), with two exceptions: the default
+% optional argument is \oarg{p} and it has an additional mandatory
+% argument, the other function. The resulting \MF{} path travels along one
+% the graph of the first function from the starting $x$ to the ending $x$,
+% thence vertically to the graph of the second function, along it (in
+% reverse) to the starting $x$ and finally, vertically to the start of the
+% first function's graph.
+%
+% \DescribeMacro{\plrregion}
+% The figure macro \cs{plrregion} also produces a closed \MF{} path. It
+% has the same parameters as \cs{plrfcn}, and the path produced begins at
+% the origin, travels along a straight line in the direction of the
+% starting angle to the beginning of the graph of the expression, along
+% that graph to the ending angle and then straight back to the origin. Its
+% default option is also \oarg{p}.
+% \begin{macrocode}
+ \newdef\btwnfcn{\simple@opt\@btwnfcn{p}}%
+ \newdef\@btwnfcn##1{\@@btwnfcn##1\mfp@delim}%
+ \newdef\@@btwnfcn##1##2\mfp@delim##3##4##5{\btwn@params{##1}{##2}%
+ \@figmac{\t@pref btwnfcn (\s@vals) (##3) (##4) (##5)}}%
+ \newdef\btwn@params##1##2{%
+ \edef\s@vals{\if s##1\mf@T\else\mf@F\fi}%
+ \mfp@ifempty{##2}{\def\t@pref{}}%
+ {\def\t@pref{t}\edef\s@vals{\s@vals, ##2}}}%
+ \newdef\plrregion{\simple@opt\@plrregion{p}}%
+ \newdef\@plrregion##1{\@@plrregion##1\mfp@delim}%
+ \newdef\@@plrregion##1##2\mfp@delim##3##4{\btwn@params{##1}{##2}%
+ \@figmac{((0,0)--(\t@pref plrfcn (\s@vals) (##3) (##4))%
+ --cycle)}}%
+% \end{macrocode}
+%
+% \subsection{Some composite objects}\label{composite}
+%
+% \DescribeMacro{\tile}
+% A tile is syntactically a \MF{} picture variable. The commands between
+% \cs{tile} (or \cs{begin}\marg{tile}) and \cs{endtile} (or
+% \cs{end}\marg{tile}) should be any sequence of \mfpic{} figure macros
+% with possible prefix macros. They will be drawn not on the main picture
+% (\gbc{currentpicture}), but on the picture given by the name in the
+% \cs{tile} command's argument.
+%
+% The argument has five parts separated by commas, the first is the
+% name, the second is the unit of length (some absolute dimension like
+% \mfc{1pt}), the next two are the width and height (pure numbers, the
+% actual dimensions being these numbers times the unit of length), the
+% last is one of the words \mfc{true} or \mfc{false}, indicating whether
+% tile should be clipped to these dimensions (true) or allowed to extend
+% beyond them (false).
+% \begin{macrocode}
+ \newdef\tile##1{\mfcmd{\@nl tile (##1)}}%
+ \newdef\endtile{\mfsrc{endtile;\@nl}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\patharr}
+% A path array is a set of \MF{} path variables each having the same name
+% followed by a different numeric suffix. This command turns off rendering
+% and simply assigns these variables in order to the path expressions
+% written by the figure macros between \cs{patharr} and \cs{endpatharr}.
+% It works by redefining \cs{store@path}, issued by all the figure
+% macros. These variables can be accessed in \mfpic{} by using the
+% \cs{mfobj} command.
+%
+% \emph{Explicit} rendering commands will work in the sense that the
+% affected path will be rendered in addition to being assigned to the
+% variable. The only parameter is the common name of the variables.
+% \begin{macrocode}
+ \newdef\patharr##1{\begingroup
+ \mfsrc{hide(numeric ##1; path ##1[]; ##1 = 0)}%
+ \def\store@path{\mfsrc{\@nl store (##1[incr ##1])}}%
+ \setrender{}}%
+ \newdef\endpatharr{\endgroup}%
+% \end{macrocode}
+%
+% \DescribeMacro{\connect}
+% \DescribeMacro{\endconnect}
+% These define an environment that can contain any sequence of figure
+% macros. It functions as a single large \cs{@figmac}, the figure being
+% the path obtained by connecting all the paths within by straight lines
+% from the end of one to the beginning of the next. It is implemented via
+% a path array, so the individual figures within the environment have
+% implicit rendering turned off. Explicit rendering commands within the
+% environment will have the expected effect.
+%
+% The \cs{if@mfp@latex} stuff at the end allows \cs{connect} to be used as
+% a \LaTeX{} environment.
+% \begin{macrocode}
+ \newdef\connect{\@figmac{begingroup; save nexus}%
+ \patharr{nexus}}%
+ \newdef\endconnect{\endpatharr
+ \mfcmd{\@nl mkpoly (\mf@F, nexus)\@nl endgroup}%
+ \if@mfp@latex \def\mfptmp@a{connect}%
+ \ifx\mfptmp@a\@currenvir
+ \aftergroup\@startfigtrue %\aftergroup\@imrendtrue
+ \fi
+ \fi}%
+% \end{macrocode}
+%
+% \subsection{Other graphical features}\label{otherfeatures}
+%
+% And now for something completely different: pie charts and bar charts
+% (or bar graphs, or histograms).
+%
+% \DescribeMacro{\piechart}
+% The \cs{piechart} command takes one optional argument containing a
+% letter and an angle, and one mandatory argument containing the data. The
+% letter can be `\texttt{c}' for clockwise or `\texttt{a}' for anticlockwise
+% and determines the direction around the pie the different wedges will be
+% drawn. The angle determines the angle of the first edge (in the given
+% direction) of the first wedge. The default is \oarg{c90} which starts
+% the first wedge at 12 o'clock and proceeds clockwise from there. The
+% data in the mandatory argument are numbers separated by commas. The size
+% of a wedge is proportional to the size of the corresponding number.
+% \cs{piechart} is a list macro and can take the data from an external
+% file.
+%
+% \DescribeMacro{\piewedge}
+% Actually, nothing is drawn, it only defines a path array and a few
+% other internal variables. Each individual wedge (elements of the just
+% mentioned array) may be drawn using the \cs{piewedge} command, which is
+% a figure macro. That command takes one optional argument that determines
+% how the wedge is drawn, as described below, and one mandatory argument,
+% the number of the wedge. Without the optional argument,
+% \cs{piewedge}\marg{1} draws the first wedge in the position given by the
+% arguments of the \cs{piechart} command.
+%
+% The optional arguments can be:
+% \begin{itemize}
+% \item \oarg{x\meta{distance}}, the wedge is exploded, drawn
+% shifted outward from its position by \meta{distance} (in graph
+% units).
+% \item \oarg{s(\meta{dx},\meta{dy})}, the wedge is shifted from its
+% position by \meta{dx} horizontally and \meta{dy} vertically (in
+% graph units).
+% \item \oarg{m(\meta{x},\meta{y})}, the wedge is moved so that its
+% point is at coordinates \parg{\meta{x},\meta{y}}.
+% \end{itemize}
+% \begin{macrocode}
+ \newdef\piechart{\simple@opt\@piechart{c}}%
+ \newdef\@piechart##1{\@@piechart##1\mfp@delim}%
+ \newdef\@@piechart##1##2\mfp@delim##3{%
+ \mfsrc{\@nl piechart(\if a##1 \else-\fi1, %
+ \mfp@mtsub{##2}{90}, ##3)}\mfp@writedata}%
+ \newdef\piewedge{\simple@opt\@piewedge{d}}%
+ \newdef\@piewedge##1{\@@piewedge##1\mfp@delim}%
+ \newdef\@@piewedge##1##2\mfp@delim##3{%
+ \@figmac{(piewedge[##3]%
+ \if x##1 shifted (##2*piedirection[##3])%
+ \else\if s##1 shifted (##2)%
+ \else\if m##1 shifted (##2 - piecenter)%
+ \else
+ \fi\fi\fi)}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\barchart}
+% \DescribeMacro{\bargraph}
+% \DescribeMacro{\gantt}
+% \DescribeMacro{\histogram}
+% The \cs{barchart} command takes one optional and two mandatory
+% arguments. The last mandatory argument contains the data, separated by
+% commas and these determine the length of the bars in graph units. This
+% is also a list macro and instead of the list, an external file can hold
+% the data.
+%
+% The optional argument determines the position and width of the bars and
+% the first mandatory argument determines the orientation. The mandatory
+% argument can be \marg{v} for vertical bars with base on the x-axis, or
+% \marg{h} for horizontal bars with base on the y-axis.
+% The optional argument contains three numbers separated by commas. The
+% first is the coordinate of the leading edge of the first bar, the second
+% is the distance (in graph coordinates) between the leading edge of one
+% bar and that of the next, and the third is the fraction of that distance
+% that is occupied by the bar. The default is \oarg{0,1,1}.
+%
+% We provide the aliases \cs{bargraph} and \cs{histogram}.
+%
+% \DescribeMacro{\chartbar}
+% \DescribeMacro{\ganttbar}
+% \DescribeMacro{\graphbar}
+% \DescribeMacro{\histobar}
+% The \cs{barchart} command does not actually draw anything, but defines a
+% path array. The \cs{chartbar} command can then be used to draw a bar
+% (one of the members of the just mentioned array). It is a figure macro
+% and take the number of the bar as its mandatory argument. Aliases
+% \cs{graphbar} and \cs{histobar} are provided. We avoid \cs{bar} because
+% it is a math accent command.
+% \begin{macrocode}
+ \newdef\barchart{\simple@opt\@barchart{0,1,1}}%
+ \newdef\@barchart##1##2{%
+ \mfsrc{\@nl barchart (##1, \if h##2\mf@F\else\mf@T\fi)}%
+ \mfp@writedata}%
+ \newlet\bargraph=\barchart
+ \newlet\histogram=\barchart
+ \newlet\gantt\barchart
+ \newdef\chartbar##1{\@figmac{chartbar[##1]}}%
+ \newlet\graphbar=\chartbar
+ \newlet\histobar=\chartbar
+ \newlet\ganttbar=\chartbar
+% \end{macrocode}
+%
+% One can add to \cs{mfp@additions} to extend \mfpic. Currently it
+% is empty. This ends \cs{@mfpic@graf@macs}.
+% \begin{macrocode}
+ \newdef\pinumber{3.14159}%
+ \mfp@additions
+}%
+% \end{macrocode}
+%
+%
+% \section{The \env{mfpic} environment}\label{mfpicenv}
+%
+% \subsection{Initializations}\label{mfpicinitializations}
+%
+% \DescribeMacro{\mfpic}
+% This command (or the \LaTeX{} environment \cs{begin}\marg{mfpic}) takes
+% two optional arguments: the xscale and the yscale. When both are
+% omitted, they are both set to 1, if the yscale is omitted, it is set
+% equal to the xscale.
+%
+% There are also 4 mandatory arguments: the first two give the minimum and
+% maximum extent of the x coordinates and the last two do the same for the
+% y coordinates. The coordinates used in the figure commands within an
+% mfpic environment are multiplied by the corresponding scales, and that
+% is the multiple of \cs{mfpicunit} used in positioning, drawing, etc.
+%
+% The optional arguments are converted by the option handling code to
+% mandatory arguments for \cs{@mfpic}, which contains the actual
+% definition.
+% \begin{macrocode}
+\newdef\mfpic{\simple@opt\@mfpicA{1}}%
+\newdef\@mfpicA#1{\simple@opt{\@mfpic{#1}}{#1}}%
+\newdef\@mfpic#1#2#3#4#5#6{%
+% \end{macrocode}
+%
+% We start by saving \mfpic{} extra fontdimen values. They will be
+% restored by \cs{endmfpic}. This makes the values local (font dimensions
+% are normally always global). Then we begin a group to localize ordinary
+% \TeX{} definitions and assignments, disable writes to the output if
+% \cs{opengraphsfile} hasn't occurred yet. save the current font in
+% \cs{@tcurr} for restoration inside text labels and captions, set the
+% switch that says we are in an \cs{mfpic} environment, disable \cs{par}
+% so that blank lines have (little or) no effect, and switch to
+% \cs{nullfont} so that stray characters (always an error) and spaces (not
+% an error), have no effect. I wonder if \cs{@empty} is a better
+% disabling definition for \cs{par} than \cs{relax}.
+% \begin{macrocode}
+ \save@mfpicdimens
+ \begingroup % ended near end of \endmfpic
+ \@ifmfpfileisopen{}%
+ {\if@mfp@nowrite\else \nooutputfileerror{\mfpic}%
+ \def\@mfsrc##1##2{}%
+ \fi}%
+ \mfp@DBlog{Starting mfpic \number\mfp@count \@online.}%
+ \font\@tcurr=\fontname\font\relax
+ \let\ifin@mfpicenv\iftrue
+% \let\par\relax
+ \let\par\@empty
+ \nullfont
+% \end{macrocode}
+%
+% The graphics macros are undefined outside the \env{mfpic} environment.
+% They are defined now by invoking \cs{@mfpic@graf@macs}.
+% \begin{macrocode}
+ \@mfpic@graf@macs
+% \end{macrocode}
+%
+% Then we define two utility macros used to convert graph coordinates into
+% actual dimensions relative to the lower left corner of the picture. The
+% first argument is a dimension, but it is normally obtained by first
+% multiplying a coordinate value by \cs{mfpicunit}. Since font dimensions
+% may be involved, we assign \texttt{\#\#1} to a scratch dimension
+% register first, since \TeX{} won't \cs{advance} font dimensions. We make
+% the final assignment global for consistency.
+% \begin{macrocode}
+ \newdef\@xconv##1{%
+ {\mfp@scratch = ##1\relax
+ \advance\mfp@scratch by -#3\mfpicunit
+ \mfp@scratch = #1\mfp@scratch
+ \global ##1 = \mfp@scratch}}%
+ \newdef\@yconv##1{%
+ {\mfp@scratch=##1\relax
+ \advance\mfp@scratch by -#5\mfpicunit
+ \mfp@scratch = #2\mfp@scratch
+ \global ##1 = \mfp@scratch}}%
+% \end{macrocode}
+%
+% We are going to add all text labels to a box \cs{@alltlabels} and put
+% that whole box on top of the graph during \cs{endmfpic}.
+% We initialize the box here. The dimensions \cs{@tlabelsbot}, etc.,
+% are also initialized. Each will be changed as labels are added, so a
+% `non-maxdimen' value at \cs{endmfpic} means there are labels to add.
+% \begin{macrocode}
+\setbox\@alltlabels\vbox{\hbox{}}%
+\@tlabelsbot \maxdimen
+\@tlabelstop -\maxdimen
+\@tlabelsleft \maxdimen
+\@tlabelsright-\maxdimen
+% \end{macrocode}
+%
+% The graph is loaded into a box register at the end of the mfpic
+% environment. The size of that box register may have to correspond to the
+% arguments of the \cs{mfpic} command. Since \cs{endmfpic} doesn't receive
+% these arguments we process them now.
+%
+% Dimensions \cs{@graphright}, etc., represent the extent of the graph
+% box. We increase them when the text is added if it extends beyond the
+% edges of the graph. These are all font dimensions, so they are global
+% assignments.
+% \begin{macrocode}
+ \@graphright=#4\mfpicunit \@xconv\@graphright
+ \@graphtop=#6\mfpicunit \@yconv\@graphtop
+ \@graphleft=0pt
+ \@graphbot=0pt
+ \@graphwd=\@graphright
+% \end{macrocode}
+%
+% \subsection{Initialization code for the current
+% picture}\label{current}
+%
+% Each \env{mfpic} environment produces a \gbc{beginmfpic...endmfpic}
+% environment in the output file. Here we initialize the variables that
+% correspond there to the 6 arguments and \cs{mfpicunit}, then begin the
+% \MF{} environment. \gbc{beginmfpic} takes the number of the current
+% figure as its only argument. For debugging purposes we write a \MF{}
+% comment the contains the line number in the \TeX{} source file where the
+% \cs{mfpic} command occurred. We also write a line of dashes
+% (\cs{mf@d}) to make it easier to find the start of the environment. This
+% will be removed in the public release.
+%
+% When \opt{mplabels} is in effect we need to set the font for the labels
+% to the saved \cs{@tcurr} by writing some \mfc{verbatimtex} code. Since
+% \opt{mplabels} can be turned on at any time, we write this whenever the
+% \opt{metapost} option is in effect. It is a common misconception that
+% \mfc{verbatimtex} can be used only once at the start of a \MP{} file. In
+% fact it can be used any number of times. It's purpose is to be at an
+% outer level, while \mfc{btex} is localized inside a box
+% \begin{macrocode}
+ \mfsrc{\@nl \mf@p\mf@d\mf@d\mf@d\@nl
+ unitlen := \the\mfpicunit\mf@s;\@nl
+ xscale := #1; yscale := #2;\@nl
+ bounds (#3, #4, #5, #6);\@nl
+ \@nl
+ beginmfpic(\number\mfp@count); \mf@p\space\@mfplineno.
+ \mfp@ifmpost
+ {\@nl verbatimtex \@nl
+ \begingroup\space\font\noexpand\MFPcfont=\fontname\@tcurr\@nl
+ etex;}{}}%
+% \end{macrocode}
+%
+% \subsection{Placing text labels}\label{textlabels}
+%
+% All the rest of \cs{@mfpic} defines commands that in some way or another
+% produce labels. The easiest part is defining \cs{tlabel} under
+% \opt{mplabels} where most of the work takes place in \file{grafbase.mp}.
+% The most involved is the definition of \cs{tlabel} without
+% \opt{mplabels}. All the rest (except \cs{tcaption}) add labels by
+% calling \cs{tlabel}. Some of those could be simpler under \opt{mplabels}
+% but then we'd need two versions of each.
+%
+% \DescribeMacro{\tlabel}
+% This is the common code, processing optional arguments, etc. for
+% \cs{tlabel}. It ultimately calls one of \cs{@tlabel} (no
+% \opt{mplabels}) or \cs{@@tlabel} (\opt{mplabels}). It takes an optional
+% argument describing the justification and rotation, followed by a
+% location in one of two syntaxes (which adds to the complication, but we
+% want to be backward compatible), followed by the text of the label
+% (\TeX{} code).
+%
+% The location can be in the form \parg{\meta{x},\meta{y}}, but if \MP{}
+% is processing labels we would like to be able to use \MP{} expressions,
+% which can contain parentheses and commas. This would mess up \TeX's
+% token matching for reading the two coordinates. Therefore we allow the
+% whole point to be enclosed in braces. Under \opt{mplabels} the contents
+% of the braces will be written to the output file without any further
+% parsing. Without \opt{mplabels}, there should be either no braces, or
+% inside the braces is the previously described syntax.
+%
+% We start with \cs{begingroup} to hide changes, then reset whitespace to
+% its normal catcodes. Without \opt{mplabels} we reset \cs{tlabel@rot} to
+% empty. Finally, we check for an optional parameter and run \cs{@tlabel@},
+% feeding it an empty optional argument if there is none.
+% \begin{macrocode}
+ \newdef\tlabel{%
+ \begingroup % ended in \@(@@)tlabel
+ \mfp@resetwhitespace
+ \@ifmplabels{}{\def\tlabel@rot{}}%
+ \null@opt\@tlabel@}%
+% \end{macrocode}
+%
+% We run \cs{tlabeljustify} on the optional parameter. This keeps the
+% default values of \cs{tl@vpos}, \cs{tl@hpos} and \cs{tlabel@rot} if
+% the parameter is empty, otherwise it modifies them inside the current
+% group.
+%
+% We then check for a left parenthesis and assume the
+% \parg{\meta{x},\meta{y}} syntax in that case, calling \cs{@@tlabel@}
+% to process it. Under \opt{mplabels} it stuffs the whole point into
+% braces and call the main code \cs{@@tlabel} with that argument,
+% otherwise it pulls out the two coordinates and feeds them as the first
+% two arguments of the main code \cs{@tlabel}.
+% \begin{macrocode}
+ \newdef\@tlabel@[##1]{\tlabeljustify{##1}%
+ \mfp@ifnextchar({\@@tlabel@}{\@@tlabel@@}}%
+ \newdef\@@tlabel@(##1,##2){%
+ \@ifmplabels
+ {\@@tlabel{(##1,##2)}}{\@tlabel{##1}{##2}}}%
+% \end{macrocode}
+%
+% If no parenthesis, we assume braces surround the point. Under
+% \opt{mplabels} we call the main code (\cs{@@tlabel}) with that argument.
+% Otherwise, we re-call the above \cs{@@tlabel@} on the contents of the
+% braces, assuming (without checking) that the contents are coordinates in
+% parentheses.
+% \begin{macrocode}
+ \newdef\@@tlabel@@##1{%
+ \@ifmplabels {\@@tlabel{##1}}{\@@tlabel@##1}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\extraendtlabel}
+% We now come to the main code under \opt{mplabels}, which should just
+% arrange to write the correct commands to the output file. All labels are
+% passed as \mfc{btex ... etex} structures. The definition of \cs{MFPtext}
+% will have been written earlier by \cs{opengraphsfile}.
+% \cs{extraendtlabel} is a hook currently only used by the \cs{tlabels}
+% command to force a loop.
+% \begin{macrocode}
+ \newdef\mfp@btex##1{btex \noexpand\MFPtext{##1} etex}%
+ \newdef\extraendtlabel{}%
+% \end{macrocode}
+%
+% The command \gbc{newgblabel}, defined in \file{graphbase.mp} for placing
+% labels, uses three parameters to justify the text. If we didn't have to
+% support the \texttt{B} vertical placement option, there would be only
+% two. All the other options involve placement \emph{relative} to the
+% bounding box. But the baseline is absolute: \MP{} always puts it at
+% y-coordinate 0 in the picture returned by \gbc{btex}. The first two
+% parameters are numerical and the third is boolean. The
+% first represents the fraction of the text that lies left of given
+% point. The second is the fraction of the text below the point. If the
+% third parameter is \mfc{true}, this fraction ignores the depth of the
+% text (so $0$ indicates baseline placement); if it is false, the depth
+% is accounted for (so $0$ indicates the very bottom of the text).
+%
+% By this point the letters of the optional parameter have been converted
+% to integer values for \cs{tl@hpos} and \cs{tl@vpos} by
+% \cs{tlabeljustify}. The following converts these integers to comma
+% separated parameters as described above using \cs{ifcase}.
+%
+% The fourth parameter of \gbc{newgblabel} is the angle of rotation. Empty
+% rotation is converted to the angle 0, otherwise it is written as is.
+% All four parameters are stored in \cs{mfp@MPpos}.
+% \begin{macrocode}
+ \newdef\mfp@setMPpos{%
+ \edef\mfp@MPpos{%
+ \ifcase\tl@hpos .5\or 1\else 0\fi, % horizontal
+ \ifcase\tl@vpos 0\or .5\or 1\else 0\fi, % vertical
+ \ifnum \tl@vpos < 0 \mf@T\else\mf@F\fi, % true=Baseline
+ \mfp@mtsub{\tlabel@rot}{0}}}%
+% \end{macrocode}
+%
+% \cs{@@tlabel} is the code called by \cs{tlabel} when \opt{mplabels} is
+% in effect. The argument is a \MP{} pair expression, or comma separated
+% list of them. It should be followed by the \TeX{} code for the label.
+% We will load the label into a token register afterwards. First
+% we restore the meaning of blank lines and then make sure any
+% \texttt{\#}'s in the \TeX{} code are not doubled by changing their
+% category.
+%
+% We load the label in a token register because writing that is (almost)
+% verbatim (blank lines become \cs{par}, \texttt{\#} symbols are
+% doubled if we're not careful, and control names have a space appended).
+% One day maybe we'll try to obtain a true verbatim writing mode.
+% \begin{macrocode}
+ \newdef\@@tlabel##1{\def\mfp@points{##1}\mfp@restorepar
+ \mfp@setMPpos \@makeother\#\mfp@gettoks\@@@tlabel}%
+% \end{macrocode}
+% Then the \gbc{newgblabel} command is written with the justification
+% parameters, and two more: the label tokens, and the point (or list of
+% points). The group (begun by \cs{tlabel}) is ended, and the
+% \cs{extraendtlabel} command invoked.
+% \begin{macrocode}
+ \newdef\@@@tlabel{%
+ \mfcmd{\@nl
+ newgblabel(\mfp@MPpos)(\mfp@btex{\the\mfp@toks})(\mfp@points)}%
+ \endgroup \extraendtlabel}%
+% \end{macrocode}
+%
+% When \opt{mplabels} is not in effect, we use \TeX{} to position the
+% label. By this point, the optional justification parameter to
+% \cs{tlabel} has been converted to integer values of \cs{tl@vpos} and
+% \cs{tl@hpos}, and the coordinates of the location are passed as the
+% first two arguments of \cs{@tlabel}. The third argument is the \TeX{}
+% code for the label.
+%
+% We put the label in a box (\cs{@textbox}) so we can measure and position
+% it. It is a \cs{vbox} so we can have multiline labels. This is effected
+% by wrapping it in a simple, left-aligned, one column \cs{halign},
+% defining \cs{\bsl} to be \cs{cr}. We make this procedure a separate
+% macro, since we need to do the identical thing in the \cs{tlabelpath}
+% code.
+% \begin{macrocode}
+ \newdef\set@textbox##1{%
+ \setbox\@textbox=\vbox{\def\\{\cr}\mfp@restorepar
+ \@tcurr\the\every@tlabel\halign{####\hfil\cr##1\crcr}}}%
+% \end{macrocode}
+%
+% We then compute its total height to simplify later code.
+% \begin{macrocode}
+ \newdef\@tlabel##1##2##3{%
+ \set@textbox{##3}%
+ \mfp@scratch\tb@ht \advance\mfp@scratch\tb@dp
+ \tb@totalht\mfp@scratch
+% \end{macrocode}
+%
+% The following computes whether the rightmost extent of the picture will
+% be increased by the addition of the label. We convert the x-coordinate
+% of the label's location to a distance from the left edge of the picture.
+% We then add to that the amount of the label extending to the right of
+% this location. Then we add or subtract the separation of the label
+% from its location. Finally, we simply add the horizontal adjustment
+% defined by the user with \cs{tlabeloffset}. The value of
+% \cs{@tlabelsright} is set equal to this if it was less. We could omit
+% this group: we never use \cs{@tlabelsright} except in debugging.
+%
+% The macro \cs{tb@wd} expands to \cs{wd}\cs{@textbox}.
+% \begin{macrocode}
+ \mfp@scratch=##1\mfpicunit
+ \@xconv\mfp@scratch
+ \begingroup
+ \ifcase\tl@hpos \advance\mfp@scratch 0.5\tb@wd % center
+ \or \advance\mfp@scratch -\tlabel@sep % right
+ \else \advance\mfp@scratch \tb@wd % left
+ \advance\mfp@scratch \tlabel@sep
+ \fi
+ \advance\mfp@scratch \tlabel@hadj
+ \ifdim \mfp@scratch>\@tlabelsright
+ \@tlabelsright=\mfp@scratch
+ \fi
+ \endgroup
+% \end{macrocode}
+%
+% The following is the same as the previous calculations, but with respect
+% to the leftmost extension of picture and label. Here, however, we save
+% the calculated value in \cs{tb@moveright}, because it is exactly the
+% amount we'll need to \cs{kern} later to position the label.
+% \begin{macrocode}
+ \begingroup
+ \ifcase\tl@hpos \advance\mfp@scratch -0.5\tb@wd % center
+ \or \advance\mfp@scratch -\tb@wd % right
+ \advance\mfp@scratch -\tlabel@sep
+ \else \advance\mfp@scratch \tlabel@sep % left
+ \fi
+ \advance\mfp@scratch \tlabel@hadj
+ \tb@moveright=\mfp@scratch
+ \ifdim \mfp@scratch<\@tlabelsleft
+ \@tlabelsleft=\mfp@scratch
+ \fi
+ \endgroup
+% \end{macrocode}
+%
+% Now we base the calculations on the vertical extent of picture and
+% label. Otherwise the idea is the same, and we may increase
+% \cs{@graphtop}. The macro \cs{tb@ht} means \cs{ht}\cs{@textbox} and
+% \cs{tb@dp} means \cs{dp}\cs{@textbox}. Again we save the calculated
+% result (in \cs{tb@raise}) for later positioning of the label.
+% \begin{macrocode}
+ \mfp@scratch=##2\mfpicunit
+ \@yconv\mfp@scratch
+ \begingroup
+ \ifcase\tl@vpos \advance\mfp@scratch \tb@totalht % bottom
+ \advance\mfp@scratch \tlabel@sep
+ \or \advance\mfp@scratch 0.5\tb@totalht % center
+ \or \advance\mfp@scratch -\tlabel@sep % top
+ \else \advance\mfp@scratch \tb@ht % baseline
+ \fi
+ \advance\mfp@scratch \tlabel@vadj
+ \tb@raise=\mfp@scratch
+ \ifdim \mfp@scratch>\@tlabelstop
+ \@tlabelstop=\mfp@scratch
+ \fi
+ \endgroup
+% \end{macrocode}
+%
+% Finally we compute the bottom-most extent.
+% \begin{macrocode}
+ \begingroup
+ \ifcase\tl@vpos \advance\mfp@scratch \tlabel@sep % bottom
+ \or \advance\mfp@scratch -0.5\tb@totalht % center
+ \or \advance\mfp@scratch -\tb@totalht % top
+ \advance\mfp@scratch -\tlabel@sep
+ \else \advance\mfp@scratch -\tb@dp % baseline
+ \fi
+ \advance\mfp@scratch \tlabel@vadj
+ \ifdim \mfp@scratch<\@tlabelsbot
+ \@tlabelsbot=\mfp@scratch
+ \fi
+ \endgroup
+% \end{macrocode}
+%
+% Now we've computed the new size of \cs{@alltlabels} and we put the
+% new label on top of it with the above calculated kerns.
+% \begin{macrocode}
+ \global \setbox\@alltlabels=%
+ \vtop{\unvbox\@alltlabels
+ \vbox to 0pt{\kern-\tb@raise
+ \hbox{\kern\tb@moveright\box\@textbox}\vss}}%
+ \endgroup % group begun in \tlabel
+ \extraendtlabel}% End \@tlabel
+% \end{macrocode}
+%
+% \subsection{Surrounding the label with a path}\label{surrounding}
+%
+% These next macros place labels, but also define a path surrounding the
+% label This allows one to clear a space for the label, create a
+% background, draw a box around it, etc. They take two optional arguments.
+% The first optional argument depends on the type of path being created.
+% It is described below. The second one is the justification as in the
+% \cs{tlabel} command. There are two mandatory arguments, the location
+% (same syntax as for \cs{tlabel}) and the text. They also have
+% star-forms, which create the path but doesn't place the label.
+%
+% All the curves are sized to just contain what I will call the
+% \emph{label strip}. Imagine a rectangle that just fits around the text.
+% Now extend it on all sides by the value defined with \cs{tlabelsep}.
+% This rectangle is the label strip.
+%
+% \DescribeMacro{\tlabelrect}
+% \cs{tlabelrect} creates the rectangular boundaries of the label strip by
+% default. With the optional argument a rectangle with rounded corners is
+% produced; the optional argument is the radius of the quarter circles used.
+% These quarter circles pass through the corners of the label strip and are
+% joined together with straight lines to create the rest of the rectangle.
+% As a special case, the optional argument can contain the keyword
+% `\texttt{roundends}' to produce a rectangle with the short sides
+% replaced by a semicircle.
+%
+% \DescribeMacro{\tlabeloval}
+% \cs{tlabeloval} produces an ellipse which, by default has the same
+% aspect ratio as the label strip. It is sized to just include that label strip,
+% passing through its four corners. The optional argument contains a
+% numerical factor $m$ that, if greater than 1, increases the width and
+% decreases the height to maintain this relationship with the label strip,
+% while multiplying the width to height ratio by $m$. The default value of
+% $m$ is 1.
+%
+% \DescribeMacro{\tlabelellipse}
+% \cs{tlabelellipse} produces an ellipse, where the optional argument $a$
+% is the ratio of its width to its height. The default for $a$ is 1, which
+% produces a circle.
+%
+% \DescribeMacro{\tlabelcircle}
+% To get a circle the user can \cs{tlabelellipse} without the optional
+% argument, or with argument \oarg{1}. However, it makes for a more
+% readable source if the command reflects the shape. \cs{tlabelcircle} is
+% defined to be essentially \cs{tlabelellipse}\oarg{1}, but it first
+% checks for the \texttt{*} and passes it along in front of the \oarg{1}.
+%
+% We implement the other three by calling \cs{tlpath} with the name of the
+% curve (\texttt{rect}, \texttt{oval}, or \texttt{ellipse}) and the
+% default value of the optional argument (\texttt{0}, \texttt{1}, and
+% \texttt{1}, respectively) as arguments.
+% \begin{macrocode}
+ \newdef\tlabelrect{\tlpath{rect}{0}}%
+ \newdef\tlabeloval{\tlpath{oval}{1}}%
+ \newdef\tlabelellipse{\tlpath{ellipse}{1}}%
+ \newdef\tlabelcircle{%
+ \mfp@ifnextchar*{\@firstoftwo{\tlabelellipse*[1]}}%
+ {\tlabelellipse[1]}}%
+% \end{macrocode}
+%
+% We store the name of the path in \cs{mfp@name} and the default argument
+% in \cs{mfp@param}, then check for a \texttt{*} and set a switch based
+% on it before calling \cs{@tlpath}. The \cs{@figmacstart} must be outside
+% the group so the switches it sets will survive for later commands to
+% detect.
+% \begin{macrocode}
+ \newdef\tlpath##1##2{\@figmacstart
+ \begingroup % ended in \tlabelpath@
+ \def\mfp@name{##1}\def\mfp@param{##2}%
+ \mfp@ifnextchar*%
+ {\@mfpswitchtrue\@firstoftwo{\@tlpath}}% gobbles the star
+ {\@mfpswitchfalse\@tlpath}}%
+% \end{macrocode}
+% Process first optional argument. First one has value of \cs{mfp@param}
+% as default. The second one has a default justification set by the user
+% with \cs{tlpathjustify} or the initial \texttt{[cc]} setting. Once these
+% are processed, we check whether a parentheses follows, calling one of
+% two different handlers for the location parameter(s).
+% \begin{macrocode}
+ \newdef\@tlpath{\null@opt\@@tlpath}%
+ \newdef\@@tlpath[##1]{%
+ \edef\mfp@param{\mfp@mtsub{##1}{\mfp@param}}%
+ \mfp@resetwhitespace
+ \simple@opt\@@@tlpath{\tlpath@v\tlpath@h\tlpath@r}}%
+ \newdef\@@@tlpath##1{\tlabeljustify{##1}%
+ \mfp@setMPpos \mfp@ifnextchar({\@tlabelpath}{\@@tlabelpath}}%
+% \end{macrocode}
+%
+% These handlers just stuff the point into a macro and call the command
+% that reads the label code. The name \cs{mfp@points} is plural (even
+% though only one point is supported) because the internal command that
+% places the label expects this macro. We use \cs{@firstofone} so
+% that the braces will not be written to the output, but they will
+% function as braces for \TeX's parameter matching.
+% \begin{macrocode}
+ \newdef\@tlabelpath (##1,##2){%
+ \def\mfp@points{(\@firstofone{##1},\@firstofone{##2})}%
+ \@@@tlabelpath}%
+ \newdef\@@tlabelpath##1{\def\mfp@points{##1}\@@@tlabelpath}%
+ \newdef\@@@tlabelpath{\mfp@restorepar
+ \@ifmplabels{\@makeother\#}{}\mfp@gettoks\tlabelpath@}%
+% \end{macrocode}
+%
+% Under \opt{mplabels} we just call on \MP{} to do everything (including
+% measuring the text). Otherwise we measure the text in \TeX{} and feed
+% the bounding box corners to \MF{} for making the path. Then we optionally
+% place the text based on the switch previously set. All the data needed
+% have already been stored in macros by previous commands in the chain.
+% \begin{macrocode}
+ \newdef\tlabelpath@{%
+ \@ifmplabels
+ {\mfcmd{text\mfp@name x (\mfp@MPpos)\@nl(origin, % dummy parameter
+ \mfp@btex{\the\mfp@toks}, \mfp@param, \mfp@points)}}%
+ {\measure@textbox{\the\mfp@toks}%
+ \mfcmd{text\mfp@name x (\mfp@MPpos)\@nl(\tb@ll, \tb@ur, % text bbox
+ \mfp@param, \mfp@points)}}%
+ \if@mfpswitch \endgroup % *-form, no label placed
+ \else % tlabel commands contain \endgroup
+ \@ifmplabels{\@@@tlabel}%
+ {\@xp\@@tlabel@\mfp@points{\the\mfp@toks}}%
+ \fi}%
+% \end{macrocode}
+%
+% Here we define the command that measures the text. It is almost a clone
+% of a similar code sequence in \cs{@tlabel}, but it produces the \gbc{ll}
+% and \gbc{ur} (corners of the boundingbox) that the \grafbase{} code
+% needs.
+% \begin{macrocode}
+ \newdef\measure@textbox##1{%
+ \set@textbox{##1}%
+ \edef\tb@ll{(0, -(\the\tb@dp))}%
+ \edef\tb@ur{(\the\tb@wd, \the\tb@ht)}}%
+% \end{macrocode}
+%
+% \subsection{Placing multiple text labels}\label{multiple}
+%
+% \DescribeMacro{\tlabels}
+% One of the more onerous things about labels in \env{mfpic} environments
+% was the shear number of them. The following was intended to reduce the
+% amount of typing by having to repeat only the arguments. \cs{tlabels}
+% takes only one argument: any sequence of valid arguments for a \cs{tlabel}
+% command, optionally separated by whitespace (but not blank lines).
+%
+% We begin a group, reset whitespace to normal, and call the command that
+% reads the argument. That command arranges to make the main code
+% self-looping by defining \cs{extraendtlabel} to call the beginning of the
+% loop, then it feeds its argument to \cs{do@tlabels} followed by a
+% delimiter to signal the end of the loop.
+% \begin{macrocode}
+ \newdef\tlabels{%
+ \begingroup % ended in \do@tlabels
+ \mfp@resetwhitespace \@tlabels}%
+ \newdef\@tlabels##1{\def\extraendtlabel{\do@tlabels}%
+ \do@tlabels##1\mfp@delim}%
+% \end{macrocode}
+%
+% If \cs{do@tlabels} sees the end-of-loop delimiter it ends the group and
+% gobbles the delimiter. Otherwise it calls \cs{tlabel}, which sees the
+% next set of arguments, and repeats the loop.
+% \begin{macrocode}
+ \newdef\do@tlabels{%
+ \mfp@ifnextchar\mfp@delim{\@firstoftwo\endgroup}{\tlabel}}%
+% \end{macrocode}
+%
+% Labelling axes generates a lot of \cs{tlabel} commands or a single
+% \cs{tlabels} command with a lot of arguments. Given that such labels
+% have much in common (e.g., for the x-axis the y-coordinate and the
+% justification are usually the same for all the labels) we can do still
+% better at abbreviating this task.
+%
+% \DescribeMacro{\axislabels}
+% The \cs{axislabels} command takes a mandatory argument (the axis)
+% followed by an optional argument (the justification, as in the
+% \cs{tlabel} command), followed by another mandatory argument, a comma
+% separated list of items of the form
+% \marg{\meta{label}}\meta{coordinate}. The label is placed at that
+% coordinate on the given axis. This command is complicated by the fact
+% that the default justification should be different for each axis (for
+% example, for the y-axis it is \oarg{cr} but for the x-axis it is
+% \oarg{tc}). For all of them, one of the parts is \texttt{c}, so after
+% resetting whitespace we initialize them both to this and later change
+% only the one that needs it.
+%
+% Also, one of the coordinates of a label will be given by the argument,
+% while the other is the location of the axis. However, which coordinate
+% is which is different for different axes. What we do is feed the
+% argument to \cs{mfp@xcoord} and \cs{mfp@ycoord}. Both are initialized to
+% the identity macro, but one is changed to expand to just the axis
+% position.
+%
+% The axis position for x- and y-axis is 0. For border axes it is
+% calculated by adding the border axis shift to the border coordinate.
+% \begin{macrocode}
+ \newdef\axislabels##1{%
+ \begingroup % ended in \do@axislabel
+ \mfp@resetwhitespace \tlabeljustify{cc}%
+ \let\mfp@xcoord=\@firstofone \let\mfp@ycoord=\@firstofone
+ \get@axisnum{##1}\axislabels
+ \ifcase\mfp@axisnum \tl@vpos=2 % x-axis -->[tc]
+ \def\mfp@ycoord{0}%
+ \or \tl@hpos=1 % y-axis-->[cr]
+ \def\mfp@xcoord{0}
+ \or \tl@hpos=1 % left -->[cr]
+ \edef\mfp@xcoord{\mfp@lshift}\mfpaddto\mfp@xcoord{#3}%
+ \or \tl@vpos=2 % bottom-->[tc]
+ \edef\mfp@ycoord{\mfp@bshift}\mfpaddto\mfp@ycoord{#5}%
+ \or \tl@hpos=-1 % right -->[cl]
+ \edef\mfp@xcoord{-\mfp@rshift}\mfpaddto\mfp@xcoord{#4}%
+ \or \tl@vpos=0 % top -->[bc]
+ \edef\mfp@ycoord{-\mfp@tshift}\mfpaddto\mfp@ycoord{#6}%
+ \fi
+% \end{macrocode}
+%
+% Now one of \cs{mfp@xcoord} or \cs{mfp@ycoord} expands to the axis
+% position. We change it so that it does this while gobbling a parameter.
+% And then call \cs{@axislabels}, feeding it an empty argument as the
+% default optional argument.
+% \begin{macrocode}
+ \ifx\@firstofone\mfp@xcoord
+ \edef\mfp@ycoord####1{\mfp@ycoord}%
+ \else
+ \edef\mfp@xcoord####1{\mfp@xcoord}%
+ \fi \null@opt\@axislabels}%
+% \end{macrocode}
+%
+% \cs{@axislabels} processes the contents of the optional parameter and
+% calls \cs{do@axislabel} on the list in the argument. An additional item
+% is added that signals the end of the loop.
+% \begin{macrocode}
+ \newdef\@axislabels[##1]##2{%
+ \tlabeljustify{##1}%
+ \do@axislabel~ ##2,\mfp@delim}%
+% \end{macrocode}
+%
+% We add some code that traps the most common typos: a comma between the
+% label and the coordinate, or a missing coordinate, or a doubled comma.
+% It seems impossible to detect which of the first two has happened, and
+% assuming the first case produces really awful results if the second is
+% true. Therefore when a coordinate seems to be missing, we just lose the
+% text (as we have no place to put it) and resume the loop. If the first
+% case is true, the next iteration will see only the number, read one
+% digit or decimal as the text and the rest as the coordinate. The output
+% will be wrong, but at least \TeX{} can proceed.
+%
+% Above we prepended a `\verb*+~ +' so that if the coordinate is missing,
+% the braces around the argument won't be lost; the space will be
+% consumed in the argument processing of \cs{do@@axislabel}.
+%
+% The first argument should be the label, and everything from that to the
+% comma is the location. In the above error cases, the second argument
+% is empty
+% \begin{macrocode}
+ \newdef\do@axislabel~##1,{%
+ \@ifmtarg{##1}{\x@axislabel}{\do@@axislabel##1\@nil}}%
+ \newdef\do@@axislabel##1##2\@nil{%
+ \@ifmtarg{##2}%
+ {\Mfpic@warn{Possible extra comma, missing coordinate, or
+ missing\@msgbreak braces in \string\axislabels\@online.
+ Skipping this label.}}%
+ {\tlabel(\mfp@xcoord{##2},\mfp@ycoord{##2}){##1}}%
+ \x@axislabel}%
+ \newdef\x@axislabel{% check for end of list
+ \mfp@ifnextchar\mfp@delim{\@firstoftwo\endgroup}{\do@axislabel~ }}%
+% \end{macrocode}
+%
+% \subsection{Captions}\label{captions}
+%
+% Captions are not added immediately by the \cs{tcaption} command. That
+% command redefines \cs{@docaption} to add it, and \cs{endmfpic} executes
+% \cs{@docaption}. For now, \cs{@docaption} does nothing.
+% \begin{macrocode}
+ \newdef\@docaption{}%
+% \end{macrocode}
+%
+% \DescribeMacro{\tcaption}
+% \cs{tcaption} takes an optional argument that holds two numbers,
+% separated by a comma. The first number determines the maximum width of a
+% one line caption. Captions larger than that multiple of the width of the
+% graphic will be reset as a paragraph, whose lines have length the second
+% number times the width of the graph. The defaults are \oarg{1.2,1}.
+%
+% \cs{@tcaption} has one mandatory argument, the caption's text. In it, the
+% \cs{\bsl} command forces line breaks. This works by forcing the width to
+% be greater than any reasonable setting of the maximum line width. When
+% this happens, the caption is reset in a \cs{vbox} and \cs{\bsl} is
+% redefined like a normal line break.
+% \begin{macrocode}
+ \newdef\tcaption{\simple@opt\tcaption@{1.2, 1.0}}%
+ \newdef\tcaption@##1{\@tcaption##1\mfp@delim}%
+ \long\def\@tcaption##1,##2\mfp@delim##3{%
+ \def\@docaption{%
+ \setbox\@textbox=%
+ \hbox{\def\\{\hskip\@M\p@}\mfp@restorepar
+ \@tcurr##3}%
+% \end{macrocode}
+%
+% If the above \cs{hbox} is too wide, we re-assign \cs{@textbox} to a
+% \cs{vbox} with \cs{hsize} determined by the second part of the optional
+% argument, and with \cs{leftskip} and \cs{rightskip} defined according
+% to the setting of \opt{centeredcaptions}.
+% \begin{macrocode}
+ \@graphwd=\wd\@wholegraph
+ \ifdim\tb@wd>##1\@graphwd
+ \setbox\@textbox=%
+ \hbox{%
+ \vbox{%
+ \if@mfp@latex % keep LaTeX's `\\'
+ \else
+ \def\\{\unskip\hbox{}\hfil\penalty-\@M\ignorespaces}%
+ \fi
+ \if@mfp@centcapt
+ \leftskip=0pt plus 0.5fil
+ \rightskip=0pt plus -0.5fil
+ \parfillskip=0pt plus 1fil
+ \else
+ \leftskip=0pt
+ \rightskip=0pt
+ \fi
+ \hsize=##2\@graphwd \mfp@restorepar
+ \noindent\@tcurr ##3%
+ }% End vbox.
+ }% End hbox.
+ \fi
+% \end{macrocode}
+%
+% Here we determine the wider of the graph or the caption, then put the
+% graph and caption together by centering them in \cs{hbox}es with this
+% width, stacked one atop the other with \cs{mfpiccaptionskip} (default:
+% \cs{medskipamount}) in between.
+% \begin{macrocode}
+ \mfp@scratch=\wd\@wholegraph
+ \ifdim \mfp@scratch<\tb@wd \mfp@scratch=\tb@wd \fi
+ \global\setbox\@wholegraph=%
+ \vbox{\hbox to \mfp@scratch{\hss\box\@wholegraph\hss}%
+ \nointerlineskip \vskip\mfpiccaptionskip
+ \hbox to \mfp@scratch{\hss\box\@textbox\hss}}% End vbox.
+ }% End \@docaption.
+% \ignorespaces
+ }% End \@tcaption.
+% \ignorespaces
+}% End of \@mfpic
+% \end{macrocode}
+%
+%
+% \section{Placing the picture: \cs{endmfpic}}\label{endmfpic}
+%
+% By the time \cs{endmfpic} is reached, the \MF{} code for the figure has
+% all been written to the output file. The labels have all been
+% accumulated and arrangements have been made to add the caption.
+%
+% \DescribeMacro{\endmfpic}
+% Under \opt{metapost}, write \cs{endgroup} to match beginning written
+% by \cs{mfpic} Then write the \cs{grafbase} command \gbc{endmfpic},
+% followed by a comment telling which figure number it is, and the line
+% number in the \TeX{} source where the \cs{endmfpic} occurred.
+% \begin{macrocode}
+\mfp@DBlog{Definition of closure of mfpic environment.}%
+\newdef\endmfpic{%
+ \mfsrc{\mfp@ifmpost{\@nl verbatimtex \endgroup\space etex;}{}\@nl
+ endmfpic;\mf@p (\number\mfp@count) \space\@mfplineno.\@nl
+ \mf@p\mf@d\mf@d\mf@d\@nl}%
+ \ifmfpicdebug\wlog{}\wlog{Mfpic: ENTERED endmfpic.}\wlog{}\fi
+% \end{macrocode}
+% The code to load and place the box is skipped if figure shipping was
+% turned off.
+% \begin{macrocode}
+ \if@shipping %
+% \end{macrocode}
+%
+% \subsection{Loading and measuring the graphic}\label{loading}
+%
+% Now we load the graphic. It would be at this point that we could add a
+% \cs{write18} to process the figure on-the-fly. Of course that would
+% require re-initializing the output file with each graphic (i.e., the
+% equivalent of issuing \cs{opengraphsfile} at every \cs{mfpic} and
+% \cs{closegraphsfile} at every \cs{endmfpic}.)
+% \begin{macrocode}
+ \global\setbox\@wholegraph=%
+ \vbox{%
+% \end{macrocode}
+%
+% If draft mode has been detected or set by the user, we just make a box
+% of the size specified with the figure number inside it.
+% \begin{macrocode}
+ \ifmfpicdraft
+ \vbox to \@graphtop{\vss
+ \hbox to \@graphwd{\kern2pt\tt\#\number\mfp@count\hss}%
+ \kern2pt}%
+ \else
+% \end{macrocode}
+%
+% The \opt{truebbox} option works at the \MP{} level. Without it the
+% height of the EPS bounding box will actually be the calculated value
+% of \cs{@graphtop} (but increased by up to \texttt{2bp} due to rounding).
+% With it, the box will be its natural height. In either case, the actual
+% height is what we use in the \MP{} case. For \MF{} we use the nominal
+% height calculated in \cs{mfpic}.
+% \begin{macrocode}
+ \mfp@ifmpost{\vbox}{\vbox to \@graphtop}%
+ {\vss
+% \end{macrocode}
+%
+% \cs{@graphfilename} holds the name of the \MP{} output figure. (It will be
+% ignored by the \opt{metafont} option.) We test if the file exists before
+% doing the graphic inclusion because of the large number of confusing error
+% messages many graphic inclusion packages generate otherwise. When absent
+% we substitute the figure number for \cs{@setmfpicgraphic}. When present,
+% and if in \LaTeXe, we arrange for the current numerical extension to be
+% accepted as an EPS or MPS file by the \cs{includegraphics} command of the
+% graphics package.
+% \begin{macrocode}
+ \edef\@graphfilename{\setfilename{\mfp@filename}%
+ {\number\mfp@count}}%
+ \mfp@ifmpost
+ {\openin\mfp@graph=\@graphfilename\relax
+ \ifeof\mfp@graph
+ \Mfpic@msg{No graph file: \@graphfilename\space.}%
+ \def\@setmfpicgraphic##1{\raise2pt\hbox{\kern2pt\tt ##1}}%
+ \closein\mfp@graph
+ \else\if@mfp@latexe
+ \@namedef{Gin@rule@.\number\mfp@count}##1{%
+ {\mfp@Gtype}{.\number\mfp@count}{##1}}%
+ \fi\fi}{}%
+% \end{macrocode}
+%
+% We put the graphic in an \cs{hbox} of the required width and close off
+% the boxes.
+% \begin{macrocode}
+ \mfp@ifmpost{\hbox}{\hbox to \@graphwd}%
+ {\@xp\@setmfpicgraphic\@xp{\@graphfilename}\hss}% End hbox.
+ \kern0pt
+ }% End vbox
+ \fi
+ }%% End vbox (\setbox\@wholegraph)
+% \end{macrocode}
+%
+% We change the horizontal and vertical dimensions under \opt{metapost} in
+% case \opt{truebbox} was in effect, but also because they are almost always
+% rounded up to whole numbers of \texttt{bp} and therefore, even without
+% \opt{truebbox} the calculated values needn't be correct.
+% \begin{macrocode}
+ \mfp@ifmpost
+ {\@graphright=\wd\@wholegraph
+ \@graphtop=\ht\@wholegraph
+ \@graphwd=\@graphright}{}%
+ \ifmfpicdebug
+ \wlog{Mfpic: graphleft = \the\@graphleft}%
+ \wlog{Mfpic: graphright = \the\@graphright}%
+ \wlog{Mfpic: graphtop = \the\@graphtop}%
+ \wlog{Mfpic: graphbot = \the\@graphbot}%
+ \wlog{Mfpic: graphwd = \the\wd\@wholegraph}%
+ \wlog{Mfpic: graphht = \the\ht\@wholegraph}%
+ \wlog{Mfpic: graphdp = \the\dp\@wholegraph}%
+ \wlog{}%
+ \fi
+% \end{macrocode}
+%
+% \subsection{Adding labels and caption}\label{addlabel}
+%
+% We now add the box \cs{@alltlabels} onto the graph box. The box should
+% still have 0pt height and depth, so we can just stick it under the graph
+% box. But first we have to adjust for \cs{mfpicllx} and \cs{mfpiclly}
+% which can only be known after the graphics inclusion. We reset the box
+% \cs{@alltlabels} so its contents are shifted by these values. We only
+% need to do this if labels have have actually been added. The signal that
+% this has happened is that the label dimensions are no longer
+% $\pm$\cs{maxdimen}.
+% \begin{macrocode}
+ \ifmfpicdebug
+ \wlog{Mfpic: tlabelsleft = \the\@tlabelsleft}%
+ \wlog{Mfpic: tlabelsright = \the\@tlabelsright}%
+ \wlog{Mfpic: tlabelstop = \the\@tlabelstop}%
+ \wlog{Mfpic: tlabelsbot = \the\@tlabelsbot}%
+ \wlog{}%
+ \fi
+ \ifdim\@tlabelsleft < \maxdimen
+ \setbox\@alltlabels\vtop to 0pt{%
+ \kern \mfpiclly bp
+ \moveleft \mfpicllx bp \box\@alltlabels
+ \vss}%
+% \end{macrocode}
+% Then we adjust \cs{@tlabelsleft}, etc. for the boundingbox offset.
+% \begin{macrocode}
+ \mfp@scratch\@tlabelsleft
+ \advance\mfp@scratch-\mfpicllx bp
+ \ifdim\mfp@scratch<\@graphleft
+ \@graphleft\mfp@scratch
+ \fi
+ \mfp@scratch\@tlabelsright
+ \advance\mfp@scratch-\mfpicllx bp
+ \ifdim\mfp@scratch>\@graphright
+ \@graphright\mfp@scratch
+ \fi
+ \mfp@scratch\@tlabelstop
+ \advance\mfp@scratch-\mfpiclly bp
+ \ifdim\mfp@scratch>\@graphtop
+ \@graphtop\mfp@scratch
+ \fi
+ \mfp@scratch\@tlabelsbot
+ \advance\mfp@scratch-\mfpiclly bp
+ \ifdim\mfp@scratch<\@graphbot
+ \@graphbot\mfp@scratch
+ \fi
+ \setbox\@wholegraph=\vtop{%
+ \unvbox\@wholegraph\box\@alltlabels}%
+ \fi
+% \end{macrocode}
+%
+% The method for putting labels in \cs{@alltlabels} does not add any width
+% on the left, nor any height to the top or depth to the bottom of that box
+% (that \TeX{} can detect), but we have saved their values and now we can
+% use them. For example, if \cs{@graphleft} is negative after the above,
+% then a label sticks out to the left, but \TeX{} thinks it has no width.
+% Therefore put \cs{kern}\texttt{-}\cs{@graphleft} to move the graph
+% rightward. The height and depth are taken care of by putting it in
+% \cs{vbox} with the calculated total height and moving the graph upward
+% with \cs{kern}\texttt{-}\cs{@graphbot}. The rightward extensions do get
+% detected by \TeX.
+% \begin{macrocode}
+ \ifmfpicdebug
+ \wlog{Mfpic: tlabelsleft = \the\@tlabelsleft}%
+ \wlog{Mfpic: tlabelsright = \the\@tlabelsright}%
+ \wlog{Mfpic: tlabelstop = \the\@tlabelstop}%
+ \wlog{Mfpic: tlabelsbot = \the\@tlabelsbot}%
+ \wlog{}%
+ \fi
+ \mfp@scratch=\@graphtop
+ \advance\mfp@scratch by -\@graphbot
+ \global \setbox\@wholegraph=%
+ \vbox to \mfp@scratch{\vss
+ \hbox{\kern-\@graphleft\box\@wholegraph}%
+ \kern-\@graphbot}% End vbox.
+% \end{macrocode}
+%
+% Now add the caption, then set the parameters \cs{mfpicheight} and
+% \cs{mfpicwidth} for user to examine. The debug info now should show
+% graphwd${}={}$graphright${}-{}$graphleft,
+% graphht${}={}$graphtop${}-{}$graphbot, and graphdp${}= 0$.
+% \begin{macrocode}
+ \ifmfpicdebug
+ \wlog{Mfpic: graphleft = \the\@graphleft}%
+ \wlog{Mfpic: graphright = \the\@graphright}%
+ \wlog{Mfpic: graphtop = \the\@graphtop}%
+ \wlog{Mfpic: graphbot = \the\@graphbot}%
+ \wlog{Mfpic: graphwd = \the\wd\@wholegraph}%
+ \wlog{Mfpic: graphht = \the\ht\@wholegraph}%
+ \wlog{Mfpic: graphdp = \the\dp\@wholegraph}%
+ \wlog{}%
+ \fi
+ \@docaption
+ \global\mfpicheight\ht\@wholegraph
+ \global\mfpicwidth\wd\@wholegraph
+ \ifmfpicdebug
+ \wlog{Mfpic: graphleft = \the\@graphleft}%
+ \wlog{Mfpic: graphright = \the\@graphright}%
+ \wlog{Mfpic: graphtop = \the\@graphtop}%
+ \wlog{Mfpic: graphbot = \the\@graphbot}%
+ \wlog{Mfpic: graphwd = \the\wd\@wholegraph}%
+ \wlog{Mfpic: graphht = \the\ht\@wholegraph}%
+ \wlog{Mfpic: graphdp = \the\dp\@wholegraph}%
+ \wlog{}%
+ \fi
+% \end{macrocode}
+%
+% \subsection{Placing the graphic}\label{placing}
+%
+% Add a frame around the box \cs{@wholegraph} in draft mode (so its size
+% can be seen) since there is practically nothing in it except the picture
+% number
+% \begin{macrocode}
+ \ifmfpicdraft
+ \setbox\@wholegraph=%
+ \hbox{\@mfpframed{-\mfpframethickness}{\box\@wholegraph}}%
+ \fi
+% \end{macrocode}
+%
+% If the \cs{savepic} command occurred prior to this, then \cs{s@vemfpic}
+% is defined and we save this picture in the box named in that
+% \cs{savepic} command and stored in the macro \cs{s@vemfpic}. Otherwise,
+% \cs{s@vemfpic} is undefined, and we place the picture (\cs{@wholegraph})
+% in the document. Afterward, we undefine \cs{s@vemfpic}.
+% \begin{macrocode}
+ \mfp@ifdefined\s@vemfpic
+ {\global\setbox\s@vemfpic=\box\@wholegraph}%
+ {\leavevmode\box\@wholegraph}%
+ \global\let\s@vemfpic\UndEfInEd
+% \end{macrocode}
+%
+% Now we advance the figure count, end the group started by the \cs{mfpic}
+% command, restore the values of extra font dimensions that were saved,
+% then arrange for spaces to be ignored in case the syntax
+% \cs{begin}\marg{mfpic}$\ldots$\cs{end}\marg{mfpic} was used.
+% \begin{macrocode}
+ \global \advance\mfp@count1
+ \fi % end of \if@shipping
+ \endgroup % Begun near start of \@mfpic
+ \restore@mfpicdimens
+ \if@mfp@latex
+ \def\mfptmp@a{mfpic}%
+ \ifx\mfptmp@a\@currenvir
+ \@ignoretrue% so \endmfpic and \end{mfpic} have the same effect.
+ \fi
+ \fi
+ \ignorespaces
+}%
+% \end{macrocode}
+%
+%
+% \section{Additional features}\label{additional}
+%
+% \subsection{Saving a copy of the picture}\label{saving}
+%
+% \DescribeMacro{\newsavepic}
+% One saves a picture by first allocating a save box with
+% \cs{newsavepic}\marg{\cs{mypic}}, then saying
+% \cs{savepic}\marg{\cs{mypic}} beforehand. The \cs{endmfpic} code
+% detects that this has been done and saves the picture in \cs{mypic}.
+% It can be placed with \cs{usepic}{\cs{mypic}}.
+%
+% \cs{newsavepic} is just a clone of \LaTeX's \cs{newsavebox}. The one
+% argument is a control sequence.
+% \begin{macrocode}
+\newdef\newsavepic#1{%
+ \if@mfp@latex \newsavebox{#1}%
+ \else
+ \mfp@ifdefined{#1}%
+ {\mfp@errmsg
+ {Command \string #1 already defined.}%
+ {You have used \newsavepic with an already defined or an^^J%
+ improper control sequence. Replace #1 with another name.^^J%
+ If you proceed, \newsavepic will be ignored.}}%
+ {\csname newbox\endcsname#1}%
+ \fi}%
+\newlet\newpic=\newsavepic % compatibility
+% \end{macrocode}
+%
+% \DescribeMacro{\savepic}
+% All \cs{savepic} really does is define \cs{s@vepic} to its argument,
+% which should be a control sequence defined by \cs{newsavepic} (or
+% \cs{newbox}).
+% \begin{macrocode}
+\newdef\savepic#1{\relax
+ \mfp@ifdefined{#1}{\gdef\s@vemfpic{#1}}%
+ {\mfp@errmsg{Box \string#1 undefined.}%
+ {You tried to save a picture in a box which had not been^^J%
+ previously allocated. Use \newsavepic to allocate a box.}}}%
+% \end{macrocode}
+%
+% \DescribeMacro{\usepic}
+% \cs{usepic} takes one argument, a control sequence that should have
+% been previously used in a \cs{savepic} comamnd. It just places the box
+% with the primitive \cs{copy} command.
+% \begin{macrocode}
+\newdef\usepic#1{\leavevmode \copy#1\relax}%
+% \end{macrocode}
+%
+% \subsection{Putting a frame around it}\label{frame}
+%
+% This is essentially code I wrote years ago to have a framing command
+% that had two properties not enjoyed by come example `\cs{boxit}' commands
+% for plain\TeX: It should have a baseline the same as the baseline of the
+% contents, and it should work as an environment, not by reading an
+% argument (so verbatim material could be included).
+%
+% \DescribeMacro{\mfpframed}
+% \DescribeMacro{\mfpframe}
+% \cs{mfpframed} takes an optional argument (the separation) and a
+% mandatory argument, the contents. \cs{mfpframe}$\ldots$\cs{endmfpframe}
+% is an environment and \cs{mfpframe} also takes the separation as an
+% optional argument.
+%
+% \DescribeMacro{\framed}
+% \cs{framed} is a common command (\ConTeXt{} has one, a few packages also
+% define it), therefore we only define it if it is not already defined.
+% \begin{macrocode}
+\newdef\mfpframed{\simple@opt\@mfpframed\mfpframesep}%
+\newdef\mfpframe{\simple@opt\@mfpframe\mfpframesep}%
+\newdef\@mfpframed#1#2{\@mfpframe{#1}#2\endmfpframe}%
+\newdef\@mfpframe#1{%
+ \leavevmode\hbox\bgroup
+ \mfpframesep#1\relax
+ \vrule width\mfpframethickness
+ \vtop\bgroup
+ \vbox\bgroup
+ \hrule height\mfpframethickness
+ \kern\mfpframesep
+ \hbox\bgroup \kern\mfpframesep \ignorespaces}%
+\newdef\endmfpframe{\unskip
+ \kern\mfpframesep
+ \egroup % end hbox
+ \egroup % end vbox
+ \kern\mfpframesep
+ \hrule height\mfpframethickness
+ \egroup % end vtop
+ \vrule width\mfpframethickness
+ \egroup}% end hbox
+\mfp@ifdefined\framed{}{\newlet\framed=\mfpframed}%
+% \end{macrocode}
+%
+% \subsection{Adding \mfc{verbatimtex} to the \file{.mp}
+% file}\label{verbatimtex}
+%
+% \DescribeMacro{mfpverbtex}
+% This is a user level utility for putting some \mfc{verbatimtex} material
+% in the output file for \MP. We allow the user to do this even before
+% \cs{opengraphsfile} by storing it in a token register and setting a flag
+% for that command to test.
+% \begin{macrocode}
+\newif\if@mfp@verbtex
+\def\mfpverbtex{%
+% \end{macrocode}
+%
+% We start a group, make sure lines will be preserved in writing the
+% material, make sure that \texttt{\#} characters will not be doubled by
+% changing its category, then continue after loading the code into the
+% token register \cs{mfp@verbtex}.
+% \begin{macrocode}
+ \begingroup \preservelines \@makeother\#%
+ \afterassignment\mfp@writetex\global\mfp@verbtex=}%
+% \end{macrocode}
+%
+% We end the group and then either set the switch to tell
+% \cs{opengraphsfile} that the material is ready, or we write it to the
+% output, between the commands \gbc{verbatimtex} and \cs{etex}.
+% \begin{macrocode}
+\def\mfp@writetex{%
+ \endgroup
+ \@ifmfpfileisopen
+ {\mfp@ifmpost
+ {\mfsrc{verbatimtex}\mfsrc{\the\mfp@verbtex}\mfcmd{etex}}%
+ {\noMP@error{verbatimtex}}%
+ \global\@mfp@verbtexfalse\mfp@verbtex{}}%
+ {\global\@mfp@verbtextrue}}%
+% \end{macrocode}
+%
+%
+% \section{Finale}\label{finale}
+%
+% Set the default starting graphic number.
+% \begin{macrocode}
+\global\mfp@count=1 % 1 because we now advance it in \endmfpic.
+% \end{macrocode}
+%
+% Create a system for adding patches in the file \file{mfppatch.tex},
+% and for user defaults in a file \file{mfpic.usr}.
+% \begin{macrocode}
+\newdef\MFPICinput#1{%
+ \immediate\openin\mfp@graph=#1
+ \ifeof\mfp@graph
+ \immediate\closein\mfp@graph
+ \else
+ \immediate\closein\mfp@graph
+ \input #1
+ \fi}%
+\MFPICinput{mfppatch.tex}%
+% \end{macrocode}
+%
+% Restore the meaning of \cs{+}, and of the \cs{newlinechar}, and execute
+% the command that restores all the saved category codes.
+% \begin{macrocode}
+\mfp@DBlog{Punctuation, etc., will revert to old catcodes now.}%
+\let\+\mfpsaveplus
+\restorenewlinechar
+\MFPicpackagE%
+\MFPICinput{mfpic.usr}%
+%</tex>
+% \end{macrocode}
+%
+% Generate a (far too) simple wrapper for \LaTeX.
+% \begin{macrocode}
+%<*sty>
+\input mfpic.tex\relax
+%</sty>
+% \end{macrocode}
+%\clearpage
+%\Finale
diff --git a/Master/texmf-dist/source/generic/mfpic/mfpic.ins b/Master/texmf-dist/source/generic/mfpic/mfpic.ins
new file mode 100644
index 00000000000..c72d045ecac
--- /dev/null
+++ b/Master/texmf-dist/source/generic/mfpic/mfpic.ins
@@ -0,0 +1,90 @@
+% File mfpic.ins
+% Mfpic version 0.7a beta 2004/04/16
+%
+% Copyright 2002--2003, Daniel H. Luecking
+%
+% Mfpic consists of the 3 files mfpic.dtx, grafbase.dtx and mfpic.ins
+% and the 5 files they generate: mfpic.tex, mfpic.sty, grafbase.mf,
+% grafbase.mp, and dvipsnam.mp.
+%
+% Mfpic may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License, either version 1.2 of this license or (at
+% your option) any later version. The latest version of this license is in
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.2 or later is part of all distributions of LaTeX version
+% 1999/12/01 or later.
+%
+% Documentation, examples, and ancillary files are separate and not
+% covered by this license. See readme.1st for a complete list. See
+% individual files for any copyright and license restrictions.
+%
+% With respect to the proposed draft LPPL-1.3: mfpic has maintenance
+% status "maintained". The Current Maintainer is Daniel H. Luecking. There
+% are several Base Interpreters: TeX, LaTeX, MetaPost and Metafont.
+%
+\input docstrip
+\keepsilent
+\preamble
+
+-------------------------------------------------------------------
+
+Copyright 2002--2003, Daniel H. Luecking
+
+Mfpic consists of the 3 files mfpic.dtx, grafbase.dtx and mfpic.ins
+and the 5 files they generate: mfpic.tex, mfpic.sty, grafbase.mf,
+grafbase.mp, and dvipsnam.mp.
+
+Documentation, examples, and ancillary files are separate. See
+readme.1st for a complete list.
+
+Mfpic may be distributed and/or modified under the conditions of the
+LaTeX Project Public License, either version 1.2 of this license or (at
+your option) any later version. The latest version of this license is in
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.2 or later is part of all distributions of LaTeX version
+1999/12/01 or later.
+
+With respect to the proposed draft LPPL-1.3: mfpic has maintenance
+status "maintained". The Current Maintainer is Daniel H. Luecking. There
+are several Base Interpreters: TeX, LaTeX, MetaPost and Metafont.
+
+\endpreamble
+\edef\zyx{%
+endinput.^^J%
+\DoubleperCent^^J%
+\DoubleperCent\space End of file `\outFileName'.}
+
+\askforoverwritefalse
+
+\generate{ \file{mfpic.tex}{\from{mfpic.dtx}{tex}}
+ \file{mfpic.sty}{\from{mfpic.dtx}{sty}}
+ \usepostamble\zyx
+ \file{grafbase.mf}{\from{grafbase.dtx}{MF}}
+ \file{grafbase.mp}{\from{grafbase.dtx}{MP}}
+ \file{dvipsnam.mp}{\from{grafbase.dtx}{dvips}}}
+
+\def\jts{^^J \space\space\space}
+\immediate\write16{%
+^^J*****************************************************************
+^^J
+^^J To finish the installation:
+^^J
+^^J -- Copy the files mfpic,tex and mfpic.sty to a location where
+\jts TeX and LaTeX will find them. In a TDS compliant system
+\jts the directory TEXMF/tex/generic/mfpic/ is recommended.
+^^J
+^^J -- Copy the file grafbase.mf to a location where Metafont
+\jts will find it, for example TEXMF/metafont/mfpic/ .
+^^J
+^^J -- Copy the files grafbase.mp and dvipsnam.mp to a location where
+\jts MetaPost will find them, for example TEXMF/metapost/mfpic/ .
+^^J
+^^J -- Refresh the filename database if your TeX system requires it.
+^^J
+^^J*****************************************************************}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/generic/midnight/00readme.txt b/Master/texmf-dist/source/generic/midnight/00readme.txt
new file mode 100644
index 00000000000..42ebbce3eff
--- /dev/null
+++ b/Master/texmf-dist/source/generic/midnight/00readme.txt
@@ -0,0 +1,18 @@
+Midnight Macros --- Tue May 7 09:08:21 PDT 1991
+
+quire [1--4]
+Macros for making booklets, printing double pages, and printing outlines
+and crop marks.
+
+gloss [5--7]
+Macros for vertically aligning words in consecutive sentences.
+
+loop [8]
+A simple looping construct (meta-macros).
+
+dolines [9--11]
+Meta-macros to separate arguments by newlines and by empty lines.
+
+labels [12--13]
+Macros to print address labels and bulk letters.
+
diff --git a/Master/texmf-dist/source/generic/midnight/Index b/Master/texmf-dist/source/generic/midnight/Index
new file mode 100644
index 00000000000..7f58fedeb01
--- /dev/null
+++ b/Master/texmf-dist/source/generic/midnight/Index
@@ -0,0 +1,23 @@
+Midnight Macros --- Thu Oct 24 14:22:09 PDT 1991
+
+quire [1--4]
+Macros for making booklets, printing double pages, and printing outlines
+and crop marks.
+
+gloss [5--7]
+Macros for vertically aligning words in consecutive sentences.
+
+loop [8]
+A simple looping construct (meta-macros).
+
+dolines [9--11]
+Meta-macros to separate arguments by newlines and by empty lines.
+
+labels [12--13]
+Macros to print address labels and bulk letters.
+
+styledef [14--16]
+Macros to selectively input parts of a file.
+
+border [17--20]
+Macros to typeset borders.
diff --git a/Master/texmf-dist/source/generic/psfig/pscompress b/Master/texmf-dist/source/generic/psfig/pscompress
new file mode 100644
index 00000000000..c0f1346818b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/pscompress
@@ -0,0 +1,12 @@
+#!/bin/csh -f
+while ($1 != "")
+ if (-e $1.bb || -e $1.Z) then
+ echo will not overwrite $1.bb or $1.Z, skipping
+ shift
+ else
+ echo "%\!" > $1.bb
+ grep \%\%BoundingBox $1 >> $1.bb
+ compress $1
+ shift
+ endif
+end
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/arbortext.pro b/Master/texmf-dist/source/generic/psfig/unsupported/arbortext.pro
new file mode 100644
index 00000000000..d06480d1120
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/arbortext.pro
@@ -0,0 +1,100 @@
+%!
+% Psfig/TeX Release 1.2
+% arbortext (dvips) version
+%
+% All software, documentation, and related files in this distribution of
+% psfig/tex are Copyright 1987, 1988 Trevor J. Darrell
+%
+% Permission is granted for use and non-profit distribution of psfig/tex
+% providing that this notice be clearly maintained, but the right to
+% distribute any portion of psfig/tex for profit or as part of any commercial
+% product is specifically reserved for the author.
+%
+%
+% $Header: figtex.pro,v 1.5 87/07/24 20:14:50 trevor Exp $
+% $Source: $
+%
+%/TeXscale { 65536 div } def
+%/psfts { S 65781.76 div N } N
+/TeXscale { 65781.76 div } def
+
+%/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap
+%currentlinejoin currentdash currentgray currentmiterlimit ] cvx def
+%
+% Since dvi2ps has an initgraphics at the beginning of texpre.ps, we can
+% assume:
+gsave initgraphics
+/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap
+currentlinejoin currentdash currentgray currentmiterlimit ] cvx def
+grestore
+
+/startTexFig {
+% usage : x y bb-llx bb-lly bb-urx bb-ury startFig
+ /SavedState save def
+ userdict maxlength dict begin
+ currentpoint transform
+
+ DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap
+ setlinewidth setmatrix
+
+ itransform moveto
+
+ /ury exch TeXscale def
+ /urx exch TeXscale def
+ /lly exch TeXscale def
+ /llx exch TeXscale def
+ /y exch TeXscale def
+ /x exch TeXscale def
+
+ currentpoint /cy exch def /cx exch def
+
+ /sx x urx llx sub div def % scaling for x
+ /sy y ury lly sub div def % scaling for y
+
+ sx sy scale % scale by (sx,sy)
+
+ cx sx div llx sub
+ cy sy div ury sub translate
+
+ /DefFigCTM matrix currentmatrix def
+
+ /initmatrix {
+ DefFigCTM setmatrix
+ } def
+ /defaultmatrix {
+ DefFigCTM exch copy
+ } def
+
+ /initgraphics {
+ DocumentInitState setmiterlimit setgray setdash
+ setlinejoin setlinecap setlinewidth setmatrix
+ DefFigCTM setmatrix
+ } def
+
+ /showpage {
+ initgraphics
+ } def
+% /erasepage and /copypage added for MatLab support (tli)
+ /erasepage {
+ initgraphics
+ } def
+ /copypage {} def
+
+} def
+% Args are llx lly urx ury (in figure coordinates)
+/clipFig {
+ currentpoint 6 2 roll
+ newpath 4 copy
+ 4 2 roll moveto
+ 6 -1 roll exch lineto
+ exch lineto
+ exch lineto
+ closepath clip
+ newpath
+ moveto
+} def
+% doclip, if called, will always be just after a `startfig'
+/doclip { llx lly urx ury clipFig } def
+/endTexFig {
+ end SavedState restore
+} def
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/dospecial.frag b/Master/texmf-dist/source/generic/psfig/unsupported/dospecial.frag
new file mode 100644
index 00000000000..90aa1cd5cbc
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/dospecial.frag
@@ -0,0 +1,43 @@
+/*
+ * This is a code fragment from a patched version of dospecial.c
+ * dvips version 5.47
+ *
+ * The changed lines are between the TJD comments.
+ * The patch allows for zcat input to plotfile commands.
+ *
+ */
+
+
+ if (strncmp(p, "ps:", 3)==0) {
+ hvpos() ;
+ psflush() ; /* now anything can happen. */
+ if (p[3]==':') {
+ if (strncmp(p+4, "[begin]", 7) == 0)
+ nlcmdout(&p[11]);
+ else if (strncmp(p+4, "[end]", 5) == 0)
+ nlcmdout(&p[9]);
+ else nlcmdout(&p[4]);
+ } else if (strncmp(p+3, " plotfile ", 10) == 0) {
+ char *sfp ;
+ p += 13;
+ /*
+ * Fixed to allow popen input for plotfile
+ * TJD 10/20/91
+ */
+ while (*p == ' ') p++;
+ if (*p == '"') {
+ p++;
+ for (sfp = p; *sfp && *sfp != '"'; sfp++) ;
+ } else {
+ for (sfp = p; *sfp && *sfp != ' '; sfp++) ;
+ }
+ *sfp = '\0';
+ if (*p == '`')
+ figcopyfile(p+1, 1);
+ else
+ figcopyfile (p, 0);
+ /* End TJD changes */
+ } else
+ nlcmdout(&p[3]);
+ return;
+ }
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/dospecial.patch b/Master/texmf-dist/source/generic/psfig/unsupported/dospecial.patch
new file mode 100644
index 00000000000..690fbfaa193
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/dospecial.patch
@@ -0,0 +1,37 @@
+*** dospecial.c Tue Jan 15 16:17:59 1991
+--- dospecial.c.new Sun Oct 20 13:14:10 1991
+***************
+*** 620,628 ****
+ } else if (strncmp(p+3, " plotfile ", 10) == 0) {
+ char *sfp ;
+ p += 13;
+! for (sfp = p; *sfp && *sfp != ' '; sfp++) ;
+ *sfp = '\0';
+! figcopyfile (p, 0);
+ } else
+ nlcmdout(&p[3]);
+ return;
+--- 620,642 ----
+ } else if (strncmp(p+3, " plotfile ", 10) == 0) {
+ char *sfp ;
+ p += 13;
+! /*
+! * Fixed to allow popen input for plotfile
+! * TJD 10/20/91
+! */
+! while (*p == ' ') p++;
+! if (*p == '"') {
+! p++;
+! for (sfp = p; *sfp && *sfp != '"'; sfp++) ;
+! } else {
+! for (sfp = p; *sfp && *sfp != ' '; sfp++) ;
+! }
+ *sfp = '\0';
+! if (*p == '`')
+! figcopyfile(p+1, 1);
+! else
+! figcopyfile (p, 0);
+! /* End TJD changes */
+ } else
+ nlcmdout(&p[3]);
+ return;
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/graphpaper.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/graphpaper.ps.gz
new file mode 100644
index 00000000000..d4ef1ea6329
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/graphpaper.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/README b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/README
new file mode 100644
index 00000000000..bc0bc81e8a3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/README
@@ -0,0 +1,76 @@
+NOTE: Much of this information and code is now obselete, since
+robust EPSF postscript can be obtained from many Mac applications
+(such as canvas and photoshop.) With system 7, Postscript can often
+be routed to a file using a dialog box option rather than cmd-F/K.
+
+=====================================================================
+=====================================================================
+Tips on redirecting Mac postscript (when there is no "Save as...EPSF")
+
+1) How to capture a figure and the LaserPrep prolog into a disk file:
+
+Many different methods exist to appempt to do this, some of which As
+of this writing, it is possible to convince MacDraw to place a Postscript
+description of a figure in a file rather than sending it directly to a
+LaserWriter by hitting clover-F immediately after clicking
+`OK' on the print dialog box. The file is always called `PostScript'
+and is left in the folder MacDraw was started in. Use a communications
+program to move the file over to the host on which TeX is running.
+
+MacDraw creates a output file in the form of `QuickDraw' calls, which
+are interpreted as a set of PostScript procedures. These procedures
+are defined in what we call the Macintosh LaserPrep prolog, which must
+be downloaded before Macintosh figures are sent to the printer. By
+using clover-K rather than clover-F in the key sequence above both the
+prolog and figure will be captured in the PostScript file. The prolog
+can be extracted by hand-editing out the portion of the clover-K file
+not also present in the clover-F file.
+
+You need to always make sure that you keep a version of the prolog
+that was resident in the Mac when the figures was generated,
+since the prolog is usually not backward compatible. E.g. figures
+which rely on laseprep version 68 will not print using laserprep
+verion 70. (Thanks Apple!)
+
+2) Make the postscript suitible for including as an encapsulated
+postscript figure.
+
+Unfortunately, the postscript produced by most versions of the
+LaserWriter driver is not well suited to be included directly as a
+psfig figure. Most versions of the LaserPrep do not include an
+accurate bounding box comment in the PostScript files they produce;
+figures created by these systems will have to have their bounding box
+added by hand. "graphpaper.ps" is often useful for determining the
+bounding box of a figure. The "cleanfig" shell script adds a default
+bounding box, removes nasty "%%EOF" lines, converts CF-LF (useful for
+files that have been moved across appletalk), and strips away
+downloaded fonts.
+
+NOTE: fonts are stripped by the cleanfig program because I found that
+my documents were crashing on figures that were downloading fonts that
+were already printer-resident. Cleanfig will remove all fonts, so if
+you are using non-resident fonts in your figures you will have to
+modify cleanfig to not stip out the downloading of those fonts.
+
+3) Make sure the Laserprep prolog is loaded in the printer
+before printing your document.
+
+Other Macintoshes will often automatically download the Laserprep
+code into the printer whenever access the printer and find it
+does not have the code already downloaded.
+
+The laserprep prolog can be manually sent down by either
+by prepending it using /bin/cat:
+ cat lprep70.pro doc.ps | lpr
+or with the dvips special header command at the top of your latex file:
+ \special{header=lprep70.procs}
+The only difference between the ".pro" and ".procs" version is what
+structuring comments are included. The ".procs" version works well
+as the argument to a \special{header=..} within dvips (e.g. it
+will preview correctly under NeWS).
+
+4) Good luck! (you may need it.)
+"macdemo.tex" containts a test document that including four version 68
+mac figures.
+
+======================================================================
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/cleanfig b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/cleanfig
new file mode 100644
index 00000000000..c4eced5b1bb
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/cleanfig
@@ -0,0 +1,3 @@
+#!/bin/csh -f
+tr \\15 \\12 | grep -v %%EOF | sed -e 's/^%%BoundingBox: ? ? ? ?/%%BoundingBox: 0 0 600 800/g' | awk -f stripfonts.awk
+
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/box.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/box.ps.gz
new file mode 100644
index 00000000000..fbef126e669
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/box.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/cm.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/cm.ps.gz
new file mode 100644
index 00000000000..c484627082e
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/cm.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/piechart.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/piechart.ps.gz
new file mode 100644
index 00000000000..6ce7ca21d05
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/piechart.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/pretzel.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/pretzel.ps.gz
new file mode 100644
index 00000000000..de0837c61c1
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/pretzel.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/rosette.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/rosette.ps.gz
new file mode 100644
index 00000000000..a6552bee437
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/rosette.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/starlines.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/starlines.ps.gz
new file mode 100644
index 00000000000..aa807b5c18d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/starlines.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/trevor.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/trevor.ps.gz
new file mode 100644
index 00000000000..87326bcb668
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/trevor.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/zip.ps.gz b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/zip.ps.gz
new file mode 100644
index 00000000000..9023fd994c3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/figs/zip.ps.gz
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep68.pro b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep68.pro
new file mode 100644
index 00000000000..0d6510011b5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep68.pro
@@ -0,0 +1,446 @@
+%!Title: "Laser Prep -- The Apple PostScript Dictionary (md)"
+%%Creator: Apple Software Engineering
+%%CreationDate: Thursday, March 19, 1987
+%{appledict version #68 0
+% Modified by T. Darrell 1/89 [TJD]
+% © CopyRight Apple Computer, Inc. 1984,1985,1986,1987,1988 All Rights Reserved.
+%%EndComments
+%%BeginProcSet: "(AppleDict md)" 68 0
+%%[TJD]%statusdict begin waittimeout 300 lt{0 60 300 setdefaulttimeouts}if end
+%%[TJD]%currentfile statusdict begin serverdict begin product (LaserWriter II NT) eq revision 1 eq and {/setrealdevice {//setrealdevice exec 31 sendpcmd 4 eq tonerlight} bind def
+%%[TJD]%/execjob {31 sendpcmd 4 eq tonerlight //execjob exec} bind def end end eexec}{end end 722{currentfile read pop pop}repeat}ifelse
+%%[TJD]% HEX CODE DELETED
+%%[TJD]%/sc {60 45 {abs exch abs 2 copy add 1 gt{1.0 sub dup mul exch 1.0 sub dup mul add 1.0 sub}{dup mul exch dup mul add 1.0 exch sub}
+%%[TJD]%ifelse}setscreen} bind def statusdict begin product(LaserWriter II)anchorsearch end
+%%[TJD]%{pop pop/letter [/letter load /exec load /sc load /exec load]cvx def/legal [/legal load /exec load /sc load /exec load]cvx def/a4 [/a4 load /exec load /sc load /exec load]cvx def/b5 [/b5 load /exec load /sc load /exec load]cvx def
+%%[TJD]%/lettersmall [/lettersmall load /exec load /sc load /exec load]cvx def/a4small [/a4small load /exec load /sc load /exec load]cvx def/note [/note load /exec load /sc load /exec load]cvx def}{pop}ifelse
+systemdict/currentpacking known{currentpacking true setpacking}if
+%%[TJD]%/LW{save statusdict/product get(LaserWriter)anchorsearch
+%%[TJD]%exch pop{length 0 eq{1}{2}ifelse}{0}ifelse exch restore}bind def
+/LW{0}def
+/LW+{LW 2 eq}bind def
+/ok{systemdict/statusdict known dup{LW 0 gt and}if}bind def
+%%[TJD]%ok{statusdict begin 9 sccinteractive 3 ne exch 0 ne or{9 0 3 setsccinteractive}if end}if
+/md 250 dict def md begin
+/av 0 def
+/T true def/F false def/mtx matrix def/s75 75 string def/s8 8 string def/s1 ( ) def/pxs 1 def/pys 1 def
+1 0 mtx defaultmatrix dtransform exch atan/pa exch def/nlw .24 def/ppr [-32 -29.52 762 582.48] def
+/pgs 1 def/por true def/xb 500 array def/so true def/tso true def/fillflag false def/pnm 1 def/fmv true def
+/sfl false def/ma 0 def/invertflag false def/dbinvertflag false def/xflip false def/yflip false def/noflips true def/scaleby96 false def/fNote true def/fBitStretch true def
+/fg (Rvd\001\001\000\000\177) def
+/bdf{bind def}bind def
+/xdf{exch def}bdf
+/xl{neg exch neg translate}bdf
+/fp{pnsh 0 ne pnsv 0 ne and}bdf
+/nop{}bdf/lnop[/nop load]cvx bdf
+/vrb[
+{fp{fg 6 get 0 ne{gsave stroke grestore}{gsave 1 setlinewidth pnsh pnsv scale stroke grestore}ifelse}if newpath}bind
+/eofill load
+dup
+/newpath load
+2 index
+dup
+{clip newpath}bind
+{}bind
+dup
+2 copy
+]def
+currentscreen/spf xdf/rot xdf/freq xdf
+/doop{vrb exch get exec}bdf
+/psu{/tso xdf /fNote xdf/fBitStretch xdf/scaleby96 xdf/yflip xdf/xflip xdf
+/invertflag xdf/dbinvertflag invertflag statusdict begin version cvr 47.0 ge product (LaserWriter) eq not and end invertflag and {not}if def
+xflip yflip or{/noflips false def}if
+/pgs xdf 2 index .72 mul exch div/pys xdf div .72 mul/pxs xdf ppr astore pop/por xdf sn and/so xdf}bdf
+/tab{statusdict /11x17 known{statusdict begin /11x17 load end}{statusdict /setpage known{statusdict begin 792 1224 1 setpage end}{statusdict /setpageparams known{statusdict begin 792 1224 0 1 setpageparams end}if}ifelse}ifelse}bdf
+/txpose{
+%[TJD] fNote{smalls}{bigs}ifelse pgs get exec
+ pxs pys scale
+ ppr aload pop por{
+ noflips{
+ pop exch neg exch translate pop 1 -1 scale
+ }if
+ xflip yflip and{
+ pop exch neg exch translate 180 rotate 1 -1 scale
+ ppr 3 get ppr 1 get neg sub neg ppr 2 get
+ ppr 0 get neg sub neg translate
+ }if
+ xflip yflip not and{
+ pop exch neg exch translate pop 180 rotate
+ ppr 3 get ppr 1 get neg sub neg 0 translate
+ }if
+ yflip xflip not and{
+ ppr 1 get neg ppr 0 get neg translate
+ }if
+ }{
+ noflips{
+ translate pop pop 270 rotate 1 -1 scale
+ }if
+ xflip yflip and{
+ translate pop pop 90 rotate 1 -1 scale
+ ppr 3 get ppr 1 get neg sub neg ppr 2 get
+ ppr 0 get neg sub neg translate
+ }if
+ xflip yflip not and{
+ translate pop pop 90 rotate ppr 3 get ppr 1 get
+ neg sub neg 0 translate
+ }if
+ yflip xflip not and{
+ translate pop pop 270 rotate ppr 2 get ppr 0 get
+ neg sub neg 0 exch translate
+ }if
+ }ifelse
+ statusdict begin waittimeout 300 lt{
+ /waittimeout 300 def
+ }if end
+ scaleby96{
+ ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div
+ 2 copy translate .96 dup scale neg exch neg exch translate
+ }if
+}bdf
+/fr{4 copy ppr aload pop 3 -1 roll add 3 1 roll exch add 6 2 roll 3 -1 roll
+sub 3 1 roll exch sub 3 -1 roll exch div 3 1 roll div exch scale pop pop xl}bdf
+/obl{{0.212557 mul}{pop 0}ifelse}bdf
+/sfd{ps fg 5 -1 roll get mul 100 div 0 ps 5 -1 roll obl ps neg 0 0 6a astore makefont setfont}bdf
+/fnt{findfont sfd}bdf
+/bt{sa 3 1 roll 3 index and put}bdf
+/sa(\000\000\000\000\000\000\000\000\000\000)def
+/fs{0 1 bt 1 2 bt 2 4 bt 3 8 bt 4 16 bt 5 32 bt 6 64 bt 7 128 bt sa exch 8 exch put}bdf
+/mx1 matrix def
+/mx2 matrix def
+/mx3 matrix def
+/bu{currentpoint currentgray currentlinewidth currentlinecap currentlinejoin currentdash exch aload length
+fg 5 sfl{1}{0}ifelse put pnsv pnsh
+2t aload pop 3a aload pop mx2 aload pop mx1 aload pop mtx currentmatrix aload pop
+mx3 aload pop ps pm restore/ps xdf mx3 astore pop}bdf
+/bn{/pm save def mx3 setmatrix newpath 0 0 moveto ct dup 39 get 0 exch getinterval cvx exec
+mtx astore setmatrix mx1 astore pop mx2 astore pop 3a astore pop
+2t astore pop/pnsh xdf/pnsv xdf gw
+/sfl fg 5 get 0 ne def array astore exch setdash setlinejoin setlinecap
+setlinewidth setgray moveto}bdf
+/fc{save vmstatus exch sub 50000 lt
+{(%%[|0|]%%)=print flush}if pop restore}bdf
+/tc{32768 div add 3 1 roll 32768 div add 2t astore pop}bdf
+/3a [0 0 0] def
+/2t 2 array def
+/tp{3a astore pop}bdf
+/tt{mx2 currentmatrix pop currentpoint 2 copy 2t aload pop qa 2 copy translate 3a aload pop exch dup 0 eq
+{pop}{1 eq{-1 1}{1 -1}ifelse scale}ifelse rotate pop neg exch neg exch translate moveto}bdf
+/te{mx2 setmatrix}bdf
+/th{3 -1 roll div 3 1 roll exch div 2 copy mx1 scale pop scale/sfl true def}bdf
+/tu{1 1 mx1 itransform scale/sfl false def}bdf
+/ts{1 1 mx1 transform scale/sfl true def}bdf
+/fz{/ps xdf}bdf
+/dv{dup 0 ne{div}{pop}ifelse}bdf
+/pop4{pop pop pop pop}bdf
+/it{sfl{mx1 itransform}if}bdf
+/gm{exch it moveto}bdf/rm{it rmoveto}bdf
+/lm{currentpoint sfl{mx1 transform}if exch pop sub 0 exch it rmoveto}bdf
+/fm{statusdict/manualfeed known}bdf
+/se{statusdict exch/manualfeed exch put}bdf
+/mf{dup/ma exch def 0 gt{fm se/t1 5 st ok ma 1 gt and{/t2 0 st/t3 0 st
+statusdict/manualfeedtimeout 3600 put
+}if}if}bdf
+/jn{/statusdict where exch pop{statusdict exch /jobname exch put}if}bdf
+/pen{pnm mul/pnsh xdf pnm mul/pnsv xdf pnsh setlinewidth}bdf
+/min{2 copy gt{exch}if pop}bdf
+/max{2 copy lt{exch}if pop}bdf
+/dh{fg 6 1 put array astore dup {1 pxs div mul exch}forall astore exch pop exch pop exch setdash}bdf
+/ih[currentdash]def
+/rh{fg 6 0 put ih aload pop setdash}bdf
+/dl{gsave nlw pys div setlinewidth 0 setgray}bdf
+/dlin{exch currentpoint currentlinewidth 2 div dup
+translate newpath moveto lineto currentpoint stroke grestore moveto}bdf
+/lin{fg 6 get 0 ne{exch lineto currentpoint 0 doop moveto}
+{exch currentpoint/pnlv xdf/pnlh xdf gsave newpath/@1 xdf/@2 xdf fp{pnlh @2 lt{pnlv @1 ge
+{pnlh pnlv moveto @2 @1 lineto pnsh 0 rlineto
+0 pnsv rlineto pnlh pnsh add pnlv pnsv add lineto pnsh neg 0 rlineto}
+{pnlh pnlv moveto pnsh 0 rlineto @2 pnsh add @1 lineto 0 pnsv rlineto
+pnsh neg 0 rlineto pnlh pnlv pnsv add lineto}ifelse}{pnlv @1 gt
+{@2 @1 moveto pnsh 0 rlineto pnlh pnsh add pnlv lineto 0 pnsv rlineto
+pnsh neg 0 rlineto @2 @1 pnsv add lineto}{pnlh pnlv moveto pnsh 0 rlineto
+0 pnsv rlineto @2 pnsh add @1 pnsv add lineto pnsh neg 0 rlineto
+0 pnsv neg rlineto}ifelse}ifelse
+closepath fill}if @2 @1 grestore moveto}ifelse}bdf
+/gw{/pnm fg 3 get fg 4 get div def}bdf
+/lw{fg exch 4 exch put fg exch 3 exch put gw pnsv pnsh pen}bdf
+/barc{/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf
+/@6 xdf/@7 xdf/@8 xdf gsave
+@5 @7 add 2 div @6 @8 add 2 div translate newpath 0 0 moveto
+@5 @7 sub @6 @8 sub mtx currentmatrix pop scale @1{newpath}if
+0 0 0.5 @4 @3 arc @4 @3 sub abs 360 ge{closepath}if
+mtx setmatrix @2 doop grestore}bdf
+/ar{dup 0 eq barc}bdf
+/ov{0 exch 360 exch true barc}bdf
+/rc{/@t xdf currentpoint 6 2 roll newpath 4 copy 4 2 roll exch moveto
+6 -1 roll lineto lineto lineto closepath @t doop moveto}bdf
+/mup{dup pnsh 2 div le exch pnsv 2 div le or}bdf
+/rr{/@1 xdf 2. div/@2 xdf 2. div/@3 xdf
+/@4 xdf/@5 xdf/@6 xdf/@7 xdf
+@7 @5 eq @6 @4 eq @2 mup or or{@7 @6 @5 @4 @1 rc}
+{@4 @6 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse
+@5 @7 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse
+@1 0 eq{/@2 @2 pnsh 2 div 2 copy gt{sub def}{0 pop4}ifelse}if
+currentpoint newpath
+@4 @6 add 2. div @7 moveto
+@4 @7 @4 @5 @2 arcto pop4
+@4 @5 @6 @5 @2 arcto pop4
+@6 @5 @6 @7 @2 arcto pop4
+@6 @7 @4 @7 @2 arcto pop4
+closepath @1 doop moveto}ifelse}bdf
+/pr{gsave newpath/pl{exch moveto/pl{exch lineto}def}def}bdf
+/pl{exch lineto}bdf
+/ep{dup 0 eq{{moveto}{exch lin}{}{(%%[|1|]%%)= flush}pathforall
+pop grestore}{doop grestore}ifelse currentpoint newpath moveto}bdf
+/gr{64. div setgray}bdf
+/pat{s8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi s8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}setscreen gr}bdf
+/sg{freq rot/spf load setscreen gr}bdf
+/dc{transform round .5 sub exch round .5 sub exch itransform}bdf
+/sn{userdict/smooth4 known}bdf
+/x8{3 bitshift}bdf
+/x4{2 bitshift}bdf
+/d4{-2 bitshift}bdf
+/d8{-3 bitshift}bdf
+/rb{15 add -4 bitshift 1 bitshift}bdf
+/db{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf/@6 @5 @3 4 add mul def
+dc translate scale/xdbit 1 1 idtransform abs/ydbit exch def abs def{0 0 1 ydbit add 1 10 rc clip}if
+@1 0 eq @1 4 eq or{1 setgray ydbit 0 1 ydbit add 1 2 rc}if
+@1 3 eq @1 7 eq or{1}{0}ifelse setgray/@9 @1 0 eq @1 1 eq @1 3 eq or or dbinvertflag xor def/@13 @6 def
+@2 fBitStretch or{/@10 @4 x4 def/@11 @3 x4 def/@12 @10 rb def/@13 @12 @11 mul def/@15 1 1 dtransform abs/calcY 1 index def round cvi/@14 exch def
+abs/calcX 1 index def round cvi scaleby96 not{1 add}if def/@16 @15 rb def/@17 @16 @14 mul def}if
+sn @13 60000 lt and @2 fBitStretch or and{mtx currentmatrix dup 1 get exch 2 get 0. eq exch 0. eq and @17 60000 lt and fBitStretch and{@16 3 bitshift @14 @9 [calcX 0 0 calcY 0 0]{@17 string @13 string
+currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4
+@10 @11 @12 dup string 5 index @15 @14 @16 dup string stretch}imagemask}{@12 x8 @11 @9 [@10 0 0 @11 0 0]{@13 string
+currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4}imagemask}ifelse}{@5 3 bitshift @3 4 add @9 [@4 0 0 @3 0 2]{currentfile @6 string readhexstring pop}imagemask}ifelse
+@7 restore}bdf
+/multibit{/mbdeep exch def/mbY exch def/mbX exch def
+save mbX mbY mbdeep[mbX 0 0 mbY 0 0]{currentfile picstr readhexstring pop}image
+restore}bdf
+/wd 16 dict def
+/mfont 14 dict def
+/mdf{mfont wcheck not{/mfont 14 dict def}if mfont begin xdf end}bdf
+/cf{{1 index/FID ne{def}{pop pop}ifelse}forall}bdf/rf{/@1 exch def/@2 exch def
+FontDirectory @2 known{cleartomark pop}{findfont dup begin dup length @1 add dict begin
+cf{/Encoding macvec def}{Encoding dup length array copy/Encoding exch def
+counttomark 2 idiv{Encoding 3 1 roll put}repeat}ifelse
+pop
+exec currentdict end end @2 exch definefont pop}ifelse}bdf
+/bmbc{exch begin wd begin
+/cr xdf
+save
+CharTable cr 6 mul 6 getinterval{}forall
+/bitheight xdf/bitwidth xdf
+.96 div/width xdf
+Gkernmax add/XOffset xdf Gdescent add/YOffset xdf/rowbytes xdf
+rowbytes 255 eq{0 0 0 0 0 0 setcachedevice}
+{Gnormsize dup scale
+width 0 XOffset YOffset bitwidth XOffset add bitheight YOffset add
+setcachedevice
+rowbytes 0 ne{
+XOffset YOffset translate newpath 0 0 moveto
+bitwidth bitheight scale
+sn{
+/xSmt bitwidth x4 def
+/ySmt bitheight x4 def
+/rSmt xSmt rb def
+rSmt x8 ySmt true
+[xSmt 0 0 ySmt neg 0 ySmt]
+{rSmt ySmt mul string CharData cr get
+1 index bitwidth bitheight rowbytes rSmt tso smooth4}
+}{rowbytes 3 bitshift bitheight 4 add true
+[bitwidth 0 0 bitheight neg 0 bitheight 2 add]
+{CharData cr get}
+}ifelse
+imagemask
+}if
+}ifelse
+restore
+end end
+}bdf
+/bb{.96 exch div/Gnormsize mdf 2 index
+/Gkernmax mdf 1 index/Gdescent mdf
+3 index div 4 1 roll
+2 index div 1. 5 2 roll
+exch div 4 1 roll
+4 array astore/FontBBox mdf
+}bdf
+/cdf{mfont/CharData get 3 1 roll put}bdf
+/bf{
+mfont begin
+/FontType 3 def
+/FontMatrix [1 0 0 1 0 0] def
+/Encoding macvec def
+/BuildChar/bmbc load def
+end
+mfont definefont pop
+}bdf
+/wi LW 1 eq{{gsave 0 0 0 0 0 0 0 0 moveto lineto lineto lineto closepath clip stringwidth grestore}bind}{/stringwidth load}ifelse def
+/aps{0 get 124 eq}bdf
+/xc{s75 cvs dup}bdf
+/xp{put cvn}bdf
+/scs{xc 3 67 put dup 0 95 xp}bdf
+/sos{xc 3 79 xp}bdf
+/sbs{xc 1 66 xp}bdf
+/sis{xc 2 73 xp}bdf
+/sob{xc 2 79 xp}bdf
+/sss{xc 4 83 xp}bdf
+/dd{exch 1 index add 3 1 roll add exch}bdf
+/smc{moveto dup show}bdf
+/kwn{FontDirectory 1 index known{findfont exch pop}}bdf
+/gl{1 currentgray sub setgray}bdf
+/mm{/mfont 10 dict def mfont begin
+/FontMatrix [1 0 0 1 0 0] def
+/FontType 3 def
+/Encoding macvec def
+/df 4 index findfont def
+/FontBBox [0 0 1 1] def
+/xda xdf/mbc xdf
+/BuildChar{wd begin/cr xdf/fd xdf/cs s1 dup 0 cr put def fd/mbc get exec end}def
+exec end mfont definefont}bdf
+/ac{dup scs kwn{exch findfont dup length 1 add dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall
+fmv{/Encoding macvec def}if/StrokeWidth nlw 1000 mul pys div ps div dup 12 lt{pop 12}if def
+/PaintType 2 def currentdict end definefont}ifelse}bdf
+/mb{dup sbs kwn{exch{pop}{bbc}{}mm}ifelse sfd}bdf
+/mo{dup sos kwn{exch{pop}{boc}{}mm}ifelse sfd}bdf
+/ms{dup sss kwn{exch{pop}{bsc}{}mm}ifelse sfd}bdf
+/ou{dup sos kwn{exch dup ac pop{scs findfont /df2 xdf}{aoc}{}mm}ifelse sfd}bdf
+/su{dup sss kwn{exch dup ac pop{scs findfont /df2 xdf}{asc}{}mm}ifelse sfd}bdf
+/ao{/fmv true def ou}bdf/as{/fmv true def su}bdf
+/vo{/fmv false def ou}bdf/vs{/fmv false def su}bdf
+/bbc{/da .03 def fd/df get setfont
+gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs 0 0 smc da 0 smc da da smc 0 da moveto show}bdf
+/boc{/da 1 ps div def fd/df get setfont
+gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs 0 0 smc da 0 smc da da smc 0 da smc gl da 2. div dup moveto show}bdf
+/bsc{/da 1 ps div def
+/ds .05 def/da2 da 2. div def fd/df get setfont
+gsave cs wi 1 index 0 ne{exch ds add da2 add exch}if grestore setcharwidth
+cs ds da2 add .01 add 0 smc 0 ds da2 sub translate 0 0 smc
+da 0 smc da da smc 0 da smc gl da 2. div dup moveto show}bdf
+/aoc{fd/df get setfont
+gsave cs wi grestore setcharwidth
+gl cs 0 0 smc fd/df2 get setfont gl 0 0 moveto show}bdf
+/asc{/da .05 def fd/df get setfont
+gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs da .01 add 0 smc 0 da translate gl 0 0 smc gl fd/df2 get setfont 0 0 moveto show}bdf
+/st{1000 mul usertime add dup 2147483647 gt{2147483647 sub}if def}bdf
+/the{usertime sub dup 0 lt exch -2147483648 gt and}bdf
+/6a 6 array def
+/2a 2 array def
+/3q 3 array def
+/qs{3 -1 roll sub exch 3 -1 roll sub exch}bdf
+/qa{3 -1 roll add exch 3 -1 roll add exch}bdf
+/qm{3 -1 roll 1 index mul 3 1 roll mul}bdf
+/qn{6a exch get mul}bdf
+/qA .166667 def/qB .833333 def/qC .5 def
+/qx{6a astore pop
+qA 0 qn qB 2 qn add qA 1 qn qB 3 qn add
+qB 2 qn qA 4 qn add qB 3 qn qA 5 qn add
+qC 2 qn qC 4 qn add qC 3 qn qC 5 qn add}bdf
+/qp{6 copy 12 -2 roll pop pop}bdf
+/qc{exch qp qx curveto}bdf
+/qi{{exch 4 copy 2a astore aload pop qa .5 qm newpath moveto}{exch 2 copy 6 -2 roll 2 qm qs 4 2 roll}ifelse}bdf
+/qq{{qc 2a aload pop qx curveto}{exch 4 copy qs qa qx curveto}ifelse}bdf
+/pt{currentpoint newpath moveto}bdf
+/qf{/fillflag true def}bdf
+/ec{1 and 0 ne{0 doop}if grestore currentpoint newpath moveto/fillflag false def}bdf
+/eu{currentpoint fp{0 ep}{grestore newpath}ifelse moveto/fillflag false def}bdf
+/bp{currentpoint newpath 2 copy moveto}bdf
+/ef{gsave fillflag{gsave eofill grestore}if}bdf
+/sm{0 exch{@1 eq{1 add}if}forall}bdf
+/lshow{4 1 roll exch/@1 exch def{1 index wi pop sub 1 index sm dv 0 @1 4 -1 roll widthshow}{1 index wi pop sub
+1 index dup sm 10 mul exch length 1 sub add dv dup 10. mul 0 @1 4 -1 roll 0 6 -1 roll awidthshow}ifelse}bdf
+/setTxMode{sa 9 2 index put 3 eq{1}{0}ifelse setgray}bdf
+/SwToSym{{}mark false/Symbol/|______Symbol 0 rf 0 sa 6 get 0 ne{pop 1}{sa 7 get 0 eq{pop 2}if}ifelse
+sa 1 get 0 ne/|______Symbol
+sa 4 get 0 ne{vs}{sa 3 get 0 ne{vo}{fnt}ifelse}ifelse}bdf
+/mc{0 3 1 roll transform neg exch pop}bdf
+/ul{dup 0 ne sa 2 get 0 ne and{gsave 0 0
+/UnderlinePosition kif{mc}{ps -10 div}ifelse/UnderlineThickness kif{mc}{ps 15 div}ifelse
+abs setlinewidth neg rmoveto
+sa 4 get 0 ne{gsave currentlinewidth 2. div dup rmoveto currentpoint newpath moveto
+2 copy rlineto stroke grestore}if
+sa 3 get sa 4 get or 0 ne{gsave gl 2 copy rlineto stroke grestore rlineto strokepath nlw pys div setlinewidth}{rlineto}ifelse
+stroke grestore}{pop}ifelse}bdf
+/sgt{2 copy known{get true}{pop pop false}ifelse}bdf
+/kif{currentfont dup/FontMatrix get exch/FontInfo sgt{true}{currentfont/df sgt
+{dup/FontInfo sgt{3 1 roll/FontMatrix get mtx concatmatrix exch true}{pop pop pop false}
+ifelse}{pop pop false}ifelse}ifelse{3 -1 roll sgt{exch true}{pop false}ifelse}{false}ifelse}bdf
+/blank/Times-Roman findfont/CharStrings get/space get def
+/macvec 256 array def
+/NUL/SOH/STX/ETX/EOT/ENQ/ACK/BEL/BS/HT/LF/VT/FF/CR/SO/SI
+/DLE/DC1/DC2/DC3/DC4/NAK/SYN/ETB/CAN/EM/SUB/ESC/FS/GS/RS/US
+macvec 0 32 getinterval astore pop
+macvec 32/Times-Roman findfont/Encoding get
+32 96 getinterval putinterval macvec dup 39/quotesingle put 96/grave put
+/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis/Udieresis/aacute
+/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute/egrave
+/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde/oacute
+/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex/udieresis
+/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
+/registered/copyright/trademark/acute/dieresis/notequal/AE/Oslash
+/infinity/plusminus/lessequal/greaterequal/yen/mu/partialdiff/summation
+/product/pi/integral/ordfeminine/ordmasculine/Omega/ae/oslash
+/questiondown/exclamdown/logicalnot/radical/florin/approxequal/Delta/guillemotleft
+/guillemotright/ellipsis/blank/Agrave/Atilde/Otilde/OE/oe
+/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide/lozenge
+/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright/fi/fl
+/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand/Acircumflex/Ecircumflex/Aacute
+/Edieresis/Egrave/Iacute/Icircumflex/Idieresis/Igrave/Oacute/Ocircumflex
+/apple/Ograve/Uacute/Ucircumflex/Ugrave/dotlessi/circumflex/tilde
+/macron/breve/dotaccent/ring/cedilla/hungarumlaut/ogonek/caron
+macvec 128 128 getinterval astore pop
+{}mark true/Courier/|______Courier 0 rf
+{/Metrics 21 dict begin/zero 600 def/one 600 def/two 600 def/three 600 def/four 600 def/five 600 def/six 600 def/seven 600 def/eight 600 def
+/nine 600 def/comma 600 def/period 600 def/dollar 600 def/numbersign 600 def/percent 600 def/plus 600 def/hyphen 600 def/E 600 def/parenleft 600 def/parenright 600 def/space 600 def
+currentdict end def currentdict/UniqueID known{/UniqueID 16#800000 def}if/FontBBox FontBBox 4 array astore def}mark true/Helvetica/|______Seattle 1 rf
+/oldsettransfer/settransfer load def
+/concatprocs{/proc2 exch cvlit def/proc1 exch cvlit def/newproc proc1 length proc2 length add array def
+newproc 0 proc1 putinterval newproc proc1 length proc2 putinterval newproc cvx}def
+/settransfer{currenttransfer concatprocs oldsettransfer}def
+/PaintBlack{{1 exch sub}settransfer gsave newpath clippath 1 setgray fill grestore}def
+/od{(Rvd\001\001\000\000\177) fg copy pop txpose
+1 0 mtx defaultmatrix dtransform exch atan/pa exch def
+newpath clippath mark
+{transform{itransform moveto}}{transform{itransform lineto}}
+{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform
+{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}
+{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put
+10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if}bdf
+/cd{}bdf
+/op{/sfl false def/pm save def}bdf
+%%[TJD]%/cp{not{userdict/#copies 0 put}if ma 0 gt{{t1 the{exit}if}loop}if{copypage}{showpage}ifelse pm restore}bdf
+/cp{ pop pop pm restore } bdf
+/px{0 3 1 roll tp tt}bdf
+/psb{/us save def}bdf
+/pse{us restore}bdf
+/ct 40 string def
+/nc{currentpoint initclip newpath gc{dup type dup/arraytype eq exch/packedarraytype eq or{exec}if}
+forall clip newpath moveto}def
+/kp{ct 0 2 index length 2 index 39 2 index put getinterval copy cvx exec mx3 currentmatrix pop}bdf
+/av 68 def
+end
+LW 1 eq userdict/a4small known not and{/a4small
+[[300 72 div 0 0 -300 72 div -120 3381]
+280 3255
+{statusdict/jobstate (printing) put 0 setblink
+margins
+exch 196 add exch 304 add 8 div round cvi frametoroket
+statusdict/jobstate (busy) put
+1 setblink}
+/framedevice load
+60 45{dup mul exch dup mul add 1.0 exch sub}/setscreen load
+{}/settransfer load/initgraphics load/erasepage load]cvx
+statusdict begin bind end readonly def}if
+md begin/bigs[lnop userdict/letter known{/letter load}{lnop}ifelse userdict/legal known{/legal load}{lnop}ifelse userdict/a4 known{/a4 load}{lnop}ifelse userdict/b5 known{/b5 load}{lnop}ifelse
+lnop lnop lnop /tab load]def
+/smalls[lnop userdict/lettersmall known{/lettersmall load}{userdict/note known{/note load}{lnop}ifelse}ifelse
+userdict/legal known{/legal load}{lnop}ifelse userdict/a4small known{/a4small load}{lnop}ifelse
+userdict/b5 known{/b5 load}{userdict/note known{/note load}{lnop}ifelse}ifelse lnop lnop lnop /tab load]def end
+systemdict/currentpacking known{setpacking}if
+%%[TJD]%currentfile ok userdict/stretch known not and{eexec}{flushfile}ifelse
+%%[TJD]%
+%%[TJD]%currentfile ok userdict/smooth4 known not and{eexec}{flushfile}ifelse
+%%[TJD]%
+%%EndProcSet
+
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep68.procs b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep68.procs
new file mode 100644
index 00000000000..5b3631c6a5e
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep68.procs
@@ -0,0 +1,439 @@
+%%BeginProcSet: "(AppleDict md)" 68 0
+%%[TJD]%statusdict begin waittimeout 300 lt{0 60 300 setdefaulttimeouts}if end
+%%[TJD]%currentfile statusdict begin serverdict begin product (LaserWriter II NT) eq revision 1 eq and {/setrealdevice {//setrealdevice exec 31 sendpcmd 4 eq tonerlight} bind def
+%%[TJD]%/execjob {31 sendpcmd 4 eq tonerlight //execjob exec} bind def end end eexec}{end end 722{currentfile read pop pop}repeat}ifelse
+%%[TJD]% HEX CODE DELETED
+%%[TJD]%/sc {60 45 {abs exch abs 2 copy add 1 gt{1.0 sub dup mul exch 1.0 sub dup mul add 1.0 sub}{dup mul exch dup mul add 1.0 exch sub}
+%%[TJD]%ifelse}setscreen} bind def statusdict begin product(LaserWriter II)anchorsearch end
+%%[TJD]%{pop pop/letter [/letter load /exec load /sc load /exec load]cvx def/legal [/legal load /exec load /sc load /exec load]cvx def/a4 [/a4 load /exec load /sc load /exec load]cvx def/b5 [/b5 load /exec load /sc load /exec load]cvx def
+%%[TJD]%/lettersmall [/lettersmall load /exec load /sc load /exec load]cvx def/a4small [/a4small load /exec load /sc load /exec load]cvx def/note [/note load /exec load /sc load /exec load]cvx def}{pop}ifelse
+systemdict/currentpacking known{currentpacking true setpacking}if
+%%[TJD]%/LW{save statusdict/product get(LaserWriter)anchorsearch
+%%[TJD]%exch pop{length 0 eq{1}{2}ifelse}{0}ifelse exch restore}bind def
+/LW{0}def
+/LW+{LW 2 eq}bind def
+/ok{systemdict/statusdict known dup{LW 0 gt and}if}bind def
+%%[TJD]%ok{statusdict begin 9 sccinteractive 3 ne exch 0 ne or{9 0 3 setsccinteractive}if end}if
+/md 250 dict def md begin
+/av 0 def
+/T true def/F false def/mtx matrix def/s75 75 string def/s8 8 string def/s1 ( ) def/pxs 1 def/pys 1 def
+1 0 mtx defaultmatrix dtransform exch atan/pa exch def/nlw .24 def/ppr [-32 -29.52 762 582.48] def
+/pgs 1 def/por true def/xb 500 array def/so true def/tso true def/fillflag false def/pnm 1 def/fmv true def
+/sfl false def/ma 0 def/invertflag false def/dbinvertflag false def/xflip false def/yflip false def/noflips true def/scaleby96 false def/fNote true def/fBitStretch true def
+/fg (Rvd\001\001\000\000\177) def
+/bdf{bind def}bind def
+/xdf{exch def}bdf
+/xl{neg exch neg translate}bdf
+/fp{pnsh 0 ne pnsv 0 ne and}bdf
+/nop{}bdf/lnop[/nop load]cvx bdf
+/vrb[
+{fp{fg 6 get 0 ne{gsave stroke grestore}{gsave 1 setlinewidth pnsh pnsv scale stroke grestore}ifelse}if newpath}bind
+/eofill load
+dup
+/newpath load
+2 index
+dup
+{clip newpath}bind
+{}bind
+dup
+2 copy
+]def
+currentscreen/spf xdf/rot xdf/freq xdf
+/doop{vrb exch get exec}bdf
+/psu{/tso xdf /fNote xdf/fBitStretch xdf/scaleby96 xdf/yflip xdf/xflip xdf
+/invertflag xdf/dbinvertflag invertflag statusdict begin version cvr 47.0 ge product (LaserWriter) eq not and end invertflag and {not}if def
+xflip yflip or{/noflips false def}if
+/pgs xdf 2 index .72 mul exch div/pys xdf div .72 mul/pxs xdf ppr astore pop/por xdf sn and/so xdf}bdf
+/tab{statusdict /11x17 known{statusdict begin /11x17 load end}{statusdict /setpage known{statusdict begin 792 1224 1 setpage end}{statusdict /setpageparams known{statusdict begin 792 1224 0 1 setpageparams end}if}ifelse}ifelse}bdf
+/txpose{
+%[TJD] fNote{smalls}{bigs}ifelse pgs get exec
+ pxs pys scale
+ ppr aload pop por{
+ noflips{
+ pop exch neg exch translate pop 1 -1 scale
+ }if
+ xflip yflip and{
+ pop exch neg exch translate 180 rotate 1 -1 scale
+ ppr 3 get ppr 1 get neg sub neg ppr 2 get
+ ppr 0 get neg sub neg translate
+ }if
+ xflip yflip not and{
+ pop exch neg exch translate pop 180 rotate
+ ppr 3 get ppr 1 get neg sub neg 0 translate
+ }if
+ yflip xflip not and{
+ ppr 1 get neg ppr 0 get neg translate
+ }if
+ }{
+ noflips{
+ translate pop pop 270 rotate 1 -1 scale
+ }if
+ xflip yflip and{
+ translate pop pop 90 rotate 1 -1 scale
+ ppr 3 get ppr 1 get neg sub neg ppr 2 get
+ ppr 0 get neg sub neg translate
+ }if
+ xflip yflip not and{
+ translate pop pop 90 rotate ppr 3 get ppr 1 get
+ neg sub neg 0 translate
+ }if
+ yflip xflip not and{
+ translate pop pop 270 rotate ppr 2 get ppr 0 get
+ neg sub neg 0 exch translate
+ }if
+ }ifelse
+ statusdict begin waittimeout 300 lt{
+ /waittimeout 300 def
+ }if end
+ scaleby96{
+ ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div
+ 2 copy translate .96 dup scale neg exch neg exch translate
+ }if
+}bdf
+/fr{4 copy ppr aload pop 3 -1 roll add 3 1 roll exch add 6 2 roll 3 -1 roll
+sub 3 1 roll exch sub 3 -1 roll exch div 3 1 roll div exch scale pop pop xl}bdf
+/obl{{0.212557 mul}{pop 0}ifelse}bdf
+/sfd{ps fg 5 -1 roll get mul 100 div 0 ps 5 -1 roll obl ps neg 0 0 6a astore makefont setfont}bdf
+/fnt{findfont sfd}bdf
+/bt{sa 3 1 roll 3 index and put}bdf
+/sa(\000\000\000\000\000\000\000\000\000\000)def
+/fs{0 1 bt 1 2 bt 2 4 bt 3 8 bt 4 16 bt 5 32 bt 6 64 bt 7 128 bt sa exch 8 exch put}bdf
+/mx1 matrix def
+/mx2 matrix def
+/mx3 matrix def
+/bu{currentpoint currentgray currentlinewidth currentlinecap currentlinejoin currentdash exch aload length
+fg 5 sfl{1}{0}ifelse put pnsv pnsh
+2t aload pop 3a aload pop mx2 aload pop mx1 aload pop mtx currentmatrix aload pop
+mx3 aload pop ps pm restore/ps xdf mx3 astore pop}bdf
+/bn{/pm save def mx3 setmatrix newpath 0 0 moveto ct dup 39 get 0 exch getinterval cvx exec
+mtx astore setmatrix mx1 astore pop mx2 astore pop 3a astore pop
+2t astore pop/pnsh xdf/pnsv xdf gw
+/sfl fg 5 get 0 ne def array astore exch setdash setlinejoin setlinecap
+setlinewidth setgray moveto}bdf
+/fc{save vmstatus exch sub 50000 lt
+{(%%[|0|]%%)=print flush}if pop restore}bdf
+/tc{32768 div add 3 1 roll 32768 div add 2t astore pop}bdf
+/3a [0 0 0] def
+/2t 2 array def
+/tp{3a astore pop}bdf
+/tt{mx2 currentmatrix pop currentpoint 2 copy 2t aload pop qa 2 copy translate 3a aload pop exch dup 0 eq
+{pop}{1 eq{-1 1}{1 -1}ifelse scale}ifelse rotate pop neg exch neg exch translate moveto}bdf
+/te{mx2 setmatrix}bdf
+/th{3 -1 roll div 3 1 roll exch div 2 copy mx1 scale pop scale/sfl true def}bdf
+/tu{1 1 mx1 itransform scale/sfl false def}bdf
+/ts{1 1 mx1 transform scale/sfl true def}bdf
+/fz{/ps xdf}bdf
+/dv{dup 0 ne{div}{pop}ifelse}bdf
+/pop4{pop pop pop pop}bdf
+/it{sfl{mx1 itransform}if}bdf
+/gm{exch it moveto}bdf/rm{it rmoveto}bdf
+/lm{currentpoint sfl{mx1 transform}if exch pop sub 0 exch it rmoveto}bdf
+/fm{statusdict/manualfeed known}bdf
+/se{statusdict exch/manualfeed exch put}bdf
+/mf{dup/ma exch def 0 gt{fm se/t1 5 st ok ma 1 gt and{/t2 0 st/t3 0 st
+statusdict/manualfeedtimeout 3600 put
+}if}if}bdf
+/jn{/statusdict where exch pop{statusdict exch /jobname exch put}if}bdf
+/pen{pnm mul/pnsh xdf pnm mul/pnsv xdf pnsh setlinewidth}bdf
+/min{2 copy gt{exch}if pop}bdf
+/max{2 copy lt{exch}if pop}bdf
+/dh{fg 6 1 put array astore dup {1 pxs div mul exch}forall astore exch pop exch pop exch setdash}bdf
+/ih[currentdash]def
+/rh{fg 6 0 put ih aload pop setdash}bdf
+/dl{gsave nlw pys div setlinewidth 0 setgray}bdf
+/dlin{exch currentpoint currentlinewidth 2 div dup
+translate newpath moveto lineto currentpoint stroke grestore moveto}bdf
+/lin{fg 6 get 0 ne{exch lineto currentpoint 0 doop moveto}
+{exch currentpoint/pnlv xdf/pnlh xdf gsave newpath/@1 xdf/@2 xdf fp{pnlh @2 lt{pnlv @1 ge
+{pnlh pnlv moveto @2 @1 lineto pnsh 0 rlineto
+0 pnsv rlineto pnlh pnsh add pnlv pnsv add lineto pnsh neg 0 rlineto}
+{pnlh pnlv moveto pnsh 0 rlineto @2 pnsh add @1 lineto 0 pnsv rlineto
+pnsh neg 0 rlineto pnlh pnlv pnsv add lineto}ifelse}{pnlv @1 gt
+{@2 @1 moveto pnsh 0 rlineto pnlh pnsh add pnlv lineto 0 pnsv rlineto
+pnsh neg 0 rlineto @2 @1 pnsv add lineto}{pnlh pnlv moveto pnsh 0 rlineto
+0 pnsv rlineto @2 pnsh add @1 pnsv add lineto pnsh neg 0 rlineto
+0 pnsv neg rlineto}ifelse}ifelse
+closepath fill}if @2 @1 grestore moveto}ifelse}bdf
+/gw{/pnm fg 3 get fg 4 get div def}bdf
+/lw{fg exch 4 exch put fg exch 3 exch put gw pnsv pnsh pen}bdf
+/barc{/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf
+/@6 xdf/@7 xdf/@8 xdf gsave
+@5 @7 add 2 div @6 @8 add 2 div translate newpath 0 0 moveto
+@5 @7 sub @6 @8 sub mtx currentmatrix pop scale @1{newpath}if
+0 0 0.5 @4 @3 arc @4 @3 sub abs 360 ge{closepath}if
+mtx setmatrix @2 doop grestore}bdf
+/ar{dup 0 eq barc}bdf
+/ov{0 exch 360 exch true barc}bdf
+/rc{/@t xdf currentpoint 6 2 roll newpath 4 copy 4 2 roll exch moveto
+6 -1 roll lineto lineto lineto closepath @t doop moveto}bdf
+/mup{dup pnsh 2 div le exch pnsv 2 div le or}bdf
+/rr{/@1 xdf 2. div/@2 xdf 2. div/@3 xdf
+/@4 xdf/@5 xdf/@6 xdf/@7 xdf
+@7 @5 eq @6 @4 eq @2 mup or or{@7 @6 @5 @4 @1 rc}
+{@4 @6 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse
+@5 @7 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse
+@1 0 eq{/@2 @2 pnsh 2 div 2 copy gt{sub def}{0 pop4}ifelse}if
+currentpoint newpath
+@4 @6 add 2. div @7 moveto
+@4 @7 @4 @5 @2 arcto pop4
+@4 @5 @6 @5 @2 arcto pop4
+@6 @5 @6 @7 @2 arcto pop4
+@6 @7 @4 @7 @2 arcto pop4
+closepath @1 doop moveto}ifelse}bdf
+/pr{gsave newpath/pl{exch moveto/pl{exch lineto}def}def}bdf
+/pl{exch lineto}bdf
+/ep{dup 0 eq{{moveto}{exch lin}{}{(%%[|1|]%%)= flush}pathforall
+pop grestore}{doop grestore}ifelse currentpoint newpath moveto}bdf
+/gr{64. div setgray}bdf
+/pat{s8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi s8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}setscreen gr}bdf
+/sg{freq rot/spf load setscreen gr}bdf
+/dc{transform round .5 sub exch round .5 sub exch itransform}bdf
+/sn{userdict/smooth4 known}bdf
+/x8{3 bitshift}bdf
+/x4{2 bitshift}bdf
+/d4{-2 bitshift}bdf
+/d8{-3 bitshift}bdf
+/rb{15 add -4 bitshift 1 bitshift}bdf
+/db{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf/@6 @5 @3 4 add mul def
+dc translate scale/xdbit 1 1 idtransform abs/ydbit exch def abs def{0 0 1 ydbit add 1 10 rc clip}if
+@1 0 eq @1 4 eq or{1 setgray ydbit 0 1 ydbit add 1 2 rc}if
+@1 3 eq @1 7 eq or{1}{0}ifelse setgray/@9 @1 0 eq @1 1 eq @1 3 eq or or dbinvertflag xor def/@13 @6 def
+@2 fBitStretch or{/@10 @4 x4 def/@11 @3 x4 def/@12 @10 rb def/@13 @12 @11 mul def/@15 1 1 dtransform abs/calcY 1 index def round cvi/@14 exch def
+abs/calcX 1 index def round cvi scaleby96 not{1 add}if def/@16 @15 rb def/@17 @16 @14 mul def}if
+sn @13 60000 lt and @2 fBitStretch or and{mtx currentmatrix dup 1 get exch 2 get 0. eq exch 0. eq and @17 60000 lt and fBitStretch and{@16 3 bitshift @14 @9 [calcX 0 0 calcY 0 0]{@17 string @13 string
+currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4
+@10 @11 @12 dup string 5 index @15 @14 @16 dup string stretch}imagemask}{@12 x8 @11 @9 [@10 0 0 @11 0 0]{@13 string
+currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4}imagemask}ifelse}{@5 3 bitshift @3 4 add @9 [@4 0 0 @3 0 2]{currentfile @6 string readhexstring pop}imagemask}ifelse
+@7 restore}bdf
+/multibit{/mbdeep exch def/mbY exch def/mbX exch def
+save mbX mbY mbdeep[mbX 0 0 mbY 0 0]{currentfile picstr readhexstring pop}image
+restore}bdf
+/wd 16 dict def
+/mfont 14 dict def
+/mdf{mfont wcheck not{/mfont 14 dict def}if mfont begin xdf end}bdf
+/cf{{1 index/FID ne{def}{pop pop}ifelse}forall}bdf/rf{/@1 exch def/@2 exch def
+FontDirectory @2 known{cleartomark pop}{findfont dup begin dup length @1 add dict begin
+cf{/Encoding macvec def}{Encoding dup length array copy/Encoding exch def
+counttomark 2 idiv{Encoding 3 1 roll put}repeat}ifelse
+pop
+exec currentdict end end @2 exch definefont pop}ifelse}bdf
+/bmbc{exch begin wd begin
+/cr xdf
+save
+CharTable cr 6 mul 6 getinterval{}forall
+/bitheight xdf/bitwidth xdf
+.96 div/width xdf
+Gkernmax add/XOffset xdf Gdescent add/YOffset xdf/rowbytes xdf
+rowbytes 255 eq{0 0 0 0 0 0 setcachedevice}
+{Gnormsize dup scale
+width 0 XOffset YOffset bitwidth XOffset add bitheight YOffset add
+setcachedevice
+rowbytes 0 ne{
+XOffset YOffset translate newpath 0 0 moveto
+bitwidth bitheight scale
+sn{
+/xSmt bitwidth x4 def
+/ySmt bitheight x4 def
+/rSmt xSmt rb def
+rSmt x8 ySmt true
+[xSmt 0 0 ySmt neg 0 ySmt]
+{rSmt ySmt mul string CharData cr get
+1 index bitwidth bitheight rowbytes rSmt tso smooth4}
+}{rowbytes 3 bitshift bitheight 4 add true
+[bitwidth 0 0 bitheight neg 0 bitheight 2 add]
+{CharData cr get}
+}ifelse
+imagemask
+}if
+}ifelse
+restore
+end end
+}bdf
+/bb{.96 exch div/Gnormsize mdf 2 index
+/Gkernmax mdf 1 index/Gdescent mdf
+3 index div 4 1 roll
+2 index div 1. 5 2 roll
+exch div 4 1 roll
+4 array astore/FontBBox mdf
+}bdf
+/cdf{mfont/CharData get 3 1 roll put}bdf
+/bf{
+mfont begin
+/FontType 3 def
+/FontMatrix [1 0 0 1 0 0] def
+/Encoding macvec def
+/BuildChar/bmbc load def
+end
+mfont definefont pop
+}bdf
+/wi LW 1 eq{{gsave 0 0 0 0 0 0 0 0 moveto lineto lineto lineto closepath clip stringwidth grestore}bind}{/stringwidth load}ifelse def
+/aps{0 get 124 eq}bdf
+/xc{s75 cvs dup}bdf
+/xp{put cvn}bdf
+/scs{xc 3 67 put dup 0 95 xp}bdf
+/sos{xc 3 79 xp}bdf
+/sbs{xc 1 66 xp}bdf
+/sis{xc 2 73 xp}bdf
+/sob{xc 2 79 xp}bdf
+/sss{xc 4 83 xp}bdf
+/dd{exch 1 index add 3 1 roll add exch}bdf
+/smc{moveto dup show}bdf
+/kwn{FontDirectory 1 index known{findfont exch pop}}bdf
+/gl{1 currentgray sub setgray}bdf
+/mm{/mfont 10 dict def mfont begin
+/FontMatrix [1 0 0 1 0 0] def
+/FontType 3 def
+/Encoding macvec def
+/df 4 index findfont def
+/FontBBox [0 0 1 1] def
+/xda xdf/mbc xdf
+/BuildChar{wd begin/cr xdf/fd xdf/cs s1 dup 0 cr put def fd/mbc get exec end}def
+exec end mfont definefont}bdf
+/ac{dup scs kwn{exch findfont dup length 1 add dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall
+fmv{/Encoding macvec def}if/StrokeWidth nlw 1000 mul pys div ps div dup 12 lt{pop 12}if def
+/PaintType 2 def currentdict end definefont}ifelse}bdf
+/mb{dup sbs kwn{exch{pop}{bbc}{}mm}ifelse sfd}bdf
+/mo{dup sos kwn{exch{pop}{boc}{}mm}ifelse sfd}bdf
+/ms{dup sss kwn{exch{pop}{bsc}{}mm}ifelse sfd}bdf
+/ou{dup sos kwn{exch dup ac pop{scs findfont /df2 xdf}{aoc}{}mm}ifelse sfd}bdf
+/su{dup sss kwn{exch dup ac pop{scs findfont /df2 xdf}{asc}{}mm}ifelse sfd}bdf
+/ao{/fmv true def ou}bdf/as{/fmv true def su}bdf
+/vo{/fmv false def ou}bdf/vs{/fmv false def su}bdf
+/bbc{/da .03 def fd/df get setfont
+gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs 0 0 smc da 0 smc da da smc 0 da moveto show}bdf
+/boc{/da 1 ps div def fd/df get setfont
+gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs 0 0 smc da 0 smc da da smc 0 da smc gl da 2. div dup moveto show}bdf
+/bsc{/da 1 ps div def
+/ds .05 def/da2 da 2. div def fd/df get setfont
+gsave cs wi 1 index 0 ne{exch ds add da2 add exch}if grestore setcharwidth
+cs ds da2 add .01 add 0 smc 0 ds da2 sub translate 0 0 smc
+da 0 smc da da smc 0 da smc gl da 2. div dup moveto show}bdf
+/aoc{fd/df get setfont
+gsave cs wi grestore setcharwidth
+gl cs 0 0 smc fd/df2 get setfont gl 0 0 moveto show}bdf
+/asc{/da .05 def fd/df get setfont
+gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs da .01 add 0 smc 0 da translate gl 0 0 smc gl fd/df2 get setfont 0 0 moveto show}bdf
+/st{1000 mul usertime add dup 2147483647 gt{2147483647 sub}if def}bdf
+/the{usertime sub dup 0 lt exch -2147483648 gt and}bdf
+/6a 6 array def
+/2a 2 array def
+/3q 3 array def
+/qs{3 -1 roll sub exch 3 -1 roll sub exch}bdf
+/qa{3 -1 roll add exch 3 -1 roll add exch}bdf
+/qm{3 -1 roll 1 index mul 3 1 roll mul}bdf
+/qn{6a exch get mul}bdf
+/qA .166667 def/qB .833333 def/qC .5 def
+/qx{6a astore pop
+qA 0 qn qB 2 qn add qA 1 qn qB 3 qn add
+qB 2 qn qA 4 qn add qB 3 qn qA 5 qn add
+qC 2 qn qC 4 qn add qC 3 qn qC 5 qn add}bdf
+/qp{6 copy 12 -2 roll pop pop}bdf
+/qc{exch qp qx curveto}bdf
+/qi{{exch 4 copy 2a astore aload pop qa .5 qm newpath moveto}{exch 2 copy 6 -2 roll 2 qm qs 4 2 roll}ifelse}bdf
+/qq{{qc 2a aload pop qx curveto}{exch 4 copy qs qa qx curveto}ifelse}bdf
+/pt{currentpoint newpath moveto}bdf
+/qf{/fillflag true def}bdf
+/ec{1 and 0 ne{0 doop}if grestore currentpoint newpath moveto/fillflag false def}bdf
+/eu{currentpoint fp{0 ep}{grestore newpath}ifelse moveto/fillflag false def}bdf
+/bp{currentpoint newpath 2 copy moveto}bdf
+/ef{gsave fillflag{gsave eofill grestore}if}bdf
+/sm{0 exch{@1 eq{1 add}if}forall}bdf
+/lshow{4 1 roll exch/@1 exch def{1 index wi pop sub 1 index sm dv 0 @1 4 -1 roll widthshow}{1 index wi pop sub
+1 index dup sm 10 mul exch length 1 sub add dv dup 10. mul 0 @1 4 -1 roll 0 6 -1 roll awidthshow}ifelse}bdf
+/setTxMode{sa 9 2 index put 3 eq{1}{0}ifelse setgray}bdf
+/SwToSym{{}mark false/Symbol/|______Symbol 0 rf 0 sa 6 get 0 ne{pop 1}{sa 7 get 0 eq{pop 2}if}ifelse
+sa 1 get 0 ne/|______Symbol
+sa 4 get 0 ne{vs}{sa 3 get 0 ne{vo}{fnt}ifelse}ifelse}bdf
+/mc{0 3 1 roll transform neg exch pop}bdf
+/ul{dup 0 ne sa 2 get 0 ne and{gsave 0 0
+/UnderlinePosition kif{mc}{ps -10 div}ifelse/UnderlineThickness kif{mc}{ps 15 div}ifelse
+abs setlinewidth neg rmoveto
+sa 4 get 0 ne{gsave currentlinewidth 2. div dup rmoveto currentpoint newpath moveto
+2 copy rlineto stroke grestore}if
+sa 3 get sa 4 get or 0 ne{gsave gl 2 copy rlineto stroke grestore rlineto strokepath nlw pys div setlinewidth}{rlineto}ifelse
+stroke grestore}{pop}ifelse}bdf
+/sgt{2 copy known{get true}{pop pop false}ifelse}bdf
+/kif{currentfont dup/FontMatrix get exch/FontInfo sgt{true}{currentfont/df sgt
+{dup/FontInfo sgt{3 1 roll/FontMatrix get mtx concatmatrix exch true}{pop pop pop false}
+ifelse}{pop pop false}ifelse}ifelse{3 -1 roll sgt{exch true}{pop false}ifelse}{false}ifelse}bdf
+/blank/Times-Roman findfont/CharStrings get/space get def
+/macvec 256 array def
+/NUL/SOH/STX/ETX/EOT/ENQ/ACK/BEL/BS/HT/LF/VT/FF/CR/SO/SI
+/DLE/DC1/DC2/DC3/DC4/NAK/SYN/ETB/CAN/EM/SUB/ESC/FS/GS/RS/US
+macvec 0 32 getinterval astore pop
+macvec 32/Times-Roman findfont/Encoding get
+32 96 getinterval putinterval macvec dup 39/quotesingle put 96/grave put
+/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis/Udieresis/aacute
+/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute/egrave
+/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde/oacute
+/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex/udieresis
+/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
+/registered/copyright/trademark/acute/dieresis/notequal/AE/Oslash
+/infinity/plusminus/lessequal/greaterequal/yen/mu/partialdiff/summation
+/product/pi/integral/ordfeminine/ordmasculine/Omega/ae/oslash
+/questiondown/exclamdown/logicalnot/radical/florin/approxequal/Delta/guillemotleft
+/guillemotright/ellipsis/blank/Agrave/Atilde/Otilde/OE/oe
+/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide/lozenge
+/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright/fi/fl
+/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand/Acircumflex/Ecircumflex/Aacute
+/Edieresis/Egrave/Iacute/Icircumflex/Idieresis/Igrave/Oacute/Ocircumflex
+/apple/Ograve/Uacute/Ucircumflex/Ugrave/dotlessi/circumflex/tilde
+/macron/breve/dotaccent/ring/cedilla/hungarumlaut/ogonek/caron
+macvec 128 128 getinterval astore pop
+{}mark true/Courier/|______Courier 0 rf
+{/Metrics 21 dict begin/zero 600 def/one 600 def/two 600 def/three 600 def/four 600 def/five 600 def/six 600 def/seven 600 def/eight 600 def
+/nine 600 def/comma 600 def/period 600 def/dollar 600 def/numbersign 600 def/percent 600 def/plus 600 def/hyphen 600 def/E 600 def/parenleft 600 def/parenright 600 def/space 600 def
+currentdict end def currentdict/UniqueID known{/UniqueID 16#800000 def}if/FontBBox FontBBox 4 array astore def}mark true/Helvetica/|______Seattle 1 rf
+/oldsettransfer/settransfer load def
+/concatprocs{/proc2 exch cvlit def/proc1 exch cvlit def/newproc proc1 length proc2 length add array def
+newproc 0 proc1 putinterval newproc proc1 length proc2 putinterval newproc cvx}def
+/settransfer{currenttransfer concatprocs oldsettransfer}def
+/PaintBlack{{1 exch sub}settransfer gsave newpath clippath 1 setgray fill grestore}def
+/od{(Rvd\001\001\000\000\177) fg copy pop txpose
+1 0 mtx defaultmatrix dtransform exch atan/pa exch def
+newpath clippath mark
+{transform{itransform moveto}}{transform{itransform lineto}}
+{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform
+{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}
+{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put
+10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if}bdf
+/cd{}bdf
+/op{/sfl false def/pm save def}bdf
+%%[TJD]%/cp{not{userdict/#copies 0 put}if ma 0 gt{{t1 the{exit}if}loop}if{copypage}{showpage}ifelse pm restore}bdf
+/cp{ pop pop pm restore } bdf
+/px{0 3 1 roll tp tt}bdf
+/psb{/us save def}bdf
+/pse{us restore}bdf
+/ct 40 string def
+/nc{currentpoint initclip newpath gc{dup type dup/arraytype eq exch/packedarraytype eq or{exec}if}
+forall clip newpath moveto}def
+/kp{ct 0 2 index length 2 index 39 2 index put getinterval copy cvx exec mx3 currentmatrix pop}bdf
+/av 68 def
+end
+LW 1 eq userdict/a4small known not and{/a4small
+[[300 72 div 0 0 -300 72 div -120 3381]
+280 3255
+{statusdict/jobstate (printing) put 0 setblink
+margins
+exch 196 add exch 304 add 8 div round cvi frametoroket
+statusdict/jobstate (busy) put
+1 setblink}
+/framedevice load
+60 45{dup mul exch dup mul add 1.0 exch sub}/setscreen load
+{}/settransfer load/initgraphics load/erasepage load]cvx
+statusdict begin bind end readonly def}if
+md begin/bigs[lnop userdict/letter known{/letter load}{lnop}ifelse userdict/legal known{/legal load}{lnop}ifelse userdict/a4 known{/a4 load}{lnop}ifelse userdict/b5 known{/b5 load}{lnop}ifelse
+lnop lnop lnop /tab load]def
+/smalls[lnop userdict/lettersmall known{/lettersmall load}{userdict/note known{/note load}{lnop}ifelse}ifelse
+userdict/legal known{/legal load}{lnop}ifelse userdict/a4small known{/a4small load}{lnop}ifelse
+userdict/b5 known{/b5 load}{userdict/note known{/note load}{lnop}ifelse}ifelse lnop lnop lnop /tab load]def end
+systemdict/currentpacking known{setpacking}if
+%%[TJD]%currentfile ok userdict/stretch known not and{eexec}{flushfile}ifelse
+%%[TJD]%
+%%[TJD]%currentfile ok userdict/smooth4 known not and{eexec}{flushfile}ifelse
+%%[TJD]%
+%%EndProcSet
+
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep70.pro b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep70.pro
new file mode 100644
index 00000000000..cd0ad2a2792
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep70.pro
@@ -0,0 +1,451 @@
+%!PS-Adobe-2.0
+%%BeginProcSet: "(AppleDict md)" 70 0
+statusdict begin product(LaserWriter II NT)eq revision 1 eq and
+{userdict begin/oldcds/cleardictstack load def/cleardictstack{31 sendpcmd 4 eq tonerlight/oldcds load exec}bind def
+end
+currentfile eexec
+}{save currentfile 359 string readhexstring pop pop restore}ifelse
+35de8eabfc7fa5eac0431edc501ad43f5fcbdf9fdd321cce93b525f4439dd94696bf56ac13a0a2aad1e6bcf444711e941d7217138d20ae0500145f815439cc14e697ad201df728ea4ccad4ac
+331aa03a7aacde10760bf4ee12bbf73c77cdcbf1796f26f0dd255d2407e1ac41
+d27489a69d6b69c6a841468b46720b75ad65650700e0c528e7af61e7e3e821b59445c44b69831ebc9deaf0e3aecc14b7a1c2e18bc1fa42a59219f1e36f236e3d6c89114b1f231999c3dbce6b43f3e2918fcb85575941a9d1e65c86aa08e6eea86cc66ce90e5e4add57f2585e
+7b1c0b5203cfc46868d6e3c0d66db79174e7091e32e307679732da062e440e41dabd36a161b611a7e4523a49694026206803dbfd5be5c5fe433f0f18a40057db6f1302848c8da4a10a7f14c6
+3d512806362b1be092ad5dbd36d75fe63e4cae2ba9b72390f580cac344a08bdf6eb9e36ec45bad2a0b82829a72e0efa2d87332c482196e690361168271c55053341ab3
+end
+/sc {60 45 {abs exch abs 2 copy add 1 gt{1.0 sub dup mul exch 1.0 sub dup mul add 1.0 sub}{dup mul exch dup mul add 1.0 exch sub}
+ifelse}setscreen} bind def statusdict begin product(LaserWriter II)anchorsearch end
+{pop pop/letter [/letter load /exec load /sc load /exec load]cvx def/legal [/legal load /exec load /sc load /exec load]cvx def/a4 [/a4 load /exec load /sc load /exec load]cvx def/b5 [/b5 load /exec load /sc load /exec load]cvx def
+/lettersmall [/lettersmall load /exec load /sc load /exec load]cvx def/a4small [/a4small load /exec load /sc load /exec load]cvx def/note [/note load /exec load /sc load /exec load]cvx def}{pop}ifelse
+systemdict/currentpacking known{currentpacking true setpacking}if
+/LW{save statusdict/product get(LaserWriter)anchorsearch
+exch pop{length 0 eq{1}{2}ifelse}{0}ifelse exch restore}bind def
+/LW+{LW 2 eq}bind def
+/ok{systemdict/statusdict known dup{LW 0 gt and}if}bind def
+ok{statusdict begin 9 sccinteractive 3 ne exch 0 ne or{9 0 3 setsccinteractive}if end}if
+/md 270 dict def md begin
+/av 0 def
+/T true def/F false def/mtx matrix def/s75 75 string def/sa8 8 string def/sb8 8 string def
+/sc8 8 string def/sd8 8 string def/s1 ( ) def/pxs 1 def/pys 1 def
+/ns false def
+1 0 mtx defaultmatrix dtransform exch atan/pa exch def/nlw .24 def/ppr [-32 -29.52 762 582.48] def
+/pgr [0 0 0 0] def
+/pgs 1 def/por true def/xb 500 array def/so true def/tso true def/fillflag false def/pnm 1 def/fmv true def
+/sfl false def/ma 0 def/invertflag false def/dbinvertflag false def/xflip false def/yflip false def/noflips true def/scaleby96 false def/fNote true def/fBitStretch true def
+/4colors false def/3colors false def/2colors false def
+/wtkey false def
+statusdict begin/waittimeout where{pop waittimeout 300 lt{md /wtkey true put}if}if end
+wtkey{statusdict begin/setdefaulttimeouts where{pop 0 60 300 setdefaulttimeouts}if end}if
+/fg (Rvd\001\001\000\000\177) def
+/bdf{bind def}bind def
+/xdf{exch def}bdf
+/xl{neg exch neg translate}bdf
+/fp{pnsh 0 ne pnsv 0 ne and}bdf
+/nop{}bdf/lnop[/nop load]cvx bdf
+/vrb[
+{fp{fg 6 get 0 ne{gsave stroke grestore}{gsave 1 setlinewidth pnsh pnsv scale stroke grestore}ifelse}if newpath}bind
+/eofill load
+dup
+/newpath load
+2 index
+dup
+{clip newpath}bind
+{}bind
+dup
+2 copy
+]def
+systemdict/currentcolorscreen known{currentcolorscreen/dkspf xdf/dkrot xdf/dkfreq xdf/dyspf xdf/dyrot xdf/dyfreq xdf/dmspf xdf/dmrot xdf/dmfreq xdf
+/dcspf xdf/dcrot xdf/dcfreq xdf}{currentscreen/spf xdf/rot xdf/freq xdf}ifelse
+/doop{vrb exch get exec}bdf
+/psu{/udf xdf/tso xdf /fNote xdf/fBitStretch xdf/scaleby96 xdf/yflip xdf/xflip xdf
+/invertflag xdf/dbinvertflag invertflag statusdict begin version cvr 47.0 ge product (LaserWriter) eq not and end invertflag and {not}if def
+xflip yflip or{/noflips false def}if
+/pgs xdf 2 index .72 mul exch div/pys xdf div .72 mul/pxs xdf ppr astore pop pgr astore pop/por xdf sn and/so xdf}bdf
+/tab{statusdict /11x17 known{statusdict begin /11x17 load end}{statusdict /setpage known{statusdict begin 792 1224 1 setpage end}{statusdict /setpageparams known{statusdict begin 792 1224 0 1 setpageparams end}if}ifelse}ifelse}bdf
+/a3Size{statusdict /a3 known{statusdict begin /a3 load end}{statusdict /setpageparams known{statusdict begin 842 1191 0 1 setpageparams end}if}ifelse}bdf
+/txpose{fNote{smalls}{bigs}ifelse pgs get exec pxs pys scale ppr aload pop por{noflips{pop exch neg exch translate pop 1 -1 scale}if
+xflip yflip and{pop exch neg exch translate 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if
+xflip yflip not and{pop exch neg exch translate pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{ppr 1 get neg ppr 0 get neg translate}if}
+{noflips{translate pop pop 270 rotate 1 -1 scale}if xflip yflip and{translate pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if
+xflip yflip not and{translate pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{translate pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 exch translate}if}ifelse
+wtkey{statusdict/waittimeout 300 put}if
+scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy translate .96 dup scale neg exch neg exch translate}if}bdf
+/fr{4 copy pgr aload pop 3 -1 roll add 3 1 roll exch add 6 2 roll 3 -1 roll
+sub 3 1 roll exch sub 3 -1 roll exch div 3 1 roll div exch scale pop pop xl}bdf
+/obl{{0.212557 mul}{pop 0}ifelse}bdf
+/sfd{ps fg 5 -1 roll get mul 100 div 0 ps 5 -1 roll obl ps neg 0 0 6a astore makefont setfont}bdf
+/fnt{findfont sfd}bdf
+/bt{sa 3 1 roll 3 index and put}bdf
+/sa(\000\000\000\000\000\000\000\000\000\000)def
+/fs{0 1 bt 1 2 bt 2 4 bt 3 8 bt 4 16 bt 5 32 bt 6 64 bt 7 128 bt sa exch 8 exch put}bdf
+/mx1 matrix def
+/mx2 matrix def
+/mx3 matrix def
+/bu{currentpoint 4colors{currentcmykcolor}{currentrgbcolor}ifelse currentlinewidth currentlinecap currentlinejoin
+currentdash exch aload length fg 5 sfl{1}{0}ifelse put pnsv pnsh
+2t aload pop 3a aload pop mx2 aload pop mx1 aload pop mtx currentmatrix aload pop
+mx3 aload pop ps pm restore/ps xdf mx3 astore pop}bdf
+/bn{/pm save def mx3 setmatrix newpath 0 0 moveto ct dup 39 get 0 exch getinterval cvx exec mtx astore setmatrix mx1 astore pop mx2 astore pop 3a
+astore pop 2t astore pop/pnsh xdf/pnsv xdf gw
+/sfl fg 5 get 0 ne def array astore exch setdash setlinejoin setlinecap
+setlinewidth 4colors{setcmykcolor}{setrgbcolor}ifelse moveto}bdf
+/fc{save vmstatus exch sub 50000 lt
+{(%%[|0|]%%)=print flush}if pop restore}bdf
+/tc{32768 div add 3 1 roll 32768 div add 2t astore pop}bdf
+/3a [0 0 0] def
+/2t 2 array def
+/tp{3a astore pop}bdf
+/tt{mx2 currentmatrix pop currentpoint 2 copy 2t aload pop qa 2 copy translate 3a aload pop exch dup 0 eq
+{pop}{1 eq{-1 1}{1 -1}ifelse scale}ifelse rotate pop neg exch neg exch translate moveto}bdf
+/te{mx2 setmatrix}bdf
+/th{3 -1 roll div 3 1 roll exch div 2 copy mx1 scale pop scale/sfl true def}bdf
+/tu{1 1 mx1 itransform scale/sfl false def}bdf
+/ts{1 1 mx1 transform scale/sfl true def}bdf
+/fz{/ps xdf}bdf
+/dv{dup 0 ne{div}{pop}ifelse}bdf
+/pop4{pop pop pop pop}bdf
+/it{sfl{mx1 itransform}if}bdf
+/gm{exch it moveto}bdf/rm{it rmoveto}bdf
+/lm{currentpoint sfl{mx1 transform}if exch pop sub 0 exch it rmoveto}bdf
+/fm{statusdict/manualfeed known}bdf
+/se{statusdict exch/manualfeed exch put}bdf
+/mf{dup/ma exch def 0 gt{fm se/t1 5 st ok ma 1 gt and{/t2 0 st/t3 0 st
+statusdict/manualfeedtimeout 3600 put
+}if}if}bdf
+/jn{/statusdict where exch pop{statusdict exch /jobname exch put}if}bdf
+/pen{pnm mul/pnsh xdf pnm mul/pnsv xdf pnsh setlinewidth}bdf
+/min{2 copy gt{exch}if pop}bdf
+/max{2 copy lt{exch}if pop}bdf
+/dh{fg 6 1 put array astore dup {1 pxs div mul exch}forall astore exch pop exch pop exch setdash}bdf
+/ih[currentdash]def
+/rh{fg 6 0 put ih aload pop setdash}bdf
+/dl{gsave nlw pys div setlinewidth 0 setgray}bdf
+/dlin{exch currentpoint currentlinewidth 2 div dup
+translate newpath moveto lineto currentpoint stroke grestore moveto}bdf
+/lin{fg 6 get 0 ne{exch lineto currentpoint 0 doop moveto}
+{exch currentpoint/pnlv xdf/pnlh xdf gsave newpath/@1 xdf/@2 xdf fp{pnlh @2 lt{pnlv @1 ge
+{pnlh pnlv moveto @2 @1 lineto pnsh 0 rlineto
+0 pnsv rlineto pnlh pnsh add pnlv pnsv add lineto pnsh neg 0 rlineto}
+{pnlh pnlv moveto pnsh 0 rlineto @2 pnsh add @1 lineto 0 pnsv rlineto
+pnsh neg 0 rlineto pnlh pnlv pnsv add lineto}ifelse}{pnlv @1 gt
+{@2 @1 moveto pnsh 0 rlineto pnlh pnsh add pnlv lineto 0 pnsv rlineto
+pnsh neg 0 rlineto @2 @1 pnsv add lineto}{pnlh pnlv moveto pnsh 0 rlineto
+0 pnsv rlineto @2 pnsh add @1 pnsv add lineto pnsh neg 0 rlineto
+0 pnsv neg rlineto}ifelse}ifelse
+closepath fill}if @2 @1 grestore moveto}ifelse}bdf
+/gw{/pnm fg 3 get fg 4 get div def}bdf
+/lw{fg exch 4 exch put fg exch 3 exch put gw pnsv pnsh pen}bdf
+/barc{/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf
+/@6 xdf/@7 xdf/@8 xdf gsave
+@5 @7 add 2 div @6 @8 add 2 div translate newpath 0 0 moveto
+@5 @7 sub @6 @8 sub mtx currentmatrix pop scale @1{newpath}if
+0 0 0.5 @4 @3 arc @4 @3 sub abs 360 ge{closepath}if
+mtx setmatrix @2 doop grestore}bdf
+/ar{dup 0 eq barc}bdf
+/ov{0 exch 360 exch true barc}bdf
+/rc{/@t xdf currentpoint 6 2 roll newpath 4 copy 4 2 roll exch moveto
+6 -1 roll lineto lineto lineto closepath @t doop moveto}bdf
+/mup{dup pnsh 2 div le exch pnsv 2 div le or}bdf
+/rr{/@1 xdf 2. div/@2 xdf 2. div/@3 xdf
+/@4 xdf/@5 xdf/@6 xdf/@7 xdf
+@7 @5 eq @6 @4 eq @2 mup or or{@7 @6 @5 @4 @1 rc}
+{@4 @6 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse
+@5 @7 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse
+@1 0 eq{/@2 @2 pnsh 2 div 2 copy gt{sub def}{0 pop4}ifelse}if
+currentpoint newpath
+@4 @6 add 2. div @7 moveto
+@4 @7 @4 @5 @2 arcto pop4
+@4 @5 @6 @5 @2 arcto pop4
+@6 @5 @6 @7 @2 arcto pop4
+@6 @7 @4 @7 @2 arcto pop4
+closepath @1 doop moveto}ifelse}bdf
+/pr{gsave newpath/pl{exch moveto/pl{exch lineto}def}def}bdf
+/pl{exch lineto}bdf
+/ep{dup 0 eq{{moveto}{exch lin}{}{(%%[|1|]%%)= flush}pathforall
+pop grestore}{doop grestore}ifelse currentpoint newpath moveto}bdf
+/gr{64. div setgray}bdf
+/savescreen{ns not{/ns true def systemdict/currentcolorscreen known{currentcolorscreen/pkspf xdf/pkrot xdf/pkfreq xdf/pyspf xdf/pyrot xdf/pyfreq xdf/pmspf xdf/pmrot xdf/pmfreq xdf
+/pcspf xdf/pcrot xdf/pcfreq xdf}{currentscreen/sspf xdf/srot xdf/sfreq xdf}ifelse}if}bdf
+/restorescreen{/ns false def systemdict/setcolorscreen known{pcfreq pcrot/pcspf load pmfreq pmrot/pmspf load pyfreq pyrot/pyspf load
+pkfreq pkrot/pkspf load setcolorscreen}{sfreq srot/sspf load setscreen}ifelse}bdf
+/pat{savescreen sa8
+copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}setscreen exch not{gr}{pop}ifelse}bdf
+/sg{restorescreen gr}bdf
+/cpat{savescreen 10 2 roll 7 -1 roll sa8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}8 -1 roll sb8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sb8
+exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}9 -1 roll sc8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sc8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}10 -1 roll sd8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sd8
+exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}psuedo1 dsc 4{4 -1 roll 1 exch 64 div sub}repeat setcmykcolor pop pop}bdf
+systemdict/setcolorscreen known{/psuedo1 lnop bdf/dsc/setcolorscreen load def}{/psuedo1{16{pop}repeat sa8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}}bdf
+/bwsc{setscreen dup gr 0 exch 0 exch 64 exch 64 exch 64 exch}bdf/dsc/bwsc load def
+}ifelse
+systemdict/setcmykcolor known not{/setcmykcolor{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdf}if
+/dc{transform round .5 sub exch round .5 sub exch itransform}bdf
+/sn{userdict/smooth4 known}bdf
+/x8{3 bitshift}bdf
+/x4{2 bitshift}bdf
+/d4{-2 bitshift}bdf
+/d8{-3 bitshift}bdf
+/rb{15 add -4 bitshift 1 bitshift}bdf
+/db{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf/@6 @5 @3 4 add mul def
+dc translate scale/xdbit 1 1 idtransform abs/ydbit exch def abs def{0 0 1 ydbit add 1 10 rc clip}if
+@1 0 eq @1 4 eq or{currentrgbcolor 1 setgray ydbit 0 1 ydbit add 1 2 rc setrgbcolor}if
+@1 3 eq @1 7 eq or{1 setgray}{currentrgbcolor 2 index eq exch 2 index eq and exch pop{0 setgray}if}ifelse/@9 @1 0 eq @1 1 eq @1 3 eq or or dbinvertflag xor def/@13 @6 def
+@2 fBitStretch or{/@10 @4 x4 def/@11 @3 x4 def/@12 @10 rb def/@13 @12 @11 mul def/@15 1 1 dtransform abs/calcY 1 index def round cvi/@14 exch def
+abs/calcX 1 index def round cvi scaleby96 not{1 add}if def/@16 @15 rb def/@17 @16 @14 mul def}if
+sn @13 60000 lt and @2 fBitStretch or and{mtx currentmatrix dup 1 get exch 2 get 0. eq exch 0. eq and @17 60000 lt and fBitStretch and{@16 3 bitshift @14 @9 [calcX 0 0 calcY 0 0]{@17 string @13 string
+currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4
+@10 @11 @12 dup string 5 index @15 @14 @16 dup string stretch}imagemask}{@12 x8 @11 @9 [@10 0 0 @11 0 0]{@13 string
+currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4}imagemask}ifelse}{@5 3 bitshift @3 4 add @9 [@4 0 0 @3 0 2]{currentfile @6 string readhexstring pop}imagemask}ifelse
+@7 restore}bdf
+systemdict/setcmykcolor known{/psuedo lnop bdf/di/colorimage load def}{/routines[{.3 mul add 1}bind{.59 mul add 2}bind{.11 mul add round cvi str exch i exch put/i i 1 add def 0 0}bind]def
+/psuedo{/i 0 def 0 exch 0 exch{exch routines exch get exec}forall pop pop str}bdf/bwi{pop pop image}bdf/di/bwi load def}ifelse
+/cdb{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf
+systemdict/setcmykcolor known not{dc}if translate scale /@6 xdf
+/@18 @5 dup 60000 ge{pop 60000}if string def @6 not{/str @18 0 @18 length 3 idiv getinterval def}if @4 @3 8 [@4 0 0 @3 0 0]@6{{currentfile @18 readhexstring pop}image}{{currentfile @18 readhexstring pop psuedo}false 3 di}ifelse @7 restore}bdf
+/wd 16 dict def
+/mfont 14 dict def
+/mdf{mfont wcheck not{/mfont 14 dict def}if mfont begin xdf end}bdf
+/cf{{1 index/FID ne{def}{pop pop}ifelse}forall}bdf/rf{/@1 exch def/@2 exch def
+FontDirectory @2 known{cleartomark pop}{findfont dup begin dup length @1 add dict begin
+cf{/Encoding macvec def}{Encoding dup length array copy/Encoding exch def
+counttomark 2 idiv{Encoding 3 1 roll put}repeat}ifelse
+pop
+exec currentdict end end @2 exch definefont pop}ifelse}bdf
+/bmbc{exch begin wd begin
+/cr xdf
+save
+CharTable cr 6 mul 6 getinterval{}forall
+/bitheight xdf/bitwidth xdf
+.96 div/width xdf
+Gkernmax add/XOffset xdf Gdescent add/YOffset xdf/rowbytes xdf
+rowbytes 255 eq{0 0 0 0 0 0 setcachedevice}
+{Gnormsize dup scale
+width 0 XOffset YOffset bitwidth XOffset add bitheight YOffset add
+setcachedevice
+rowbytes 0 ne{
+XOffset YOffset translate newpath 0 0 moveto
+bitwidth bitheight scale
+sn{
+/xSmt bitwidth x4 def
+/ySmt bitheight x4 def
+/rSmt xSmt rb def
+rSmt x8 ySmt true
+[xSmt 0 0 ySmt neg 0 ySmt]
+{rSmt ySmt mul string CharData cr get
+1 index bitwidth bitheight rowbytes rSmt tso smooth4}
+}{rowbytes 3 bitshift bitheight 4 add true
+[bitwidth 0 0 bitheight neg 0 bitheight 2 add]
+{CharData cr get}
+}ifelse
+imagemask
+}if
+}ifelse
+restore
+end end
+}bdf
+/bb{.96 exch div/Gnormsize mdf 2 index
+/Gkernmax mdf 1 index/Gdescent mdf
+3 index div 4 1 roll
+2 index div 1. 5 2 roll
+exch div 4 1 roll
+4 array astore/FontBBox mdf
+}bdf
+/cdf{mfont/CharData get 3 1 roll put}bdf
+/bf{
+mfont begin
+/FontType 3 def
+/FontMatrix [1 0 0 1 0 0] def
+/Encoding macvec def
+/MFontType 0 def
+/BuildChar/bmbc load def
+end
+mfont definefont pop
+}bdf
+/wi LW 1 eq{{gsave 0 0 0 0 0 0 0 0 moveto lineto lineto lineto closepath clip stringwidth grestore}bind}{/stringwidth load}ifelse def
+/aps{0 get 124 eq}bdf
+/xc{s75 cvs dup}bdf
+/xp{put cvn}bdf
+/scs{xc 3 67 put dup 0 95 xp}bdf
+/sos{xc 3 79 xp}bdf
+/sbs{xc 1 66 xp}bdf
+/sis{xc 2 73 xp}bdf
+/sob{xc 2 79 xp}bdf
+/sss{xc 4 83 xp}bdf
+/dd{exch 1 index add 3 1 roll add exch}bdf
+/smc{moveto dup show}bdf
+/ndf2{udf{dup /FontType get 0 eq{/FDepVector get{dup /FontType get 0 eq{ndf2}{dup /df2 known{begin df2 0 null put end
+}{pop}ifelse}ifelse}forall}{/df2 known{dup begin df2 0 null put end}if}ifelse}{pop}ifelse}bdf
+/kwn{FontDirectory 1 index known{findfont dup ndf2 exch pop}}bdf
+/gl{1 currentgray sub setgray}bdf
+/newmm{dup /FontType get 0 eq{dup maxlength dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall currentdict end
+dup /FDepVector 2 copy get[exch 6 index exch 6 index exch{newmm 3 1 roll}forall pop pop] put dup
+}{/mfont 10 dict def mfont begin/FontMatrix [1 0 0 1 0 0] def
+/FontType 3 def/Encoding macvec def/df 1 index def/df2 1 array def/FontBBox [0 0 1 1] def/StyleCode 2 index def
+/mbc{bcarray StyleCode get}def/BuildChar{exch begin wd begin/cr exch def/cs s1 dup 0 cr put def df /MFontType known not{
+df2 0 get null eq{df dup length 2 add dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall
+/StrokeWidth nlw 1000 mul pys div ps div dup 12 lt{pop 12}if def/PaintType 2 def currentdict end
+/q exch definefont df2 exch 0 exch put}if}if mbc exec end end}def end mfont}ifelse
+3 index exch definefont exch pop}bdf
+/mb{dup sbs kwn{0 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/mo{dup sos kwn{2 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/ms{dup sss kwn{4 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/ou{dup sos kwn{mfont/df2 known{mfont begin df2 0 null put end}if 3 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/su{dup sss kwn{mfont/df2 known{mfont begin df2 0 null put end}if 5 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/ao{/fmv true def ou}bdf/as{/fmv true def su}bdf
+/vo{/fmv false def ou}bdf/vs{/fmv false def su}bdf
+/c{currentrgbcolor dup 4 1 roll eq 3 1 roll eq and/gray xdf}bdf
+/bcarray[{/da .03 def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs 0 0 smc da 0 smc da da smc 0 da moveto show}bind dup{/da 1 ps div def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs 0 0 smc da 0 smc da da smc 0 da smc c gray{gl}{1 setgray}ifelse da 2. div dup moveto show}bind
+{df setfont gsave cs wi grestore setcharwidth c gray{gl}{currentrgbcolor 1 setgray}ifelse cs 0 0 smc df2 0 get setfont
+gray{gl}{4 1 roll setrgbcolor}ifelse 0 0 moveto show}bind
+{/da 1 ps div def/ds .05 def/da2 da 2. div def df setfont gsave cs wi 1 index 0 ne{exch ds add da2 add exch}if grestore setcharwidth
+cs ds da2 add .01 add 0 smc 0 ds da2 sub translate 0 0 smc da 0 smc da da smc 0 da smc c gray{gl}{1 setgray}ifelse da 2. div dup moveto show}bind
+{/da .05 def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth c cs da .01 add 0 smc 0 da translate
+gray{gl}{currentrgbcolor 1 setgray 4 -1 roll}ifelse 0 0 smc gray{gl}{4 1 roll setrgbcolor}ifelse df2 0 get setfont 0 0 moveto show}bind]def
+/st{1000 mul usertime add dup 2147483647 gt{2147483647 sub}if def}bdf
+/the{usertime sub dup 0 lt exch -2147483648 gt and}bdf
+/6a 6 array def
+/2a 2 array def
+/3q 3 array def
+/qs{3 -1 roll sub exch 3 -1 roll sub exch}bdf
+/qa{3 -1 roll add exch 3 -1 roll add exch}bdf
+/qm{3 -1 roll 1 index mul 3 1 roll mul}bdf
+/qn{6a exch get mul}bdf
+/qA .166667 def/qB .833333 def/qC .5 def
+/qx{6a astore pop
+qA 0 qn qB 2 qn add qA 1 qn qB 3 qn add
+qB 2 qn qA 4 qn add qB 3 qn qA 5 qn add
+qC 2 qn qC 4 qn add qC 3 qn qC 5 qn add}bdf
+/qp{6 copy 12 -2 roll pop pop}bdf
+/qc{exch qp qx curveto}bdf
+/qi{{exch 4 copy 2a astore aload pop qa .5 qm newpath moveto}{exch 2 copy 6 -2 roll 2 qm qs 4 2 roll}ifelse}bdf
+/qq{{qc 2a aload pop qx curveto}{exch 4 copy qs qa qx curveto}ifelse}bdf
+/pt{currentpoint newpath moveto}bdf
+/qf{/fillflag true def}bdf
+/ec{dup 4 and 0 ne{closepath}if 1 and 0 ne{0 doop}if grestore currentpoint newpath moveto/fillflag false def}bdf
+/eu{currentpoint fp{0 ep}{grestore newpath}ifelse moveto/fillflag false def}bdf
+/bp{currentpoint newpath 2 copy moveto}bdf
+/ef{gsave fillflag{gsave eofill grestore}if}bdf
+/sm{0 exch{@1 eq{1 add}if}forall}bdf
+/lshow{4 1 roll exch/@1 exch def{1 index wi pop sub 1 index sm dv 0 @1 4 -1 roll widthshow}{1 index wi pop sub
+1 index dup sm 10 mul exch length 1 sub add dv dup 10. mul 0 @1 4 -1 roll 0 6 -1 roll awidthshow}ifelse}bdf
+/setTxMode{sa 9 2 index put exch not{3 eq{1}{0}ifelse setgray}{pop}ifelse}bdf
+/SwToSym{{}mark false/Symbol/|______Symbol 0 rf 0 sa 6 get 0 ne{pop 1}{sa 7 get 0 eq{pop 2}if}ifelse
+sa 1 get 0 ne/|______Symbol
+sa 4 get 0 ne{vs}{sa 3 get 0 ne{vo}{fnt}ifelse}ifelse}bdf
+/mc{0 3 1 roll transform neg exch pop}bdf
+/ul{dup 0 ne sa 2 get 0 ne and{gsave 0 0
+/UnderlinePosition kif{mc}{ps -10 div}ifelse/UnderlineThickness kif{mc}{ps 15 div}ifelse
+abs setlinewidth neg rmoveto
+sa 4 get 0 ne{gsave currentlinewidth 2. div dup rmoveto currentpoint newpath moveto
+2 copy rlineto stroke grestore}if
+sa 3 get sa 4 get or 0 ne{gsave currentrgbcolor dup 4 1 roll eq 3 1 roll eq and{gl}{1 setgray}ifelse 2 copy rlineto stroke grestore rlineto strokepath nlw pys div setlinewidth}{rlineto}ifelse
+stroke grestore}{pop}ifelse}bdf
+/sgt{2 copy known{get true}{pop pop false}ifelse}bdf
+/kif{currentfont dup/FontMatrix get exch/FontInfo sgt{true}{currentfont/df sgt
+{dup/FontInfo sgt{3 1 roll/FontMatrix get mtx concatmatrix exch true}{pop pop pop false}
+ifelse}{pop pop false}ifelse}ifelse{3 -1 roll sgt{exch true}{pop false}ifelse}{false}ifelse}bdf
+/blank/Times-Roman findfont/CharStrings get/space get def
+/macvec 256 array def
+/NUL/SOH/STX/ETX/EOT/ENQ/ACK/BEL/BS/HT/LF/VT/FF/CR/SO/SI
+/DLE/DC1/DC2/DC3/DC4/NAK/SYN/ETB/CAN/EM/SUB/ESC/FS/GS/RS/US
+macvec 0 32 getinterval astore pop
+macvec 32/Times-Roman findfont/Encoding get
+32 96 getinterval putinterval macvec dup 39/quotesingle put 96/grave put
+/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis/Udieresis/aacute
+/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute/egrave
+/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde/oacute
+/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex/udieresis
+/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
+/registered/copyright/trademark/acute/dieresis/notequal/AE/Oslash
+/infinity/plusminus/lessequal/greaterequal/yen/mu/partialdiff/summation
+/product/pi/integral/ordfeminine/ordmasculine/Omega/ae/oslash
+/questiondown/exclamdown/logicalnot/radical/florin/approxequal/Delta/guillemotleft
+/guillemotright/ellipsis/blank/Agrave/Atilde/Otilde/OE/oe
+/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide/lozenge
+/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright/fi/fl
+/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand/Acircumflex/Ecircumflex/Aacute
+/Edieresis/Egrave/Iacute/Icircumflex/Idieresis/Igrave/Oacute/Ocircumflex
+/apple/Ograve/Uacute/Ucircumflex/Ugrave/dotlessi/circumflex/tilde
+/macron/breve/dotaccent/ring/cedilla/hungarumlaut/ogonek/caron
+macvec 128 128 getinterval astore pop
+{}mark true/Courier/|______Courier 0 rf
+{/Metrics 21 dict begin/zero 600 def/one 600 def/two 600 def/three 600 def/four 600 def/five 600 def/six 600 def/seven 600 def/eight 600 def
+/nine 600 def/comma 600 def/period 600 def/dollar 600 def/numbersign 600 def/percent 600 def/plus 600 def/hyphen 600 def/E 600 def/parenleft 600 def/parenright 600 def/space 600 def
+currentdict end def currentdict/UniqueID known{/UniqueID 16#800000 def}if/FontBBox FontBBox 4 array astore def}mark true/Helvetica/|______Seattle 1 rf
+/oldsettransfer/settransfer load def
+/concatprocs{/proc2 exch cvlit def/proc1 exch cvlit def/newproc proc1 length proc2 length add array def
+newproc 0 proc1 putinterval newproc proc1 length proc2 putinterval newproc cvx}def
+/settransfer{currenttransfer concatprocs oldsettransfer}def
+/PaintBlack{{1 exch sub}settransfer gsave newpath clippath 1 setgray fill grestore}def
+/od{(Rvd\001\001\000\000\177) fg copy pop txpose
+1 0 mtx defaultmatrix dtransform exch atan/pa exch def
+newpath clippath mark
+{transform{itransform moveto}}{transform{itransform lineto}}
+{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform
+{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}
+{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put
+10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if
+statusdict/processcolors known{statusdict begin processcolors end dup 4 eq{/4colors true def pop}{3 eq{/3colors true def}{/2color true def}ifelse}ifelse}{/2colors true def}ifelse}bdf
+/cd{}bdf
+/op{/sfl false def systemdict/currentcolorscreen known{dcfreq dcrot/dcspf load dmfreq dmrot/dmspf load dyfreq dyrot/dyspf load
+dkfreq dkrot/dkspf load setcolorscreen}{freq rot/spf load setscreen}ifelse savescreen
+/ns false def/pm save def}bdf
+/cp{not{userdict/#copies 0 put}if ma 0 gt{{t1 the{exit}if}loop}if{copypage}{showpage}ifelse pm restore}bdf
+/px{0 3 1 roll tp tt}bdf
+/psb{/us save def}bdf
+/pse{us restore}bdf
+/ct 40 string def
+/nc{currentpoint initclip newpath gc{dup type dup/arraytype eq exch/packedarraytype eq or{exec}if}
+forall clip newpath moveto}def
+/kp{ct 0 2 index length 2 index 39 2 index put getinterval copy cvx exec mx3 currentmatrix pop}bdf
+/av 70 def
+end
+LW 1 eq userdict/a4small known not and{/a4small
+[[300 72 div 0 0 -300 72 div -120 3381]
+280 3255
+{statusdict/jobstate (printing) put 0 setblink
+margins
+exch 196 add exch 304 add 8 div round cvi frametoroket
+statusdict/jobstate (busy) put
+1 setblink}
+/framedevice load
+60 45{dup mul exch dup mul add 1.0 exch sub}/setscreen load
+{}/settransfer load/initgraphics load/erasepage load]cvx
+statusdict begin bind end readonly def}if
+md begin/bigs[lnop userdict/letter known{/letter load}{lnop}ifelse userdict/legal known{/legal load}{lnop}ifelse userdict/a4 known{/a4 load}{lnop}ifelse userdict/b5 known{/b5 load}{lnop}ifelse
+lnop lnop lnop /tab load/a3Size load]def
+/smalls[lnop userdict/lettersmall known{/lettersmall load}{userdict/note known{/note load}{lnop}ifelse}ifelse
+userdict/legal known{/legal load}{lnop}ifelse userdict/a4small known{/a4small load}{lnop}ifelse
+userdict/b5 known{/b5 load}{userdict/note known{/note load}{lnop}ifelse}ifelse lnop lnop lnop /tab load/a3Size load]def end
+systemdict/currentpacking known{setpacking}if
+/checkload{{currentfile eexec} {/junk save def/mystring 65000 string def
+/endexec (e%endeexec) def{currentfile mystring readline not{stop}if endexec eq{exit}if}loop junk restore}ifelse}bind def
+ok userdict/stretch known not and checkload
+373A767D4B7FD94FE5903B7014B1B8D3BED02632C855D56F458B118ACF3AF73FC4EF5E81F5749042B5F9CF1016D093B75F250B7D8280B2EACE05A37037F7BDF6E12226D7D4E2DF2C52FAFD5FD40FE72A0D3AC4BD485D8369D4C87636E920D1DAF222D92155A9CB1667E715F0B82799B37CC8F5B32B74B39CF494536DC39C7EF04A7BCB29E2CEC79073CADCCFB23B4AA1363F876F5121B618071B7B4EB1E5DE75FAA2368A3E5DB2B198623AFE92AE9484270FE7F57A850E88C0D3EEA156611C91D8E480D4370B025CCA6929A2BF40AD3D01B2CB7EE6DFB46E12A830542337F7819B67F9765210F76DB06F34DA5B13A11759305C582E16D2B854939F6D9121F2A4F285282F5DCD3D15896D121E3D6F5BE79E087451BB0ED233CDBEF090D3B4AC2DC34B97E70C61D95FB072B8C12D2ABD843520949A39DCF99E2C1AA8FBCD025E47E0A82A8D96E75BAF40F52AD402495BBD4DE0F356C8B14E764874E639C9F045A0D1908EC6456EB6C5B8A6F826192F767EF2C55A21C58F5F9CC1F59247B55F2387828C7FE89D5E7D8484D1BC86CB6673BDBE4FE17DD9BDE95224FE645136F41330BF155A4DDE1B0A32233BF471CE58FBC660DC7E641B0A0D30018454E2191C414A3011FF3FED1C0D88FE1FF9F75DCC456D097947226FBEC92509146D3A4CFFC0471B31C53222ED9DD88566F60F6C0D705AD79DACF53B070026F083ED28B5CF757AAA0A169F6F320A75E9D2ED50ABD939AF85B6346C2ADB25D168F10508E1516D194C635E6B187FADEA0829DBF0390C0F003F0265E215BC96CA3CC13D4A8E01570BE193CA75A620728CD275ACF1986EFFB3A13419FE55EA7C4467B7E7EEDC1FC29C9F8C46A557D2CCDB914EF7B93E7530D555DFC2398AFC68CAD991F062EF85BAA1884EC166C7C5DF8543666D8C41BE267D706BD1588F1F662F705CAE4D29DC38EF66BFAA89470D8A099B6F1B4587F7B024412276106FCD3EB5AE17A5D1DF1781992DC40EA0A992F706F701304CEA9D9073E7A74F1E687D81C3E5841D31CF86855BAAAD9B5D30317C75150A857C6B114735315CDD1AEF36C26BBB0645499406DEE2F24B3B1C72FEC97C7BA31AA2CDAB25418BB1DC4C7E4757F1D625087B0FD0300C03A65F2A72CE734925735277E034CDCF599129679F70CC8B66E03878851DB75041F275E1E5761F3EC753BE1359CA364A22047AE4886217F9259FE19FF5B116E8019B98B143114B313E8BEF87EC949D85C82E0812E6F50525E73890AF362CC8EE8A85F4197E6AC18638EF12E56A808D439AF1BFD363F140314BF4E534485C42F1856688CC35288E8D770120A420FB9F1FCF8AE8BD6D6156CC23E6C51119FE4DE1B68C9DF3487E9974BF9ED31F8D3CE93FF101867319F2FF492D5D398B4F09A66F2F55BCAB34B99173B7EE89039D00DD21A7B3A52E9F028F8301B5FC12D409412E064513BC579AAC498F577EA8ECD1FE3E42DC3CC320786C7B00194FEDF344402C33FC492D4BA86992B01683F440220FFE756BC88A94223D316078D69D33560E8EAB76B24CB7AA4320CF435593D76F624324ABE00B5587A4F283C725EA24567133F25F472B5E2E4474DDB5A16AC5F2DF32350395D3E3892FE361F4D5C9A610C654C9227614FBBAFF3356A90A2266E00F66234061075491571A65616211257F160000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+cleartomark
+e%endeexec
+
+ok userdict/smooth4 known not and checkload
+F94E00EE41A71C59E5CAEED1EDBCF23D1DBA1EE99B9BB356492923BD8B1BA83A87CEB0E07377A31FD6241E814681118E17DC7CACE570399506E6E441B871B6043831BD03EFC11DBBD8001EE2FF8CFBD485065D455A2E15AC36F1A84AD8789FA6461199C7CD14CB9FD64D4B06452B7FC0A8FC263F70F1CCB893295D4DE70ADAB771C0F84396FA98C60B11DA02ABA157298DF0A23621853BEF167443A985ADC09BEFFD51CB4D29179E2B34609EF38A49DA61F4BFC256A3DE0732D7D29754A194857B9C9E9971227AA1DD0611FBB10E44E5FF66C062D9C24ED3290529330BC317825E876929582DB0E39B9FC5EFD20CC1D4F94920EB9C534D0DA90DE70D25BC7287319CF28602B3F46633C242CAFC8905E960317E3C2FA20AB8DB06ADBAF292FC7BA2CA14EE65DF28B99CC11666B70AD33E8E1D57D63D4B89ECC615AE5747C1CA752C833D8D6DE54CD4A0350B44310555CE3BD2C615ADD27B634CDB350AF3A432CE78AACD2909A5B586F666CD87919A36DB1CBE86B3CE281DFD01CD7E1B8A18A4B415CECBFF79A5C4390A15EA77D14D6BE12BAB5A8268C3F286D0590060647CABED674443CD258F11415E866AB330A251691B61F2422A61AFE59B6B4FBDCF85ED9BA0F8E483C034089E6877FF5923698D3A0DC0EED6B9CFD32DF0839BC4EA5F6D1FCB6DD0920391E57E84745131D02D100179F4E0A68EC0A5FF6680A6F463D038B04AF63FFA13D743B995A26A743C26D387209023C91DE43DF047A16F328AC9DDC08573B38BE9EA341EA16C78EC32F3A1B36B90D95A50610F4D050EC1C33497F3F3A81A1B4C8BEF0BA84EE2FAA32DC112DAC490AF53E1749C4A0D866CAF7B893E52383B0D38065C333FB122B700D7246F7EE87D942AE3DB5C1DD77E9E76C80CC5AD63D28DFED0E229CE604673F78CD47F258FDF5BF3A3EAEC5C9BC8E482D8DBA9D268A35DA8C095A690679ED2123E8B8F5E4826FA3B199EAA5D482D4B6AA86572E387CECEB7149C8947F41D6339328A748A17F8C4AD3B0555F1E409450BA0C564F1F488BB5096EB003568D4D5EF6489897E27409547D0EE4487D30184793B0F27BD265A64BDB3EA6761569DA955620C612E718677B77D6D81B999C6298877AFE0D1D6F6F358377A8BD2402F669C64B972B3A065EF7DD4BDEFFFE17E63DB8898FA6E69166B710AAD6BA2EA9AF61E4B8C8701638D4D6E4DFFFC192AEF6BC027095C4C72D748979675BA29FAF61E75343E14E61034602E5A79CD2519796ED6A9CC4EDEA46A9B59D4A807E786B5EE46F25B0360BC8E7C12D723122CDEEF247C9776F4C99C8EBED6828AA19744B5ADF0D07D95D98B3072372388D41B0FAB1CCE2775170679575ECDCA13B22A17FE9C6605C3445F58F1A829512DAB6C528F83580C8AA53C35D605F626F5AD0B7FC1EA87D69A835E3F53A1F450FB0AF42A5772F89D92A50D10F15BDBDA409F50C0B8AB93FE8A16D029DD8BB5C480D1466735ED4D9CAF637E5ECD6C2ECB6BF3B3EFBEE7AB936D2C568E3009D156B87CACB1FB3A48A70BC91B2EC35CC9147FFB1A524E2B2F2E4E2C1B12F1C1C63768BB95CD62FEC01CBA79B9FA282DD4DF49990F27FF8EE4E2DDE2F0ACD83BC9D4BE0090192C7A799967EC4DC2D63C0835E22D4C4B366D7FDCF3A05A4B53DF780F986EF25C79B665D5C00EFF7F17C0BB6D544F9D83A7FDAC47D9C5683A656011374253C918FF6EA64749DD971B2300DD5320033E01EC591F6318CCE94CE2B81C04322EC52B624E50643B52391CCD2AB56396A2AD8E2D3CA61B80D9D4CC363B2DF7863526958CDF3497E36648406C317E58EC563E7C26149A2A3C643ADFB39A8DD92974C6D2A2A9D7B71CDF3FEBBF32BB02E7B45CF53AAEAD5E963A4AA4AF9A149A08A4EC303D5F2369977E93F54897EEAD31B06C5845D63F49D65F8E5573962241A57CCD717CE6CA8C784A11192943616EA059B51BC38429E18D0121FCBB6FBD5D909B0D89E616C66DEF6A0F165A7030BD911A1B120468329CBB006C8D37720E531CF31E878CB4AAAC137633675C3D546F5162487AB35F470C042BDEB945E0F2532BF92AA6FD53434440221ECD3533A7AA89900CB19EFE2CD872DF8B7969AF0D3B72BF31DC5DD69CA6460966F61AB17CB507964098DBA3AF122EEC3128A9BAFE1034493F372B36BD1351205E9043A67C544402D8BCE24358C8A5CE33867A00794CF7097D59C88279A11EE9C854E7E7AAE881F9828C569D208F5F33375F59E9A3818CFA38AAD0CBFBA32F9F44A8BB79DE4C40E3886457C16DA4A27953AA1E99472E35F2323F0BAA5E37DC28CBA46FEFB73B190016055ADD4D27615D748499A0E1C4B8C7EC339C1C4D95A813A85918A8D01EEB485DDCDCEA6EA3F2C2A9D85C139CD90CCB352634F9AFE836BCAC0C274E352BA2071B5269D5DE4CCDE3FF990CBA974980C7332AE1545A9C60D5D1459D3AE95C1AC065733AF14FADB440A110DD539563B8D850CD0704C52F3F7CCCB53630D776560CBD22D8FF08F5B354487A171AEC15F5F54DE9CAB668BCAC573E788D92762EF63E76087005F4AC2D02E0CAC173C11BE62ACE5DC4D3374F2F9746C9981E125FF9AB8CAE76D13039E2C54DFD708E028A619EA1ED78E6B46F06DF0D0B74BBEDD8C190C7C0CEBDE8F7A4888CC36575313478DD2CFE392E9BB7B2416955D44B7024A3BA43FBF37293B386D64746D7748895411D243FAEC50638F2AA33337D7FA018ADDAC5835A0DDFAE99AD6299DFB4CA6872C59853E3AC12FC9E3D26629C5B49CF844C87B3C4BFBE3074E3A1CE6984758C20C661084381CD6B4582D84F19C0000B5FC0DCB42B567E396031601C095D7016283EBE5F13CD8A3A374A74DDBBABD36081149F8BC242085F2F7297CC97FD3B8BAD206D8AC9707A39ECCC7963B522E08DA391A1EF12DD4D746DBDDDCC0834F88160CF189A9645567CEC2F023A571AF0DFD15DB85B744C28C000DF53B05F8F210841F6E87A04F20C777B7C0BE6182BE2E90226E5301A12532A745F2FAAA81637CF11B78CD2B99A4D18B862D6C5DBD31793FB16A2D9AAD376D4484D75AA833D0068B1D34DB74E3302480854E3B5484D8A47E39A89A2FA927BC3641EA7F8E004FDE4C2F08D40D99F1ACB47CAF6887629BF6DFE12968D297596D28CE0CF148B12E7DCB49FB94F5ADBD214C3A6CE1E249831BA9EB8A189F2CE1ABE39A7B537253E369A508A2AF2ADB9463F9B56BBBFF31D535FF997F537C6675C196E7ECBD493F652FA7CC6D9C1CA3379BFDB5AF7513C6E834054494296B91A6EE800114363D5D5D0759F41B4DECB653B9DE3E94583579EF549ED5F3FAFB12661ABC0C57A332406517ED3454EDED34B386C60F78DC976266E0EAF54FC245FB0E3EFC8016236436B599C1C97A8C5E0AC8F7836161873C71F01ED9CC25C236420F41FD8277993D3959205912FA0927B59E3DAE7377D82079447D6E41EE5AEC0DFFF79AF8F4ED47F17EE708FEA45877860D56F8CBCE65A061E8E1CA4A5FBAF0E13429A7F0ADB6F178FA449F46CC539BBC0107E3A53B1C362A04B20E6D721E7E6E1E4976A11DDC98C7614D22B53DFBB6DAE533AC9BE882021A735C30DAA4A44AED09F49A390E8CFF59BD9C30667AF21B03EC5CEBD5C2C3AA2769E8D714191A48E7DDF50B13D1560E82EFB65FCE601AE9E8C351FBA1DED80B7351314E7F9F9A784BFE3759B7E322A84E7B51F9DC5F5D9C8050CD79B27C0A4B0DD68A3C27A948AD6858E35B960D2DEA838C479CAEA83B1A912174ACB2100E55E7A14892D7A9B3711FF0B20065C1995B49E1F23464A92DD140642E3A7B1973849E64D1A3CF60000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+cleartomark
+e%endeexec
+%% TJD hacks 6/91 to get lprep 70 and psfig to work with pageview:
+md begin
+/nc{currentpoint initclip newpath gc{dup type dup/arraytype eq exch/packedarraytype eq or{exec}if}
+forall % clip
+newpath moveto}def
+end
+%%EndProcSet
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep70.procs b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep70.procs
new file mode 100644
index 00000000000..4ecbfc62ec9
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/lprep70.procs
@@ -0,0 +1,450 @@
+%%BeginProcSet: "(AppleDict md)" 70 0
+statusdict begin product(LaserWriter II NT)eq revision 1 eq and
+{userdict begin/oldcds/cleardictstack load def/cleardictstack{31 sendpcmd 4 eq tonerlight/oldcds load exec}bind def
+end
+currentfile eexec
+}{save currentfile 359 string readhexstring pop pop restore}ifelse
+35de8eabfc7fa5eac0431edc501ad43f5fcbdf9fdd321cce93b525f4439dd94696bf56ac13a0a2aad1e6bcf444711e941d7217138d20ae0500145f815439cc14e697ad201df728ea4ccad4ac
+331aa03a7aacde10760bf4ee12bbf73c77cdcbf1796f26f0dd255d2407e1ac41
+d27489a69d6b69c6a841468b46720b75ad65650700e0c528e7af61e7e3e821b59445c44b69831ebc9deaf0e3aecc14b7a1c2e18bc1fa42a59219f1e36f236e3d6c89114b1f231999c3dbce6b43f3e2918fcb85575941a9d1e65c86aa08e6eea86cc66ce90e5e4add57f2585e
+7b1c0b5203cfc46868d6e3c0d66db79174e7091e32e307679732da062e440e41dabd36a161b611a7e4523a49694026206803dbfd5be5c5fe433f0f18a40057db6f1302848c8da4a10a7f14c6
+3d512806362b1be092ad5dbd36d75fe63e4cae2ba9b72390f580cac344a08bdf6eb9e36ec45bad2a0b82829a72e0efa2d87332c482196e690361168271c55053341ab3
+end
+/sc {60 45 {abs exch abs 2 copy add 1 gt{1.0 sub dup mul exch 1.0 sub dup mul add 1.0 sub}{dup mul exch dup mul add 1.0 exch sub}
+ifelse}setscreen} bind def statusdict begin product(LaserWriter II)anchorsearch end
+{pop pop/letter [/letter load /exec load /sc load /exec load]cvx def/legal [/legal load /exec load /sc load /exec load]cvx def/a4 [/a4 load /exec load /sc load /exec load]cvx def/b5 [/b5 load /exec load /sc load /exec load]cvx def
+/lettersmall [/lettersmall load /exec load /sc load /exec load]cvx def/a4small [/a4small load /exec load /sc load /exec load]cvx def/note [/note load /exec load /sc load /exec load]cvx def}{pop}ifelse
+systemdict/currentpacking known{currentpacking true setpacking}if
+/LW{save statusdict/product get(LaserWriter)anchorsearch
+exch pop{length 0 eq{1}{2}ifelse}{0}ifelse exch restore}bind def
+/LW+{LW 2 eq}bind def
+/ok{systemdict/statusdict known dup{LW 0 gt and}if}bind def
+ok{statusdict begin 9 sccinteractive 3 ne exch 0 ne or{9 0 3 setsccinteractive}if end}if
+/md 270 dict def md begin
+/av 0 def
+/T true def/F false def/mtx matrix def/s75 75 string def/sa8 8 string def/sb8 8 string def
+/sc8 8 string def/sd8 8 string def/s1 ( ) def/pxs 1 def/pys 1 def
+/ns false def
+1 0 mtx defaultmatrix dtransform exch atan/pa exch def/nlw .24 def/ppr [-32 -29.52 762 582.48] def
+/pgr [0 0 0 0] def
+/pgs 1 def/por true def/xb 500 array def/so true def/tso true def/fillflag false def/pnm 1 def/fmv true def
+/sfl false def/ma 0 def/invertflag false def/dbinvertflag false def/xflip false def/yflip false def/noflips true def/scaleby96 false def/fNote true def/fBitStretch true def
+/4colors false def/3colors false def/2colors false def
+/wtkey false def
+statusdict begin/waittimeout where{pop waittimeout 300 lt{md /wtkey true put}if}if end
+wtkey{statusdict begin/setdefaulttimeouts where{pop 0 60 300 setdefaulttimeouts}if end}if
+/fg (Rvd\001\001\000\000\177) def
+/bdf{bind def}bind def
+/xdf{exch def}bdf
+/xl{neg exch neg translate}bdf
+/fp{pnsh 0 ne pnsv 0 ne and}bdf
+/nop{}bdf/lnop[/nop load]cvx bdf
+/vrb[
+{fp{fg 6 get 0 ne{gsave stroke grestore}{gsave 1 setlinewidth pnsh pnsv scale stroke grestore}ifelse}if newpath}bind
+/eofill load
+dup
+/newpath load
+2 index
+dup
+{clip newpath}bind
+{}bind
+dup
+2 copy
+]def
+systemdict/currentcolorscreen known{currentcolorscreen/dkspf xdf/dkrot xdf/dkfreq xdf/dyspf xdf/dyrot xdf/dyfreq xdf/dmspf xdf/dmrot xdf/dmfreq xdf
+/dcspf xdf/dcrot xdf/dcfreq xdf}{currentscreen/spf xdf/rot xdf/freq xdf}ifelse
+/doop{vrb exch get exec}bdf
+/psu{/udf xdf/tso xdf /fNote xdf/fBitStretch xdf/scaleby96 xdf/yflip xdf/xflip xdf
+/invertflag xdf/dbinvertflag invertflag statusdict begin version cvr 47.0 ge product (LaserWriter) eq not and end invertflag and {not}if def
+xflip yflip or{/noflips false def}if
+/pgs xdf 2 index .72 mul exch div/pys xdf div .72 mul/pxs xdf ppr astore pop pgr astore pop/por xdf sn and/so xdf}bdf
+/tab{statusdict /11x17 known{statusdict begin /11x17 load end}{statusdict /setpage known{statusdict begin 792 1224 1 setpage end}{statusdict /setpageparams known{statusdict begin 792 1224 0 1 setpageparams end}if}ifelse}ifelse}bdf
+/a3Size{statusdict /a3 known{statusdict begin /a3 load end}{statusdict /setpageparams known{statusdict begin 842 1191 0 1 setpageparams end}if}ifelse}bdf
+/txpose{fNote{smalls}{bigs}ifelse pgs get exec pxs pys scale ppr aload pop por{noflips{pop exch neg exch translate pop 1 -1 scale}if
+xflip yflip and{pop exch neg exch translate 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if
+xflip yflip not and{pop exch neg exch translate pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{ppr 1 get neg ppr 0 get neg translate}if}
+{noflips{translate pop pop 270 rotate 1 -1 scale}if xflip yflip and{translate pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if
+xflip yflip not and{translate pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{translate pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 exch translate}if}ifelse
+wtkey{statusdict/waittimeout 300 put}if
+scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy translate .96 dup scale neg exch neg exch translate}if}bdf
+/fr{4 copy pgr aload pop 3 -1 roll add 3 1 roll exch add 6 2 roll 3 -1 roll
+sub 3 1 roll exch sub 3 -1 roll exch div 3 1 roll div exch scale pop pop xl}bdf
+/obl{{0.212557 mul}{pop 0}ifelse}bdf
+/sfd{ps fg 5 -1 roll get mul 100 div 0 ps 5 -1 roll obl ps neg 0 0 6a astore makefont setfont}bdf
+/fnt{findfont sfd}bdf
+/bt{sa 3 1 roll 3 index and put}bdf
+/sa(\000\000\000\000\000\000\000\000\000\000)def
+/fs{0 1 bt 1 2 bt 2 4 bt 3 8 bt 4 16 bt 5 32 bt 6 64 bt 7 128 bt sa exch 8 exch put}bdf
+/mx1 matrix def
+/mx2 matrix def
+/mx3 matrix def
+/bu{currentpoint 4colors{currentcmykcolor}{currentrgbcolor}ifelse currentlinewidth currentlinecap currentlinejoin
+currentdash exch aload length fg 5 sfl{1}{0}ifelse put pnsv pnsh
+2t aload pop 3a aload pop mx2 aload pop mx1 aload pop mtx currentmatrix aload pop
+mx3 aload pop ps pm restore/ps xdf mx3 astore pop}bdf
+/bn{/pm save def mx3 setmatrix newpath 0 0 moveto ct dup 39 get 0 exch getinterval cvx exec mtx astore setmatrix mx1 astore pop mx2 astore pop 3a
+astore pop 2t astore pop/pnsh xdf/pnsv xdf gw
+/sfl fg 5 get 0 ne def array astore exch setdash setlinejoin setlinecap
+setlinewidth 4colors{setcmykcolor}{setrgbcolor}ifelse moveto}bdf
+/fc{save vmstatus exch sub 50000 lt
+{(%%[|0|]%%)=print flush}if pop restore}bdf
+/tc{32768 div add 3 1 roll 32768 div add 2t astore pop}bdf
+/3a [0 0 0] def
+/2t 2 array def
+/tp{3a astore pop}bdf
+/tt{mx2 currentmatrix pop currentpoint 2 copy 2t aload pop qa 2 copy translate 3a aload pop exch dup 0 eq
+{pop}{1 eq{-1 1}{1 -1}ifelse scale}ifelse rotate pop neg exch neg exch translate moveto}bdf
+/te{mx2 setmatrix}bdf
+/th{3 -1 roll div 3 1 roll exch div 2 copy mx1 scale pop scale/sfl true def}bdf
+/tu{1 1 mx1 itransform scale/sfl false def}bdf
+/ts{1 1 mx1 transform scale/sfl true def}bdf
+/fz{/ps xdf}bdf
+/dv{dup 0 ne{div}{pop}ifelse}bdf
+/pop4{pop pop pop pop}bdf
+/it{sfl{mx1 itransform}if}bdf
+/gm{exch it moveto}bdf/rm{it rmoveto}bdf
+/lm{currentpoint sfl{mx1 transform}if exch pop sub 0 exch it rmoveto}bdf
+/fm{statusdict/manualfeed known}bdf
+/se{statusdict exch/manualfeed exch put}bdf
+/mf{dup/ma exch def 0 gt{fm se/t1 5 st ok ma 1 gt and{/t2 0 st/t3 0 st
+statusdict/manualfeedtimeout 3600 put
+}if}if}bdf
+/jn{/statusdict where exch pop{statusdict exch /jobname exch put}if}bdf
+/pen{pnm mul/pnsh xdf pnm mul/pnsv xdf pnsh setlinewidth}bdf
+/min{2 copy gt{exch}if pop}bdf
+/max{2 copy lt{exch}if pop}bdf
+/dh{fg 6 1 put array astore dup {1 pxs div mul exch}forall astore exch pop exch pop exch setdash}bdf
+/ih[currentdash]def
+/rh{fg 6 0 put ih aload pop setdash}bdf
+/dl{gsave nlw pys div setlinewidth 0 setgray}bdf
+/dlin{exch currentpoint currentlinewidth 2 div dup
+translate newpath moveto lineto currentpoint stroke grestore moveto}bdf
+/lin{fg 6 get 0 ne{exch lineto currentpoint 0 doop moveto}
+{exch currentpoint/pnlv xdf/pnlh xdf gsave newpath/@1 xdf/@2 xdf fp{pnlh @2 lt{pnlv @1 ge
+{pnlh pnlv moveto @2 @1 lineto pnsh 0 rlineto
+0 pnsv rlineto pnlh pnsh add pnlv pnsv add lineto pnsh neg 0 rlineto}
+{pnlh pnlv moveto pnsh 0 rlineto @2 pnsh add @1 lineto 0 pnsv rlineto
+pnsh neg 0 rlineto pnlh pnlv pnsv add lineto}ifelse}{pnlv @1 gt
+{@2 @1 moveto pnsh 0 rlineto pnlh pnsh add pnlv lineto 0 pnsv rlineto
+pnsh neg 0 rlineto @2 @1 pnsv add lineto}{pnlh pnlv moveto pnsh 0 rlineto
+0 pnsv rlineto @2 pnsh add @1 pnsv add lineto pnsh neg 0 rlineto
+0 pnsv neg rlineto}ifelse}ifelse
+closepath fill}if @2 @1 grestore moveto}ifelse}bdf
+/gw{/pnm fg 3 get fg 4 get div def}bdf
+/lw{fg exch 4 exch put fg exch 3 exch put gw pnsv pnsh pen}bdf
+/barc{/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf
+/@6 xdf/@7 xdf/@8 xdf gsave
+@5 @7 add 2 div @6 @8 add 2 div translate newpath 0 0 moveto
+@5 @7 sub @6 @8 sub mtx currentmatrix pop scale @1{newpath}if
+0 0 0.5 @4 @3 arc @4 @3 sub abs 360 ge{closepath}if
+mtx setmatrix @2 doop grestore}bdf
+/ar{dup 0 eq barc}bdf
+/ov{0 exch 360 exch true barc}bdf
+/rc{/@t xdf currentpoint 6 2 roll newpath 4 copy 4 2 roll exch moveto
+6 -1 roll lineto lineto lineto closepath @t doop moveto}bdf
+/mup{dup pnsh 2 div le exch pnsv 2 div le or}bdf
+/rr{/@1 xdf 2. div/@2 xdf 2. div/@3 xdf
+/@4 xdf/@5 xdf/@6 xdf/@7 xdf
+@7 @5 eq @6 @4 eq @2 mup or or{@7 @6 @5 @4 @1 rc}
+{@4 @6 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse
+@5 @7 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse
+@1 0 eq{/@2 @2 pnsh 2 div 2 copy gt{sub def}{0 pop4}ifelse}if
+currentpoint newpath
+@4 @6 add 2. div @7 moveto
+@4 @7 @4 @5 @2 arcto pop4
+@4 @5 @6 @5 @2 arcto pop4
+@6 @5 @6 @7 @2 arcto pop4
+@6 @7 @4 @7 @2 arcto pop4
+closepath @1 doop moveto}ifelse}bdf
+/pr{gsave newpath/pl{exch moveto/pl{exch lineto}def}def}bdf
+/pl{exch lineto}bdf
+/ep{dup 0 eq{{moveto}{exch lin}{}{(%%[|1|]%%)= flush}pathforall
+pop grestore}{doop grestore}ifelse currentpoint newpath moveto}bdf
+/gr{64. div setgray}bdf
+/savescreen{ns not{/ns true def systemdict/currentcolorscreen known{currentcolorscreen/pkspf xdf/pkrot xdf/pkfreq xdf/pyspf xdf/pyrot xdf/pyfreq xdf/pmspf xdf/pmrot xdf/pmfreq xdf
+/pcspf xdf/pcrot xdf/pcfreq xdf}{currentscreen/sspf xdf/srot xdf/sfreq xdf}ifelse}if}bdf
+/restorescreen{/ns false def systemdict/setcolorscreen known{pcfreq pcrot/pcspf load pmfreq pmrot/pmspf load pyfreq pyrot/pyspf load
+pkfreq pkrot/pkspf load setcolorscreen}{sfreq srot/sspf load setscreen}ifelse}bdf
+/pat{savescreen sa8
+copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}setscreen exch not{gr}{pop}ifelse}bdf
+/sg{restorescreen gr}bdf
+/cpat{savescreen 10 2 roll 7 -1 roll sa8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}8 -1 roll sb8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sb8
+exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}9 -1 roll sc8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sc8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}10 -1 roll sd8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sd8
+exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}psuedo1 dsc 4{4 -1 roll 1 exch 64 div sub}repeat setcmykcolor pop pop}bdf
+systemdict/setcolorscreen known{/psuedo1 lnop bdf/dsc/setcolorscreen load def}{/psuedo1{16{pop}repeat sa8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}}bdf
+/bwsc{setscreen dup gr 0 exch 0 exch 64 exch 64 exch 64 exch}bdf/dsc/bwsc load def
+}ifelse
+systemdict/setcmykcolor known not{/setcmykcolor{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdf}if
+/dc{transform round .5 sub exch round .5 sub exch itransform}bdf
+/sn{userdict/smooth4 known}bdf
+/x8{3 bitshift}bdf
+/x4{2 bitshift}bdf
+/d4{-2 bitshift}bdf
+/d8{-3 bitshift}bdf
+/rb{15 add -4 bitshift 1 bitshift}bdf
+/db{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf/@6 @5 @3 4 add mul def
+dc translate scale/xdbit 1 1 idtransform abs/ydbit exch def abs def{0 0 1 ydbit add 1 10 rc clip}if
+@1 0 eq @1 4 eq or{currentrgbcolor 1 setgray ydbit 0 1 ydbit add 1 2 rc setrgbcolor}if
+@1 3 eq @1 7 eq or{1 setgray}{currentrgbcolor 2 index eq exch 2 index eq and exch pop{0 setgray}if}ifelse/@9 @1 0 eq @1 1 eq @1 3 eq or or dbinvertflag xor def/@13 @6 def
+@2 fBitStretch or{/@10 @4 x4 def/@11 @3 x4 def/@12 @10 rb def/@13 @12 @11 mul def/@15 1 1 dtransform abs/calcY 1 index def round cvi/@14 exch def
+abs/calcX 1 index def round cvi scaleby96 not{1 add}if def/@16 @15 rb def/@17 @16 @14 mul def}if
+sn @13 60000 lt and @2 fBitStretch or and{mtx currentmatrix dup 1 get exch 2 get 0. eq exch 0. eq and @17 60000 lt and fBitStretch and{@16 3 bitshift @14 @9 [calcX 0 0 calcY 0 0]{@17 string @13 string
+currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4
+@10 @11 @12 dup string 5 index @15 @14 @16 dup string stretch}imagemask}{@12 x8 @11 @9 [@10 0 0 @11 0 0]{@13 string
+currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4}imagemask}ifelse}{@5 3 bitshift @3 4 add @9 [@4 0 0 @3 0 2]{currentfile @6 string readhexstring pop}imagemask}ifelse
+@7 restore}bdf
+systemdict/setcmykcolor known{/psuedo lnop bdf/di/colorimage load def}{/routines[{.3 mul add 1}bind{.59 mul add 2}bind{.11 mul add round cvi str exch i exch put/i i 1 add def 0 0}bind]def
+/psuedo{/i 0 def 0 exch 0 exch{exch routines exch get exec}forall pop pop str}bdf/bwi{pop pop image}bdf/di/bwi load def}ifelse
+/cdb{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf
+systemdict/setcmykcolor known not{dc}if translate scale /@6 xdf
+/@18 @5 dup 60000 ge{pop 60000}if string def @6 not{/str @18 0 @18 length 3 idiv getinterval def}if @4 @3 8 [@4 0 0 @3 0 0]@6{{currentfile @18 readhexstring pop}image}{{currentfile @18 readhexstring pop psuedo}false 3 di}ifelse @7 restore}bdf
+/wd 16 dict def
+/mfont 14 dict def
+/mdf{mfont wcheck not{/mfont 14 dict def}if mfont begin xdf end}bdf
+/cf{{1 index/FID ne{def}{pop pop}ifelse}forall}bdf/rf{/@1 exch def/@2 exch def
+FontDirectory @2 known{cleartomark pop}{findfont dup begin dup length @1 add dict begin
+cf{/Encoding macvec def}{Encoding dup length array copy/Encoding exch def
+counttomark 2 idiv{Encoding 3 1 roll put}repeat}ifelse
+pop
+exec currentdict end end @2 exch definefont pop}ifelse}bdf
+/bmbc{exch begin wd begin
+/cr xdf
+save
+CharTable cr 6 mul 6 getinterval{}forall
+/bitheight xdf/bitwidth xdf
+.96 div/width xdf
+Gkernmax add/XOffset xdf Gdescent add/YOffset xdf/rowbytes xdf
+rowbytes 255 eq{0 0 0 0 0 0 setcachedevice}
+{Gnormsize dup scale
+width 0 XOffset YOffset bitwidth XOffset add bitheight YOffset add
+setcachedevice
+rowbytes 0 ne{
+XOffset YOffset translate newpath 0 0 moveto
+bitwidth bitheight scale
+sn{
+/xSmt bitwidth x4 def
+/ySmt bitheight x4 def
+/rSmt xSmt rb def
+rSmt x8 ySmt true
+[xSmt 0 0 ySmt neg 0 ySmt]
+{rSmt ySmt mul string CharData cr get
+1 index bitwidth bitheight rowbytes rSmt tso smooth4}
+}{rowbytes 3 bitshift bitheight 4 add true
+[bitwidth 0 0 bitheight neg 0 bitheight 2 add]
+{CharData cr get}
+}ifelse
+imagemask
+}if
+}ifelse
+restore
+end end
+}bdf
+/bb{.96 exch div/Gnormsize mdf 2 index
+/Gkernmax mdf 1 index/Gdescent mdf
+3 index div 4 1 roll
+2 index div 1. 5 2 roll
+exch div 4 1 roll
+4 array astore/FontBBox mdf
+}bdf
+/cdf{mfont/CharData get 3 1 roll put}bdf
+/bf{
+mfont begin
+/FontType 3 def
+/FontMatrix [1 0 0 1 0 0] def
+/Encoding macvec def
+/MFontType 0 def
+/BuildChar/bmbc load def
+end
+mfont definefont pop
+}bdf
+/wi LW 1 eq{{gsave 0 0 0 0 0 0 0 0 moveto lineto lineto lineto closepath clip stringwidth grestore}bind}{/stringwidth load}ifelse def
+/aps{0 get 124 eq}bdf
+/xc{s75 cvs dup}bdf
+/xp{put cvn}bdf
+/scs{xc 3 67 put dup 0 95 xp}bdf
+/sos{xc 3 79 xp}bdf
+/sbs{xc 1 66 xp}bdf
+/sis{xc 2 73 xp}bdf
+/sob{xc 2 79 xp}bdf
+/sss{xc 4 83 xp}bdf
+/dd{exch 1 index add 3 1 roll add exch}bdf
+/smc{moveto dup show}bdf
+/ndf2{udf{dup /FontType get 0 eq{/FDepVector get{dup /FontType get 0 eq{ndf2}{dup /df2 known{begin df2 0 null put end
+}{pop}ifelse}ifelse}forall}{/df2 known{dup begin df2 0 null put end}if}ifelse}{pop}ifelse}bdf
+/kwn{FontDirectory 1 index known{findfont dup ndf2 exch pop}}bdf
+/gl{1 currentgray sub setgray}bdf
+/newmm{dup /FontType get 0 eq{dup maxlength dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall currentdict end
+dup /FDepVector 2 copy get[exch 6 index exch 6 index exch{newmm 3 1 roll}forall pop pop] put dup
+}{/mfont 10 dict def mfont begin/FontMatrix [1 0 0 1 0 0] def
+/FontType 3 def/Encoding macvec def/df 1 index def/df2 1 array def/FontBBox [0 0 1 1] def/StyleCode 2 index def
+/mbc{bcarray StyleCode get}def/BuildChar{exch begin wd begin/cr exch def/cs s1 dup 0 cr put def df /MFontType known not{
+df2 0 get null eq{df dup length 2 add dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall
+/StrokeWidth nlw 1000 mul pys div ps div dup 12 lt{pop 12}if def/PaintType 2 def currentdict end
+/q exch definefont df2 exch 0 exch put}if}if mbc exec end end}def end mfont}ifelse
+3 index exch definefont exch pop}bdf
+/mb{dup sbs kwn{0 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/mo{dup sos kwn{2 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/ms{dup sss kwn{4 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/ou{dup sos kwn{mfont/df2 known{mfont begin df2 0 null put end}if 3 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/su{dup sss kwn{mfont/df2 known{mfont begin df2 0 null put end}if 5 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf
+/ao{/fmv true def ou}bdf/as{/fmv true def su}bdf
+/vo{/fmv false def ou}bdf/vs{/fmv false def su}bdf
+/c{currentrgbcolor dup 4 1 roll eq 3 1 roll eq and/gray xdf}bdf
+/bcarray[{/da .03 def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs 0 0 smc da 0 smc da da smc 0 da moveto show}bind dup{/da 1 ps div def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth
+cs 0 0 smc da 0 smc da da smc 0 da smc c gray{gl}{1 setgray}ifelse da 2. div dup moveto show}bind
+{df setfont gsave cs wi grestore setcharwidth c gray{gl}{currentrgbcolor 1 setgray}ifelse cs 0 0 smc df2 0 get setfont
+gray{gl}{4 1 roll setrgbcolor}ifelse 0 0 moveto show}bind
+{/da 1 ps div def/ds .05 def/da2 da 2. div def df setfont gsave cs wi 1 index 0 ne{exch ds add da2 add exch}if grestore setcharwidth
+cs ds da2 add .01 add 0 smc 0 ds da2 sub translate 0 0 smc da 0 smc da da smc 0 da smc c gray{gl}{1 setgray}ifelse da 2. div dup moveto show}bind
+{/da .05 def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth c cs da .01 add 0 smc 0 da translate
+gray{gl}{currentrgbcolor 1 setgray 4 -1 roll}ifelse 0 0 smc gray{gl}{4 1 roll setrgbcolor}ifelse df2 0 get setfont 0 0 moveto show}bind]def
+/st{1000 mul usertime add dup 2147483647 gt{2147483647 sub}if def}bdf
+/the{usertime sub dup 0 lt exch -2147483648 gt and}bdf
+/6a 6 array def
+/2a 2 array def
+/3q 3 array def
+/qs{3 -1 roll sub exch 3 -1 roll sub exch}bdf
+/qa{3 -1 roll add exch 3 -1 roll add exch}bdf
+/qm{3 -1 roll 1 index mul 3 1 roll mul}bdf
+/qn{6a exch get mul}bdf
+/qA .166667 def/qB .833333 def/qC .5 def
+/qx{6a astore pop
+qA 0 qn qB 2 qn add qA 1 qn qB 3 qn add
+qB 2 qn qA 4 qn add qB 3 qn qA 5 qn add
+qC 2 qn qC 4 qn add qC 3 qn qC 5 qn add}bdf
+/qp{6 copy 12 -2 roll pop pop}bdf
+/qc{exch qp qx curveto}bdf
+/qi{{exch 4 copy 2a astore aload pop qa .5 qm newpath moveto}{exch 2 copy 6 -2 roll 2 qm qs 4 2 roll}ifelse}bdf
+/qq{{qc 2a aload pop qx curveto}{exch 4 copy qs qa qx curveto}ifelse}bdf
+/pt{currentpoint newpath moveto}bdf
+/qf{/fillflag true def}bdf
+/ec{dup 4 and 0 ne{closepath}if 1 and 0 ne{0 doop}if grestore currentpoint newpath moveto/fillflag false def}bdf
+/eu{currentpoint fp{0 ep}{grestore newpath}ifelse moveto/fillflag false def}bdf
+/bp{currentpoint newpath 2 copy moveto}bdf
+/ef{gsave fillflag{gsave eofill grestore}if}bdf
+/sm{0 exch{@1 eq{1 add}if}forall}bdf
+/lshow{4 1 roll exch/@1 exch def{1 index wi pop sub 1 index sm dv 0 @1 4 -1 roll widthshow}{1 index wi pop sub
+1 index dup sm 10 mul exch length 1 sub add dv dup 10. mul 0 @1 4 -1 roll 0 6 -1 roll awidthshow}ifelse}bdf
+/setTxMode{sa 9 2 index put exch not{3 eq{1}{0}ifelse setgray}{pop}ifelse}bdf
+/SwToSym{{}mark false/Symbol/|______Symbol 0 rf 0 sa 6 get 0 ne{pop 1}{sa 7 get 0 eq{pop 2}if}ifelse
+sa 1 get 0 ne/|______Symbol
+sa 4 get 0 ne{vs}{sa 3 get 0 ne{vo}{fnt}ifelse}ifelse}bdf
+/mc{0 3 1 roll transform neg exch pop}bdf
+/ul{dup 0 ne sa 2 get 0 ne and{gsave 0 0
+/UnderlinePosition kif{mc}{ps -10 div}ifelse/UnderlineThickness kif{mc}{ps 15 div}ifelse
+abs setlinewidth neg rmoveto
+sa 4 get 0 ne{gsave currentlinewidth 2. div dup rmoveto currentpoint newpath moveto
+2 copy rlineto stroke grestore}if
+sa 3 get sa 4 get or 0 ne{gsave currentrgbcolor dup 4 1 roll eq 3 1 roll eq and{gl}{1 setgray}ifelse 2 copy rlineto stroke grestore rlineto strokepath nlw pys div setlinewidth}{rlineto}ifelse
+stroke grestore}{pop}ifelse}bdf
+/sgt{2 copy known{get true}{pop pop false}ifelse}bdf
+/kif{currentfont dup/FontMatrix get exch/FontInfo sgt{true}{currentfont/df sgt
+{dup/FontInfo sgt{3 1 roll/FontMatrix get mtx concatmatrix exch true}{pop pop pop false}
+ifelse}{pop pop false}ifelse}ifelse{3 -1 roll sgt{exch true}{pop false}ifelse}{false}ifelse}bdf
+/blank/Times-Roman findfont/CharStrings get/space get def
+/macvec 256 array def
+/NUL/SOH/STX/ETX/EOT/ENQ/ACK/BEL/BS/HT/LF/VT/FF/CR/SO/SI
+/DLE/DC1/DC2/DC3/DC4/NAK/SYN/ETB/CAN/EM/SUB/ESC/FS/GS/RS/US
+macvec 0 32 getinterval astore pop
+macvec 32/Times-Roman findfont/Encoding get
+32 96 getinterval putinterval macvec dup 39/quotesingle put 96/grave put
+/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis/Udieresis/aacute
+/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute/egrave
+/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde/oacute
+/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex/udieresis
+/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
+/registered/copyright/trademark/acute/dieresis/notequal/AE/Oslash
+/infinity/plusminus/lessequal/greaterequal/yen/mu/partialdiff/summation
+/product/pi/integral/ordfeminine/ordmasculine/Omega/ae/oslash
+/questiondown/exclamdown/logicalnot/radical/florin/approxequal/Delta/guillemotleft
+/guillemotright/ellipsis/blank/Agrave/Atilde/Otilde/OE/oe
+/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide/lozenge
+/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright/fi/fl
+/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand/Acircumflex/Ecircumflex/Aacute
+/Edieresis/Egrave/Iacute/Icircumflex/Idieresis/Igrave/Oacute/Ocircumflex
+/apple/Ograve/Uacute/Ucircumflex/Ugrave/dotlessi/circumflex/tilde
+/macron/breve/dotaccent/ring/cedilla/hungarumlaut/ogonek/caron
+macvec 128 128 getinterval astore pop
+{}mark true/Courier/|______Courier 0 rf
+{/Metrics 21 dict begin/zero 600 def/one 600 def/two 600 def/three 600 def/four 600 def/five 600 def/six 600 def/seven 600 def/eight 600 def
+/nine 600 def/comma 600 def/period 600 def/dollar 600 def/numbersign 600 def/percent 600 def/plus 600 def/hyphen 600 def/E 600 def/parenleft 600 def/parenright 600 def/space 600 def
+currentdict end def currentdict/UniqueID known{/UniqueID 16#800000 def}if/FontBBox FontBBox 4 array astore def}mark true/Helvetica/|______Seattle 1 rf
+/oldsettransfer/settransfer load def
+/concatprocs{/proc2 exch cvlit def/proc1 exch cvlit def/newproc proc1 length proc2 length add array def
+newproc 0 proc1 putinterval newproc proc1 length proc2 putinterval newproc cvx}def
+/settransfer{currenttransfer concatprocs oldsettransfer}def
+/PaintBlack{{1 exch sub}settransfer gsave newpath clippath 1 setgray fill grestore}def
+/od{(Rvd\001\001\000\000\177) fg copy pop txpose
+1 0 mtx defaultmatrix dtransform exch atan/pa exch def
+newpath clippath mark
+{transform{itransform moveto}}{transform{itransform lineto}}
+{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform
+{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}
+{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put
+10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if
+statusdict/processcolors known{statusdict begin processcolors end dup 4 eq{/4colors true def pop}{3 eq{/3colors true def}{/2color true def}ifelse}ifelse}{/2colors true def}ifelse}bdf
+/cd{}bdf
+/op{/sfl false def systemdict/currentcolorscreen known{dcfreq dcrot/dcspf load dmfreq dmrot/dmspf load dyfreq dyrot/dyspf load
+dkfreq dkrot/dkspf load setcolorscreen}{freq rot/spf load setscreen}ifelse savescreen
+/ns false def/pm save def}bdf
+/cp{not{userdict/#copies 0 put}if ma 0 gt{{t1 the{exit}if}loop}if{copypage}{showpage}ifelse pm restore}bdf
+/px{0 3 1 roll tp tt}bdf
+/psb{/us save def}bdf
+/pse{us restore}bdf
+/ct 40 string def
+/nc{currentpoint initclip newpath gc{dup type dup/arraytype eq exch/packedarraytype eq or{exec}if}
+forall clip newpath moveto}def
+/kp{ct 0 2 index length 2 index 39 2 index put getinterval copy cvx exec mx3 currentmatrix pop}bdf
+/av 70 def
+end
+LW 1 eq userdict/a4small known not and{/a4small
+[[300 72 div 0 0 -300 72 div -120 3381]
+280 3255
+{statusdict/jobstate (printing) put 0 setblink
+margins
+exch 196 add exch 304 add 8 div round cvi frametoroket
+statusdict/jobstate (busy) put
+1 setblink}
+/framedevice load
+60 45{dup mul exch dup mul add 1.0 exch sub}/setscreen load
+{}/settransfer load/initgraphics load/erasepage load]cvx
+statusdict begin bind end readonly def}if
+md begin/bigs[lnop userdict/letter known{/letter load}{lnop}ifelse userdict/legal known{/legal load}{lnop}ifelse userdict/a4 known{/a4 load}{lnop}ifelse userdict/b5 known{/b5 load}{lnop}ifelse
+lnop lnop lnop /tab load/a3Size load]def
+/smalls[lnop userdict/lettersmall known{/lettersmall load}{userdict/note known{/note load}{lnop}ifelse}ifelse
+userdict/legal known{/legal load}{lnop}ifelse userdict/a4small known{/a4small load}{lnop}ifelse
+userdict/b5 known{/b5 load}{userdict/note known{/note load}{lnop}ifelse}ifelse lnop lnop lnop /tab load/a3Size load]def end
+systemdict/currentpacking known{setpacking}if
+/checkload{{currentfile eexec} {/junk save def/mystring 65000 string def
+/endexec (e%endeexec) def{currentfile mystring readline not{stop}if endexec eq{exit}if}loop junk restore}ifelse}bind def
+ok userdict/stretch known not and checkload
+373A767D4B7FD94FE5903B7014B1B8D3BED02632C855D56F458B118ACF3AF73FC4EF5E81F5749042B5F9CF1016D093B75F250B7D8280B2EACE05A37037F7BDF6E12226D7D4E2DF2C52FAFD5FD40FE72A0D3AC4BD485D8369D4C87636E920D1DAF222D92155A9CB1667E715F0B82799B37CC8F5B32B74B39CF494536DC39C7EF04A7BCB29E2CEC79073CADCCFB23B4AA1363F876F5121B618071B7B4EB1E5DE75FAA2368A3E5DB2B198623AFE92AE9484270FE7F57A850E88C0D3EEA156611C91D8E480D4370B025CCA6929A2BF40AD3D01B2CB7EE6DFB46E12A830542337F7819B67F9765210F76DB06F34DA5B13A11759305C582E16D2B854939F6D9121F2A4F285282F5DCD3D15896D121E3D6F5BE79E087451BB0ED233CDBEF090D3B4AC2DC34B97E70C61D95FB072B8C12D2ABD843520949A39DCF99E2C1AA8FBCD025E47E0A82A8D96E75BAF40F52AD402495BBD4DE0F356C8B14E764874E639C9F045A0D1908EC6456EB6C5B8A6F826192F767EF2C55A21C58F5F9CC1F59247B55F2387828C7FE89D5E7D8484D1BC86CB6673BDBE4FE17DD9BDE95224FE645136F41330BF155A4DDE1B0A32233BF471CE58FBC660DC7E641B0A0D30018454E2191C414A3011FF3FED1C0D88FE1FF9F75DCC456D097947226FBEC92509146D3A4CFFC0471B31C53222ED9DD88566F60F6C0D705AD79DACF53B070026F083ED28B5CF757AAA0A169F6F320A75E9D2ED50ABD939AF85B6346C2ADB25D168F10508E1516D194C635E6B187FADEA0829DBF0390C0F003F0265E215BC96CA3CC13D4A8E01570BE193CA75A620728CD275ACF1986EFFB3A13419FE55EA7C4467B7E7EEDC1FC29C9F8C46A557D2CCDB914EF7B93E7530D555DFC2398AFC68CAD991F062EF85BAA1884EC166C7C5DF8543666D8C41BE267D706BD1588F1F662F705CAE4D29DC38EF66BFAA89470D8A099B6F1B4587F7B024412276106FCD3EB5AE17A5D1DF1781992DC40EA0A992F706F701304CEA9D9073E7A74F1E687D81C3E5841D31CF86855BAAAD9B5D30317C75150A857C6B114735315CDD1AEF36C26BBB0645499406DEE2F24B3B1C72FEC97C7BA31AA2CDAB25418BB1DC4C7E4757F1D625087B0FD0300C03A65F2A72CE734925735277E034CDCF599129679F70CC8B66E03878851DB75041F275E1E5761F3EC753BE1359CA364A22047AE4886217F9259FE19FF5B116E8019B98B143114B313E8BEF87EC949D85C82E0812E6F50525E73890AF362CC8EE8A85F4197E6AC18638EF12E56A808D439AF1BFD363F140314BF4E534485C42F1856688CC35288E8D770120A420FB9F1FCF8AE8BD6D6156CC23E6C51119FE4DE1B68C9DF3487E9974BF9ED31F8D3CE93FF101867319F2FF492D5D398B4F09A66F2F55BCAB34B99173B7EE89039D00DD21A7B3A52E9F028F8301B5FC12D409412E064513BC579AAC498F577EA8ECD1FE3E42DC3CC320786C7B00194FEDF344402C33FC492D4BA86992B01683F440220FFE756BC88A94223D316078D69D33560E8EAB76B24CB7AA4320CF435593D76F624324ABE00B5587A4F283C725EA24567133F25F472B5E2E4474DDB5A16AC5F2DF32350395D3E3892FE361F4D5C9A610C654C9227614FBBAFF3356A90A2266E00F66234061075491571A65616211257F160000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+cleartomark
+e%endeexec
+
+ok userdict/smooth4 known not and checkload
+F94E00EE41A71C59E5CAEED1EDBCF23D1DBA1EE99B9BB356492923BD8B1BA83A87CEB0E07377A31FD6241E814681118E17DC7CACE570399506E6E441B871B6043831BD03EFC11DBBD8001EE2FF8CFBD485065D455A2E15AC36F1A84AD8789FA6461199C7CD14CB9FD64D4B06452B7FC0A8FC263F70F1CCB893295D4DE70ADAB771C0F84396FA98C60B11DA02ABA157298DF0A23621853BEF167443A985ADC09BEFFD51CB4D29179E2B34609EF38A49DA61F4BFC256A3DE0732D7D29754A194857B9C9E9971227AA1DD0611FBB10E44E5FF66C062D9C24ED3290529330BC317825E876929582DB0E39B9FC5EFD20CC1D4F94920EB9C534D0DA90DE70D25BC7287319CF28602B3F46633C242CAFC8905E960317E3C2FA20AB8DB06ADBAF292FC7BA2CA14EE65DF28B99CC11666B70AD33E8E1D57D63D4B89ECC615AE5747C1CA752C833D8D6DE54CD4A0350B44310555CE3BD2C615ADD27B634CDB350AF3A432CE78AACD2909A5B586F666CD87919A36DB1CBE86B3CE281DFD01CD7E1B8A18A4B415CECBFF79A5C4390A15EA77D14D6BE12BAB5A8268C3F286D0590060647CABED674443CD258F11415E866AB330A251691B61F2422A61AFE59B6B4FBDCF85ED9BA0F8E483C034089E6877FF5923698D3A0DC0EED6B9CFD32DF0839BC4EA5F6D1FCB6DD0920391E57E84745131D02D100179F4E0A68EC0A5FF6680A6F463D038B04AF63FFA13D743B995A26A743C26D387209023C91DE43DF047A16F328AC9DDC08573B38BE9EA341EA16C78EC32F3A1B36B90D95A50610F4D050EC1C33497F3F3A81A1B4C8BEF0BA84EE2FAA32DC112DAC490AF53E1749C4A0D866CAF7B893E52383B0D38065C333FB122B700D7246F7EE87D942AE3DB5C1DD77E9E76C80CC5AD63D28DFED0E229CE604673F78CD47F258FDF5BF3A3EAEC5C9BC8E482D8DBA9D268A35DA8C095A690679ED2123E8B8F5E4826FA3B199EAA5D482D4B6AA86572E387CECEB7149C8947F41D6339328A748A17F8C4AD3B0555F1E409450BA0C564F1F488BB5096EB003568D4D5EF6489897E27409547D0EE4487D30184793B0F27BD265A64BDB3EA6761569DA955620C612E718677B77D6D81B999C6298877AFE0D1D6F6F358377A8BD2402F669C64B972B3A065EF7DD4BDEFFFE17E63DB8898FA6E69166B710AAD6BA2EA9AF61E4B8C8701638D4D6E4DFFFC192AEF6BC027095C4C72D748979675BA29FAF61E75343E14E61034602E5A79CD2519796ED6A9CC4EDEA46A9B59D4A807E786B5EE46F25B0360BC8E7C12D723122CDEEF247C9776F4C99C8EBED6828AA19744B5ADF0D07D95D98B3072372388D41B0FAB1CCE2775170679575ECDCA13B22A17FE9C6605C3445F58F1A829512DAB6C528F83580C8AA53C35D605F626F5AD0B7FC1EA87D69A835E3F53A1F450FB0AF42A5772F89D92A50D10F15BDBDA409F50C0B8AB93FE8A16D029DD8BB5C480D1466735ED4D9CAF637E5ECD6C2ECB6BF3B3EFBEE7AB936D2C568E3009D156B87CACB1FB3A48A70BC91B2EC35CC9147FFB1A524E2B2F2E4E2C1B12F1C1C63768BB95CD62FEC01CBA79B9FA282DD4DF49990F27FF8EE4E2DDE2F0ACD83BC9D4BE0090192C7A799967EC4DC2D63C0835E22D4C4B366D7FDCF3A05A4B53DF780F986EF25C79B665D5C00EFF7F17C0BB6D544F9D83A7FDAC47D9C5683A656011374253C918FF6EA64749DD971B2300DD5320033E01EC591F6318CCE94CE2B81C04322EC52B624E50643B52391CCD2AB56396A2AD8E2D3CA61B80D9D4CC363B2DF7863526958CDF3497E36648406C317E58EC563E7C26149A2A3C643ADFB39A8DD92974C6D2A2A9D7B71CDF3FEBBF32BB02E7B45CF53AAEAD5E963A4AA4AF9A149A08A4EC303D5F2369977E93F54897EEAD31B06C5845D63F49D65F8E5573962241A57CCD717CE6CA8C784A11192943616EA059B51BC38429E18D0121FCBB6FBD5D909B0D89E616C66DEF6A0F165A7030BD911A1B120468329CBB006C8D37720E531CF31E878CB4AAAC137633675C3D546F5162487AB35F470C042BDEB945E0F2532BF92AA6FD53434440221ECD3533A7AA89900CB19EFE2CD872DF8B7969AF0D3B72BF31DC5DD69CA6460966F61AB17CB507964098DBA3AF122EEC3128A9BAFE1034493F372B36BD1351205E9043A67C544402D8BCE24358C8A5CE33867A00794CF7097D59C88279A11EE9C854E7E7AAE881F9828C569D208F5F33375F59E9A3818CFA38AAD0CBFBA32F9F44A8BB79DE4C40E3886457C16DA4A27953AA1E99472E35F2323F0BAA5E37DC28CBA46FEFB73B190016055ADD4D27615D748499A0E1C4B8C7EC339C1C4D95A813A85918A8D01EEB485DDCDCEA6EA3F2C2A9D85C139CD90CCB352634F9AFE836BCAC0C274E352BA2071B5269D5DE4CCDE3FF990CBA974980C7332AE1545A9C60D5D1459D3AE95C1AC065733AF14FADB440A110DD539563B8D850CD0704C52F3F7CCCB53630D776560CBD22D8FF08F5B354487A171AEC15F5F54DE9CAB668BCAC573E788D92762EF63E76087005F4AC2D02E0CAC173C11BE62ACE5DC4D3374F2F9746C9981E125FF9AB8CAE76D13039E2C54DFD708E028A619EA1ED78E6B46F06DF0D0B74BBEDD8C190C7C0CEBDE8F7A4888CC36575313478DD2CFE392E9BB7B2416955D44B7024A3BA43FBF37293B386D64746D7748895411D243FAEC50638F2AA33337D7FA018ADDAC5835A0DDFAE99AD6299DFB4CA6872C59853E3AC12FC9E3D26629C5B49CF844C87B3C4BFBE3074E3A1CE6984758C20C661084381CD6B4582D84F19C0000B5FC0DCB42B567E396031601C095D7016283EBE5F13CD8A3A374A74DDBBABD36081149F8BC242085F2F7297CC97FD3B8BAD206D8AC9707A39ECCC7963B522E08DA391A1EF12DD4D746DBDDDCC0834F88160CF189A9645567CEC2F023A571AF0DFD15DB85B744C28C000DF53B05F8F210841F6E87A04F20C777B7C0BE6182BE2E90226E5301A12532A745F2FAAA81637CF11B78CD2B99A4D18B862D6C5DBD31793FB16A2D9AAD376D4484D75AA833D0068B1D34DB74E3302480854E3B5484D8A47E39A89A2FA927BC3641EA7F8E004FDE4C2F08D40D99F1ACB47CAF6887629BF6DFE12968D297596D28CE0CF148B12E7DCB49FB94F5ADBD214C3A6CE1E249831BA9EB8A189F2CE1ABE39A7B537253E369A508A2AF2ADB9463F9B56BBBFF31D535FF997F537C6675C196E7ECBD493F652FA7CC6D9C1CA3379BFDB5AF7513C6E834054494296B91A6EE800114363D5D5D0759F41B4DECB653B9DE3E94583579EF549ED5F3FAFB12661ABC0C57A332406517ED3454EDED34B386C60F78DC976266E0EAF54FC245FB0E3EFC8016236436B599C1C97A8C5E0AC8F7836161873C71F01ED9CC25C236420F41FD8277993D3959205912FA0927B59E3DAE7377D82079447D6E41EE5AEC0DFFF79AF8F4ED47F17EE708FEA45877860D56F8CBCE65A061E8E1CA4A5FBAF0E13429A7F0ADB6F178FA449F46CC539BBC0107E3A53B1C362A04B20E6D721E7E6E1E4976A11DDC98C7614D22B53DFBB6DAE533AC9BE882021A735C30DAA4A44AED09F49A390E8CFF59BD9C30667AF21B03EC5CEBD5C2C3AA2769E8D714191A48E7DDF50B13D1560E82EFB65FCE601AE9E8C351FBA1DED80B7351314E7F9F9A784BFE3759B7E322A84E7B51F9DC5F5D9C8050CD79B27C0A4B0DD68A3C27A948AD6858E35B960D2DEA838C479CAEA83B1A912174ACB2100E55E7A14892D7A9B3711FF0B20065C1995B49E1F23464A92DD140642E3A7B1973849E64D1A3CF60000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+cleartomark
+e%endeexec
+%% TJD hacks 6/91 to get lprep 70 and psfig to work with pageview:
+md begin
+/nc{currentpoint initclip newpath gc{dup type dup/arraytype eq exch/packedarraytype eq or{exec}if}
+forall % clip
+newpath moveto}def
+end
+%%EndProcSet
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macdemo.tex b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macdemo.tex
new file mode 100644
index 00000000000..70fd42c7d3a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macdemo.tex
@@ -0,0 +1,19 @@
+\documentstyle[psfig]{article}
+\psfigurepath{macfigs:figs}
+\special{header=lprep68.pro}
+\begin{document}
+This is a rosette and some MacDraw output:
+
+\centerline{\psfig{figure=rosette.ps,height=2in}\hspace{.25in}
+ \psfig{figure=macdraw.fig68,height=2in}}
+
+This is what hacking Mac Postscript is like:
+
+\centerline{\psfig{figure=bullet.fig68,height=2in}}
+
+And now a graph:
+
+\centerline{\psfig{figure=dave.fig68,height=2in,clip=}}
+
+Thats all folks.
+\end{document}
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/bullet.fig68.Z b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/bullet.fig68.Z
new file mode 100644
index 00000000000..d46556690b7
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/bullet.fig68.Z
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/bullet.fig68.bb b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/bullet.fig68.bb
new file mode 100644
index 00000000000..e58060028b1
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/bullet.fig68.bb
@@ -0,0 +1,2 @@
+%!
+%%BoundingBox: 0 500 500 800
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/dave.fig68.Z b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/dave.fig68.Z
new file mode 100644
index 00000000000..4795f24ed05
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/dave.fig68.Z
Binary files differ
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/dave.fig68.bb b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/dave.fig68.bb
new file mode 100644
index 00000000000..c4708324c1b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/dave.fig68.bb
@@ -0,0 +1,2 @@
+%!
+%%BoundingBox: 80 280 460 600
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/macdraw.fig68.Z b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/macdraw.fig68.Z
new file mode 100644
index 00000000000..b3f34d5e809
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/macdraw.fig68.Z
@@ -0,0 +1,4 @@
+%B@™Ò"™7bʴᆂ%¨¤¡Ã¦ŒUÜЙX‘ÌÃCä” C看MÂŒ!"'Ì1\äpQãcÈ‘߸!BÒ"ˆ+eȸ)3‡L˜<,@)#FN0ròÀL#Ž¡„9Cô"ŠžnȤø(äM°iÜœ)‹ç" 5`¼û‡ÜFL^¼ƒfb™1hÂÀ)Ãæc7cØÔ!SŠœ7c¦”¡sQŠ pàT$’f mÈ´0“æL‘)D€°„CˆEÂyÓ¦Ms>Æ&ãø ›7gÈ–9“–ä:¶5J¦SŽ‚Ð w£@×[̈BûÛ6¸×À!¦\7ʧ‡©´½‘ö×ダ3§Ž|ýLxˆƒc weiÄQP)¨AÝ[m˜¡ÀÁ–q&GÇrÍeµ•O?Àô so½…GaÜq7Ø‚®pF÷!–âw2ÌEÃ[6€ Ç)¬áœ åÍpƒŠ,r7ÇdTàÑ„e(𖹉QfŒ¡À}´ÕØð„Ù1YgahÉÇd–É%^n4F˜oÉá ÔÅÀ 7äwfè¡€“PJYÞ{/ŒY&™g¦ &”íIC5Ì0ƒ 5Âàºæ‚ V*)
+S„цfe€ÒJ-½ÓL5€`pÔAG
+.¥AhÌÆw(à¢g”æb«t(C ?ÊðãŠ{:g'8p÷^i;Cª9¼‡”ÍÂÔ(×
+K,L7p×mµ0]Å­”1˜+ 3œëm±9üØm¶ÒànU­Í`ƒµè~ËnyÝÆ°- qÝ.4Ðà,·q(P†ƒo!‡° üÕâ/¢#\3®f#Ž:*™"²6Ø+±Ù “Ê1è‹°ªvˆ|r³4!\CÍ1$Œó´5¿õFÌ%«8±Àín—jºÜ)œª½?Ë<t£5³]5+LCÏ0+ðÞuc8-¥QÑÄcxt[„%hÅÕqç \ No newline at end of file
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/macdraw.fig68.bb b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/macdraw.fig68.bb
new file mode 100644
index 00000000000..e58060028b1
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/macfigs/macdraw.fig68.bb
@@ -0,0 +1,2 @@
+%!
+%%BoundingBox: 0 500 500 800
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/stripfonts.awk b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/stripfonts.awk
new file mode 100644
index 00000000000..b3ddd748af6
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/macdemo/stripfonts.awk
@@ -0,0 +1,5 @@
+BEGIN {p = 1}
+$1 == "%%BeginFont:" { p = 0 }
+{ if (p==1) print $0 }
+$1 == "%%EndFont" { print "bn"; p = 1 }
+$1 == "%%EndFont:" { print "bn"; p = 1 }
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/psfig-li.pro b/Master/texmf-dist/source/generic/psfig/unsupported/psfig-li.pro
new file mode 100644
index 00000000000..167e31a02a0
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/psfig-li.pro
@@ -0,0 +1,100 @@
+%!
+% Psfig/TeX Release 1.2
+% dvi2ps-li version
+%
+% All software, documentation, and related files in this distribution of
+% psfig/tex are Copyright 1987, 1988 Trevor J. Darrell
+%
+% Permission is granted for use and non-profit distribution of psfig/tex
+% providing that this notice be clearly maintained, but the right to
+% distribute any portion of psfig/tex for profit or as part of any commercial
+% product is specifically reserved for the author.
+%
+%
+% $Header: figtex.pro,v 1.5 87/07/24 20:14:50 trevor Exp $
+% $Source: $
+%
+%/TeXscale { 65536 div } def
+%/psfts { S 65781.76 div N } N
+/TeXscale { 65781.76 div } def
+
+%/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap
+%currentlinejoin currentdash currentgray currentmiterlimit ] cvx def
+%
+% Since dvi2ps has an initgraphics at the beginning of texpre.ps, we can
+% assume:
+gsave initgraphics
+/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap
+currentlinejoin currentdash currentgray currentmiterlimit ] cvx def
+grestore
+
+/startTexFig {
+% usage : x y bb-llx bb-lly bb-urx bb-ury startFig
+ /SavedState save def
+ userdict maxlength dict begin
+ currentpoint transform
+
+ DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap
+ setlinewidth setmatrix
+
+ itransform moveto
+
+ /ury exch TeXscale def
+ /urx exch TeXscale def
+ /lly exch TeXscale def
+ /llx exch TeXscale def
+ /y exch TeXscale def
+ /x exch TeXscale def
+
+ currentpoint /cy exch def /cx exch def
+
+ /sx x urx llx sub div def % scaling for x
+ /sy y ury lly sub div def % scaling for y
+
+ sx sy scale % scale by (sx,sy)
+
+ cx sx div llx sub
+ cy sy div ury sub translate
+
+ /DefFigCTM matrix currentmatrix def
+
+ /initmatrix {
+ DefFigCTM setmatrix
+ } def
+ /defaultmatrix {
+ DefFigCTM exch copy
+ } def
+
+ /initgraphics {
+ DocumentInitState setmiterlimit setgray setdash
+ setlinejoin setlinecap setlinewidth setmatrix
+ DefFigCTM setmatrix
+ } def
+
+ /showpage {
+ initgraphics
+ } def
+% /erasepage and /copypage added for MatLab support (tli)
+ /erasepage {
+ initgraphics
+ } def
+ /copypage {} def
+
+} def
+% Args are llx lly urx ury (in figure coordinates)
+/clipFig {
+ currentpoint 6 2 roll
+ newpath 4 copy
+ 4 2 roll moveto
+ 6 -1 roll exch lineto
+ exch lineto
+ exch lineto
+ closepath clip
+ newpath
+ moveto
+} def
+% doclip, if called, will always be just after a `startfig'
+/doclip { llx lly urx ury clipFig } def
+/endTexFig {
+ end SavedState restore
+} def
diff --git a/Master/texmf-dist/source/generic/psfig/unsupported/psfig-li.tex b/Master/texmf-dist/source/generic/psfig/unsupported/psfig-li.tex
new file mode 100644
index 00000000000..4255bc3199f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/psfig/unsupported/psfig-li.tex
@@ -0,0 +1,391 @@
+% Psfig/TeX Release 1.2
+% dvi2ps-li version
+%
+% All software, documentation, and related files in this distribution of
+% psfig/tex are Copyright 1987, 1988 Trevor J. Darrell
+%
+% Permission is granted for use and non-profit distribution of psfig/tex
+% providing that this notice be clearly maintained, but the right to
+% distribute any portion of psfig/tex for profit or as part of any commercial
+% product is specifically reserved for the author.
+%
+% $Header: psfig.tex,v 1.9 88/01/08 17:42:01 trevor Exp $
+% $Source: $
+%
+% Thanks to Greg Hager (GDH) and Ned Batchelder for their contributions
+% to this project.
+%
+\catcode`\@=11\relax
+\newwrite\@unused
+\def\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}
+\typeout{psfig/tex 1.2-dvi2ps-li}
+
+%% Here's how you define your figure path. Should be set up with null
+%% default and a user useable definition.
+
+\def\figurepath{./}
+\def\psfigurepath#1{\edef\figurepath{#1}}
+
+%
+% @psdo control structure -- similar to Latex @for.
+% I redefined these with different names so that psfig can
+% be used with TeX as well as LaTeX, and so that it will not
+% be vunerable to future changes in LaTeX's internal
+% control structure,
+%
+\def\@nnil{\@nil}
+\def\@empty{}
+\def\@psdonoop#1\@@#2#3{}
+\def\@psdo#1:=#2\do#3{\edef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
+ \expandafter\@psdoloop#2,\@nil,\@nil\@@#1{#3}\fi}
+\def\@psdoloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else
+ #5\def#4{#2}\ifx #4\@nnil \else#5\@ipsdoloop #3\@@#4{#5}\fi\fi}
+\def\@ipsdoloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
+ \let\@nextwhile=\@psdonoop \else
+ #4\relax\let\@nextwhile=\@ipsdoloop\fi\@nextwhile#2\@@#3{#4}}
+\def\@tpsdo#1:=#2\do#3{\xdef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
+ \@tpsdoloop#2\@nil\@nil\@@#1{#3}\fi}
+\def\@tpsdoloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
+ \let\@nextwhile=\@psdonoop \else
+ #4\relax\let\@nextwhile=\@tpsdoloop\fi\@nextwhile#2\@@#3{#4}}
+%
+%
+\def\psdraft{
+ \def\@psdraft{0}
+ %\typeout{draft level now is \@psdraft \space . }
+}
+\def\psfull{
+ \def\@psdraft{100}
+ %\typeout{draft level now is \@psdraft \space . }
+}
+\psfull
+\newif\if@prologfile
+\newif\if@postlogfile
+\newif\if@noisy
+\def\pssilent{
+ \@noisyfalse
+}
+\def\psnoisy{
+ \@noisytrue
+}
+\psnoisy
+%%% These are for the option list.
+%%% A specification of the form a = b maps to calling \@p@@sa{b}
+\newif\if@bbllx
+\newif\if@bblly
+\newif\if@bburx
+\newif\if@bbury
+\newif\if@height
+\newif\if@width
+\newif\if@rheight
+\newif\if@rwidth
+\newif\if@clip
+\newif\if@verbose
+\def\@p@@sclip#1{\@cliptrue}
+
+%%% GDH 7/26/87 -- changed so that it first looks in the local directory,
+%%% then in a specified global directory for the ps file.
+
+\def\@p@@sfile#1{\def\@p@sfile{null}%
+ \openin1=#1
+ \ifeof1\closein1%
+ \openin1=\figurepath#1
+ \ifeof1\typeout{Error, File #1 not found}
+ \else\closein1
+ \edef\@p@sfile{\figurepath#1}%
+ \fi%
+ \else\closein1%
+ \def\@p@sfile{#1}%
+ \fi}
+\def\@p@@sfigure#1{\def\@p@sfile{null}%
+ \openin1=#1
+ \ifeof1\closein1%
+ \openin1=\figurepath#1
+ \ifeof1\typeout{Error, File #1 not found}
+ \else\closein1
+ \def\@p@sfile{\figurepath#1}%
+ \fi%
+ \else\closein1%
+ \def\@p@sfile{#1}%
+ \fi}
+
+\def\@p@@sbbllx#1{
+ %\typeout{bbllx is #1}
+ \@bbllxtrue
+ \dimen100=#1
+ \edef\@p@sbbllx{\number\dimen100}
+}
+\def\@p@@sbblly#1{
+ %\typeout{bblly is #1}
+ \@bbllytrue
+ \dimen100=#1
+ \edef\@p@sbblly{\number\dimen100}
+}
+\def\@p@@sbburx#1{
+ %\typeout{bburx is #1}
+ \@bburxtrue
+ \dimen100=#1
+ \edef\@p@sbburx{\number\dimen100}
+}
+\def\@p@@sbbury#1{
+ %\typeout{bbury is #1}
+ \@bburytrue
+ \dimen100=#1
+ \edef\@p@sbbury{\number\dimen100}
+}
+\def\@p@@sheight#1{
+ \@heighttrue
+ \dimen100=#1
+ \edef\@p@sheight{\number\dimen100}
+ %\typeout{Height is \@p@sheight}
+}
+\def\@p@@swidth#1{
+ %\typeout{Width is #1}
+ \@widthtrue
+ \dimen100=#1
+ \edef\@p@swidth{\number\dimen100}
+}
+\def\@p@@srheight#1{
+ %\typeout{Reserved height is #1}
+ \@rheighttrue
+ \dimen100=#1
+ \edef\@p@srheight{\number\dimen100}
+}
+\def\@p@@srwidth#1{
+ %\typeout{Reserved width is #1}
+ \@rwidthtrue
+ \dimen100=#1
+ \edef\@p@srwidth{\number\dimen100}
+}
+\def\@p@@ssilent#1{
+ \@verbosefalse
+}
+\def\@p@@sprolog#1{\@prologfiletrue\def\@prologfileval{#1}}
+\def\@p@@spostlog#1{\@postlogfiletrue\def\@postlogfileval{#1}}
+\def\@cs@name#1{\csname #1\endcsname}
+\def\@setparms#1=#2,{\@cs@name{@p@@s#1}{#2}}
+%
+% initialize the defaults (size the size of the figure)
+%
+\def\ps@init@parms{
+ \@bbllxfalse \@bbllyfalse
+ \@bburxfalse \@bburyfalse
+ \@heightfalse \@widthfalse
+ \@rheightfalse \@rwidthfalse
+ \def\@p@sbbllx{}\def\@p@sbblly{}
+ \def\@p@sbburx{}\def\@p@sbbury{}
+ \def\@p@sheight{}\def\@p@swidth{}
+ \def\@p@srheight{}\def\@p@srwidth{}
+ \def\@p@sfile{}
+ \def\@p@scost{10}
+ \def\@sc{}
+ \@prologfilefalse
+ \@postlogfilefalse
+ \@clipfalse
+ \if@noisy
+ \@verbosetrue
+ \else
+ \@verbosefalse
+ \fi
+
+}
+%
+% Go through the options setting things up.
+%
+\def\parse@ps@parms#1{
+ \@psdo\@psfiga:=#1\do
+ {\expandafter\@setparms\@psfiga,}}
+%
+% Compute bb height and width
+%
+\newif\ifno@bb
+\newif\ifnot@eof
+\newread\ps@stream
+\def\bb@missing{
+ \if@verbose{
+ \typeout{psfig: searching \@p@sfile \space for bounding box}
+ }\fi
+ \openin\ps@stream=\@p@sfile
+ \no@bbtrue
+ \not@eoftrue
+ \catcode`\%=12
+ \loop
+ \read\ps@stream to \line@in
+ \global\toks200=\expandafter{\line@in}
+ \ifeof\ps@stream \not@eoffalse \fi
+ %\typeout{ looking at :: \the\toks200 }
+ \@bbtest{\toks200}
+ \if@bbmatch\not@eoffalse\expandafter\bb@cull\the\toks200\fi
+ \ifnot@eof \repeat
+ \catcode`\%=14
+}
+\catcode`\%=12
+\newif\if@bbmatch
+\def\@bbtest#1{\expandafter\@a@\the#1%%BoundingBox:\@bbtest\@a@}
+\long\def\@a@#1%%BoundingBox:#2#3\@a@{\ifx\@bbtest#2\@bbmatchfalse\else\@bbmatchtrue\fi}
+\long\def\bb@cull#1 #2 #3 #4 #5 {
+ \dimen100=#2 bp\edef\@p@sbbllx{\number\dimen100}
+ \dimen100=#3 bp\edef\@p@sbblly{\number\dimen100}
+ \dimen100=#4 bp\edef\@p@sbburx{\number\dimen100}
+ \dimen100=#5 bp\edef\@p@sbbury{\number\dimen100}
+ \no@bbfalse
+}
+\catcode`\%=14
+%
+\def\compute@bb{
+ \no@bbfalse
+ \if@bbllx \else \no@bbtrue \fi
+ \if@bblly \else \no@bbtrue \fi
+ \if@bburx \else \no@bbtrue \fi
+ \if@bbury \else \no@bbtrue \fi
+ \ifno@bb \bb@missing \fi
+ \ifno@bb \typeout{FATAL ERROR: no bb supplied or found}
+ \no-bb-error
+ \fi
+ %
+ \count203=\@p@sbburx
+ \count204=\@p@sbbury
+ \advance\count203 by -\@p@sbbllx
+ \advance\count204 by -\@p@sbblly
+ \edef\@bbw{\number\count203}
+ \edef\@bbh{\number\count204}
+ %\typeout{ bbh = \@bbh, bbw = \@bbw }
+}
+%
+% \in@hundreds performs #1 * (#2 / #3) correct to the hundreds,
+% then leaves the result in @result
+%
+\def\in@hundreds#1#2#3{\count240=#2 \count241=#3
+ \count100=\count240 % 100 is first digit #2/#3
+ \divide\count100 by \count241
+ \count101=\count100
+ \multiply\count101 by \count241
+ \advance\count240 by -\count101
+ \multiply\count240 by 10
+ \count101=\count240 %101 is second digit of #2/#3
+ \divide\count101 by \count241
+ \count102=\count101
+ \multiply\count102 by \count241
+ \advance\count240 by -\count102
+ \multiply\count240 by 10
+ \count102=\count240 % 102 is the third digit
+ \divide\count102 by \count241
+ \count200=#1\count205=0
+ \count201=\count200
+ \multiply\count201 by \count100
+ \advance\count205 by \count201
+ \count201=\count200
+ \divide\count201 by 10
+ \multiply\count201 by \count101
+ \advance\count205 by \count201
+ %
+ \count201=\count200
+ \divide\count201 by 100
+ \multiply\count201 by \count102
+ \advance\count205 by \count201
+ %
+ \edef\@result{\number\count205}
+}
+\def\compute@wfromh{
+ % computing : width = height * (bbw / bbh)
+ \in@hundreds{\@p@sheight}{\@bbw}{\@bbh}
+ %\typeout{ \@p@sheight * \@bbw / \@bbh, = \@result }
+ \edef\@p@swidth{\@result}
+ %\typeout{w from h: width is \@p@swidth}
+}
+\def\compute@hfromw{
+ % computing : height = width * (bbh / bbw)
+ \in@hundreds{\@p@swidth}{\@bbh}{\@bbw}
+ %\typeout{ \@p@swidth * \@bbh / \@bbw = \@result }
+ \edef\@p@sheight{\@result}
+ %\typeout{h from w : height is \@p@sheight}
+}
+\def\compute@handw{
+ \if@height
+ \if@width
+ \else
+ \compute@wfromh
+ \fi
+ \else
+ \if@width
+ \compute@hfromw
+ \else
+ \edef\@p@sheight{\@bbh}
+ \edef\@p@swidth{\@bbw}
+ \fi
+ \fi
+}
+\def\compute@resv{
+ \if@rheight \else \edef\@p@srheight{\@p@sheight} \fi
+ \if@rwidth \else \edef\@p@srwidth{\@p@swidth} \fi
+}
+%
+% Compute any missing values
+\def\compute@sizes{
+ \compute@bb
+ \compute@handw
+ \compute@resv
+}
+%
+% \psfig
+% usage : \psfig{file=, height=, width=, bbllx=, bblly=, bburx=, bbury=,
+% rheight=, rwidth=, clip=}
+%
+% "clip=" is a switch and takes no value, but the `=' must be present.
+\def\psfig#1{\vbox {
+ % do a zero width hard space so that a single
+ % \psfig in a centering enviornment will behave nicely
+ %{\setbox0=\hbox{\ }\ \hskip-\wd0}
+ %
+ \ps@init@parms
+ \parse@ps@parms{#1}
+ \compute@sizes
+ %
+ \ifnum\@p@scost<\@psdraft{
+ \if@verbose{
+ \typeout{psfig: including \@p@sfile \space }
+ }\fi
+ %
+ \special{ pstext="\@p@swidth \space
+ \@p@sheight \space
+ \@p@sbbllx \space \@p@sbblly \space
+ \@p@sbburx \space
+ \@p@sbbury \space startTexFig" \space}
+ \if@clip{
+ \if@verbose{
+ \typeout{(clip)}
+ }\fi
+ \special{ pstext="doclip \space"}
+ }\fi
+ \if@prologfile
+ \special{psfile=\@prologfileval \space } \fi
+ \special{psfile=\@p@sfile \space }
+ \if@postlogfile
+ \special{psfile=\@postlogfileval \space } \fi
+ \special{pstext=endTexFig \space }
+ % Create the vbox to reserve the space for the figure
+ \vbox to \@p@srheight true sp{
+ \hbox to \@p@srwidth true sp{
+ \hss
+ }
+ \vss
+ }
+ }\else{
+ % draft figure, just reserve the space and print the
+ % path name.
+ \vbox to \@p@srheight true sp{
+ \vss
+ \hbox to \@p@srwidth true sp{
+ \hss
+ \if@verbose{
+ \@p@sfile
+ }\fi
+ \hss
+ }
+ \vss
+ }
+ }\fi
+}}
+\def\psglobal{\typeout{psfig: PSGLOBAL is OBSOLETE; use psprint -m instead}}
+\catcode`\@=12\relax
+
diff --git a/Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.dtx b/Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.dtx
new file mode 100644
index 00000000000..346c207efc5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.dtx
@@ -0,0 +1,837 @@
+% \iffalse meta-comment, etc.
+%%
+%% Package `pst-fr3d.dtx'
+%%
+%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
+%%
+%% February 25, 2002
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory macros/latex/base/lppl.txt.
+%%
+%% DESCRIPTION:
+%% `pst-fr3d' is a PSTricks package to draw three dimensional grids
+%% with various customizations.
+%%
+% \fi
+%
+% \DoNotIndex{\\,\^,\@}
+% \DoNotIndex{\@ifnextchar,\@nameuse,\@nil,\@undefined}
+% \DoNotIndex{\advance}
+% \DoNotIndex{\begin}
+% \DoNotIndex{\catcode,\CodelineIndex,\csname}
+% \DoNotIndex{\def,\define@key,\definecolor,\divide,\DocInput}
+% \DoNotIndex{\documentclass,\dp}
+% \DoNotIndex{\edef,\else,\EnableCrossrefs,\end,\endcsname,\endinput}
+% \DoNotIndex{\endpspicture}
+% \DoNotIndex{\fi,\filedate,\fileversion}
+% \DoNotIndex{\GetFileInfo}
+% \DoNotIndex{\hbadness,\hbox,\hfuzz,\ht}
+% \DoNotIndex{\ifdim,\ifx,\input}
+% \DoNotIndex{\let}
+% \DoNotIndex{\message}
+% \DoNotIndex{\newhsbcolor,\newif}
+% \DoNotIndex{\OnlyDescription}
+% \DoNotIndex{\p@,\ProvidesPackage,\psframebox,\psframesep}
+% \DoNotIndex{\psline,\pslinewidth,\pspolygon,\psset,\PstAtCode,\pst@boxg}
+% \DoNotIndex{\pst@dima,\pst@dimb,\pst@dimc,\pst@dimd,\pst@dimh}
+% \DoNotIndex{\pst@dimtonum,\pst@expandafter,\pst@getnumiii,\pst@hbox}
+% \DoNotIndex{\pst@tempa,\pst@tempb,\pst@tempc,\pst@tempg,\pst@temph}
+% \DoNotIndex{\pst@tempi,\PSTricksLoaded}
+% \DoNotIndex{\RecordChanges,\relax}
+% \DoNotIndex{\setbox,\setkeys,\space}
+% \DoNotIndex{\the,\tw@}
+% \DoNotIndex{\usepackage}
+% \DoNotIndex{\wd}
+% \DoNotIndex{\z@}
+%
+% \setcounter{IndexColumns}{2}
+%
+% \newcommand{\PstFrameBoxThreeDPackage}{`\textsf{pst-fr3d}'}
+% \newcommand{\PstFrameBoxThreeDMacro}{\cs{PstFrameBoxThreeD}}
+% \newcommand{\ColorPackage}{`\textsf{color}'}
+% \newcommand{\PstColPackage}{`\textsf{pstricks}'}
+%
+% ^^A From ltugboat.cls
+%
+% ^^A Typeset the name of an environment
+% \providecommand\env[1]{\textsf{#1}}
+% \providecommand\clsname[1]{\textsf{#1}}
+% \providecommand\pkgname[1]{\textsf{#1}}
+% \providecommand\optname[1]{\textsf{#1}}
+% \providecommand\progname[1]{\textsf{#1}}
+%
+% ^^A A list of options for a package/class
+% \newenvironment{optlist}{\begin{description}%
+% \renewcommand\makelabel[1]{%
+% \descriptionlabel{\mdseries\optname{##1}}}%
+% \itemsep0.25\itemsep}%
+% {\end{description}}
+%
+% ^^A Utility macros
+%
+%
+% ^^A Example macros - adapted from the `fvrb-ex' package
+% ^^A ---------------------------------------------------
+%
+% ^^A Take care that we use here the four /?_W characters as escape
+% ^^A characters, so we can't use these characters in the examples!
+%
+% \makeatletter
+%
+% ^^A To highlight some verbatim sequences (comments, macro names, etc.)
+% \def\HLEmphasize#1{\textit{#1}}
+% \newcommand{\BS}{\texttt{\symbol{`\\}}}
+% \def\HLMacro#1{\BS{}def\HLMacro@i#1\@nil}
+% \def\HLMacro@i#1def#2\@nil{\HLReverse{#2}}
+% \def\HLReverse#1{{\setlength{\fboxsep}{1pt}\HLReverse@i{#1}}}
+% \def\HLReverse@i#1{\colorbox{black}{\textcolor{white}{\textbf{#1}}}}
+%
+% \def\Example{\FV@Environment{}{Example}}
+% \def\endExample{%
+% \end{VerbatimOut}
+% \Below@Example{\input{\jobname.tmp}}
+% \endgroup}
+%
+% \def\CenterExample{\FV@Environment{}{Example}}
+% \def\endCenterExample{%
+% \end{VerbatimOut}
+% \begin{center}
+% \Below@Example{\input{\jobname.tmp}}
+% \end{center}
+% \endgroup}
+%
+% \def\SideBySideExample{\FV@Environment{}{Example}}
+% \def\endSideBySideExample{%
+% \end{VerbatimOut}
+% \SideBySide@Example{\input{\jobname.tmp}}
+% \endgroup}
+%
+% \def\FVB@Example{%
+% \begingroup
+% \FV@UseKeyValues
+% \parindent=0pt
+% \multiply\topsep by 2
+% \VerbatimEnvironment
+% \begin{VerbatimOut}[gobble=4,codes={\catcode`\W=12}]{\jobname.tmp}}
+%
+% \def\Below@Example#1{%
+% \VerbatimInput[gobble=0,commentchar=W,commandchars=/?_,frame=single,
+% numbers=left,numbersep=3pt]{\jobname.tmp}
+% \catcode`\%=14\relax
+% \catcode`\W=9\relax
+% ^^A We suppress the effect of the highlighting macros
+% \catcode`/=0\relax
+% \catcode`?=1\relax
+% \catcode`_=2\relax
+% \def\HLEmphasize##1{##1}%
+% \def\HLMacro##1{##1}%
+% \def\HLReverse##1{##1}%
+% #1
+% \par}
+%
+% \def\SideBySide@Example#1{%
+% \vskip 1mm
+% \@tempdimb=\FV@XRightMargin
+% \advance\@tempdimb -5mm
+% \begin{minipage}[c]{\@tempdimb}
+% \fvset{xrightmargin=0pt}
+% \catcode`\%=14\relax
+% \catcode`\W=9\relax
+% ^^A We suppress the effect of the highlighting macros
+% \catcode`/=0\relax
+% \catcode`?=1\relax
+% \catcode`_=2\relax
+% \def\HLEmphasize##1{##1}%
+% \def\HLMacro##1{##1}%
+% \def\HLReverse##1{##1}%
+% #1
+% \end{minipage}%
+% \@tempdimb=\textwidth
+% \advance\@tempdimb -\FV@XRightMargin
+% \advance\@tempdimb 5mm
+% \begin{minipage}[c]{\@tempdimb}
+% \VerbatimInput[gobble=0,commentchar=W,commandchars=/?_,
+% frame=single,numbers=left,numbersep=3pt,
+% xleftmargin=5mm,xrightmargin=0pt]{\jobname.tmp}
+% \end{minipage}
+% \vskip 1mm}
+%
+% \makeatother
+%
+% ^^A End of example macros from `fvrb-ex'
+%
+% ^^A For the possible index and changes log
+% \setlength{\columnseprule}{0.6pt}
+%
+% ^^A Beginning of the documentation itself
+%
+% \title{The \PstFrameBoxThreeDPackage{} package\\
+% A PSTricks package\\
+% for three dimensional framed boxes}
+% \author{Denis \textsc{Girou}\thanks{CNRS/IDRIS ---
+% Centre National de la Recherche Scientifique /
+% Institut du D\'eveloppement et des Ressources en Informatique
+% Scientifique --- Orsay --- France ---
+% \mbox{\texttt{<Denis.Girou@idris.fr>}}.}}
+% \date{Version 1.0\\February 25, 2002\\
+% {\small Documentation revised February 25, 2002}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package allow to draw three dimensional framed boxes using the
+% macro \PstFrameBoxThreeDMacro. This is specially useful to draw 3d-like
+% buttons.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Introduction}
+%
+% \PstFrameBoxThreeDPackage{} offer a unique main macro with few parameters to
+% interact on it. This is just a small extension of the \cs{psframebox} macro.
+%
+% All the relevant PSTricks parameters can be use with it, but the
+% \texttt{linestyle}, \texttt{linecolor}, \texttt{doubleline} and
+% \texttt{doublecolor} ones must not be used, as they would be overridden.
+% Nevertheless, some usual parameters are not relevant for this kind of boxes
+% and would produce ``strange'' results (for instance \texttt{border},
+% \texttt{linearc} and \texttt{shadow}).
+%
+% As usual, \LaTeX{} users are supposed to have loaded the \PstColPackage{}
+% package before this one, to ensure the compatibility with the standard
+% \ColorPackage{} \LaTeX{} package.
+%
+% The syntax of the macro is the same than the one for the other macros for
+% framed boxes, so simply:
+%
+% \vspace{1mm}
+% \noindent%
+% \fbox{\PstFrameBoxThreeDMacro\texttt{[optional\_parameters]\{\emph{stuff}\}}}
+%
+% \vspace{1mm}
+% We can put all the valid material inside such 3d boxes, including other
+% framed boxes.
+%
+% Note also that, obviously, this documentation is very color oriented, and
+% is done to be read on a screen or a colored paper.
+%
+% \section{Usage}
+%
+% \subsection{Default behavior}
+%
+% The default behavior is the following:
+%
+% \begin{CenterExample}
+% \PstFrameBoxThreeD{Button}\hfill
+% \PstFrameBoxThreeD{\shortstack{Yes!\\Yes!\\Yes!}}\hfill
+% \PstFrameBoxThreeD{\Huge$\frac{1}{\sqrt{3}}$}%
+% \end{CenterExample}
+%
+% Of course, we can use all the relevant generic PSTricks parameters for the
+% framed boxes (but not those relative to \emph{double} lines), specially
+% those applying to boxes:
+%
+% \begin{CenterExample}
+% \PstFrameBoxThreeD[doublesep=0.1]{Button}\hfill
+% \PstFrameBoxThreeD[doublesep=0.2]{Button}\hfill
+% \PstFrameBoxThreeD[doublesep=0.5]{Button}%
+% \end{CenterExample}
+%
+% Specially look at the behavior of the \texttt{framesep},
+% \texttt{doublesep} and \texttt{linewidth} parameters:
+%
+% \begin{CenterExample}
+% \PstFrameBoxThreeD[framesep=0.3]{Button}\hfill
+% \PstFrameBoxThreeD[doublesep=0.3]{Button}\hfill
+% \PstFrameBoxThreeD[linewidth=0.3]{Button}\hfill
+% \PstFrameBoxThreeD[doublesep=0.3,linewidth=0.3]{Button}\hfill
+% \PstFrameBoxThreeD[framearc=0.5]{Button}%
+% \end{CenterExample}
+%
+% \subsection{Parameters}
+%
+% To change the way the boxes are drawn, we can also use \textbf{four}
+% specific parameters:
+%
+% \begin{optlist}
+% \item [FrameBoxThreeDColorHSB (real real real)]: to define the colors
+% used, in the HSB (\emph{hue}, \emph{saturation}, \emph{brightness}) model.
+% This is a sequence of three real values, separated by spaces. This will
+% define the color of the interior of the frame. And for the borders we will
+% use it too, changing it brightness in light and dark.
+%
+% Note also that if the \emph{brightness} value is negative, no color
+% will fill the interior of the box (this is useful if the general background
+% is not white).
+% (\emph{Default:~0~0~0.5} --- it must be three numbers between 0~and~1, but
+% as explained the last one can be negative, which has a special meaning).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \psset{doublesep=0.1}
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.1 0.3 0.5_]{%
+% Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_]{%
+% Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.4 0.1 0.5_]{%
+% \Huge$\frac{1}{\sqrt{3}}$}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.9 0.5 0.5_]{%
+% \psovalbox[fillstyle=solid,fillcolor=yellow]{Button}}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.4 0.7 0.2_]{%
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.4 0.7 0.5_]{%
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.4 0.7 0.8_]{%
+% Button}}}%
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \psset{doublesep=0.2}
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0 0 0.3_]{Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0 0 0.7_]{Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0 0 -1_]{Button}\hfill
+% \definecolor{MyGray}{gray}{0.85}
+% \psframe*[linecolor=MyGray](-0.3,-0.65)(2.1,0.9)
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0 0 -1_]{Button}%
+% \end{CenterExample}
+%
+% \begin{SideBySideExample}[xrightmargin=3cm]
+% \PstFrameBoxThreeD%
+% [linewidth=0.2,
+% /HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.3 0.2 0.5_]{%
+% \Huge\textcolor{white}{\textbf{21}}}
+% \end{SideBySideExample}
+%
+% \begin{optlist}
+% \item [FrameBoxThreeDOn (boolean)]: to simulate an ON / OFF button, by
+% exchange of the dark and light colors of the borders (this will give the
+% same result that to use a negative value for the
+% \texttt{FrameBoxThreeDBrightnessDistance} parameter)
+% (\emph{Default:~true}).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.1 0.9 0.5_]{%
+% Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.1 0.9 0.5_,
+% /HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_]{Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.1 0.9 0.5_,
+% /HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_,linewidth=0.2]{Button}%
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \PstFrameBoxThreeD[linewidth=0.5,/HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_,
+% /HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.8 0.5 0.5_]{%
+% \Large\textcolor{yellow}{\textbf{This is your last chance...}}}
+% \end{CenterExample}
+%
+% \begin{optlist}
+% \item [FrameBoxThreeDOpposite (boolean)]: to use the same color for the
+% left and right borders, and the same other for the bottom and top ones, or
+% rather for left and top and right and bottom.
+% (\emph{Default:~false}).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \psset{linewidth=0.2}
+% \newcommand{\Button}{\textcolor{white}{\textbf{Button}}}
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.7 0.8 0.8_]{%
+% \Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.7 0.8 0.8_,
+% /HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_]{\Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.7 0.8 0.8_,
+% /HLEmphasize?FrameBoxThreeDOpposite_=/HLReverse?true_]{\Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.7 0.8 0.8_,
+% /HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_,
+% /HLEmphasize?FrameBoxThreeDOpposite_=/HLReverse?true_]{\Button}%
+% \end{CenterExample}
+%
+% \begin{optlist}
+% \item [FrameBoxThreeDBrightnessDistance (real)]: the distance brightness
+% of the color used to fill the interior of the box. If this is a negative
+% number, we will got the same effect that the one of setting
+% \texttt{FrameBoxThreeDOn} to false. And if it value is 0, the borders will
+% have obviously the same color that the interior.
+% (\emph{Default:~0.15} --- it must be a number between -0.5~and~0.5, but the
+% \emph{brightness} plus and minus it must stay between 0~and~1).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \psset{doublesep=0.2}
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_]{%
+% Button}\hfill % /HLEmphasize?Default = 0.15_
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_,
+% /HLEmphasize?FrameBoxThreeDBrightnessDistance_=/HLReverse?0.3_]{%
+% Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_,
+% /HLEmphasize?FrameBoxThreeDBrightnessDistance_=/HLReverse?0.5_]{%
+% Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.7_,
+% /HLEmphasize?FrameBoxThreeDBrightnessDistance_=/HLReverse?0.3_]{%
+% Button}\hfill
+% \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_,
+% /HLEmphasize?FrameBoxThreeDBrightnessDistance_=/HLReverse?-0.2_]{%
+% Button}%
+% \end{CenterExample}
+%
+% \section{Examples}
+%
+% We give here more advanced examples.
+%
+% \begin{CenterExample}
+% \psset{doublesep=0.12}
+% \multido{\nButtonA=0.1+0.4}{3}{%
+% \multido{\nButtonB=0+0.05}{11}{%
+% \PstFrameBoxThreeD%
+% [FrameBoxThreeDColorHSB=\nButtonA\space 0.5 0.5,
+% FrameBoxThreeDBrightnessDistance=\nButtonB]{OK}}\\}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \psset{doublesep=0.05}
+% \multido{\nButtonA=0+0.1}{11}{%
+% \multido{\nButtonB=0+0.05}{21}{%
+% \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=%
+% \nButtonB\space \nButtonA\space 0.8]{\$}}\\}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \psset{gradmidpoint=1,gradangle=90}
+% \psdblframebox[framesep=0.3,fillstyle=gradient,
+% gradbegin=yellow,gradend=LemonChiffon]{%
+% \shortstack[l]{%
+% \makebox[8cm]{\LARGE\textbf{Introduction}\dotfill}\\
+% {\Large by Catherine \textsc{Parker}}\hfill
+% \raisebox{5.5mm}{%
+% \PstFrameBoxThreeD[linewidth=0.15,
+% FrameBoxThreeDColorHSB=0.3 0.2 0.5]{%
+% \LARGE\textcolor{white}{3}}}}}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \psshadowbox[framesep=0.3,fillstyle=gradient,
+% gradbegin=Orange,gradend=yellow]{%
+% \setlength{\tabcolsep}{0mm}%
+% \begin{tabular}{ll}
+% \makebox[10cm]{%
+% \LARGE\textbf{Description of the problem\dotfill}} &
+% \raisebox{-5mm}{%
+% \PstFrameBoxThreeD[linewidth=0.15,
+% FrameBoxThreeDColorHSB=0.9 0.5 0.5]{%
+% \LARGE\textcolor{white}{\textbf{25}}}}\\[-3mm]
+% \textcolor{red}{\large by Helen \textsc{Mitchell}
+% and Ann \textsc{Cartridge}}
+% \end{tabular}}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \newcommand{\MyNode}[2]{%
+% \TR{\PstFrameBoxThreeD[linewidth=0.1,FrameBoxThreeDOn=#2,
+% FrameBoxThreeDColorHSB=0.2 0.4 0.5,
+% FrameBoxThreeDBrightnessDistance=0.2]{#1}}}
+% \renewcommand{\psedge}[2]{\ncangle{#2}{#1}}
+%
+% \psset{angleB=-90,angleA=90,levelsep=2,treesep=3}
+% \pstree{\MyNode{Richard}{true}}
+% {\pstree{\MyNode{Paul}{true}}
+% {\pstree{\MyNode{Jack}{true}}
+% {\MyNode{Michel}{false}}
+% \MyNode{Adam}{false}}
+% \MyNode{Herbert}{false}}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \newcommand{\EntryA}[1]{%
+% \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=0.4 0.6 0.5]{%
+% \makebox[2.2cm]{#1}}}
+% \newcommand{\EntryB}[1]{%
+% \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=0.16 1 0.8]{%
+% \makebox[0.5cm]{#1}}}
+% \newcommand{\EntryC}[1]{%
+% \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=0.7 0.2 0.8]{%
+% \makebox[1.4cm]{#1}}}
+% \newcommand{\EntryD}[1]{%
+% \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=0.9 0.5 0.5]{%
+% \makebox[1.4cm]{#1}}}
+%
+% \begin{table}[htbp]
+% \centering
+% \large\bfseries
+% \setlength{\tabcolsep}{5mm}%
+% \setlength{\belowcaptionskip}{3mm}%
+% \caption{Results of the year}
+% \PstFrameBoxThreeD[framesep=0.4,doublesep=0.5,
+% FrameBoxThreeDColorHSB=0.3 0.2 0.4]{%
+% \psset{framesep=0.3,doublesep=0.2}%
+% \begin{tabular}{lrr}
+% \\
+% \EntryA{1st Quarter}&\EntryB{723}& \\[1.5cm]
+% \EntryA{2nd Quarter}&\EntryB{819}&\EntryC{+13 \%} \\[1.5cm]
+% \EntryA{3rd Quarter}&\EntryB{687}&\EntryD{--16.1 \%}\\[1.5cm]
+% \EntryA{4th Quarter}&\EntryB{894}&\EntryC{+30.1 \%} \\[1cm]
+% \end{tabular}}
+% \end{table}
+% \end{CenterExample}
+%
+%
+% \StopEventually{}
+%
+% ^^A .................... End of the documentation part ....................
+%
+% \section{Driver file}
+%
+% The next bit of code contains the documentation driver file for \TeX{},
+% i.e., the file that will produce the documentation you are currently
+% reading. It will be extracted from this file by the \texttt{docstrip}
+% program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{pst-fr3d.dtx}
+\usepackage{fancyvrb}
+\usepackage{multido}
+\usepackage{pstricks}
+\usepackage{pst-fr3d}
+\usepackage{pst-grad}
+\usepackage{pst-tree}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\OnlyDescription % Comment it for implementation details
+\hbadness=7000 % Over and under full box warnings
+\hfuzz=3pt
+\definecolor{LemonChiffon}{rgb}{1.,0.98,0.8}
+\definecolor{Orange} {rgb}{1.,0.65,0.}
+\definecolor{Pink} {rgb}{1.,0.75,0.8}
+\begin{document}
+ \DocInput{pst-fr3d.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% \section{\PstFrameBoxThreeDPackage{} \LaTeX{} wrapper}
+%
+% \begin{macrocode}
+%<*latex-wrapper>
+\ProvidesPackage{pst-fr3d}[2002/02/25 package wrapper for PSTricks pst-fr3d.tex]
+\input pst-fr3d.tex
+%</latex-wrapper>
+% \end{macrocode}
+%
+% \section{\PstFrameBoxThreeDPackage{} code}
+%
+% \begin{macrocode}
+%<*pst-fr3d>
+% \end{macrocode}
+%
+% \subsection{Preambule}
+%
+% Who we are.
+%
+% \begin{macrocode}
+\csname PstFrameBoxThreeDLoaded\endcsname
+\let\PstFrameBoxThreeDLoaded\endinput
+% \end{macrocode}
+%
+% Require the PSTricks package.
+%
+% \begin{macrocode}
+\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
+% \end{macrocode}
+%
+% David \textsc{Carlisle} interface to the `\textsf{keyval}' package.
+%
+% \begin{macrocode}
+\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
+% \end{macrocode}
+%
+% Catcodes changes.
+%
+% \begin{macrocode}
+\edef\PstAtCode{\the\catcode`\@}
+\catcode`\@=11\relax
+\pst@addfams{pst-fr3d}
+\def\fileversion{1.01}
+\def\filedate{2004/11/14}
+\message{`Pst-FrameBox3d' v\fileversion, \filedate\space (Denis Girou)}
+% \end{macrocode}
+%
+% \subsection{Definition of the parameters}
+%
+% \texttt{FrameBoxThreeDOn} to draw the 3d framed box with an ON / OFF
+% effect.
+%
+% \begin{macrocode}
+\newif\ifPstFrameBoxThreeD@On
+\define@key[psset]{pst-fr3d}{FrameBoxThreeDOn}[true]{\@nameuse{PstFrameBoxThreeD@On#1}}
+% \end{macrocode}
+%
+% \texttt{FrameBoxThreeDOpposite} to use the same colors for the opposite
+% sides or the contiguous ones.
+%
+% \begin{macrocode}
+\newif\ifPstFrameBoxThreeD@Opposite
+\define@key[psset]{pst-fr3d}{FrameBoxThreeDOpposite}[true]{%
+\@nameuse{PstFrameBoxThreeD@Opposite#1}}
+% \end{macrocode}
+%
+% \texttt{FrameBoxThreeDColorHSB} to define the colors used, in the HSB
+% (\emph{hue}, \emph{saturation}, \emph{brightness}) model. This is a sequence
+% of three real values, separated by spaces. This will define the color of the
+% interior of the frame. And for the borders we will use it too, changing it
+% brightness in light and dark.
+%
+% \begin{macrocode}
+\define@key[psset]{pst-fr3d}{FrameBoxThreeDColorHSB}{%
+\PstFrameBoxThreeD@ColorHSB@i#1\@nil}
+\def\PstFrameBoxThreeD@ColorHSB@i#1\@nil{%
+\pst@expandafter\pst@getnumiii{#1} {} {} {} {}\@nil
+\edef\PstFrameBoxThreeD@Hue{\pst@tempg}%
+\edef\PstFrameBoxThreeD@Saturation{\pst@temph}%
+\edef\PstFrameBoxThreeD@Brightness{\pst@tempi}}
+% \end{macrocode}
+%
+% \texttt{FrameBoxThreeDBrightnessDistance} to define the brightness
+% distance between the brightness used for the material of the box
+% (\texttt{BrightnessC}) and the two brightnesss used for the borders
+% (\texttt{BrightnessA} and \texttt{BrightnessB}): \texttt{BrightnessA} =
+% \texttt{BrightnessC} + \texttt{FrameBoxThreeDBrightnessDistance} and
+% \texttt{BrightnessB} = \texttt{BrightnessC} --
+% \texttt{FrameBoxThreeDBrightnessDistance}. It can be a negative number. And
+% if the brightness is negative, we will use a value of 0.5 to compute the two
+% other colors.
+%
+% \begin{macrocode}
+\define@key[psset]{pst-fr3d}{FrameBoxThreeDBrightnessDistance}{%
+\edef\PstFrameBoxThreeD@BrightnessDistance{#1}}
+% \end{macrocode}
+%
+% Next, we set the default values for all these new parameters.
+%
+% \begin{macrocode}
+\psset{%
+ FrameBoxThreeDOn=true,FrameBoxThreeDOpposite=false,
+ FrameBoxThreeDColorHSB=0 0 0.5,FrameBoxThreeDBrightnessDistance=0.15}%
+% \end{macrocode}
+%
+% \subsection{Main macro}
+%
+% The general \cs{PstFrameBoxThreeD} macro to draw three dimensional boxed
+% frames.
+%
+% \begin{macro}{\PstFrameBoxThreeD}
+% \begin{macrocode}
+\def\PstFrameBoxThreeD{%
+\@ifnextchar[{\PstFrameBoxThreeD@i}{\PstFrameBoxThreeD@i[]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstFrameBoxThreeD@i}
+% \begin{macrocode}
+\def\PstFrameBoxThreeD@i[#1]#2{{%
+% \end{macrocode}
+%
+% We force ``dimmen=middle''.
+%
+% \begin{macrocode}
+\psset{dimen=middle}%
+% \end{macrocode}
+%
+% Then we set the local changes of parameters.
+%
+% \begin{macrocode}
+\psset{#1}%
+% \end{macrocode}
+%
+%
+% If the brightness is negative, the interior of the frame will not be
+% filled with color, and a value of 0.5 will be used to compute the two colors
+% of the borders.
+%
+% \begin{macrocode}
+\ifdim\PstFrameBoxThreeD@Brightness\p@<\z@%
+ \def\PstFrameBoxThreeD@FillStyle{none}%
+ \def\pst@tempa{0.5}%
+\else
+ \def\PstFrameBoxThreeD@FillStyle{solid}%
+ \def\pst@tempa{\PstFrameBoxThreeD@Brightness}%
+\fi
+% \end{macrocode}
+%
+% Computation of the colors of the borders.
+%
+% \begin{macrocode}
+\pst@dimh=\pst@tempa\p@
+\advance\pst@dimh\PstFrameBoxThreeD@BrightnessDistance\p@
+\pst@dimtonum{\pst@dimh}{\pst@tempb}%
+\advance\pst@dimh-\PstFrameBoxThreeD@BrightnessDistance\p@
+\advance\pst@dimh-\PstFrameBoxThreeD@BrightnessDistance\p@
+\pst@dimtonum{\pst@dimh}{\pst@tempc}%
+% \end{macrocode}
+%
+% If the \ColorPackage{} \LaTeX{} package was not loaded (using the
+% \PstColPackage{} compatibility package which is hightly recommanded for
+% \LaTeX{} users), we will use the PSTricks color model.
+%
+% \begin{macrocode}
+\ifx\definecolor\@undefined
+ \newhsbcolor{PstFrameBoxThreeD@ColorC}{%
+ \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempa}%
+ \ifPstFrameBoxThreeD@On
+ \newhsbcolor{PstFrameBoxThreeD@ColorA}{%
+ \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempc}%
+ \newhsbcolor{PstFrameBoxThreeD@ColorB}{%
+ \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempb}%
+ \else
+ \newhsbcolor{PstFrameBoxThreeD@ColorA}{%
+ \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempb}%
+ \newhsbcolor{PstFrameBoxThreeD@ColorB}{%
+ \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempc}%
+ \fi
+% \end{macrocode}
+%
+% If the \ColorPackage{} \LaTeX{} package was loaded, we will use it as
+% color model.
+%
+% \begin{macrocode}
+\else
+ \definecolor{PstFrameBoxThreeD@ColorC}{hsb}{%
+ \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempa}%
+ \ifPstFrameBoxThreeD@On
+ \definecolor{PstFrameBoxThreeD@ColorA}{hsb}{%
+ \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempc}%
+ \definecolor{PstFrameBoxThreeD@ColorB}{hsb}{%
+ \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempb}%
+ \else
+ \definecolor{PstFrameBoxThreeD@ColorA}{hsb}{%
+ \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempb}%
+ \definecolor{PstFrameBoxThreeD@ColorB}{hsb}{%
+ \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempc}%
+ \fi
+\fi
+% \end{macrocode}
+%
+% Now, we can \emph{really} draw the box and the borders.
+%
+% No lines here.
+%
+% \begin{macrocode}
+\psset{linestyle=none}%
+% \end{macrocode}
+%
+% We draw the material in a standard \cs{psframebox} macro, defining
+% \texttt{doubleline} to \texttt{true}, to compute correctly the bounding box
+% of the box with it borders.
+%
+% \begin{macrocode}
+\psframebox[fillstyle=\PstFrameBoxThreeD@FillStyle,
+ fillcolor=PstFrameBoxThreeD@ColorC,doubleline=true]{#2}%
+% \end{macrocode}
+%
+% We save the material to frame in an internal box, without the size of it
+% borders.
+%
+% \begin{macrocode}
+\setbox\pst@boxg=\hbox{\psframebox{#2}}%
+% \end{macrocode}
+%
+% Then we save in another internal box the same thing, this time with the
+% size of it borders.
+%
+% \begin{macrocode}
+\setbox\pst@hbox=\hbox{\psframebox[doubleline=true]{#2}}%
+% \end{macrocode}
+%
+% We compute the four internal coordinates for the borders.
+%
+% \begin{macrocode}
+\pst@dima=\wd\pst@hbox
+\advance\pst@dima-\wd\pst@boxg
+\divide\pst@dima\tw@
+% \end{macrocode}
+%
+% \begin{macrocode}
+\pst@dimb=\pst@dima
+% \end{macrocode}
+%
+% \begin{macrocode}
+\advance\pst@dima\wd\pst@boxg
+% \end{macrocode}
+%
+% Now, we can draw the borders, of course in a \texttt{solid} mode.
+%
+% \begin{macrocode}
+\psset{fillstyle=solid}%
+% \end{macrocode}
+%
+% We draw first the left then the top borders.
+%
+% \begin{macrocode}
+\pspolygon[fillcolor=PstFrameBoxThreeD@ColorA]
+ (-\wd\pst@hbox,-\dp\pst@hbox)(-\pst@dima,-\dp\pst@boxg)
+ (-\pst@dima,\ht\pst@boxg)(-\wd\pst@hbox,\ht\pst@hbox)
+\pspolygon[fillcolor=PstFrameBoxThreeD@ColorB]
+ (-\wd\pst@hbox,\ht\pst@hbox)(-\pst@dima,\ht\pst@boxg)
+ (-\pst@dimb,\ht\pst@boxg)(0,\ht\pst@hbox)
+% \end{macrocode}
+%
+% We must compute the colors of the two other borders.
+%
+% \begin{macrocode}
+\ifPstFrameBoxThreeD@Opposite
+ \def\pst@tempa{PstFrameBoxThreeD@ColorA}%
+ \def\pst@tempb{PstFrameBoxThreeD@ColorB}%
+\else
+ \def\pst@tempa{PstFrameBoxThreeD@ColorB}%
+ \def\pst@tempb{PstFrameBoxThreeD@ColorA}%
+\fi
+% \end{macrocode}
+%
+% Now, we draw the right then the bottom borders.
+%
+% \begin{macrocode}
+\pspolygon[fillcolor=\pst@tempa]
+ (0,-\dp\pst@hbox)(-\pst@dimb,-\dp\pst@boxg)
+ (-\pst@dimb,\ht\pst@boxg)(0,\ht\pst@hbox)
+\pspolygon[fillcolor=\pst@tempb]
+ (-\wd\pst@hbox,-\dp\pst@hbox)(-\pst@dima,-\dp\pst@boxg)
+ (-\pst@dimb,-\dp\pst@boxg)(0,-\dp\pst@hbox)
+% \end{macrocode}
+%
+% And, to finish, a dark oblique line in the middle of the light border and
+% a light oblique line in the middle of the dark border, if the identical
+% colors are contiguous.
+%
+% \begin{macrocode}
+\ifPstFrameBoxThreeD@Opposite
+\else
+ \psset{linestyle=solid,linewidth=0.2pt,arrows=cc-cc}%
+ \psline[linecolor=PstFrameBoxThreeD@ColorA]
+ (-\pst@dimb,\ht\pst@boxg)(0,\ht\pst@hbox)
+ \psline[linecolor=PstFrameBoxThreeD@ColorB]
+ (-\wd\pst@hbox,-\dp\pst@hbox)(-\pst@dima,-\dp\pst@boxg)
+\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Closing}
+%
+% Catcodes restoration.
+%
+% \begin{macrocode}
+\catcode`\@=\PstAtCode\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pst-fr3d>
+% \end{macrocode}
+%
+% \Finale
+% \PrintIndex
+% \PrintChanges
+%
+\endinput
+%%
+%% End of file `pst-fr3d.dtx'
diff --git a/Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.ins b/Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.ins
new file mode 100644
index 00000000000..9bcc8406cf9
--- /dev/null
+++ b/Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.ins
@@ -0,0 +1,37 @@
+%% `pst-fr3d.ins'
+%%
+%% Docstrip installation instruction file for docstyle `pst-fr3d'
+%%
+%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
+%%
+%% February 25, 2002
+
+\def\batchfile{pst-fr3d.ins}
+\input docstrip.tex
+\keepsilent
+\Msg{*** Generating the `pst-fr3d' package ***}
+\askforoverwritefalse
+\generate{\file{pst-fr3d.tex}{\from{pst-fr3d.dtx}{pst-fr3d}}}
+\generate{\file{pst-fr3d.sty}{\from{pst-fr3d.dtx}{latex-wrapper}}}
+
+\ifToplevel{%
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the files}
+\Msg{* pst-fr3d.sty and pst-fr3d.tex in a directory/folder searched by TeX.}
+\Msg{*}
+\Msg{* To produce the documentation, run the file `pst-fr3d.dtx'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* If you require the commented code, desactivating the}
+\Msg{* OnlyDescription macro, you must recompile, execute:}
+\Msg{* `makeindex -s gind.ist pst-fr3d'}
+\Msg{* `makeindex -s gglo.ist -o pst-fr3d.gls pst-fr3d.glo'}
+\Msg{* and recompile.}
+\Msg{*}
+\Msg{***********************************************************}
+}
+
+\endinput
+%%
+%% End of file `pst-fr3d.ins'
diff --git a/Master/texmf-dist/source/generic/realcalc/readme b/Master/texmf-dist/source/generic/realcalc/readme
new file mode 100644
index 00000000000..aa152337fb9
--- /dev/null
+++ b/Master/texmf-dist/source/generic/realcalc/readme
@@ -0,0 +1,39 @@
+realcalc.tex
+
+(Copyright) Frank Buchholz, Jan. 1993
+e-mail: buchholz@lusty.informatik.uni-dortmund.de
+
+Real arithmetic with big values and high precision.
+Calculations are done with 9 decimal digits.
+Usable with TeX and LaTeX.
+
+Files:
+ readme This file
+ realcalc.tex You have to \input realcalc.tex to use it.
+ realdemo.tex Demo with LaTeX.
+ realtest.tex Demo with TeX (Type \test\bye after the prompt)
+
+Installation:
+ Put the file realcalc.tex where your TeX looks for inputs.
+ Name a copy realcalc.sty to use as a LaTeX style option,
+ or create a file realcalc.sty with the lines:
+ \input realcalc.tex
+ \endinput
+
+Documentation:
+ Use following command to extract the documentation:
+ grep %% realcalc.tex
+
+COPYING:
+ Copying of part or all of this file is allowed under the following
+ conditions only:
+ (1) You may freely distribute unchanged copies of the files. You have
+ to include this file when you do so.
+ (2) You may modify a renamed copy of the files, but only for personal
+ use or use within an organization.
+ (3) You may copy fragments from the files, for personal use or for
+ distribution, as long as credit is given where credit is due.
+
+ You are NOT ALLOWED to take money for the distribution or use of
+ this file or modified versions or fragments thereof, except for
+ a nominal charge for copying etc.
diff --git a/Master/texmf-dist/source/generic/ruhyphen/BUGS b/Master/texmf-dist/source/generic/ruhyphen/BUGS
new file mode 100644
index 00000000000..84456e41f64
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/BUGS
@@ -0,0 +1,75 @@
+-*-coding: koi8-r;-*-
+
+1) the following command shows useless (because of \lefthyphenmin=2)
+or incorrect patterns which set hyphenation after the first letter:
+
+grep '^\..[0-9]' ruhyph*.tex
+
+ruhyphas.tex:
+.×8Ó8Ô8Ò8
+.Ï5×Ø4
+.Ï4Ô×ÅÒÄ
+.Ï4Ô×ÅÒÖÄ
+
+2) the following command shows useless (because of \righthyphenmin=2)
+or incorrect patterns which set hyphenation before the last letter:
+
+grep '[0-9].\.$' ruhyph*.tex
+
+ruhyphas.tex:
+.ÕÌØ5Å.
+.Ä×Ï5Å6Ë.
+
+3) the patterns for the whole words shown by the command
+
+grep '^\..*\.$' ruhyph*.tex
+
+are also questionable (probably it is better to store them in
+\hyphenation list). Such patterns occur in ruhyphas.tex and
+ruhyphzn.tex.
+
+4) the following command will show patterns which contain letter
+combinations absent in the full dictionary:
+
+./reduce-patt < ruhyphXX.tex | diff - ruhyphXX.tex | perl -n -e 'print if (s/^> //)'
+
+where XX should be replaced accordingly, and it is assumed that the
+script `reduce-patt' refers to the full lowercased wordlist (e.g.
+generated from the rus-ispell dictionary by Alexander Lebedev).
+
+There may be 3 reasons for such `wrong' patterns:
+
+ a) there are no existing words which could be influenced by these
+ patterns. In this case, such patterns should be removed.
+
+ b) the pattern corresponds to the word with letter `cyre', but
+ the orthographically-correct word uses the letter `cyryo'.
+ In this case, the pattern should be leaved, because it
+ corresponds to the (relatively common) case when `cyryo' is
+ replaced by `cyre'.
+
+ c) the patterns are correct (correspond to existing words), but
+ the dictionary does not contain such words. In this case, the
+ dictionary should be supplemented.
+
+5) to ensure that there will be absolutely no -xx breaks for English
+words when the combined Russian-English hyphenation is used, a changed
+English patterns should be used, with removed `strange' patterns
+matching the regexp "[0-9][a-z][a-z]\." (see the file enrhm2.tex).
+
+6) [not a bug] should the main hyphenation files be sorted using
+`sorthyph' script?
+
+7) Known cases of bad hyphenation (to be fixed by authors of
+corresponding patterns). All found hyphenation positions are shown.
+Bad positions are marked with `='. Please send additional examples of
+bad hyphenation for various patterns in this collection to email
+addresses given at the end of README. See also some other examples
+in the release notes of Alexander Lebedev's patterns in the file
+README.ruhyphal.
+
+ruhyphas.tex:
+
+ ÓÉÎ-È-ÒÏÔ=ÒÏÎ-ÎÙÊ
+ ÍÅ=ÖÁ=ÔÏÍ-ÎÙÊ
+ ÐÏÄ-Ô×ÅÒÖ=ÄÁ-ÀÔ
diff --git a/Master/texmf-dist/source/generic/ruhyphen/Makefile b/Master/texmf-dist/source/generic/ruhyphen/Makefile
new file mode 100644
index 00000000000..ab1ec67813a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/Makefile
@@ -0,0 +1,10 @@
+PATTERNS = al as ct dv mg vl zn
+CYRYO = $(patsubst %,cyryo%.tex,$(PATTERNS))
+
+cyryo: $(CYRYO)
+
+distclean:
+ rm -f $(CYRYO)
+
+cyryo%.tex: ruhyph%.tex
+ ./mkcyryo $< > $@
diff --git a/Master/texmf-dist/source/generic/ruhyphen/README b/Master/texmf-dist/source/generic/ruhyphen/README
new file mode 100644
index 00000000000..a490b42259d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/README
@@ -0,0 +1,368 @@
+-*-coding: koi8-r;-*-
+
+ ruhyphen package
+ (Collection of Russian hyphenation patterns)
+
+ Version 1.7 (March 23, 2003)
+
+
+This package contains hyphenation patterns for Russian language,
+which can be used for various Cyrillic font encodings. It contains
+all Russian hyphenation patterns we know of (currently, these are
+seven different patterns, --- see below), so you can choose your
+favorite pattern. :-)
+
+Copyright notice and distribution conditions are given in the
+beginning of the file `ruhyphen.tex'. It applies to all *.tex files
+in this package (listed below). Note that seven pattern files
+(ruhyph*.tex, except ruhyphen.tex) are copyrighted by their
+authors.
+
+Thus, all patterns are freely distributable.
+
+To install, copy all *.tex files to your texmf tree. For example,
+create a directory $TEXMF/tex/generic/ruhyphen/ and put all *.tex
+files there.
+
+Before creating a format file, edit the file ruhyphen.tex and select
+the pattern and font encoding to use (see below for the list of
+patterns and supported font encodings).
+
+Usually, hyphenation setup is based on file `hyphen.cfg' which loads
+hyphenation patterns in proper encodings for languages which you will
+use. It is highly recommended to install BABEL package which provides
+a unified mechanism for hyphenation configurations, and comes with
+it's own `hyphen.cfg'. This is recommended not only to LaTeX users,
+but also if you will use a `cyrplain' bundle of the T2 package to
+`russify' plain TeX-based formats.
+
+You have two options: either use patterns for Russian language in
+separate TeX \language (so to get proper hyphenation you must switch
+languages explicitly in your documents using commands like \Russian,
+\English, \French, etc), or use one `combined' Russian-English
+language. If you will use only Russian and English languages in your
+documents, the latter option is more convenient (in this case, there
+will be no need to switch between Russian and English languages to get
+proper hyphenation). This option is recommended especially for
+Plain-TeX based macro packages: Plain TeX, AMS-TeX, Texinfo, BLUe TeX,
+etc; it can be convenient for LaTeX as well, if you mostly typeset
+bilingual Russian-English documents.
+
+In case of using BABEL's mechanism of hyphenation setup, edit the file
+language.dat (it is part of BABEL, and could usually be found in the
+`tex/generic/config' directory of the TDS-compliant TEXMF tree). In
+the case of using separate languages, use `ruhyphen.tex' as the
+Russian hyphenation file, i.e. put the following lines:
+
+english hyphen
+russian ruhyphen
+
+For combined Russian-English patterns, use `ruenhyph.tex' as the
+hyphenation file, i.e. put the following lines:
+
+ruseng ruenhyph
+=russian
+=english
+
+In both cases, lines for other languages could be commented or leaved
+depending on your needs.
+
+Note that it is better in general to have original English patterns
+preloaded for the default language, so you may use also the following:
+
+english hyphen
+ruseng ruenhyph
+=russian
+
+In this case, documents in English will be hyphenated exactly as they
+should, and English fragments inside a Russian text will be hyphenated
+as close as possible to this. This variant requires, however, more TeX
+memory for patterns, and you should not forget to switch \language to
+Russian when needed (using babel with `russian' as the last option
+will do this automatically).
+
+If you refuse to install BABEL, you can create your own `hyphen.cfg'
+file containing e.g. the following lines:
+
+----------------------------------------------------------------------
+%\def\English{\language0 }
+%\def\Russian{\language1 }
+%\English
+\input hyphen
+%\Russian
+\input ruhyphen
+\lefthyphenmin=2 \righthyphenmin=2 % disallow x- or -x breaks; -xx OK
+%\English
+%\lefthyphenmin=2 \righthyphenmin=3 % disallow x- or -xx breaks
+----------------------------------------------------------------------
+
+or simply
+
+----------------------------------------------------------------------
+\input ruenhyph
+----------------------------------------------------------------------
+
+Basically, if you need to typeset multilingual documents, --- you
+should use LaTeX and T2* Cyrillic encodings. :-)
+
+Note that, when running the file ruhyphen.tex (or ruenhyph.tex)
+through TeX, the only global effect is execution of \patterns (and
+\hyphenation for exceptions) for the current language, and also
+setting the \lefthyphenmin and \righthyphenmin to 2. In particular,
+no global changes of \lccode, \uccode, \catcode, etc. values are
+made. So, to activate hyphenation, you have to set (at least) the
+\lccode values for lowercase and uppercase Russian letters globally in
+your TeX file to match the font encoding (and maybe also make other
+settings, like \uccode and \sfcode). This is usually done in separate
+packages (where those font encodings are defined).
+
+Files in this package are organized in a very flexible and compact
+way, sharing the same hyphenation pattern files for different font
+encodings. Thus, having (currently available) seven different patterns
+and five different font encodings, we have 7*5=35 different possible
+combinations of pattern and encoding (which is specified in the file
+ruhyphen.tex), or, adding also combined `Russian-English' patterns
+(loaded via ruenhyph.tex), we have 70 different combinations
+supported! It is very easy to add the support for any new pattern or
+font encoding, --- just add an additional file ruhyph<pattern>.tex for
+new patterns (and generate the corresponding file cyryo<pattern>.tex
+using `mkcyryo' script), or a file koi2<encoding>.tex for new
+encoding, and add corresponding lines to `ruhyphen.tex'.
+
+Descriptions of files:
+
+1) main hyphenation files
+
+These are Russian hyphenation patterns created by different people.
+Some patterns were generated with `patgen', some were created
+manually. The quality of all patterns is comparable. Nevertheless, for
+the highest quality of hyphenation we recommend using ruhyphal.tex
+(which is switched on by default). The patterns are stored in koi8-r
+Cyrillic encoding (in a form both compact and convenient for reading
+and editing by humans), but we provide a means for re-encoding of
+patterns (using some TeX hackery) to any desired font encoding (see
+below), so there is no need to modify these main files. All patterns
+were (re)named according to the standard scheme ruhyph*.tex, where `*'
+denotes the origin of patterns. The following files are included into
+this collection (in alphabetical order):
+
+ruhyphal.tex
+ 10-Mar-03 created by Alexander I. Lebedev <swan@scon155.phys.msu.su>
+ (previously were an extended and corrected variant of Dimitri Vulis'
+ patterns, but now are independenly generated with patgen, using
+ the rus-ispell dictionary).
+ ftp://scon155.phys.msu.su/pub/russian/hyphen/ruhyphal.tar.gz
+ruhyphas.tex
+ v1.0b4a 23-Jul-98 of `ashyphen' created by Andrey Slepuhin
+ <pooh@msu.ru>, ftp://forest.nmd.msu.ru/pub/tex/hyphenation/
+ruhyphct.tex
+ 31-Dec-89 is a version found in a CyrTUG TeX distribution
+ruhyphdv.tex
+ The original patterns created by Dimitri Vulis <dlv@bwalk.dm.com>,
+ re-encoded to koi8-r.
+ruhyphmg.tex
+ 30-May-98 patterns created by Mikhail Grinchuk <grinchuk@lsil.com>.
+ Created manually, with the aim to get more or less good results
+ with smallest feasible memory usage. Current version hyphenates
+ with relatively big number of errors, but patterns are really small.
+ruhyphvl.tex
+ 22-Jul-00 Dimitri Vulis' patterns extended by M. Vorontsova and
+ S. Lvovski <serge@mccme.ru>, and later modified by A.Cherepanov,
+ V.Kryukov and A.Shen,
+ ftp://mccme.ru/users/shen/texkoi/
+ruhyphzn.tex
+ v2.01 beta 23-Mar-03 of `znhyphen' created by Sergei V. Znamenskii
+ <znamensk@rustex.botik.ru>,
+ ftp://ftp.botik.ru/rented/znamensk/tex_dists/03_97/rusifika.zip
+
+
+2) additional patterns for the letter `cyryo'
+
+Generated from the base files using `mkcyryo' script, these files
+provide patterns for the `cyryo' letter to make its behavior with
+respect to hyphenation identical to `cyre'. This can be done by
+making \lccode of `cyryo' equal to the code of `cyre' -- this is not the
+best solution because it will lead to incorrect work of \lowercase,
+and, moreover, in LaTeX it is forbidden to change \lccode values.
+These files should be used with the corresponding main hyphenation
+files.
+
+There are some words with two `cyryo' letters (the following examples
+were provided by Alexander I. Lebedev):
+
+ÔÒ£È×£ÄÅÒÎÙÊ ÔÒ£È×£ÒÓÔÎÙÊ ÔÒ£ÈÚ×£ÚÄÏÞÎÙÊ ÔÒ£ÈËÏÌ£ÓÎÙÊ ÔÒ£ÈÒÕÂÌ£×ËÁ
+ÔÒ£ÈÒÕÂÌ£×ÙÊ ÔÒ£ÈÛ£ÒÓÔÎÙÊ ÞÅÔÙÒ£È×£ÓÅÌØÎÙÊ ÞÅÔÙÒ£ÈÚ×£ÚÄÏÞÎÙÊ ÞÅÔÙÒ£ÈËÏÌ£ÓÎÙÊ
+
+because of this, it is insufficient to add patterns with only one
+`cyryo' letter, so we generate also patterns with two `cyryo' (however,
+in practice all of them are `reduced' by the `reduce-patt' script :).
+
+cyryoal.tex
+ generated from ruhyphal.tex
+cyryoas.tex
+ generated from ruhyphas.tex
+cyryoct.tex
+ generated from ruhyphct.tex
+cyryodv.tex
+ generated from ruhyphdv.tex
+cyryomg.tex
+ generated from ruhyphmg.tex
+cyryovl.tex
+ generated from ruhyphvl.tex
+cyryozn.tex
+ generated from ruhyphzn.tex
+
+Makefile
+ rules for generation of `cyryo*.tex' files. Run `make distclean'
+ to remove all `cyryo*.tex' files; run `make' to regenerate them.
+mkcyryo
+ shell script used for generation of `cyryo*.tex' files
+reduce-patt
+ a perl script which could be used to verify which patterns do not
+ correspond to `real' words present in a wordlist. It is used by
+ `mkcyryo' script to remove unnecessary patterns. This was suggested
+ by Alexander Lebedev, and requires his excellent rus-ispell dictionary
+ available at ftp://scon155.phys.msu.su/pub/russian/ispell/rus-ispell.tar.gz
+ (we used version 0.99f4 in preparation of this package).
+
+ The following command will generate a lowercased wordlist with
+ letter `cyryo', needed for `mkcyryo' and `reduce-patt' scripts:
+
+ cat russian.dict | ispell -d russian -e | tr ' à-ÿ' '\012À-ß' | \
+ grep £ | ./sortkoi8 | uniq > /tmp/.wl-lc-cyryo
+
+ Remove `grep £' from a pipe to get a full lowercased wordlist
+ /tmp/.wl-lc-full useful for `reduce-patt' in general.
+
+
+3) TeX files for re-encoding of patterns from koi8-r to various TeX
+ font encodings.
+
+These files use commands like \lccode `\<letter>=<number> (instead of
+\lccode <number>=<number>), where <letter> is an 8-bit letter code (in
+koi8-r encoding, in which patterns are stored) and <number> is the
+slot number in the destination font encoding. This makes the patterns
+"stable" against reencoding to any Cyrillic encoding, and also usable
+with non-standard "on the fly" reencoding mechanisms like TCX or TCP
+(switched on at TeX format creation phase) used in some TeX
+implementations (provided that these transformations are 1-to-1 in
+*all* the range 128--255, -- otherwise the results may be incorrect).
+This was suggested by Alexander Cherepanov <cherepan@mccme.ru> (we'd
+like to thank him also for other useful suggestions on the ruhyphen
+package). However, we do not recommend using non-standard mechanisms
+like TCX or TCP in general (in favor of the portable and more powerful
+approach with active characters provided by inputenc LaTeX package and
+also used in cyrplain package).
+
+As suggested by Alexander Fryntov, these files also include support
+for five additional Cyrillic letters present in koi8-ru encoding, so
+that they could be used e.g. for the Ukrainian hyphenation patterns.
+
+koi2t2a.tex
+ koi8-r to T2A encoding (for Russian letters, also T2B, T2C, T2D, X2).
+ This is the main font encoding to be used for typesetting Cyrillic
+ with TeX.
+koi2ucy.tex
+ koi8-r to UCY (Omega Unicode Cyrillic) encoding.
+koi2lcy.tex
+ koi8-r to LCY (similar to cp866) encoding used e.g. in `old' LH
+ fonts.
+koi2ot2.tex
+ koi8-r to OT2 7-bit Cyrillic TeX encoding used e.g. in
+ AMS Washington Cyrillic fonts (wncy*) and LH fonts (wn*).
+ To get better hyphenation and kerning, you may use virtual fonts
+ without WN-ligatures, like WLCY or WL fonts.
+koi2koi.tex
+ koi8-r to koi8-r setup (needed anyway to setup \lccode values).
+ Note, that `koi' is bad name for TeX font encoding.
+
+catkoi.tex
+ Set the \catcode values of the lowercase Russian letters in the
+ koi8-r encoding to 12. The purpose of this file is to avoid strange
+ effects in case of unusual catcodes (e.g. active) for the letters
+ used in hyphenation files.
+
+
+4) files to be used by users
+
+ruhyphen.tex
+ main `head' file which inputs the specified patterns and re-encodes
+ them to the specified font encoding. Users can edit this file,
+ selecting the patterns and font encodings.
+ruenhyph.tex
+ alternative `head' file which inputs combined Russian-English
+ patterns. Do not mix patterns for 7-bit Cyrillic font encodings
+ (OT2) with English patterns! This can be used only for 8-bit
+ Cyrillic font encodings (and, of course, for UCY).
+
+
+5) other files
+
+README
+ this file
+enrhm2.tex
+ Avoid -xx breaks for English when \righthyphenmin=2. Used by
+ ruenhyph.tex.
+hypht2.tex
+ This file contains additional hyphenation patterns including the
+ character hyphen `-'. It enables the hyphenation of words containing
+ explicit hyphens when using fonts with \hyphenchar\font <> `\-
+ (e.g. T2* encoded fonts). Derived from `hypht1.tex' by Bernd Raichle;
+ see comments there. :-) To switch on hyphenation of words containing
+ explicit hyphens, one should (apart from preloading this file into
+ format) set \lccode`\-=`\-, and also \defaulthyphenchar=127 before
+ loading fonts (i.e. before \usepackage[T2A]{fontenc}), or set
+ \hyphenchar\font=127 for already preloaded font. Note that loading
+ these additional patterns requires significant additional amount
+ of TeX hyphenation trie size.
+
+sortkoi8
+ shell script; simple wrapper for `sort' to sort Russian texts
+ in koi8-r encoding alphabetically.
+sorthyph
+ Perl script for sorting hyphenation files (Latin or Cyrillic in
+ koi8-r encoding).
+trans
+ shell script for re-encoding between cp1251, koi8-r, cp866,
+ iso-8859-5, and Mac Cyrillic charsets (not used here).
+
+
+The following properties of patterns are customizable in the file
+ruhyphen.tex:
+
+* which font encoding to use. Note that this setting has nothing to do
+ with the input encodings of your (La)TeX documents!
+
+* which of seven available pattern files to use.
+
+* [1st optional line] whether to load patterns for the letter `cyryo'.
+
+* [2nd optional line] whether to load patterns which enable
+ hyphenation of words containing explicit hyphens (only in case of
+ using T2* font encodings). See the above description of hypht2.tex
+ for additional information.
+
+* [3rd optional line] whether to load two patterns .ne8 and 8ne. which
+ disallow breaking off the `ne' from a word (where `n' and `e' are
+ corresponding Russian letters; `ne' in Russian means `not' and breaking
+ it can confuse the reader). This was suggested by Alexander Lebedev.
+
+* [4th optional line] whether to load patterns which disallow breaking
+ a consonant followed by hard sign from a word. Such words are absent
+ in `modern' Russian language, but were used when `old orthography'
+ was in use. This was suggested by Alexander V. Lukyanov.
+
+And last but not least,
+
+* whether to load the file ruhyphen.tex or ruenhyph.tex (for combined
+ Russian-English hyphenation).
+
+
+Happy TeXing!
+
+
+Mail your comments, questions, and Russian hyphenation patterns which
+are absent in this collection to:
+
+ Werner Lemberg <wl@gnu.org>
+ Vladimir Volovich <vvv@vsu.ru>
diff --git a/Master/texmf-dist/source/generic/ruhyphen/README.ruhyphal b/Master/texmf-dist/source/generic/ruhyphen/README.ruhyphal
new file mode 100644
index 00000000000..0b736af3a41
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/README.ruhyphal
@@ -0,0 +1,118 @@
+
+ ëÏÍÍÅÎÔÁÒÉÉ Ë ×ÙÐÕÓËÕ ÎÏ×ÙÈ ÔÁÂÌÉà ÐÅÒÅÎÏÓÏ× ruhyphal.tex
+
+úÁÞÅÍ ÅÝÅ ÏÄÎÁ ÔÁÂÌÉÃÁ ÐÅÒÅÎÏÓÏ× ÄÌÑ ÒÕÓÓËÏÇÏ ÑÚÙËÁ?
+
+÷ ÎÁÓÔÏÑÝÅÅ ×ÒÅÍÑ ÄÌÑ ÒÁÂÏÔÙ × TeX Ó ÔÅËÓÔÁÍÉ ÎÁ ÒÕÓÓËÏÍ ÑÚÙËÅ ÐÏÌÕÞÉÌÉ
+ÒÁÓÐÒÏÓÔÒÁÎÅÎÉÅ ÛÅÓÔØ ÔÁÂÌÉà ÇÅÎÅÒÁÃÉÉ ÐÅÒÅÎÏÓÏ×, ÉÓÐÏÌØÚÕÀÝÉÈ × Ó×ÏÅÊ
+ÏÓÎÏ×Å ÁÌÇÏÒÉÔÍ æÒÁÎËÁ ìÑÎÇÁ. üÔÉ ÔÁÂÌÉÃÙ ÓÏÂÒÁÎÙ × ÐÁËÅÔ ruhyphen
+÷ÌÁÄÉÍÉÒÏÍ ÷ÏÌÏ×ÉÞÅÍ É ÷ÅÒÎÅÒÏÍ ìÅÍÂÅÒÇÏÍ É × ÎÁÓÔÏÑÝÅÅ ×ÒÅÍÑ Ñ×ÌÑÀÔÓÑ
+ÞÁÓÔØÀ ÓÔÁÎÄÁÒÔÎÏÇÏ ÄÅÒÅ×Á ËÁÔÁÌÏÇÏ× texmf. üÔÏ -- ÔÁÂÌÉÃÙ, ÓÏÚÄÁÎÎÙÅ
+äÍÉÔÒÉÅÍ ÷ÕÌÉÓÏÍ (ruhyphdv.tex × ÏÂÏÚÎÁÞÅÎÉÑÈ ÐÁËÅÔÁ ruhyphen, ÄÁÌÅÅ
+ÓÏËÒÁÝÅÎÎÏ ÐÏ ÉÍÅÎÉ ÓÏÓÔÁ×ÉÔÅÌÑ -- dv), ÉÈ ÐÏÓÌÅÄÕÀÝÁÑ ÍÏÄÉÆÉËÁÃÉÑ
+í.÷ÏÒÏÎÃÏ×ÏÊ É ó.ìØ×Ï×ÓËÉÍ (ruhyphvl.tex, vl), ÉÈ ÂÏÌÅÅ ÓÕÝÅÓÔ×ÅÎÎÁÑ
+ÐÅÒÅÒÁÂÏÔËÁ, ÓÄÅÌÁÎÎÁÑ ÄÌÑ CyrTUG (ruhyphct.tex, ct), Á ÔÁËÖÅ Ä×Å ÎÅÚÁ×ÉÓÉÍÙÅ
+ÒÁÚÒÁÂÏÔËÉ, ÓÄÅÌÁÎÎÙÅ óÅÒÇÅÅÍ úÎÁÍÅÎÓËÉÍ (ruhyphzn.tex, zn) É áÎÄÒÅÅÍ
+óÌÅÐÕÈÉÎÙÍ (ruhyphas.tex, as). óÏ×ÓÅÍ ÎÅÄÁ×ÎÏ × ÐÁËÅÔ ÂÙÌÁ ×ËÌÀÞÅÎÁ ÅÝÅ
+ÏÄÎÁ ÔÁÂÌÉÃÁ ÐÅÒÅÎÏÓÏ× (ruhyphmg.tex, mg), ÓÏÓÔÁ×ÌÅÎÎÁÑ íÉÈÁÉÌÏÍ çÒÉÎÞÕËÏÍ.
+
+ë ÓÏÖÁÌÅÎÉÀ, ×ÓÅ ÜÔÉ ÔÁÂÌÉÃÙ ÄÁÌÅËÉ ÏÔ ÓÏ×ÅÒÛÅÎÓÔ×Á. óÒÁ×ÎÅÎÉÑ, ÐÒÏ×ÅÄÅÎÎÙÅ
+ÎÁ ÒÅÁÌØÎÙÈ ÔÅËÓÔÁÈ (ÏÄÉÎ É ÔÏÔ ÖÅ TeX'Ï×ÓËÉÊ ÔÅËÓÔ ÆÏÒÍÁÔÉÒÏ×ÁÌÓÑ Ó
+ËÁÖÄÏÊ ÉÚ ÕËÁÚÁÎÎÙÈ ÔÁÂÌÉÃ É ÚÁÔÅÍ ÁÎÁÌÉÚÉÒÏ×ÁÌÓÑ ÎÁ ÐÒÅÄÍÅÔ ÐÏÑ×ÌÅÎÉÑ
+ÏÛÉÂÏË É "ÎÅÂÌÁÇÏÚ×ÕÞÎÏÓÔÅÊ" ÐÒÉ ÐÅÒÅÎÏÓÅ), ÐÏËÁÚÁÌÉ, ÞÔÏ ×ÓÅ (!) ÔÁÂÌÉÃÙ
+ÄÁÀÔ ÏÛÉÂËÉ × ÐÅÒÅÎÏÓÁÈ, ÐÒÉÞÅÍ ÎÁÉÌÕÞÛÉÅ ÒÅÚÕÌØÔÁÔÙ, ÎÁ ÐÅÒ×ÙÊ ×ÚÇÌÑÄ,
+ÐÏÌÕÞÁÌÉÓØ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÔÁÂÌÉà ÷ÕÌÉÓÁ (dv) É ÅÅ ÐÒÏÉÚ×ÏÄÎÙÈ (vl, ct).
+
+äÌÑ ÂÏÌÅÅ ×ÎÉÍÁÔÅÌØÎÏÇÏ ÁÎÁÌÉÚÁ ÒÁÚÌÉÞÉÊ ÔÁÂÌÉà ÂÙÌÉ ÉÚÕÞÅÎÙ ÆÁÊÌÙ ÒÁÚÌÉÞÉÊ
+× ÐÅÒÅÎÏÓÁÈ ÄÌÑ ÓÌÏ×, ÓÇÅÎÅÒÉÒÏ×ÁÎÎÙÈ ÉÚ ÍÏÅÇÏ ÏÒÆÏÇÒÁÆÉÞÅÓËÏÇÏ ÓÌÏ×ÁÒÑ
+(ftp://scon155.phys.msu.su/pub/russian/ispell/rus-ispell.tar.gz), ËÏÔÏÒÙÅ
+ÐÏËÁÚÁÌÉ, ÞÔÏ ÒÁÚÌÉÞÉÑ ÎÏÓÑÔ ÓÉÓÔÅÍÁÔÉÞÅÓËÉÊ ÈÁÒÁËÔÅÒ.
+
+ôÁË, ÔÁÂÌÉÃÁ vl Ñ×ÌÑÅÔÓÑ ÐÒÏÓÔÙÍ ÒÁÓÛÉÒÅÎÉÅÍ ÔÁÂÌÉà dv, × ËÏÔÏÒÏÊ ÚÁÐÒÅÝÅÎÙ
+×ÓÅ ÐÅÒÅÎÏÓÙ, ÐÒÉ ËÏÔÏÒÙÈ ÐÏÓÌÅÄÎÉÊ ÓÌÏÇ ÏÓÔÁÅÔÓÑ ÂÅÚ ÇÌÁÓÎÏÊ (ÎÁÐÒÉÍÅÒ,
+ÂÅÚ-ÄÎ), Á ÔÁËÖÅ ÒÑÄ ÐÅÒÅÎÏÓÏ×, ÐÏÚ×ÏÌÑÀÝÉÈ ÐÏÌÕÞÉÔØ × ÐÅÒÅÎÅÓÅÎÎÏÊ ÓÔÒÏËÅ
+ÎÅÐÒÉÌÉÞÎÙÅ ÓÌÏ×Á. ÷ÓÅ ÏÓÔÁÌØÎÙÅ ÎÅÔÏÞÎÏÓÔÉ ÔÁÂÌÉà dv ÔÁÂÌÉÃÁ vl ÐÒÏÓÔÏ
+ËÏÐÉÒÕÅÔ.
+
+÷ ÔÁÂÌÉÃÁÈ ct ÉÓÐÒÁ×ÌÅÎÏ ÍÎÏÖÅÓÔ×Ï ÎÅÔÏÞÎÏÓÔÅÊ ÔÁÂÌÉà dv (ÄÏÂÁ×ÌÅÎÏ,
+ÎÁÐÒÉÍÅÒ, ÍÎÏÖÅÓÔ×Ï ÏÔÓÕÔÓÔ×Ï×Á×ÛÉÈ ÐÅÒÅÎÏÓÏ×, ÓËÏÒÒÅËÔÉÒÏ×ÁÎ ÒÑÄ ÏÛÉÂÏË
+ÐÅÒÅÎÏÓÏ× ÎÁ ÇÒÁÎÉÃÅ ÐÒÉÓÔÁ×ËÁ-ËÏÒÅÎØ), ÎÏ ×ÓÅ ÒÁ×ÎÏ ÏÛÉÂËÉ ÏÓÔÁÌÉÓØ,
+ÎÁÐÒÉÍÅÒ: ×Á-ËÕ-ÕÍ-É-ÒÏ-×Á-ÎÉÅ, ×Ù-Ó-ËÁ-ÖÕ, ÄÒÅ×-ÎÅÅ-×ÒÅÊ-ÓËÉÊ,
+ÉÓ-ËÏ-ÒÅ-ÖØ-ÔÅ, ÎÅÏ-ÐÁÓ-ÎÙÊ, ÏÄ-Õ-ÒÉ, ÐÌÁÃ-Ä-ÁÒ-ÍÅ, ÐÏÄ-ÕÒ-ÎÅ-Å-ÔÅ, ÓÏ-ÓÎ,
+ÓÒÁ-ÚÉ-ÍÓÑ (ÚÎÁËÉ ÐÅÒÅÎÏÓÁ ÕËÁÚÙ×ÁÀÔ ÎÁ ÍÅÓÔÁ ×ÏÚÍÏÖÎÙÈ ÐÅÒÅÎÏÓÏ×; ÐÒÁ×ÉÌÁ
+ÐÅÒÅÎÏÓÏ× ÓÍÏÔÒÉ × ÓÏÐÒÏ×ÏÖÄÁÀÝÅÍ ÆÁÊÌÅ hyphen.rules). ðÒÉ ÜÔÏÍ ÎÅ ×ÓÅ
+ÉÓÐÒÁ×ÌÅÎÉÑ ÍÏÖÎÏ ÐÒÉÚÎÁÔØ ÕÄÁÞÎÙÍÉ (ÐÒÏÐÁÄÁÅÔ ÞÁÓÔØ ÐÅÒÅÎÏÓÏ×, ÉÎÏÇÄÁ
+×ÏÚÎÉËÁÀÔ ÏÛÉÂËÉ).
+
+ôÁÂÌÉÃÙ as, zn ÓÏÄÅÒÖÁÔ ÚÁÍÅÔÎÏ ÂÏÌØÛÅ ÏÛÉÂÏË, ËÏÔÏÒÙÅ ÐÒÉ ÆÏÒÍÁÔÉÒÏ×ÁÎÉÉ
+ÔÅËÓÔÁ ÓÒÅÄÓÔ×ÁÍÉ TeX ÐÒÏÑ×ÌÑÀÔÓÑ ËÁË ÎÅÕÄÁÞÎÙÊ ÐÅÒÅÎÏÓ × ÓÕÆÆÉËÓÅ ÉÌÉ
+ËÁË ÎÅÐÒÁ×ÉÌØÎÏÅ ÏÔÄÅÌÅÎÉÅ ÐÒÉÓÔÁ×ËÉ ÏÔ ËÏÒÎÑ. ôÁË, × ÔÁÂÌÉÃÁÈ as
+ÐÏÑ×ÌÑÅÔÓÑ ÒÁÚÂÉÅÎÉÅ ÂÕË× ÓÔ × ÓÕÆÆÉËÓÁÈ (Á×-ÔÏÒ-ÓÔ-×Ï, ÁËÕÛÅÒÓ-Ô-×Ï,
+ÁÎÏ-ÎÉÍ-ÎÏÓ-ÔÉ), É ÒÑÄ ÄÒÕÇÉÈ ÏÛÉÂÏË (ÁÎÔÉË-ÒÉ-ÚÉÓ-ÎÙÊ, ×Â-ÌÉ-ÚÉ,
+×ÎÅÓ-ÌÕ-ÖÅÂ-ÎÙÊ, Ä×Õ-Èß-ÑÒÕÓ-ÎÙÊ, ÍÅ-ÖÁ-ÔÏÍ-ÎÙÊ, ÏÄÕ-ÈÏÔ-×Ï-ÒÅÎ-ÎÏ,
+ÓÔÒÏÊÐ-ÌÏ-ÝÁÄ-ËÁ, ÔÅ-ÈÏÔ-ÄÅ-ÌÅ, ÞÅ-ÈÏÓ-ÌÏ-×ÁÃ-ËÉÊ, ÔÒÅÈ-Ð-ÒÏ-ÃÅÎÔ-ÎÙÊ,
+ÆÅÌØ-Äß-ÅÇÅ-ÒÀ, ÆÕÔ-ÂÏ-ÌÉÓ-ÔÙ, ÞÉÓ-ÔÏÐ-ÌÀ-Å×, ÛÅÒÓ-ÔÑ-ÎÏÊ). îÅÓËÏÌØËÏ
+ÌÕÞÛÅÅ ×ÐÅÞÁÔÌÅÎÉÅ ÏÓÔÁÅÔÓÑ ÏÔ ÔÁÂÌÉà zn, ÈÏÔÑ × ÎÉÈ ÐÒÉÓÕÔÓÔ×ÕÅÔ ÔÏ ÖÅ
+ÎÁÄÏÅÄÌÉ×ÏÅ ÒÁÚÂÉÅÎÉÅ ÂÕË× ÓÔ × ÓÕÆÆÉËÓÁÈ (ÁÒ-ÔÉÓ-ÔÉÞ-ÎÏÓ-ÔØÀ,
+ÉÚ-ÄÁ-ÔÅÌØ-ÓÔ-×Ï, ÓÔÒÏ-ÇÏÓ-ÔÉ, ÛÅÓ-ÔØÀ) É ÏÛÉÂËÉ (ÂÅ-ÓÔÁÒ-ÎÁÑ,
+ÂÏ-ÇÏÐ-ÒÏ-ÔÉ×-ÎÙÊ, ÚÁ-×ÏÔ-ÄÅ-ÌÏÍ, ËÉ-ÎÏ-Óß-ÅÍÏÞ-ÎÙÊ, ÍÅ-ÔÅÏÓ-×ÏÄ-ËÏÊ,
+ÍÏ-ÎÏ-ËÌØ, ÐÅ-ÒÅ-ÊÄÅÎ-ÎÙÊ, ÆØ-ÏÒ-ÄÙ, ÛØ-ÅÔ).
+
+ôÁÂÌÉÃÙ mg ÏÔÌÉÞÁÅÔ ÉÈ ÍÁÌÙÊ ÒÁÚÍÅÒ (ÎÅÂÏÌØÛÏÅ ÞÉÓÌÏ ÐÒÁ×ÉÌ ÐÅÒÅÎÏÓÁ),
+ÏÄÎÁËÏ ÐÒÉ ÜÔÏÍ ËÏÌÉÞÅÓÔ×Ï ÏÛÉÂÏË × ÎÉÈ ÏËÁÚÙ×ÁÅÔÓÑ ÎÁÍÎÏÇÏ ÂÏÌØÛÅ.
+
+âÅÚÕÓÌÏ×ÎÏ, ÏÛÉÂËÉ ÐÒÉ ÐÅÒÅÎÏÓÅ ÎÅÉÚÂÅÖÎÙ, ÔÅÍ ÂÏÌÅÅ ÞÔÏ ÓÔÒÏÇÉÅ ÐÒÁ×ÉÌÁ
+ÐÅÒÅÎÏÓÏ× ÏÔÓÕÔÓÔ×ÕÀÔ, Á ÓÁÍÉ ÐÒÁ×ÉÌÁ ÓÏÄÅÒÖÁÔ ÉÓËÌÀÞÅÎÉÑ (ÎÁÐÒÉÍÅÒ,
+ÐÅÒ×ÙÊ ÐÅÒÅÎÏÓ × ÓÌÏ×Å ÉÚÕ-ÞÅ-ÎÉÅ ÏÔÒÙ×ÁÅÔ ÇÌÁÓÎÕÀ ÏÔ ËÏÒÎÑ, ÞÔÏ ÚÁÐÒÅÝÅÎÏ
+ÆÏÒÍÁÌØÎÙÍÉ ÐÒÁ×ÉÌÁÍÉ, ÎÏ ÔÅÍ ÎÅ ÍÅÎÅÅ ÓÞÉÔÁÅÔÓÑ ÐÒÁ×ÉÌØÎÙÍ). ëÒÏÍÅ ÔÏÇÏ,
+ÐÅÒÅÎÏÓÙ ÄÏÌÖÎÙ ÒÁÓÓÔÁ×ÌÑÔØÓÑ ÔÁË, ÞÔÏÂÙ ÒÁÚÏÒ×ÁÎÎÏÅ ÓÌÏ×Ï ÏÓÔÁ×ÁÌÏÓØ
+ÌÅÇËÏ ÕÚÎÁ×ÁÅÍÙÍ. îÁÐÒÉÍÅÒ, ÓÌÏ×Á ÐÅÒÅ-ÏÆÏÒÍÌÅÎÎÙÊ, ÎÁÉ-×ÁÖÎÅÊÛÉÊ,
+ÇÅÏ-ÇÒÁÆÉÑ ÕÚÎÁÀÔÓÑ ÇÏÒÁÚÄÏ ÌÅÇÞÅ, ÞÅÍ ÆÏÒÍÁÌØÎÏ ×ÅÒÎÙÅ × ÓÍÙÓÌÅ ÐÅÒÅÎÏÓÏ×
+ÓÌÏ×Á ÐÅÒÅÏ-ÆÏÒÍÌÅÎÎÙÊ, ÎÁ-É×ÁÖÎÅÊÛÉÊ, ÇÅ-ÏÇÒÁÆÉÑ. ðÏ ÜÔÏÊ ÐÒÉÞÉÎÅ ÎÅËÏÔÏÒÙÅ
+ÐÅÒÅÎÏÓÙ ÌÕÞÛÅ ÚÁÐÒÅÔÉÔØ.
+
+ôÁË ÐÏÑ×ÉÌÁÓØ ÉÄÅÑ ÓÏÚÄÁÔØ (ÐÏ ËÒÁÊÎÅÊ ÍÅÒÅ ÄÌÑ Ó×ÏÅÊ ÒÁÂÏÔÙ) ÔÁÂÌÉÃÙ,
+ÓÏÄÅÒÖÁÝÉÅ ×ÏÚÍÏÖÎÏ ÍÅÎØÛÅÅ ÞÉÓÌÏ ÏÛÉÂÏË. îÁ ÐÅÒ×ÏÍ ÜÔÁÐÅ ÂÙÌÏ ÒÅÛÅÎÏ
+ÍÏÄÉÆÉÃÉÒÏ×ÁÔØ ÔÁÂÌÉÃÙ ÷ÕÌÉÓÁ, ËÏÔÏÒÙÅ Ñ×ÌÑÀÔÓÑ public domain, ÒÁÚÒÅÛÅÎÙ
+ÄÌÑ ÍÏÄÉÆÉËÁÃÉÉ É, ËÁË ÍÎÅ ÐÏËÁÚÁÌÏÓØ, ÓÏÄÅÒÖÁÔ ÓÒÁ×ÎÉÔÅÌØÎÏ ÎÅÍÎÏÇÏ ÏÛÉÂÏË.
+÷ÏÚÍÏÖÎÏ, ÍÏÄÉÆÉËÁÃÉÑ ÔÁÂÌÉà úÎÁÍÅÎÓËÏÇÏ ÂÙÌÁ ÂÙ ÂÏÌÅÅ ÜÆÆÅËÔÉ×ÎÏÊ, ÎÏ ÏÎÁ
+ÚÁÐÒÅÝÅÎÁ ÌÉÃÅÎÚÉÅÊ. îÏ×ÁÑ ÔÁÂÌÉÃÁ ÂÙÌÁ ÎÁÚ×ÁÎÁ (× ÓÏÏÔ×ÅÔÓÔ×ÉÉ ÓÏ ÓÈÅÍÏÊ
+ÎÁÉÍÅÎÏ×ÁÎÉÑ, ÐÒÅÄÌÏÖÅÎÎÏÊ × ÐÁËÅÔÅ ruhyphen) ruhyphal.tex.
+
+îÁ ÐÅÒ×ÏÍ ÜÔÁÐÅ × ÔÁÂÌÉÃÕ ÂÙÌÉ ×ËÌÀÞÅÎÙ ÐÒÁ×ÉÌÁ, ÉÓËÌÀÞÁÀÝÉÅ ÇÅÎÅÒÁÃÉÀ
+ÐÏÓÌÅÄÎÅÇÏ ÓÌÏÇÁ ÂÅÚ ÇÌÁÓÎÏÊ (ÔÉÐÁ ÍÏ-ÎÏ-ËÌØ); ÎÁÊÄÅÎÙ É ÄÏÂÁ×ÌÅÎÙ ÁÎÁÌÏÇÉÞÎÙÅ
+ÐÒÁ×ÉÌÁ ÄÌÑ ÉÓËÌÀÞÅÎÉÑ ÐÏÑ×ÌÅÎÉÑ ÐÅÒ×ÏÇÏ ÓÌÏÇÁ ÂÅÚ ÇÌÁÓÎÏÊ (ÔÁËÉÈ ËÁË ÛØ-ÅÔ);
+ÉÓËÌÀÞÅÎÏ ÂÏÌØÛÉÎÓÔ×Ï ÓÌÕÞÁÅ× ÐÏÑ×ÌÅÎÉÑ × ÓÅÒÅÄÉÎÅ ÓÌÏ×Á ÓÌÏÇÏ×, ÓÏÓÔÏÑÝÉÈ
+ÉÚ ÏÄÎÉÈ ÓÏÇÌÁÓÎÙÈ; ÐÅÒÅÐÉÓÁÎÙ ÐÒÁ×ÉÌÁ ÐÅÒÅÎÏÓÏ× ÓÌÏ×, ÓÏÄÅÒÖÁÝÉÈ ÂÕË×Ù Ê, ß.
+ðÏ ÓÒÁ×ÎÅÎÉÀ Ó ÉÓÈÏÄÎÙÍÉ ÔÁÂÌÉÃÁÍÉ dv ÂÙÌÏ ÉÚÍÅÎÅÎÏ (ÉÓËÌÀÞÅÎÏ ÉÌÉ ÐÅÒÅÄÅÌÁÎÏ)
+ÐÒÉÍÅÒÎÏ 25% ÐÒÁ×ÉÌ. âÙÌ ÉÓÐÒÁ×ÌÅÎ ÒÑÄ ÏÛÉÂÏË, ×ÏÚÎÉËÁÀÝÉÈ ÎÁ ÇÒÁÎÉÃÅ
+ÐÒÉÓÔÁ×ËÁ-ËÏÒÅÎØ, É ÐÒÁËÔÉÞÅÓËÉ ×ÓÅ ÏÛÉÂËÉ ÐÒÉ ÇÅÎÅÒÁÃÉÉ ÏËÏÎÞÁÎÉÊ.
+ëÒÏÍÅ ÔÏÇÏ, ÉÚ ÜÓÔÅÔÉÞÅÓËÉÈ ÓÏÏÂÒÁÖÅÎÉÊ ÄÏÂÁ×ÌÅÎÏ ÐÒÁ×ÉÌÏ, ÐÏ ËÏÔÏÒÏÍÕ ÎÅ
+ÍÏÇÕÔ ÐÅÒÅÎÏÓÉÔØÓÑ ÓÌÏÇÉ, ÓÏÓÔÏÑÝÉÅ ÉÚ Ä×ÕÈ ÇÌÁÓÎÙÈ ÂÅÚ ÓÏÇÌÁÓÎÏÊ (ÔÉÐÁ
+ÁÕ-ÄÉÔÏÒÉÑ). óÄÅÌÁÎÎÙÅ ÉÓÐÒÁ×ÌÅÎÉÑ ËÏÓÎÕÌÉÓØ ÎÁÐÉÓÁÎÉÑ ÂÏÌÅÅ 51 ÔÙÓÑÞ
+ÓÌÏ×.
+
+óÌÅÄÕÀÝÁÑ (×ÔÏÒÁÑ) ×ÅÒÓÉÑ ÔÁÂÌÉà ruhyphal.tex ÓÏÚÄÁÎÁ Ó ÐÏÍÏÝØÀ ÐÒÏÇÒÁÍÍÙ
+patgen ÎÁ ÏÓÎÏ×Å ÄÏÓÔÁÔÏÞÎÏ ÔÝÁÔÅÌØÎÏ ×Ù×ÅÒÅÎÎÏÇÏ ÓÐÉÓËÁ ÓÌÏ× Ó ÐÅÒÅÎÏÓÁÍÉ,
+ÐÏÌÕÞÅÎÎÙÈ ÎÁ ÐÅÒ×ÏÍ ÜÔÁÐÅ. ðÏ ÓÒÁ×ÎÅÎÉÀ Ó ÐÅÒ×ÙÍ ÜÔÁÐÏÍ, ÎÁ ×ÔÏÒÏÍ
+ÜÔÁÐÅ × ÓÐÉÓËÅ ÂÙÌÏ ÓËÏÒÒÅËÔÉÒÏ×ÁÎÏ ÎÁÐÉÓÁÎÉÅ ÏËÏÌÏ 24 ÔÙÓÑÞ ÓÌÏ×.
+ðÏÓÌÅÄÎÑÑ (ÎÁÓÔÏÑÝÁÑ) ×ÅÒÓÉÑ ÔÁÂÌÉà ruhyphal.tex ÔÁËÖÅ ÓÏÚÄÁÎÁ Ó ÐÏÍÏÝØÀ
+ÐÒÏÇÒÁÍÍÙ patgen ÎÁ ÏÓÎÏ×Å ÒÁÓÛÉÒÅÎÎÏÇÏ ÓÐÉÓËÁ ÓÌÏ× (990 ÔÙÓÑÞ ÓÌÏ×ÏÆÏÒÍ)
+Ó ÍÎÏÖÅÓÔ×ÏÍ ÄÏÐÏÌÎÅÎÉÊ É ÕÌÕÞÛÅÎÉÊ × ÐÅÒÅÎÏÓÁÈ.
+
+ïÄÎÏ×ÒÅÍÅÎÎÏ Ó ÔÁÂÌÉÃÁÍÉ ruhyphal.tex × ÐÁËÅÔ ×ËÌÀÞÅÎÁ ÄÏÐÏÌÎÉÔÅÌØÎÁÑ
+ÔÁÂÌÉÃÁ cyryoal.tex, ÓÏÄÅÒÖÁÝÁÑ ×ÓÅ ÓÕÝÅÓÔ×ÅÎÎÙÅ ÐÒÁ×ÉÌÁ ÆÏÒÍÉÒÏ×ÁÎÉÑ
+ÐÅÒÅÎÏÓÏ× × ÓÌÏ×ÁÈ, ÓÏÄÅÒÖÁÝÉÈ ÂÕË×Õ £. üÔÉ ÔÁÂÌÉÃÙ ÇÅÎÅÒÉÒÕÀÔÓÑ Ó ÐÏÍÏÝØÀ
+ÐÒÏÇÒÁÍÍÙ mkcyryo, ÉÚ ËÏÔÏÒÙÈ ÚÁÔÅÍ Ó ÐÏÍÏÝØÀ ÍÏÅÇÏ ÏÒÆÏÇÒÁÆÉÞÅÓËÏÇÏ
+ÓÌÏ×ÁÒÑ (ÁÄÒÅÓ ËÏÔÏÒÏÇÏ ÂÙÌ ÕËÁÚÁÎ ×ÙÛÅ) ÕÄÁÌÑÀÔÓÑ ×ÓÅ ÎÅÉÓÐÏÌØÚÕÅÍÙÅ ÐÒÁ×ÉÌÁ.
+
+ðÏÓÌÅ ÞÅÔÙÒÅÈ ÌÅÔ ÒÁÂÏÔÙ ÎÁÄ ÔÁÂÌÉÃÁÍÉ, ËÁË ÍÎÅ ËÁÖÅÔÓÑ, ÉÈ ËÁÞÅÓÔ×Ï ÓÔÁÌÏ
+ÌÕÞÛÅ, ÞÅÍ ËÁÞÅÓÔ×Ï ÏÓÔÁÌØÎÙÈ ÔÁÂÌÉà ÐÅÒÅÎÏÓÁ. ïÄÎÁËÏ ÏËÏÎÞÁÔÅÌØÎÏÅ
+ÓÕÖÄÅÎÉÅ ÐÏ ÜÔÏÍÕ ×ÏÐÒÏÓÕ ÍÏÇÕÔ ÓÄÅÌÁÔØ ÔÏÌØËÏ ÐÏÌØÚÏ×ÁÔÅÌÉ. óÁÍÉ ÔÁÂÌÉÃÙ
+× ËÏÄÉÒÏ×ËÅ koi8-r ÍÏÖÎÏ ÎÁÊÔÉ ÐÏ ÁÄÒÅÓÕ:
+
+ ftp://scon155.phys.msu.su/pub/russian/hyphen/ruhyphal.tar.gz
+
+ó×ÏÉ ËÏÍÍÅÎÔÁÒÉÉ É ÐÏÖÅÌÁÎÉÑ ×Ù ÍÏÖÅÔÅ ÎÁÐÒÁ×ÌÑÔØ ÓÏÓÔÁ×ÉÔÅÌÀ ÔÁÂÌÉÃ,
+áÌÅËÓÁÎÄÒÕ ìÅÂÅÄÅ×Õ <swan@scon155.phys.msu.su>.
+
diff --git a/Master/texmf-dist/source/generic/ruhyphen/hyphen.rules b/Master/texmf-dist/source/generic/ruhyphen/hyphen.rules
new file mode 100644
index 00000000000..996e146b5d8
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/hyphen.rules
@@ -0,0 +1,129 @@
+ðÒÁ×ÉÌÁ ÐÅÒÅÎÏÓÁ × ÒÕÓÓËÏÍ ÑÚÙËÅ (ÚÁÉÍÓÔ×Ï×ÁÎÏ ÉÚ ËÎÉÇÉ ë.é.âÙÌÉÎÓËÏÇÏ
+É î.î.îÉËÏÌØÓËÏÇÏ "óÐÒÁ×ÏÞÎÉË ÐÏ ÏÒÆÏÇÒÁÆÉÉ É ÐÕÎËÔÕÁÃÉÉ ÄÌÑ ÒÁÂÏÔÎÉËÏ×
+ÐÅÞÁÔÉ" (íÏÓË×Á, éÓËÕÓÓÔ×Ï, 1952).
+
+1. óÌÏ×Ï ÐÅÒÅÎÏÓÉÔÓÑ ÐÏ ÓÌÏÇÁÍ: ÓÔÏ-ÌÉË, ÷Á-ÓÉ-ÌÉ-ÓÁ.
+
+2. îÅÌØÚÑ ÏÓÔÁ×ÌÑÔØ ÎÁ ÐÒÅÄÙÄÕÝÅÊ ÓÔÒÏËÅ ÉÌÉ ÐÅÒÅÎÏÓÉÔØ ÎÁ ÓÌÅÄÕÀÝÕÀ
+ÓÔÒÏËÕ ÏÄÎÕ ÂÕË×Õ ÓÌÏ×Á.
+
+3. âÕË×Ù ß, Ø, Ê ÎÅÌØÚÑ ÏÔÄÅÌÑÔØ ÏÔ ÐÒÅÄÛÅÓÔ×ÕÀÝÅÊ ÂÕË×Ù; ÍÏÖÎÏ ÐÅÒÅÎÅÓÔÉ
+ÔÁË: ÐÏÄß-ÅÚÄ, ÐÏÌØ-ÚÁ, ×ÏÊ-ÎÁ, ÒÁÊ-ÏÎ.
+
+4. ðÒÉ ÐÅÒÅÎÏÓÅ ÓÌÏ× ÎÁ ÍÅÓÔÅ ÓÏÅÄÉÎÅÎÉÑ Ä×ÕÈ ÉÌÉ ÂÏÌØÛÅ ÓÏÇÌÁÓÎÙÈ ÜÔÉ
+ÓÏÇÌÁÓÎÙÅ ÍÏÖÎÏ ÏÔÎÅÓÔÉ É Ë ÐÒÅÄÛÅÓÔ×ÕÀÝÅÍÕ ÓÌÏÇÕ É Ë ÐÏÓÌÅÄÕÀÝÅÍÕ:
+ÓÅ-ÓÔÒÁ, ÓÅÓ-ÔÒÁ, ÓÅÓÔ-ÒÁ.
+
+5. ðÒÉ ÄÅÌÅÎÉÉ ÎÁ ÓÌÏÇÉ É ÐÒÉ ÐÅÒÅÎÏÓÅ ÎÅ ÓÌÅÄÕÅÔ ÓÏÇÌÁÓÎÕÀ ËÏÒÎÑ,
+ÓÔÏÑÝÕÀ ÎÁ ÓÔÙËÅ Ó ÓÕÆÆÉËÓÏÍ, ÏÔÎÏÓÉÔØ Ë ÓÕÆÆÉËÓÕ. îÅÐÒÁ×ÉÌØÎÏ: ÌÏ-×ÞÉÊ,
+ÍÏÓËÏ-×ÓËÉÊ, ÒÏ-ÄÎÏÊ; ÓÌÅÄÕÅÔ: ÌÏ×-ÞÉÊ, ÍÏÓËÏ×-ÓËÉÊ, ÒÏÄ-ÎÏÊ.
+
+ðÒÉ ÓÔÅÞÅÎÉÉ ÓÏÇÌÁÓÎÙÈ, ÏÔÎÏÓÑÝÉÈÓÑ Ë ÒÁÚÎÙÍ ÓÕÆÆÉËÓÁÍ, ÌÕÞÛÅ ÒÁÚÄÅÌÑÔØ
+ÐÏ ÓÕÆÆÉËÓÁÍ. îÁÐÒÉÍÅÒ: ÍÅÝÁÎ-ÓÔ×Ï, Á ÎÅ ÍÅÝÁ-ÎÓÔ×Ï; ÉÌÉ ÓÔÒÏÉÔÅÌØ-ÓÔ×Ï,
+Á ÎÅ ÓÔÒÏÉÔÅ-ÌØÓÔ×Ï É ÎÅ ÓÔÒÏÉÔÅÌØÓ-Ô×Ï.
+
+6. îÅ ÓÌÅÄÕÅÔ ÓÏÇÌÁÓÎÕÀ ÐÒÉÓÔÁ×ËÉ ÏÔÎÏÓÉÔØ Ë ÓÌÅÄÕÀÝÅÍÕ ÚÁ ÎÅÊ ÓÌÏÇÕ
+ÉÌÉ ÓÏÇÌÁÓÎÕÀ ËÏÒÎÑ (ÂÅÚ ÇÌÁÓÎÏÊ) ÏÓÔÁ×ÌÑÔØ ÐÒÉ ÐÒÉÓÔÁ×ËÅ. îÅÐÒÁ×ÉÌØÎÏ:
+ÐÏ-ÄÂÅÖÁÔØ, ÂÅ-ÓÐÒÅÓÔÁÎÎÏ, ×ÙÓ-ÔÉÒÁÔØ, ÐÒÅË-ÒÁÓÎÙÊ, ÐÒÅÓ-ÌÅÄÏ×ÁÔØ;
+ÓÌÅÄÕÅÔ: ÐÏÄ-ÂÅÖÁÔØ, ÂÅÓ-ÐÒÅÓÔÁÎÎÏ, ×Ù-ÓÔÉÒÁÔØ, ÐÒÅ-ËÒÁÓÎÙÊ, ÐÒÅ-ÓÌÅÄÏ×ÁÔØ.
+
+éÓËÌÀÞÅÎÉÅ: ÓÌÏ×Á, ÇÄÅ ÐÒÉÓÔÁ×ËÁ ÐÏÔÅÒÑÌÁ ÕÖÅ Ó×ÏÅ ÓÁÍÏÓÔÏÑÔÅÌØÎÏÅ ÚÎÁÞÅÎÉÅ
+É ÓÌÉÌÁÓØ Ó ËÏÒÎÅÍ: ÒÁ-ÚÕÍ, ÐÏ-ÄÕÛËÁ.
+
+7. åÓÌÉ ËÏÒÅÎØ ÓÌÏ×Á ÎÁÞÉÎÁÅÔÓÑ Ó ÇÌÁÓÎÏÊ, ÔÏ ÎÅ ÓÌÅÄÕÅÔ ÏÓÔÁ×ÌÑÔØ ÎÁ
+ÏÄÎÏÊ ÓÔÒÏËÅ ÐÒÉÓÔÁ×ËÕ Ó ÐÅÒ×ÏÊ ÇÌÁÓÎÏÊ ËÏÒÎÑ, Á ÏÓÔÁÌØÎÕÀ ÞÁÓÔØ ÓÌÏ×Á
+ÐÅÒÅÎÏÓÉÔØ. óÌÅÄÕÅÔ ÉÌÉ ÏÔÄÅÌÉÔØ ÐÒÉÓÔÁ×ËÕ ÏÔ ËÏÒÎÑ ÉÌÉ ÏÓÔÁ×ÉÔØ ÐÒÉ ÎÅÊ
+Ä×Á ÓÌÏÇÁ ËÏÒÎÑ. îÅÐÒÁ×ÉÌØÎÏ: ÂÅÚÁ-×ÁÒÉÊÎÙÊ, ÏÂÏ-ÓÔÒÅÎÉÅ, ÐÒÉÕ-ÒÏÞÉÔØ,
+ÐÏÄÏ-ÓÉÎÏ×ÉË; ÓÌÅÄÕÅÔ: ÂÅÚ-Á×ÁÒÉÊÎÙÊ, ÏÂ-ÏÓÔÒÅÎÉÅ, ÐÒÉ-ÕÒÏÞÉÔØ, ÐÏÄ-ÏÓÉÎÏ×ÉË
+ÉÌÉ ÐÒÉÕÒÏ-ÞÉÔØ, ÐÏÄÏÓÉ-ÎÏ×ÉË.
+
+ëÏÎÅÞÎÏ, ÎÁÄÏ ÏÔÌÉÞÁÔØ ÎÁÞÁÌØÎÕÀ ÇÌÁÓÎÕÀ ËÏÒÎÑ ÏÔ ×ÁÒÉÁÎÔÏ× ÐÒÉÓÔÁ×ËÉ.
+îÁÐÒÉÍÅÒ, ÐÒÁ×ÉÌØÎÏ ÐÅÒÅÎÅÓÔÉ ÔÁË: ÎÁÄÏ-Ò×ÁÔØÓÑ, ÏÂÏ-ÇÎÁÔØ, ÐÒÅÄÏ-ÓÔÁ×ÉÔØ.
+
+8. ðÒÉ ÐÅÒÅÎÏÓÅ ÓÌÏÖÎÙÅ ÓÏËÒÁÝÅÎÎÙÅ ÓÌÏ×Á ÓÌÅÄÕÅÔ ÒÁÚÂÉ×ÁÔØ ÎÁ ÓÏÓÔÁ×ÌÑÀÝÉÅ
+ÉÈ ÞÁÓÔÉ: ÐÁÒÔ-ÏÒÇ, ÓÐÅÃ-ÓÔÁ×ËÁ, ÎÏ ÎÅ ÔÁË: ÐÁÒ-ÔÏÒÇ, ÓÐÅÃÓ-ÔÁ×ËÁ. îÅ
+ÓÌÅÄÕÅÔ ÔÁËÖÅ ÏÂÅÓÓÍÙÓÌÉ×ÁÔØ ÓÌÏÖÎÙÅ ÓÌÏ×Á ÐÅÒÅÎÏÓÏÍ. íÏÖÎÏ ÐÅÒÅÎÅÓÔÉ:
+ÄÕÒ-ÁÌÀÍÉÎÉÊ, Á ÎÅ ÄÕÒÁ-ÌÀÍÉÎÉÊ.
+
+9. ðÒÉ ÐÅÒÅÎÏÓÅ ÎÁ ÍÅÓÔÅ ÓÔÙËÁ Ä×ÕÈ ÏÄÉÎÁËÏ×ÙÈ ÓÏÇÌÁÓÎÙÈ ÐÅÒÅÄ ÇÌÁÓÎÏÊ
+ÏÄÎÁ ÉÚ ÎÉÈ ÐÅÒÅÎÏÓÉÔÓÑ, ÄÒÕÇÁÑ ÏÓÔÁÅÔÓÑ ÎÁ ÐÒÅÄÙÄÕÝÅÊ ÓÔÒÏËÅ:
+ÐÒÏÍÙÛÌÅÎ-ÎÏÓÔØ, ËÌÁÓ-ÓÙ. îÏ: ËÌÁÓÓ-ÎÙÊ, ÐÒÏÇÒÁÍÍ-ÎÙÊ.
+
+ðÒÉÓÔÁ×ËÉ × É Ó ÐÅÒÅÄ ËÏÒÎÑÍÉ, ÎÁÞÉÎÁÀÝÉÍÉÓÑ Ó × É Ó, Á ÔÁËÖÅ Ä×ÏÊÎÙÅ
+ÓÏÇÌÁÓÎÙÅ × ÎÁÞÁÌÅ ËÏÒÎÑ ÐÒÉ ÐÅÒÅÎÏÓÅ ÎÅ ÒÁÚÄÅÌÑÀÔÓÑ: ÎÏ×Ï-××ÅÄÅÎÉÅ,
+ÐÏ-ÓÓÏÒÉÔØ, ÐÏÄÏ-ÖÖÅÎÎÙÊ.
+
+10. ÷ ÓÌÏ×ÁÈ, ÉÍÅÀÝÉÈ ÐÏÓÌÅ ÐÒÉÓÔÁ×ËÉ Ù, ÜÔÁ ÂÕË×Á ÏÓÔÁÅÔÓÑ ÐÒÉ ÐÒÉÓÔÁ×ËÅ:
+ÒÏÚÙ-ÇÒÙÛ, ÐÏÄÙ-ÓËÁÔØ.
+
+
+ðÏÈÏÖÉÅ (ÞÕÔØ ÄÏÐÏÌÎÅÎÎÙÅ) ÐÒÁ×ÉÌÁ ÍÏÖÎÏ ÎÁÊÔÉ É × ËÎÉÇÅ ÔÅÈ ÖÅ Á×ÔÏÒÏ×
+"òÕÓÓËÉÊ ÑÚÙË: óÐÒÁ×ÏÞÎÉË ÐÏ ÏÒÆÏÇÒÁÆÉÉ É ÐÕÎËÔÕÁÃÉÉ" (5-Å ÉÚÄÁÎÉÅ, í.,
+éÚÄ. íçõ, 1998).
+
+ ---------------------------------------------------------------
+
+÷ÏÔ ÞÔÏ ÇÏ×ÏÒÉÔ ÂÏÌÅÅ Ó×ÅÖÉÊ ÉÓÔÏÞÎÉË (á.÷.äÕÄÎÉËÏ×, á.é.áÒÂÕÚÏ×Á,
+é.é.÷ÏÒÏÖÂÉÃËÁÑ. òÕÓÓËÉÊ ÑÚÙË. í., ÷ÙÓÛ.ÛËÏÌÁ, 1977):
+
+ïÂÙÞÎÏ ÓÌÏ×Á ÐÅÒÅÎÏÓÑÔÓÑ ÐÏ ÓÌÏÇÁÍ (ÄÏ-ÒÏ-ÇÁ, ÐÒÅÄ-ÒÁÓ-Ó×ÅÔ-ÎÙÊ,
+ÐÒÏ-ÄÏÌ-ÖÉ-ÔÅÌØ-ÎÏÓÔØ).
+
+äÁÎÎÏÅ ÐÒÁ×ÉÌÏ ÉÍÅÅÔ ÓÌÅÄÕÀÝÉÅ ÏÇÒÁÎÉÞÅÎÉÑ:
+
+1. ÎÁÞÁÌØÎÙÅ É ËÏÎÅÞÎÙÅ ÇÌÁÓÎÙÅ ÂÕË×Ù, ÏÂÏÚÎÁÞÁÀÝÉÅ ÏÔÄÅÌØÎÙÊ ÓÌÏÇ, ÎÅ
+ÏÓÔÁ×ÌÑÀÔÓÑ ÎÁ ÓÔÒÏËÅ É ÎÅ ÐÅÒÅÎÏÓÑÔÓÑ ÎÁ ÓÔÒÏËÕ (ÁÍÅ-ÒÉ-ËÁÎ-ÓËÉÊ,
+ÑÐÏÎ-ÓËÉÊ, ÐÏ-Ü-ÚÉÑ, ÔÒÕ-ÄÏ-ÌÀ-ÂÉÅ);
+
+2. ËÏÎÅÞÎÙÅ ÓÏÇÌÁÓÎÙÅ ÂÕË×Ù ÐÒÉÓÔÁ×ÏË ÎÅÏÂÈÏÄÉÍÏ ÏÓÔÁ×ÌÑÔØ ÎÁ ÓÔÒÏËÅ
+(ÐÏÄ-ÂÒÏ-ÓÉÔØ, ×ÏÚ-ÒÁ-ÚÉÔØ, ÎÁÄ-ÂÒÏ×-ÎÙÊ);
+
+3. ÎÅÌØÚÑ ÐÅÒÅÎÏÓÉÔØ ÎÁ ÓÌÅÄÕÀÝÕÀ ÓÔÒÏËÕ ÞÁÓÔØ ÓÌÏ×Á, ÎÁÞÉÎÁÀÝÕÀÓÑ
+ÂÕË×ÏÊ Ù (ÐÏ-ÄÙ-ÔÏ-ÖÉÔØ);
+
+ [úÁÍÅÞÁÎÉÅ: ÎÅÔÒÕÄÎÏ ×ÉÄÅÔØ, ÞÔÏ ÐÅÒ×ÙÊ ÐÅÒÅÎÏÓ × ÐÒÉÍÅÒÅ
+ ÎÁÒÕÛÁÅÔ ÐÒÁ×ÉÌÏ 2. üÔÏÔ ÐÅÒÅÎÏÓ ÐÏ-×ÉÄÉÍÏÍÕ ÓÌÅÄÕÅÔ ÉÓËÌÀÞÉÔØ.]
+
+4. ÎÅÌØÚÑ ÐÒÉÓÏÅÄÉÎÑÔØ Ë ÐÒÉÓÔÁ×ËÅ ÎÁ ÇÌÁÓÎÕÀ ÐÅÒ×ÕÀ ÓÏÇÌÁÓÎÕÀ ÂÕË×Õ
+ËÏÒÎÑ (ÐÏ-ÄÒÕ-ÇÉ, ÚÁ-Ó×ÅÔ-ÌÏ, ×Ï-Ò×ÁÔØ-ÓÑ);
+
+5. ÎÅÌØÚÑ ÒÁÚÂÉ×ÁÔØ ÐÒÉ ÐÅÒÅÎÏÓÅ ÓÕÆÆÉËÓ -ÓË- (ÓÏ-×ÅÔ-ÓËÉÊ, ÆÒÁÎ-ÃÕÚ-ÓËÉÊ,
+ÒÕÓ-ÓËÉÊ); ÐÒÏÉÚ×ÏÄÎÙÅ ÏÔ ÎÅÇÏ ÓÕÆÆÉËÓÙ -ÅÓË-, -ÞÅÓË- É ÄÒ. ÐÒÉ ÐÅÒÅÎÏÓÅ
+ÒÁÚÂÉ×ÁÀÔÓÑ (×ÒÁ-ÖÅÓ-ËÉÊ, ÕÐÁ-ÄÏÞ-ÎÉ-ÞÅÓ-ËÉÊ);
+
+6. ÎÅÌØÚÑ ÏÓÔÁ×ÌÑÔØ ÎÁ ÓÔÒÏËÅ ÉÌÉ ÐÅÒÅÎÏÓÉÔØ ÎÁ ÓÌÅÄÕÀÝÕÀ ÓÔÒÏËÕ Ä×Å
+ÏÄÉÎÁËÏ×ÙÅ ÓÏÇÌÁÓÎÙÅ (ËÏÌ-ÌÅË-ÃÉÑ, ËÏÍ-ÍÕ-ÎÉÚÍ, ÏÓÅÎ-ÎÉÊ).
+
+ -----------------------------------------------------------------
+
+á ×ÏÔ ÞÔÏ ÎÁÐÉÓÁÎÏ × ËÎÉÇÅ æ.âÁÕÜÒÁ "áÚÂÕËÁ ÎÁÂÏÒÝÉËÁ" (éÚÄ. ãë óòðð óóóò,
+ì., 1925) [ïÓÏÂÅÎÎÏÓÔÉ ÐÕÎËÔÕÁÃÉÉ ÓÏÈÒÁÎÅÎÙ]:
+
+1. ïÄÎÏÓÌÏÖÎÙÅ ÓÌÏ×Á ÎÅÌØÚÑ ÎÉËÏÇÄÁ ÒÁÚÄÅÌÑÔØ É ÉÈ ÓÌÅÄÕÅÔ ÉÌÉ ×ÙËÌÀÞÁÔØ
+× ÔÕ ÖÅ ÓÔÒÏËÕ, ÉÌÉ ÃÅÌÉËÏÍ ÐÅÒÅÎÏÓÉÔØ ÎÁ ÓÌÅÄÕÀÝÕÀ, ÎÁÐÒ., ËÏÔ, ÄÏÖÄØ,
+ÓÔÅÐØ. ëÒÏÍÅ ÔÏÇÏ ÎÅÌØÚÑ ÐÅÒÅÎÏÓÉÔØ ÏËÏÎÞÁÎÉÑ ÓÌÏ× ÉÌÉ ÖÅ ÏÔÄÅÌÑÔØ ÎÁÞÁÌÏ
+ÓÌÏ×, ÓÏÓÔÏÑÝÉÈ ÉÚ ÏÄÎÉÈ ÔÏÌØËÏ ÓÏÇÌÁÓÎÙÈ ÂÕË×, ËÁË ÎÁÐÒÉÍÅÒ, ÓÌÏ×Ï
+"×ÓÐÏÍÎÉ", ÍÏÖÎÏ ÒÁÚÄÅÌÉÔØ ÎÁ ×ÓÐÏ-ÍÎÉ, Á ÎÅ ×Ó-ÐÏÍÎÉ.
+
+2. îÁÈÏÄÑÝÁÑÓÑ ÍÅÖÄÕ Ä×ÕÍÑ ÇÌÁÓÎÙÍÉ ÏÄÎÁ ÓÏÇÌÁÓÎÁÑ ÐÒÉ ÐÅÒÅÎÏÓÅ ÏÔÎÏÓÉÔÓÑ
+Ë ÓÌÅÄÕÀÝÅÍÕ ÓÌÏÇÕ, ËÁË ÎÁÐÒ., ÐÏ-ÌÅ, ÚÎÁ-ÍÑ, Ó×Ï-ÂÏ-ÄÁ.
+
+3. åÓÌÉ ÍÑÇËÉÊ ÚÎÁË "Ø" ÓÔÏÉÔ ÍÅÖÄÕ Ä×ÕÍÑ ÓÏÇÌÁÓÎÙÍÉ, ÔÏ ÅÇÏ ÎÅÌØÚÑ
+ÏÔÄÅÌÑÔØ, Á ÓÌÅÄÕÅÔ ×ÓÅÇÄÁ ÏÓÔÁ×ÌÑÔØ ÎÁ ÐÅÒ×ÏÊ ÓÔÒÏËÅ, ÎÁÐÒ.: ÍÁÌÅÎØ-ËÉÊ,
+ÍÁÌØ-ÞÉË. îÏ ÅÓÌÉ "Ø" ÒÁÚÄÅÌÑÅÔ ÇÌÁÓÎÙÅ Å, É, À, Ñ, ÏÔ ÓÏÇÌÁÓÎÏÊ, ÔÏ
+ÔÏÇÄÁ ÓÌÏ×Ï ÎÅÌØÚÑ ÒÁÚÂÉÔØ Ó ÏÓÔÁ×ÌÅÎÉÅÍ "Ø" ÎÁ ÐÅÒ×ÏÊ ÓÔÒÏËÅ, Á ÅÇÏ
+ÓÌÅÄÕÅÔ ÐÅÒÅÎÅÓÔÉ ÎÁ ÓÌÅÄÕÀÝÕÀ, ÎÁÐÒ. ÷ÏÒÏ-ÂØÅ×, óÏÌÏ-×ØÅ×.
+
+4. îÅÌØÚÑ ÒÁÚÄÅÌÑÔØ: ÂÌ, ×Ì, ÍÌ, ÐÌ, ÆÌ, ÖÄ, É ÐÏÜÔÏÍÕ ÓÌÅÄÕÅÔ ÐÅÒÅÎÏÓÉÔØ:
+ÎÁÄÅ-ÖÄÁ, ÌÏ-×ÌÀ, ÌÀ-ÂÌÀ.
+
+5. óÕÆÆÉËÓÙ ÓËÉÊ É ÓÔ×Ï ÎÉËÏÇÄÁ ÎÅ ÒÁÚÄÅÌÑÀÔÓÑ, Á ÐÏÜÔÏÍÕ ÓÌÅÄÕÅÔ ÐÅÒÅÎÏÓÉÔØ:
+ÈÉÍÉÞÅ-ÓËÉÊ, ÏÐÔÉÞÅ-ÓËÉÊ, ÔÏÒÖÅ-ÓÔ×Ï, ÐÒÁÚÄÎÅ-ÓÔ×Ï.
+
+6. ðÒÉ ÐÅÒÅÎÏÓÅ ÓÌÏÖÎÙÈ ÓÌÏ× ÎÅÏÂÈÏÄÉÍÏ ÐÏÍÎÉÔØ, ÞÔÏ ÎÅÌØÚÑ ÏÔÎÉÍÁÔØ Õ ËÏÒÎÑ
+ÏÄÎÕ ÉÌÉ ÎÅÓËÏÌØËÏ ÂÕË× É ÐÒÉÓÏÅÄÉÎÑÔØ ÉÈ Ë ÐÒÉÓÔÁ×ËÅ, Á ÓÌÅÄÕÅÔ ÄÅÌÉÔØ
+ÔÏÞÎÏ ÎÁ ËÏÒÅÎØ É ÐÒÉÓÔÁ×ËÕ Ë ÎÅÍÕ; ÐÏÜÔÏÍÕ ÎÁÄÏ ÐÅÒÅÎÏÓÉÔØ ÐÅÒ×Ï-Ú×ÁÎÎÙÊ,
+ÎÉÓ-ÈÏÄÉÔØ.
+
+7. óÌÏÖÎÙÅ ÓÌÏ×Á ÎÁÄÏ ÄÅÌÉÔØ ÎÁ ÉÈ ÓÏÓÔÁ×ÎÙÅ ÞÁÓÔÉ: ÒÅÓ-ÐÕÂÌÉËÁ, ÔÉÐÏ-ÇÒÁÆÉÑ,
+ËÎÉÇÏ-ÐÅÞÁÔÁÎÉÅ, ÐÅÒÅ-ÐÌÅÔÞÉË, ÐÁÒÏ-ÈÏÄ.
diff --git a/Master/texmf-dist/source/generic/ruhyphen/mkcyryo b/Master/texmf-dist/source/generic/ruhyphen/mkcyryo
new file mode 100755
index 00000000000..286c8657549
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/mkcyryo
@@ -0,0 +1,22 @@
+#!/bin/sh
+# make patterns for the cyryo by repeating patterns for cyre
+
+TMP=.cyryo-tmp
+
+awk '/^\\patterns{/ {p=1;next} /^}/ {p=0;next} p {print}' $1 > $TMP
+cat $TMP | grep 'Å' | grep -v 'Å[^Å]*Å' > ${TMP}1
+cat $TMP | grep 'Å[^Å]*Å' | grep -v 'Å[^Å]*Å[^Å]*Å' > ${TMP}2
+cat $TMP | grep 'Å[^Å]*Å[^Å]*Å' > ${TMP}3
+test ! -s ${TMP}3 || { echo "*** triple cyre detected in $1:" 1>&2; cat ${TMP}3 1>&2; }
+
+{
+echo "% accompanying patterns for cyryo generated from $1"
+echo "\patterns{"
+cat ${TMP}1 | sed 's,Å,£,'
+cat ${TMP}2 | sed 'y,Å,£,'
+cat ${TMP}2 | sed 's,Å,£,'
+cat ${TMP}2 | sed 's,Å,£,2'
+echo "}"
+} | ./reduce-patt | ./sorthyph
+
+rm -f $TMP ${TMP}[123]
diff --git a/Master/texmf-dist/source/generic/ruhyphen/reduce-patt b/Master/texmf-dist/source/generic/ruhyphen/reduce-patt
new file mode 100755
index 00000000000..3d146e09c26
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/reduce-patt
@@ -0,0 +1,8 @@
+#!/usr/bin/perl -n
+
+if (/^\\patterns{/) { $p=1; print; next; }
+if (/^}/) { $p=0; print; next; }
+if (!$p) { print; next; }
+
+$p=$_; chomp; y/0-9//d; s/^\./^/; s/\.$/\$/;
+print $p if (!system "grep", "-q", "$_", "/tmp/.wl-lc-cyryo");
diff --git a/Master/texmf-dist/source/generic/ruhyphen/sorthyph b/Master/texmf-dist/source/generic/ruhyphen/sorthyph
new file mode 100755
index 00000000000..13680ee5931
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/sorthyph
@@ -0,0 +1,9 @@
+#!/usr/bin/perl
+# sort a hyphenation file
+$| = 1;
+while (<>) { print; last if /^\\patterns{/ }
+open (SORT, "| sh sortkoi8 | awk '{print \$2}'");
+while (<>) { last if /^}/; chomp; $temp=$_; s/[0-9.]//g; print SORT "$_\t$temp\n" }
+close (SORT);
+print;
+while (<>) { print }
diff --git a/Master/texmf-dist/source/generic/ruhyphen/sortkoi8 b/Master/texmf-dist/source/generic/ruhyphen/sortkoi8
new file mode 100755
index 00000000000..ac990400ba3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/sortkoi8
@@ -0,0 +1,16 @@
+#!/bin/sh
+# sort a file in Cyrillic koi8-r encoding alphabetically
+#
+# -f Fold lower case characters into the equivalent upper case
+# characters when sorting so that, for example, `B' is greater
+# than `a' (without `-f', uppercase characters precede lowercase).
+
+if [ "$1" = "-f" ]; then
+ FOLD="-f"
+ ALPH='áÁâÂ÷×çÇäÄåų£öÖúÚéÉêÊëËìÌíÍîÎïÏðÐòÒóÓôÔõÕæÆèÈãÃþÞûÛýÝÿßùÙøØüÜàÀñÑ'
+else
+ ALPH='áâ÷çäå³öúéêëìíîïðòóôõæèãþûýÿùøüàñÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑ'
+fi
+TEMP='¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'
+
+tr $ALPH $TEMP | sort $FOLD | tr $TEMP $ALPH
diff --git a/Master/texmf-dist/source/generic/ruhyphen/trans b/Master/texmf-dist/source/generic/ruhyphen/trans
new file mode 100755
index 00000000000..1a65ffaec36
--- /dev/null
+++ b/Master/texmf-dist/source/generic/ruhyphen/trans
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+koi='áâ÷çäåöúéêëìíîïðòóôõæèãþûýÿùøüàñÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀѳ£'
+iso='°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîï¡ñ'
+win='ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ¨¸'
+alt='€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯àáâãäåæçèéêëìíîïðñ'
+mac='€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþßÝÞ'
+
+eval tr \$$1 \$$2
diff --git a/Master/texmf-dist/source/generic/shapepar/proshap.py b/Master/texmf-dist/source/generic/shapepar/proshap.py
new file mode 100644
index 00000000000..e91e65e0a55
--- /dev/null
+++ b/Master/texmf-dist/source/generic/shapepar/proshap.py
@@ -0,0 +1,350 @@
+"""
+proshap.py v. 1.1
+
+Desc:
+Rasterizer for producing shapes useful for the LaTeX package
+shapepar. It's a python script. www.python.org.
+
+
+Copyright Manuel Gutierrez Algaba January 2003
+All rights reserved.
+Released under GPL license.
+
+Contact: algaba@gmx.net
+
+Changes:
+1.1 : New {10}{0}b{5.6} command, automatic now.
+1.1 : New copyright notice
+
+known Bugs:
+
+ Watch when have two forks at the same line. Example:
+ --------------------------------------------
+ ----- --------------- --------
+
+Solution: Increase the resolution (number of lines and height) and
+don't put the two forks at the same line.
+
+It _may_ fail a 'bit'.
+
+"""
+
+import string
+
+test1 = """
+ 3333
+ 33333333333
+ 33333333333333
+ 3333333333333333
+ 333333
+ 333333
+ 3333333
+ 3333333
+ 3333333 3333
+ 3333333 33333333
+ 3333333 33333333333 3
+ 3333333 333333 33333 33
+ 333333 333333 33333 3333
+ 333333 333333 33333 3333
+ 33333333333333333 3333333333
+ 33333333333333 33333333
+"""
+
+test3 = """
+ 33333333333333333
+ 33333333333333333333333333333
+ 333333333333333333333333333333333
+ 33333333333333333333333333333333333
+ 3333333333333333333333333333333333333
+ 333333 3333333 333333
+ 33333 33333 33333
+ 333333 3333333 33333
+ 33333333333333333 33333333333333333
+ 333333333333333 333333333333333
+ 3333333333333 3333333333333
+ 333333333333333333333333333333
+ 3333333333333333333333333333
+ 33 333
+ 333333 333333333
+ 3333333333333333333333
+"""
+
+test4 = """
+ 33
+ 333333
+ 33333333
+ 3333333333
+ 333333333333
+ 33333333
+ 3333333333333333
+ 3333
+ 3333
+"""
+
+
+test5 = """
+
+ 333333333333333333333
+ 3333333333333333333333
+ 33333333333 3333
+ 3333333 333
+ 33333333
+ 33333333333
+ 3333333333333333333333333333333333333333333333
+ 3333333333333333333333333333333333333333333333
+ 3333333333333333333333333333333333333333333333
+ 3333333333333333333333333333333333333333333333
+ 3333333333333333333333333333333333333333333333
+ 33333 333333333 3333333
+ 333 3333333 33333
+ 33 33333333333 333
+ 3 3333333333333333 33
+
+"""
+
+test6 = """
+3
+333
+333333333
+ 333333333333
+ 33333333333333333
+ 33333333333333333
+ 33333333333333333
+ 33333333333333333
+ 333333333333333333
+ 3333333333333333333
+ 3333333333333333333
+ 33333333333333333333
+ 33333333333333333
+"""
+
+test7 = """
+
+ 3333 33333 333333 333 33
+ 333333333333 333 333 33 33 33
+ 333 333 333 333 33 333 333 3333
+3333 33333333 333333 33
+
+
+"""
+test8 = """
+
+ 33333333333333333333333333333333
+ 33333333333333333333333333
+ 33333 33333
+ 3333333 3333333
+ 333333333 333333333
+ 333333333 333333333
+ 3333333 3333333
+ 33333333333333333333333333
+"""
+
+test9 = """
+333333333333333333333333333333333333333333333333333333333333
+333333333333333333333333333333333333333333333333333333333333
+ 3333333333333333333333333333333333333333333333
+ 33333333333333333333333333333333333333
+ 33333333333333333333333333333333
+ 333333333333333333333
+ 33333333333333333
+ 33333333333333333
+ 33333333333333333
+ 333333333333333333333
+ 33333333333333333333333333333333
+ 333333333333333333333333333333333333333
+ 3333333333333333333333333333333333333333333333
+333333333333333333333333333333333333333333333333333333333333
+"""
+test10 = """
+ 3
+ 3
+ 3
+ 33333
+ 3333333
+ 333
+ 3
+ 3
+"""
+
+test11 = """
+
+ 3
+ 3333
+ 333
+33
+"""
+
+test12 = """
+3333 3333 3333 3333
+33333 333333 333333 33333
+3333333 333333333 3333333333 333333
+33333333333333333333333333333333333333333333333
+"""
+test = test3
+list_of_lines = string.split(test,"\n")
+
+def detect_start(line, index = 0):
+ """
+ line : not containing \n
+ """
+ c = index
+ for i in line:
+ if i!=" ":
+ return c
+ c = c +1
+ return None
+
+def detect_end(line, index):
+ """
+ line : not containing \n
+ """
+ c = index
+ for i in line:
+ if i==" " :
+ break
+ c = c + 1
+ return c
+
+def generate(current, last):
+ """
+ current, last : list of segments, perhaps requiring a
+ join or a split
+
+ """
+ for i in xrange(0,len(current)):
+ if i == len(current) -1:
+ break
+ for j in last:
+ if j.overlaps(current[i], current[i+1]):
+ j.make_joint()
+ #print "o"
+
+ for i in xrange(0,len(last)):
+ if i == len(last) -1:
+ break
+ for j in current:
+ if j.splits(last[i], last[i+1]):
+ #print "s"
+ j.make_split()
+
+class segment:
+ def __init__(self, start, end, number ):
+ self._start = start
+ self._end = end
+ self._split = 0
+ self._joint = 0
+ self._numberofline = number
+
+ def get_no_line(self):
+ return self._numberofline
+
+ def make_height(self, h):
+ self._height = h
+
+ def make_joint(self):
+ self._joint = self._joint + 1
+
+ def make_split(self):
+ self._split = self._split + 1
+
+ def overlaps(self, seg1, seg2):
+ """
+ This segment is the 'father' of seg1 , seg2 , See drawing:
+ -------------------- <-- seg this
+ --------- -------- <-- seg1 and seg2
+ """
+ return seg1._end > self._start and seg2._start < self._end
+
+ def splits(self, seg1, seg2):
+ """
+ This segment is the 'son' of seg1 , seg2 , See drawing:
+ --------- -------- <-- seg1 and seg2
+ -------------------- <-- seg this
+ """
+ return seg1._end > self._start and seg2._start < self._end
+
+ def generate_line(self, factor, heading = None):
+ dev = ""
+ if not heading is None :
+ dev = dev + "{"+ str(self._height)+ "}"
+ dev = dev +"t{"
+ l = self._end - self._start
+ l = l * factor
+ if self._split:
+ c = "j"
+ else:
+ c = "s"
+ if self._split or self._joint:
+ a = self._split + self._joint # one of them will be 0
+ div_f = a + 1.0
+ dev = dev + str(self._start* factor) + "}{" + str(l/div_f) + \
+ "}"
+ for i in xrange(0,a):
+ dev = dev + c+ "t{"+ \
+ str(self._start* factor + (i+1)*l/div_f)+ \
+ "}{" + str(l/div_f) +"}"
+ else:
+ dev = dev = dev + str(self._start* factor) + "}{" + str(l)+ "}"
+ return dev
+
+list_of_segments = []
+last_line_segments = []
+current_line_segments = []
+
+numberofline = 0
+for i in list_of_lines:
+ numberofline = numberofline + 1
+ s = detect_start(i)
+ if s is None:
+ continue
+ e = detect_end(line = i[s:], index = s)
+ while 1:
+ #print s,e
+ current_line_segments.append(segment(s,e, numberofline))
+ s = detect_start(line = i[e:], index = e)
+ if s is None:
+ break
+ e = detect_end(line = i[s:], index = s)
+
+ generate(current_line_segments, last_line_segments)
+ list_of_segments = list_of_segments + current_line_segments
+ last_line_segments = current_line_segments
+ current_line_segments =[]
+
+each_char = 0.4
+height = 0
+inc_height = 0.8
+numberofline = -1
+
+#{20}{0}b{1.6}
+result = ""
+max = -1
+for i in list_of_segments:
+ if i._end > max:
+ max = i._end
+ i.make_height(height)
+ height = height + inc_height
+ nl= i.get_no_line()
+ if nl != numberofline:
+ numberofline = nl
+ result = result + "\\\\"
+ result = result + i.generate_line(each_char,heading = 1) + "\n"
+ else:
+ result = result + i.generate_line(each_char) + "\n"
+
+height = height + inc_height
+
+# str(list_of_segments[0]._start)
+middle = str(each_char *max/2.0)
+
+result = "\\gdef\\bassshape{{"+ middle + \
+ "}{0}b{"+ middle +"}\n" + result
+
+
+result = result+ "\\\\{"+str(height) +"}e{"+ middle +"}" + "}\n"
+print result
+f = open("result.tex","w")
+f.write(result)
+f.close()
+
+
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/0sampdos.inf b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/0sampdos.inf
new file mode 100644
index 00000000000..b7bcb5379bf
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/0sampdos.inf
@@ -0,0 +1,5 @@
+ All files in this directory belong to the TAP package
+
+ Use TCV.BAT to translate *.RAW files into plain TeX.
+ (TCV.BAT makes use of Gnu AWK; the version 3.0.x is recommended)
+
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/post1.tex b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/post1.tex
new file mode 100644
index 00000000000..0e2330f2bfa
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/post1.tex
@@ -0,0 +1,3 @@
+\endtable
+
+\end
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/post2.tex b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/post2.tex
new file mode 100644
index 00000000000..2a7a74853ad
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/post2.tex
@@ -0,0 +1,4 @@
+\B"\Z"\Z" "\Z"\Z" "\Z"\Z" "\Z"\Z" "\Z"\Z" "\Z"\Z" "\Z"\Z\E"
+\endtable
+
+\end
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea1.tex b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea1.tex
new file mode 100644
index 00000000000..9af340975b8
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea1.tex
@@ -0,0 +1,5 @@
+\input tap
+\nopagenumbers
+
+\begintable
+\begintableformat &\center \endtableformat
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea2.tex b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea2.tex
new file mode 100644
index 00000000000..a6af34ddb91
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea2.tex
@@ -0,0 +1,7 @@
+\input tap
+\nopagenumbers
+
+\def\Z{\hbox to5mm{}}
+
+\begintable
+\begintableformat &\center \endtableformat
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea3.tex b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea3.tex
new file mode 100644
index 00000000000..a6c581c8e82
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/prea3.tex
@@ -0,0 +1,6 @@
+\input tap
+\nopagenumbers
+
+\thistable{\desiredwidth36em}
+\begintable
+\begintableformat &\left \endtableformat
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv0.raw b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv0.raw
new file mode 100644
index 00000000000..74403186b1d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv0.raw
@@ -0,0 +1,5 @@
+ÉÍÍÍÍÑÍÍÍÍËÍÍÍÍÑÍÍÍÍ»
+º 1 ³ 2 º 3 ³ 4 º
+ÇÄÄÄÄÅÄÄÄÄ×ÄÄÄÄÅÄÄÄĶ
+º 11 ³ 22 º 33 ³ 44 º
+ÈÍÍÍÍÏÍÍÍÍÊÍÍÍÍÏÍÍÍͼ
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv1.raw b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv1.raw
new file mode 100644
index 00000000000..be6f5924445
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv1.raw
@@ -0,0 +1,9 @@
+ÉÍÍÍÍÑÍÍÍÍËÍÍÍÍÑÍÍÍÍ»
+º 1 ³ 1 º 1 ³ 1 º
+º 2 ³ 2 º 2 ³ 2 º
+º 3 ³ 3 º 3 ³ 3 º
+ÇÄÄÄÄÅÄÄÄÄ×ÄÄÄÄÅÄÄÄĶ
+º 44 ³ 44 º 44 ³ 44 º
+º 55 ³ 55 º 55 ³ 55 º
+º 66 ³ 66 º 66 ³ 66 º
+ÈÍÍÍÍÏÍÍÍÍÊÍÍÍÍÏÍÍÍͼ
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv2.raw b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv2.raw
new file mode 100644
index 00000000000..5ca9a2c85c3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv2.raw
@@ -0,0 +1,11 @@
+
+
+ ÉÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
+ º rubryka 1 ³ rubryka 2 ³ rubryka 3 ³ rubryka 4 º
+ ÌÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
+ º rubryka 1 i 2 ³ rubryka 3 i 4 º
+ ÇÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
+ º ³ rubryka 2 i 3 ³ º
+ ÇÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ wiersz 3 i 4 º
+ º rubryka 1, 2, 3 ³ º
+ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv3.raw b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv3.raw
new file mode 100644
index 00000000000..57ce13288d8
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv3.raw
@@ -0,0 +1,15 @@
+ J. H. B\"ohning, 1838
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
+ M. J. H. B\"ohning, 1882 ³
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
+ ³ ³ M. D. Blase, 1840
+ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
+L. M. Bohning, 1912 ³
+ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
+ ³ E. F. Ehlert, 1845
+ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
+ ³ P. A. M. Ehlert, 1884 ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
+ ³ C. L. Wischmeyer, 1850
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
+
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv4.raw b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv4.raw
new file mode 100644
index 00000000000..9af65fe2dd1
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv4.raw
@@ -0,0 +1,8 @@
+ COLUMN
+ OF NUMBERS
+ÍÍÍÍÍÍÍÍÍÍÍÍ
+ 12,3
+ 0,12
+ 12345,678
+ 0,1234
+123456,0
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv5.raw b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv5.raw
new file mode 100644
index 00000000000..d2ec5442dd5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv5.raw
@@ -0,0 +1,15 @@
+ ÉÍÍÍÍÍÍÍ»
+ ºB O S Sº
+ ÈÍÍÍÑÍÍͼ
+ ³
+ ³
+ ³
+ ³
+ ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
+ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³
+ ÚÄÄÄÁÄÄÄ¿ ÚÄÄÄÁÄÄÄ¿ ÚÄÄÄÁÄÄÄ¿ ÚÄÄÄÁÄÄÄ¿ ÚÄÄÄÁÄÄÄ¿ ÚÄÄÄÁÄÄÄ¿
+ ³ v-ce ³ ³ v-ce ³ ³ v-ce ³ ³ v-ce ³ ³ v-ce ³ ³ v-ce ³
+ ³ boss 1³ ³ boss 2³ ³ boss 3³ ³ boss 4³ ³ boss 5³ ³ boss 6³
+ ÀÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÙ
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv6.raw b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv6.raw
new file mode 100644
index 00000000000..b3a3c4cca95
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tapcv6.raw
@@ -0,0 +1,36 @@
+
+
+
+ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+ ³ ³
+ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³
+ ³ ³ ³ ³
+ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³
+ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ÉÍÍÍÍÍÍÍÍÍ» ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ º º ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ º T A P º ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ º º ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ÈÍÍÍÍÍÍÍÍͼ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ³ ³
+ ³ ³ ³ ³ ³ ³ ³ ³
+ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ³
+ ³ ³ ³ ³ ³ ³
+ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³
+ ³ ³ ³ ³
+ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³
+ ³ ³
+ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tcv.bat b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tcv.bat
new file mode 100644
index 00000000000..660ff087ee2
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tcv.bat
@@ -0,0 +1,16 @@
+@echo off
+:: %1 input file name
+:: %2 output file name
+:: %3 extra spaces added at sides of every cell
+:: %4 span columns if %4=0, no spanning if %4=1
+:: %5 TeX text inserted in rows containing only vertical rules
+:: %6 preamble file name
+:: %7 postamble file name
+call tcv_ tapcv0.raw tapcv0.tex prea1.tex post1.tex 2 0
+call tcv_ tapcv1.raw tapcv1.tex prea1.tex post1.tex 2 0
+call tcv_ tapcv2.raw tapcv2.tex prea1.tex post1.tex 2 0
+call tcv_ tapcv3.raw tapcv3.tex prea3.tex post1.tex 0 1
+call tcv_ tapcv4.raw tapcv4.tex prea1.tex post1.tex 2 0
+call tcv_ tapcv5.raw tapcv5.tex prea2.tex post2.tex 2 0 \\V{x}
+call tcv_ tapcv6.raw tapcv6a.tex prea1.tex post1.tex 2 0 \\D+
+call tcv_ tapcv6.raw tapcv6b.tex prea1.tex post1.tex 2 0
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tcv_.bat b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tcv_.bat
new file mode 100644
index 00000000000..f8ffb442b9b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/sampdos/tcv_.bat
@@ -0,0 +1,4 @@
+echo converting %1 to %2
+gawk -f../tapcv.awk -vEXPROW=%5 -vNOSPAN=%6 -vINSROW=%7 %1 > tmp.tmp
+copy /b %3 + tmp.tmp + %4 %2 > nul
+del tmp.tmp
diff --git a/Master/texmf-dist/source/generic/tap/tabcv/tapcv.awk b/Master/texmf-dist/source/generic/tap/tabcv/tapcv.awk
new file mode 100644
index 00000000000..1be6213b475
--- /dev/null
+++ b/Master/texmf-dist/source/generic/tap/tabcv/tapcv.awk
@@ -0,0 +1,239 @@
+# ---------------------------------------------------------------------------
+ This file belongs to the TAP package
+# ---------------------------------------------------------------------------
+# This is an AWK translator of tables written in extended ASCII format
+# to TeX/TAP format.
+
+# VERSION: 0.71, Tuesday, January 27th, 1998 -- essentially the
+# same as ver. 0.5 of Friday, May 3rd, 1996 (BachoTeX 96 release)
+
+# AUTHORS' COORDINATES
+#
+# Names: Bogu\l{}aw Jackowski, Piotr Pianowski, Piotr Strzelczyk
+# Mail: BOP s.c., ul. Piastowska 70, 80-363 Gda\'nsk, Poland
+# Email: B.Jackowski@GUST.ORG.PL
+
+# ===========================================================================
+BEGIN {
+ EXPROW=EXPROW+0 # pad each cell with at least EXPROW spaces
+ NOSPAN=NOSPAN+0 # use " mark instead of @ operator
+# INSROW is inserted in rows ~ "^[ " U S "]+$" (if not empty)
+ H="Í"; V="¶·¹º»¼½ÇÈÉÊËÌÎÐÒÓÖ×"; h="Ä"; v="µ¸´³¿Ù¾ÆÀÚÁÂÃÅÏÑÔÕØ"
+ U=" º³" # U is the subset of V + v + " "
+ S="°" # the explicit mark of a strut column (converted later to ")
+}
+# ===========================================================================
+function int_subst(u) {# task-specific substitutions for table interior
+ gsub("<","$<$",u); gsub(">","$>$",u); gsub("%","\\%",u); return u
+}
+function spaces(n) {return (n>0 ? sprintf("%" n "s", "") : "")}
+function chars(n,c, t) {t=spaces(n); gsub(" ", c, t); return t}
+function tildes(n) {return chars(n,"~")}
+function center(l,s, k1,k2) {
+# pads string s symmetrically with spaces such that result has length=l
+ k2=0; k1=int((l-length(s))/2); if (k1>=0) k2=l-length(s)-k1
+ return spaces(k1) s spaces(k2)
+}
+# ===========================================================================
+# STORE ALL THE STUFF
+# ===========================================================================
+/[^ ]/ {
+ if ( !(($0 ~ "^[ " U S "]+$") && (INSROW=="")) ) {
+ gsub(/ +$/,"") # trailing spaces are meaningless
+ line[++line_]=$0
+ if (longest<length($0)) longest=length($0) # fix max line length
+ PFX[line_]=(line[line_] ~ "(^[" V v S " ]+$)|([" H h "])" ? "-" : "+")
+ if ($0 ~ "^[ " U S "]+$") PFX[line_]="0"
+ }
+}
+# ===========================================================================
+END {
+# PASS 0:
+# 0a: truncate leading spaces
+ u=longest
+ for (l=1; l<=line_; ++l)
+ if (match(line[l],/^ +[^ ]/)) {if (RLENGTH<u) u=RLENGTH} else u=1
+ if (u>1) for (l=1; l<=line_; ++l) line[l]=substr(line[l],u)
+ longest=longest-u+1
+# 0b: check whether the first and the last columns contain vrules
+ i=1; j=1;
+ for (l=1; l<=line_; ++l) {
+ if (substr(line[l],1,1) ~ ("[" V v S "]")) i=0
+ if (length(line[l])==longest)
+ if (substr(line[l],longest) ~ ("[" V v S "]")) j=0
+ }
+# 0c: pad with trailing spaces (make the length of all rows equal)
+ for (l=1; l<=line_; ++l) line[l]=line[l] spaces(longest-length(line[l]))
+# 0d: add artificial begin and end strut, if needed
+ if (j) for (l=1; l<=line_; ++l) line[l]=line[l] S
+ if (i) for (l=1; l<=line_; ++l) line[l]=S line[l]
+ longest=longest+i+j
+# 0e: fix prefixes
+ for (l=1; l<=line_-1; ++l)
+ if ((PFX[l]=="-") && (PFX[l+1]=="+")) PFX[l+1]="^"
+ for (l=1; l<=line_-1; ++l) {
+ if ((PFX[l]=="^") && (PFX[l+1]=="-")) PFX[l]=":"
+ if ((PFX[l]=="+") && (PFX[l+1]=="-")) PFX[l]="_"
+ }
+# PASS 1: check input data
+# 1a: find position of vrules for all rows
+ for (l=1; l<=line_; ++l) {
+ for (i=1; i<=length(line[l]); ++i) {
+ ch=substr(line[l],i,1)
+ if ((ch!=".") && (ch!="?") && (ch!="(") && (ch!=")")\
+ && (ch!="+") && (ch!="*") && (ch!="[") && (ch!="]"))
+ if (match(V v S,ch)) C[i]=i
+ }
+ }
+ for (i in C) if ((i+0)>C_) C_=i+0 # index is a string, hence forced coercion
+ for (i=1; i<=C_; ++i) if (i in C) {D[++D_]=i; C[i]=D_}
+# if (c in C) holds, a vrule has occured in c-th column; C_ is the maximal
+# such c; for d such that 1<=d<=D_ (D[d] in C) holds; moreover, C[D[d]]=d
+# 1b: check consistency of data (in the positions of vrules only spaces
+# or vrules or struts may appear, unless NOSPAN==0)
+ for (l=1; l<=line_; ++l) for (i=1; i<=D_; ++i)
+ if ((NOSPAN) || (i==1) || (i==D_))
+ if (!match(V v S " ",substr(line[l],D[i],1))) {
+ print "! INCONSISTENT DATA."
+ print "ROW:", l ", COLUMN:", i ", CHARACTER:",
+ substr(line[l],D[i],1) "."
+ exit
+ }
+# 1c: put opening and closing struts, and all remaining struts if (NOSPAN==1)
+ for (l=1; l<=line_; ++l) for (i=1; i<=D_; ++i)
+ if ((NOSPAN) || (i==1) || (i==D_))
+ if (substr(line[l],D[i],1)==" ")
+ line[l]=substr(line[l],1,D[i]-1) S substr(line[l],D[i]+1)
+# PASS 2: check areas between vertical rules (find the longest one)
+ for (l=1; l<=line_; ++l) {
+ s=line[l]; t=""; u2=1
+ while (s!="") {
+ if (match(s,"[" V v S "][^" V v S "]+[" V v S "]")) {
+ t=t substr(s,RSTART,1)
+ u=substr(s,RSTART+1,RLENGTH-2)
+ s=substr(s,RSTART+RLENGTH-1)
+ u_=length(u); gsub("^ +","",u); gsub(" +$","",u)
+ u1=u2+RSTART-1; u2=u1+RLENGTH-1; c1=C[u1]; c2=C[u2]
+ if (u ~ /^[0-9]+[\.,]?[0-9]*$/) {
+ if (match(u,/^[0-9]+$/)) {
+ if (DD[c1,c2]<RLENGTH) DD[c1,c2]=RLENGTH
+ } else {
+ if (match(u,/^[0-9]+/))
+ if (LD[c1,c2]<RLENGTH) LD[c1,c2]=RLENGTH
+ if (match(u,/[\.,][0-9]*$/))
+ if (RD[c1,c2]<RLENGTH) RD[c1,c2]=RLENGTH
+ }
+ }
+ if ((u=="") && (NOSPAN)) {
+ u=spaces(u_)
+ for (i=C[u1]+1; i<=C[u2]-1; ++i) {
+ u=substr(u,1,D[i]-D[C[u1]]-1) S substr(u,D[i]-D[C[u1]]+1)
+ }
+ }
+ t=t center(u_,u)
+ } else {t=t s; s=""}
+ }
+ line[l]=t
+ }
+# PASS 3: transform appropriately (adding @ operator, if needed)
+# areas between vertical rules
+ for (l=1; l<=line_; ++l) {
+ s=line[l]; t=""; u2=1
+ while (s!="") {
+ if (match(s,"[" V v S "][^" V v S "]+[" V v S "]")) {
+ t=t substr(s,RSTART,1)
+ u=substr(s,RSTART+1,RLENGTH-2)
+ s=substr(s,RSTART+RLENGTH-1)
+ u_=length(u); gsub("^ +","",u); gsub(" +$","",u)
+ u1=u2+RSTART-1; u2=u1+RLENGTH-1; c1=C[u1]+0; c2=C[u2]+0
+ if (u ~ /^[0-9]+[\.,]?[0-9]*$/) {
+ if (match(u,/^[0-9]+$/)) {u=tildes(DD[c1,c2]-RLENGTH) u}
+ else {
+ if (match(u,/^[0-9]+/)) u=tildes(LD[c1,c2]-RLENGTH) u
+ if (match(u,/[\.,][0-9]*$/)) u=u tildes(RD[c1,c2]-RLENGTH)
+ }
+ }
+ gsub("[" h "]+","\\-",u); gsub("[" H "]+","\\=",u)
+ if ((c1==1) && (line[l] ~ "^[" U S " ]+$"))
+ {u=INSROW} else u=int_subst(u)
+ if ((c2-c1)>1) u="@" c2-c1 " " u
+ u=center(u_,u)
+ PAD[l,u2]=length(u)-u_ # PAD[l,u2] = shift of vrule u2 in line l
+ t=t u
+ } else {t=t s; s=""}
+ }
+ line[l]=t
+ }
+# PASS 4: align distorted columns (surprisingly hard task...)
+# 4a: find maximal shifts of vrules for all table rows
+ for (i=1; i<=D_; ++i) PADmax[D[i]]=EXPROW
+ for (l=1; l<=line_; ++l)
+ for (j=2; j<=D_; ++j) {i=D[j]
+ if ((l,i) in PAD)
+ PADmax[i]=(PAD[l,i]>PADmax[i] ? PAD[l,i] : PADmax[i])
+ }
+ for (l=1; l<=line_; ++l) {
+# 4b: find shifts of vrules for a given row
+ PAD_=0
+ for (j=2; j<=D_; ++j) {i=D[j]
+ if ((l,i) in PAD) {PADloc[i]=PADmax[i]+PAD_; PAD_=0}
+ else {PADloc[i]=0; PAD_+=PADmax[i]} # slip over non-existant rules
+ }
+# 4c: add spaces before appropriate vrules
+ cc=0;
+ for (j=2; j<=D_; ++j) {i=D[j]
+ if (PADloc[i]>0) {
+ line[l]=substr(line[l],1,i+cc-1+PAD[l,i]) spaces(PADloc[i]-PAD[l,i]) substr(line[l],i+cc+PAD[l,i])
+ cc+=PADloc[i]
+ }
+ }
+ }
+# 4d: center cells again
+ for (l=1; l<=line_; ++l) {
+ s=line[l]; t=""
+ while (s!="") {
+ if (match(s,"[" V v S "][^" V v S "]+[" V v S "]")) {
+ t=t substr(s,RSTART,1)
+ u=substr(s,RSTART+1,RLENGTH-2); s=substr(s,RSTART+RLENGTH-1)
+ u_=length(u); gsub("^ +","",u); gsub(" +$","",u); t=t center(u_,u)
+ } else {t=t s; s=""}
+ }
+ line[l]=t
+ }
+# PASS 5: output results
+# 5a: insert !, | and "
+ for (l=1; l<=line_; ++l) {
+ gsub("[" V "]","!",line[l])
+ gsub("[" v "]","|",line[l])
+ gsub("[" S "]","\"",line[l])
+ p=line[l]; gsub(/(\\\|)|(\\!)|(\\")/," ",p); gsub(/[^\|!"]/," ",p);
+ PAT[p]=1 # fix row pattern
+ print "\\B" substr(line[l],1,1)\
+ PFX[l] substr(line[l],2,length(line[l])-2)\
+ "\\E" substr(line[l],length(line[l]),1)
+ }
+# 5b: clear old values of C and D and fix new ones
+ for (i in C) delete C[i]; for (i in D) delete D[i]; C_=0; D_=0;
+ for (p in PAT) for (i=1; i<=length(p); ++i) if (substr(p,i,1)!=" ")
+ {C[i]=1; if (i>C_) C_=i}
+ for (i=1; i<=C_; ++i) if (i in C) {D[++D_]=i; C[i]=D_}
+# 5c: write extra information
+ if (NOSPAN) {# add a row with complete column marks (a comment in fact)
+ p=spaces(D[D_]-D[1])
+ for (i=1; i<=D_; ++i) p=substr(p,1,D[i]-1) "\"" substr(p,D[i]+1)
+ print "\\B" substr(p,1,1) " " substr(p,2,length(p)-2)\
+ "\\E" substr(p,length(p),1)
+ }
+# 5d: add the ``rear''
+# print "% ROW PATTERNS:"
+# for (p in PAT) {
+# for (i in C) if (substr(p,i,1)==" ") p=substr(p,1,i-1) "\"" substr(p,i+1)
+# print "%\\B" substr(p,1,1)\
+# "0" substr(p,2,length(p)-2) "\\E" substr(p,length(p),1)
+# }
+# print "% VRULES FOUND IN THE FOLLOWING COLUMNS:"
+# print "%"
+# print "% No. Col.:"
+# for (j=1; j<=D_; ++j) printf("%s %3d %4d\n", "%", j, D[j])
+}
+# ===========================================================================
diff --git a/Master/texmf-dist/source/generic/textmerg/textmerg.drv b/Master/texmf-dist/source/generic/textmerg/textmerg.drv
new file mode 100644
index 00000000000..6358492a5ac
--- /dev/null
+++ b/Master/texmf-dist/source/generic/textmerg/textmerg.drv
@@ -0,0 +1,18 @@
+%%
+%% This is file `textmerg.drv',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% textmerg.dtx (with options: `driver')
+%%
+\documentclass{ltxdoc}
+\RecordChanges
+\begin{document}
+ \DocInput{textmerg.dtx}
+ \PrintIndex
+ \PrintChanges
+\end{document}
+\endinput
+%%
+%% End of file `textmerg.drv'.
diff --git a/Master/texmf-dist/source/generic/textmerg/textmerg.dtx b/Master/texmf-dist/source/generic/textmerg/textmerg.dtx
new file mode 100644
index 00000000000..58befcbfa2d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/textmerg/textmerg.dtx
@@ -0,0 +1,890 @@
+% \iffalse meta-comment
+% \begin{macrocode}
+%<*textmerg|plain>
+\def\fileversion{2.01}
+\def\filedate{1994/06/20}
+\def\filename{textmerg.dtx}
+\def\Copyright{Copyright (C) 1992,1994 Mike Piff, University of Sheffield, England}
+%</textmerg|plain>
+% \end{macrocode}
+%
+% This file is placed in the public domain. No provision is made for
+% support of the use of the facilities herein.
+%
+% For updates, contact your nearest CTAN site.
+%
+% \fi
+%
+% \changes{2.01}{1994/06/20}{First version for LaTeX2e}
+% \changes{2.01a}{2000/08/25}{rf10@cam.ac.uk --- relaxation of licence
+% terms}
+%
+%\CheckSum{349}
+%
+%\title{Text merges in \TeX\ and \LaTeX\thanks{This article originally
+%appeared in TUGboat Vol 13(4), 1992, p518--523.}}
+%\author{Mike Piff}
+%\maketitle
+%\thispagestyle{headings}
+%\begin{abstract}
+% In this article the author explains how to do some standard
+% and not so standard word processor text merges in \TeX\ documents,
+% using no other tools than \TeX\ itself.
+% A common application is to the mail merge or form letter,
+% where names and addresses are
+% stored in a file, together with other bits of information, and a standard
+% letter with variable fields embedded in it is customized for every name
+% from this file.
+% Another application is to the pretty-printing of the contents of a database.
+%
+% The macros described in |textmerg.sty| work equally
+% in both plain \TeX\ and \LaTeX. However, this has meant heavy use
+% of |\def| where |\newcommand| would have been preferable.
+%\end{abstract}
+%
+%\tableofcontents
+%
+%\section{Introduction}
+%It is often said that although \LaTeX\ is good at typesetting
+%mathematics, it is wholly unsuitable for common word processor functions
+%such as mail merges.
+%The latter are easy to achieve in most ordinary word processors,
+%but in its raw state \LaTeX\ is incapable of doing a mail merge, or, indeed, of
+%generating the same block of text over and over again but with different
+%parameters in each block, those parameters having been read from a subsidiary
+%merge file.
+%The latter file might possibly be the output from a database or any other
+%program.
+%
+%This article aims to show the reader that such a repetitive task need not be
+%as difficult as it at first appears. In \TeX, it is possible to hide many
+%details of a facility inside a subsidiary style file, so that the user is
+%unaware of what fearful processes are going on in the background.
+%It is then possible to present the end-user with an extremely simple
+%interface, perhaps simpler and more powerful than is available in other
+%systems.
+%
+%In earlier TUGboat articles
+%\cite{Bell:TB8-1-54,Garavelli:TB8-1-53,Lee:TB7-3-187,%
+%McKinstry:TB8-1-60} it was shown how a standard letter could be
+%customized by adding names and addresses from a separate file. I aim to show
+%that it is possible to achieve far more than this with a fairly compact
+%but general set of macros.
+%
+%\section{A simple example}
+%Suppose that we have a list of student names and examination grades, one
+%per student, and that we wish to send a letter to each student giving
+%his/her exam grade.
+%We must decide first what bits of information must be prepared in
+%our subsidiary file, by looking at an example letter and finding out which
+%items change from letter to letter.
+%
+%Suppose that one instance of our letter is the following,
+%a \LaTeX\ example.
+%\begin{verbatim}
+%\begin{letter}{Miss Iusta Mo\\
+% 34 Winchester Road\\
+% Sheffield\\
+% England}
+% \opening{Dear Miss Mo,}
+% This letter is to inform you
+% that you obtained grade A in
+% your recent examinations.
+% \closing{Yours faithfully,}
+%\end{letter}
+%\end{verbatim}
+%We can see that we need to know the student's title, forename(s), surname,
+%address and grade to compose such a letter.
+%
+%One of the simplest ways of achieving this effect is to prepare a file
+%with lines of the form
+%\begin{verbatim}
+%\MyLetter{Mr}...{C}
+%\end{verbatim}
+%for each student and then simply |\input| it into a \LaTeX\ file in which
+%|\MyLetter| has been defined as having five parameters.
+%A problem with this approach is that we may not be able to coax the student
+%database into producing such a file.
+%Another problem is that we need something more subtle if there are fifty
+%parameters. For example, we might want to print out the
+%contents of the student database with one page per student, but it could be
+%that there are fifty information fields per student. Even worse,
+%the number of pieces of information per student might not be a
+%constant number, because, say, we are printing out fields from a related
+%file in which marks on individual examination papers are held.
+%
+%We shall tackle our simple example in a way that lends itself
+%to more generality later on, and in a form that most database programs
+%should be capable of handling.
+%
+%We thus prepare a subsidiary file |results.dat|
+%with records of five fields in it.
+%Each student is represented by five lines of this file,
+% \begin{macrocode}
+%<*results>
+Miss
+Iusta
+Mo
+34 Winchester Road\\Sheffield\\England
+A
+Mr
+Arthur
+Minit
+43 Sheffield Road\\Winchester\\England
+C
+%</results>
+% \end{macrocode}
+%and the student records appear one after another in this file.
+%Thus both the field and record separators are carriage returns.
+%
+%\DescribeMacro{\Merge}
+%\DescribeMacro{\Fields}
+%\TeX\ itself needs to know three bits of information:
+%\begin{enumerate}
+% \item the name of the subsidiary file,
+% \item the fields to read, and
+% \item the template of the letter.
+%\end{enumerate}
+%We pass it this information in the following form
+% \begin{macrocode}
+%<*examp>
+\documentclass[12pt]{letter}
+\usepackage{textmerg}
+\begin{document}
+\Fields{\Title\Forenames\Surname
+ \Address\Grade}
+\Merge{results.dat}{%
+\begin{letter}{\Title\ \Forenames\
+ \Surname\\\Address}
+ \opening{Dear \Title\ \Surname,}
+ This letter is to inform you
+ that you obtained grade \Grade\ in
+ your recent examinations.
+ \closing{Yours faithfully,}
+\end{letter}}
+\end{document}
+%</examp>
+% \end{macrocode}
+%\LaTeX\ should
+%open the subsidiary file and, for each set of five parameters,
+%generate a letter in the |dvi| file. When it reaches the end of
+%the merge file, \LaTeX\ should terminate execution of the |\Merge|
+%command and presumably finish the document.
+%
+%\section{A few complications}
+%
+%Looking at the above example in a bit more generality,
+%we see that we are reading
+%records of $n$ fields from the merge file and placing them into a \TeX\ document
+%in such a way that they replace $n$ preassigned control sequences.
+%However, it may happen that the merge file is prepared by humans, who might
+%possibly have inserted some extra blank lines into the file. Again, it
+%could be that certain sorts of fields might be blank,
+%whereas others can never be blank.
+%Perhaps it would be better to build in some degree of error recovery.
+%
+%\DescribeMacro{\Fields}
+%We shall make the assumption that the first field in any record is definitely
+%a non-blank one and that we know beforehand whether each
+%of the others might conceivably be blank.
+%We make a modification to our |\Fields| statement.
+%It can contain not only
+%the field name control sequences but also the tokens |+| and~|-|,
+%with the following interpretation. A |+| indicates that all following
+%fields should be re-read until a non-blank result is obtained.
+%A |-| indicates that any following fields could conceivably be blank,
+%subject to the restriction that the very first field is always non-blank.
+%
+%Thus the command
+%\begin{verbatim}
+%\Fields{\a+\b\c-\d}
+%\end{verbatim}
+%would indicate that only |\d| is allowed to be blank, because the
+%|+| token has no effect.
+%In
+%\begin{verbatim}
+%\Fields{-\a\b+-\c+\d}
+%\end{verbatim}
+%the initial |-| token enables blank reading of data tokens, but the very
+%first data token is not permitted to be blank anyway.
+%Thus |\a| is read as a non-blank token and |\b| as a
+%possibly blank token.
+%The sequence |+-| now switches non-blank reading on and off again,
+%so |\c| is read as possibly blank.
+%Finally |\d| is non-blank.
+%
+%Another complication we allow is that the |\Fields| command can
+%appear several times in our file. The interpretation is that
+%the last occurrence of |\Fields| before we encounter the |\Merge|
+%command will indicate the fields to be read for every record. Any
+%occurrences of |\Fields| within the merged text indicate a new list
+%of fields to be read when that command is encountered. This lets us
+%do some conditional processing, such as\footnote{It is assumed that
+%{\tt\string\Mrs} expands to {\tt Mrs}.}
+%\begin{verbatim}
+% \ifx\Title\Mrs
+% \Fields{\MaidenName}
+% \fi
+%\end{verbatim}
+%and also gives us some flexibility about the field order later on.
+%
+%It should also be stressed that the undefined control sequences
+%appearing in the template need not
+%correspond exactly to the fields in the subsidiary file.
+%An example might be that the subsidiary file contains the text
+%\begin{verbatim}
+%Spriggs, Mr Abraham L
+%\end{verbatim}
+%and one field read is |\FullName|.
+%\TeX\ would then have to pre-process this
+%name to generate its several components as used in the template.
+%The command |\PreProcess| could be included at the start of the template.
+%\begin{verbatim}
+%\def\parse#1, #2 #3\endparse{%
+% \def\Surname{#1}\def\Title{#2}%
+% \def\Forenames{#3}}
+%\def\PreProcess{\expandafter
+% \parse\FullName\endparse}
+%\end{verbatim}
+%
+%An alternative and simpler looking approach to reading fields from a file
+%|\fil| might be to define each such field as
+%follows.
+%\begin{verbatim}
+%\def\Field#1{\def#1{\read\fil to#1#1}}
+%\Field\Name \Field\Address \Field\Mark
+%\end{verbatim}
+%The first time |\Name| is encountered, it reads its own expansion
+%from |\fil| and then expands itself.
+%Henceforth, it has acquired its new expansion.
+%The disadvantage is that |\Name| must appear in the
+%text before any subsidiary field such as |\Surname|
+%can be used.
+%
+%Finally we should consider the possibility that the second parameter of
+%|\Merge| might be too large to fit into memory. We can clearly handle
+%this problem by allowing the second parameter merely to consist of the text
+%|\input template|, so that the root file handles two subsidiary
+%files, one containing the template and the other containing the fields.
+%
+%
+%\section{A complicated example}
+%
+%We will next look at an example in which the template contains a table
+%of indeterminate length, albeit fixed width. So far our macros work
+%in either plain \TeX\ or in \LaTeX, but the way in which these
+%two packages handle
+%tables is slightly different. However, the only difference that need
+%concern us is that \LaTeX\ uses |\\| where plain \TeX\ uses |\cr|.
+%
+%\DescribeMacro{\MultiRead}
+%The example given here is in \LaTeX, but our style will work equally well
+%in plain \TeX. In our student letter we wish to insert a table of course
+%codes and marks. Since each student did a different number of courses, we
+%need some way of recognizing the end of the course list in the merge file.
+%The default will be to insert a blank line at the end of such a sub-list.
+%Thus, the following text appears before the close of the letter template.
+%\begin{verbatim}
+%Here are your marks on individual papers.
+%\begin{center}
+% \begin{tabular}{|lr|}\hline
+% Code&Mark\\\hline
+% \MultiRead{2}\\\hline
+% \end{tabular}
+%\end{center}
+%\end{verbatim}
+%The merge file now has the following structure.
+%\begin{verbatim}
+%Title
+%...
+%Grade
+%Code
+%Mark
+%...
+%Code
+%Mark
+%\end{verbatim}
+%$\langle${\it blank\/}$\rangle$
+%\begin{verbatim}
+%Title
+%...
+%\end{verbatim}
+%
+%\DescribeMacro{\MarkEnd}
+%In other applications some of the fields in the table might possibly be blank.
+%We then let the user change the $\langle${\it blank\/}$\rangle$
+%line marking the end of a list to some other string of his own choosing.
+%\begin{verbatim}
+%\MarkEnd{***}
+%\end{verbatim}
+%
+%There might be multiple tables in the same template,
+%with their data intermingled in the merge file with main fields.
+%The generalized |\Fields| command allows us
+%to order the merge file however we want. Thus we could have main fields, then
+%a table, followed by more main fields, and so on.
+%
+%\DescribeMacro{\Process}
+%A final complication is that the fields appearing in a table are essentially
+%anonymous. By this I mean that they are transferred into the table as
+%they are, without any pre-processing possible through appearing
+%in the template as control sequences. If we wish what appears in
+%the table to be different from what appears in the file, a mechanism is needed
+%to tell \TeX\ that a certain column has to be treated in a certain way.
+%The command
+%\begin{verbatim}
+%\Process{n}{\foo}
+%\end{verbatim}
+%will replace every field $\langle f\rangle$ read into column $n$
+%by |\foo{|$\langle f\rangle$|}|.
+%It is even possible to do some numerical calculations by this method.
+%
+%Here is a \LaTeX\ example to illustrate the table processing
+%features of |textmerg.sty|.
+% \begin{macrocode}
+%<*example>
+\documentclass[12pt]{article}
+\usepackage{textmerg}
+\MarkEnd{***}
+\Process{2}{\Advance}
+\def\Advance#1{#1\addtocounter{page}{#1}}
+\Fields{+\Name\Verb}
+\begin{document}
+\Merge{silly.dat}{%
+ Dear \Name,\par
+ Here is a table to \Verb\ at:
+ \Fields{\Width}%
+ \begin{tabular}{*{\Width}c}
+ \MultiRead\Width
+ \end{tabular}.\par
+ \Fields{\Adj}%
+ That was \Adj!
+ \clearpage}
+\end{document}
+%</example>
+% \end{macrocode}
+%The effect of this file is not apparent until we see |silly.dat|.
+%It is listed here.
+% \begin{macrocode}
+%<*silly>
+Mike
+look
+3
+1
+2
+3
+11
+12
+13
+***
+good
+Shelagh
+gaze
+2
+21
+22
+23
+24
+***
+horrid
+%</silly>
+% \end{macrocode}
+%
+% The same can be done in plain \TeX.
+% \begin{macrocode}
+%<*plainexample>
+\input textmerg
+\MarkEnd{***}
+\Process{2}{\Advance}
+\def\Advance#1{#1\global\advance\count0by#1}
+\Fields{+\Name\Verb}
+\Merge{silly.dat}{%
+ Dear \Name,\par
+ Here is a table to \Verb\ at:
+ \Fields{\Width}%
+ \vbox{\halign{\hfil{} ## {}\hfil&&\hfil{} ## {}\hfil\cr
+ \MultiRead\Width\cr
+ }}.\par
+ \Fields{\Adj}%
+ That was \Adj!
+ \vfill\eject}
+\end
+
+%</plainexample>
+% \end{macrocode}
+%
+%
+%\StopEventually{
+%\begin{thebibliography}{GHWW84}
+%\bibitem[{Bel}87]{Bell:TB8-1-54}
+%Edwin~V. {Bell, II}.
+%\newblock {{AutoLetter: A \TeX\ form letter procedure}}.
+%\newblock {\em TUGBoat}, 8(1):54, April 1987.
+%
+%\bibitem[Gar87]{Garavelli:TB8-1-53}
+%John~S. Garavelli.
+%\newblock {{Form letter macros}}.
+%\newblock {\em TUGBoat}, 8(1):53, April 1987.
+%
+%\bibitem[Lee86]{Lee:TB7-3-187}
+%John Lee.
+%\newblock {{Form letters}}.
+%\newblock {\em TUGBoat}, 7(3):187, October 1986.
+%
+%\bibitem[McK87]{McKinstry:TB8-1-60}
+%Graeme McKinstry.
+%\newblock {{Form letters}}.
+%\newblock {\em TUGBoat}, 8(1):60, April 1987.
+%\end{thebibliography}
+%}
+%
+% \section{Identification}
+%
+% This package can only be used with \LaTeXe, so
+% an appropriate message is displayed when another
+% format is used\footnote{However, some code is inserted
+% to allow its use with plain \protect\TeX}.
+% \begin{macrocode}
+%<*textmerg>
+\NeedsTeXFormat{LaTeX2e}[1994/01/01]
+% \end{macrocode}
+%
+% Announce the package name and its version:
+% \begin{macrocode}
+\ProvidesPackage{textmerg}[\filedate]
+% \end{macrocode}
+%
+% And display it on the terminal (and the log file):
+% \begin{macrocode}
+\typeout{Package `textmerg' <\filedate>.}
+\typeout{\Copyright}
+%</textmerg>
+% \end{macrocode}
+%
+% The plain \TeX\ version will simply |\input| this package file. Thus
+% we need to know that it will understand everything in the file.
+% \begin{macrocode}
+%<*plain>
+\def\NeedsTeXFormat#1[#2]{}
+\def\ProvidesPackage#1[#2]{}
+\def\typeout#1{\immediate\write0{#1}}
+\input textmerg.sty
+%</plain>
+% \end{macrocode}
+%
+%
+%\section{Implementation of the simple case}
+%
+% \begin{macro}{\glet}
+%For convenience we define a frequently used combination here.
+% \begin{macrocode}
+%<*textmerg>
+\def\glet{\global\let}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MergeFile}
+% \begin{macro}{\InputFile}
+%The subsidiary merge file is defined next. A macro is then defined that
+%attempts to open it for reading. If that is unsuccessful, the file is
+%closed and an error message is issued.
+% \begin{macrocode}
+\newread\MergeFile
+\def\InputFile#1{%
+ \openin\MergeFile=#1
+ \ifeof\MergeFile
+ \errmessage{Empty merge file}%
+ \closein\MergeFile
+ \long\def\MakeTemplate##1{%
+ \def\Template{}}%
+ \else\GetInput\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%The command |\MakeTemplate| will be used later to generate the body
+%of the form into which fields are inserted. We redefine it if the file
+%is empty so that it produces no text.
+%
+% \begin{macro}{\GetInput}
+%Because the conditional |\ifeof| does not return true until after an
+%unsuccessful read operation, a mechanism of looking ahead is used which is
+%similar to that found in Pascal.
+% \begin{macrocode}
+\def\GetInput{{\endlinechar=-1
+ \global\read\MergeFile to\InputBuffer}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SeeIfEof}
+% \begin{macro}{\LookAgain}
+%We set up a mechanism for deciding whether or not we have
+%exhausted the merge file. It forces |\ifeof| to return true
+%by skipping over blank lines.
+% \begin{macrocode}
+\def\SeeIfEof{%
+ \let\NextLook\relax
+ \ifeof\MergeFile
+ \else
+ \ifx\InputBuffer\empty
+ \LookAgain
+ \fi
+ \fi
+ \NextLook}
+\def\LookAgain{\GetInput
+ \let\NextLook\SeeIfEof}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ifNonBlank}
+% \begin{macro}{\AllowBlank}
+% \begin{macro}{\DontAllowBlank}
+%We can now prepare to read actual fields from the merge file. A conditional
+%is used to indicate whether or not the field we are about to read is
+%allowed to be blank. We also set up a mechanism for changing its value.
+% \begin{macrocode}
+\newif\ifNonBlank \NonBlankfalse
+\def\AllowBlank{\global\NonBlankfalse}
+\def\DontAllowBlank{\global\NonBlanktrue}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ReadIn}
+% \begin{macro}{\MissingField}
+%Fields are actually read by means of the following command. Its only
+%parameter is the name of the control sequence into which the field is
+%read.
+% \begin{macrocode}
+\def\ReadIn#1{%
+ \ifNonBlank\SeeIfEof\fi
+ \ifeof\MergeFile
+ \gdef#1{??}\MissingField
+ \else
+ \glet#1\InputBuffer
+ \GetInput
+ \fi}
+\def\MissingField{%
+ \message{Missing field in file}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\GlobalFields}
+% \begin{macro}{\Fields}
+%The |\Fields| command places its parameter into a token
+%register called |\GlobalFields|.
+%This command will be redefined by the |\Merge| command.
+% \begin{macrocode}
+\newtoks\GlobalFields
+\def\Fields#1{\GlobalFields{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ParseFields}
+% \begin{macro}{\EndParseFields}
+%When a field token list is read,
+%each individual token within it must be either
+%read as a field or interpreted as a blank/nonblank switch.
+%The next token is then read by tail recursion.
+%It is assumed that the final token in the list is |\EndParseFields|.
+%This must be defined to expand to something unlikely to be read as a
+%value of one of the fields, and so we |\let| it to |\ParseFields|.
+% \begin{macrocode}
+\def\ParseFields#1{%
+ \ifx#1\EndParseFields
+ \let\NextParse\relax
+ \else
+ \let\NextParse\ParseFields
+ \ifx#1+\DontAllowBlank
+ \else
+ \ifx#1-\AllowBlank
+ \else\ReadIn#1
+ \fi
+ \fi
+ \fi\NextParse}
+\let\EndParseFields\ParseFields
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ReadFields}
+%We apply this command to our token register after expanding it.
+% \begin{macrocode}
+\def\ReadFields#1{\expandafter\ParseFields
+ \the#1\EndParseFields
+ \AllowBlank}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Merge}
+% \begin{macro}{\MakeTemplate}
+%At long last we are ready to define the |\Merge| command itself.
+%The first parameter is the filename of the subsidiary file and the second
+%is the template or form into which fields are inserted.
+%Since a |\Fields| command within the |\Merge| text is meant
+%to act immediately on the token list that follows it, we redefine it
+%to operate in a different way.
+% \begin{macrocode}
+\long\def\Merge#1#2{\begingroup%
+ \InputFile{#1}%
+ \def\Fields##1{%
+ \ParseFields##1\EndParseFields}%
+ \MakeTemplate{#2}\Iterate}
+\long\def\MakeTemplate#1{\def\Template{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%The grouping keeps any changes to the definition of |\MakeTemplate|
+%local to this merge.
+%Thus several consecutive merges can be handled
+%within one document.
+%The |\endgroup| is supplied by the macro |\Iterate|
+%when the merge file has been exhausted.
+%
+% \begin{macro}{\Iteratecounter}
+% \begin{macro}{\Iterate}
+%|\Iterate| must read the fields which were declared before it was entered,
+%substitute them into its template and repeat itself using tail recursion
+%if the end of the merge file has not been encountered.
+% \begin{macrocode}
+\countdef\Iteratecounter=2
+\Iteratecounter=0
+\def\Iterate{%
+ \global\advance\Iteratecounter by1
+ \ReadFields\GlobalFields
+ \Template
+ \SeeIfEof
+ \ifeof\MergeFile
+ \def\NextIteration{%
+ \endgroup\closein\MergeFile}%
+ \else
+ \let\NextIteration\Iterate
+ \fi
+ \NextIteration}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%The point of the use of counter 2 in the above is that it is accessible to
+%the print driver for page selection.
+%Anyone who has started printing 150 letters, all with page number~1,
+%only to run out of paper half way, will appreciate the use of this artifice!
+%
+%\section{Implementation of merged tables}
+%
+% \begin{macro}{\MultiCount}
+% \begin{macro}{\MaxCount}
+% \begin{macro}{\ifStartOfList}
+%We set up two counters, one for the column we are reading and the
+%other for the total number of columns in the table.
+%We also need a conditional to mark the start of the table, so that
+%we terminate each row correctly with |\\| or |\cr|, or nothing at all
+%at the beginning of the first row.
+% \begin{macrocode}
+\newcount\MultiCount \newcount\MaxCount
+\newif\ifStartOfList
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\MultiRead}
+%The parameter to |\MultiRead| is the number of columns to read at a
+%time. This command passes control to |\NextRead| after initializing
+%certain parameters.
+% \begin{macrocode}
+\def\MultiRead#1{%
+ \ifnum#1>0
+ \SelectCR
+ \MakeEmpty{#1}%
+ \global\StartOfListtrue
+ \glet\NextRead\MRead
+ \AllowBlank
+ \global\MaxCount=#1
+ \NextRead
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Emptyctr}
+% \begin{macro}{\MakeEmpty}
+%The command |\MakeEmpty| is required by the pre-pro\-cess\-ing
+%of each field.
+%The idea is that the command |\csname pr|$nn$|\endcsname|,
+%which we will loosely call |\pr|$nn$,
+%is executed on each field in column $nn$. However, most of these commands
+%will be undefined, and so we equate each of those that has not been
+%defined to |\empty|.
+% \begin{macrocode}
+\newcount\Emptyctr
+\def\MakeEmpty#1{\Emptyctr=0
+ \loop
+ \advance\Emptyctr by1
+ \expandafter\ifx\csname
+ pr\the\Emptyctr\endcsname\relax
+ \expandafter\glet\csname
+ pr\the\Emptyctr\endcsname\empty
+ \fi
+ \ifnum\Emptyctr<#1
+ \repeat}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%Note that, because of the way we are accessing it via |\csname|,
+%the first time |\pr|$nn$ is encountered it equates to |\relax|.
+%
+% \begin{macro}{\Process}
+%The command |\Process#1#2| defines |\pr#1| to mean |#2|.
+% \begin{macrocode}
+\def\Process#1#2{%
+ \expandafter\def\csname
+ pr#1\endcsname##1{#2{##1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MarkEnd}
+%We need to know how the last row is to be recognized. The default is an
+%empty line in the merge file.
+% \begin{macrocode}
+\def\MarkEnd#1{\gdef\EndMarker{#1}}
+\MarkEnd{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\NextLine}
+% \begin{macro}{\NextField}
+%We collect each row in a token register. The full row is assembled
+%in |\NextLine| before being passed back to \TeX. Each field is
+%read in |\TempField| and then placed temporarily into
+%|\NextField|.
+% \begin{macrocode}
+\newtoks\NextLine \newtoks\NextField
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%It is not necessary to do things this way; |\edef| can be used
+%instead, but that approach might expand tokens prematurely.
+%
+% \begin{macro}{\AppendNextField}
+%After the next field has been read, it is appended to |\NextLine|.
+% \begin{macrocode}
+\def\AppendNextField{%
+ \global\advance\MultiCount1
+ \NextField=\expandafter{\TempField}%
+ \edef\Append{\NextLine=
+ {\the\NextLine&\csname
+ pr\the\MultiCount\endcsname
+ {\the\NextField}}}%
+ \Append}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EndLine}
+% \begin{macro}{\FinishLine}
+%We need to insert the correct end marker after each row of the table.
+%The token |\cr| must be disguised a little before it is acceptable
+%in a \LaTeX\ document.
+% \begin{macrocode}
+\def\SelectCR{\glet\EndLine\\}%
+%</textmerg>
+%<plain>\def\SelectCR{\gdef\EndLine{\cr}}%
+%<*textmerg>
+\def\FinishLine{%
+ \ifStartOfList
+ \global\StartOfListfalse
+ \else\EndLine\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%This makes the assumption that if |\array| is defined then we must be
+%in \LaTeX.
+%
+% \begin{macro}{\StopProcessing}
+%We need a command to finish off a table. This should reset |\NextRead|
+%to |\AllowBlank| to terminate the tail recursion,
+%and also do some
+%error recovery in case the file ends prematurely in the middle of a row.
+% \begin{macrocode}
+\def\StopProcessing{%
+ \global\MultiCount\MaxCount
+ \glet\NextRead\AllowBlank}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MRead}
+%The command |\MRead| prepares to read a row of a table. It reads a
+%field from the merge file and checks to see whether the table has been
+%exhausted.
+% \begin{macrocode}
+\def\MRead{%
+ \global\MultiCount=1
+ \ReadIn\TempField
+ \ifx\TempField\EndMarker
+ \StopProcessing
+ \else
+ \FinishLine
+ \NextField=\expandafter{\TempField}%
+ \edef\StartLine{\NextLine={\csname
+ pr1\endcsname{\the\NextField}}}%
+ \StartLine
+ \ConstructNextRow
+ \fi
+ \NextRead}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ConstructNextRow}
+%Command |\ConstructNextRow| does most of the work of assembling a row of
+%the table.
+%It assembles |\MaxCount| fields
+%at a time into |\NextLine| unless an error is encountered.
+% \begin{macrocode}
+\def\ConstructNextRow{%
+ \ifnum\MultiCount<\MaxCount
+ \loop
+ \ReadIn\TempField
+ \ifx\TempField\EndMarker
+ \glet\TempField\empty
+ \StopProcessing
+ \MissingField
+ \else
+ \ifeof\MergeFile
+ \glet\TempField\empty
+ \StopProcessing
+ \MissingField
+ \fi
+ \fi
+ \AppendNextField
+ \ifnum\MultiCount<\MaxCount
+ \repeat
+ \fi
+ \the\NextLine}
+%</textmerg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{The documentation driver file}
+%
+% This is the driver file that produces this documentation.
+% We use the document class provided by the \LaTeXe\ distribution
+% for producing the documentation.
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\RecordChanges
+\begin{document}
+ \DocInput{textmerg.dtx}
+ \PrintIndex
+ \PrintChanges
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+%
+%
+%\Finale
+%
+%\endinput
diff --git a/Master/texmf-dist/source/generic/textmerg/textmerg.ins b/Master/texmf-dist/source/generic/textmerg/textmerg.ins
new file mode 100644
index 00000000000..4f53580fd0a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/textmerg/textmerg.ins
@@ -0,0 +1,69 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%%
+%% IMPORTANT NOTICE:
+%%
+%% No other permissions to copy or distribute this file in any form
+%% are granted and in particular no permission to modify its contents.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{textmerg.ins}
+\input docstrip.tex
+\preamble
+
+Copyright (C) 1992,1994 Mike Piff, University of Sheffield, England
+
+This file is now placed in the public domain. You are encouraged to
+distribute it together with the sources from which it was generated.
+
+\endpreamble
+
+\keepsilent
+
+\Msg{*** Generating the package file ***}
+
+\generateFile{textmerg.sty}{f}{\from{textmerg.dtx}{textmerg}}
+
+\Msg{*** Generating the plain TeX file ***}
+
+\generateFile{textmerg.tex}{f}{\from{textmerg.dtx}{plain}}
+
+\preamble
+\endpreamble
+
+\Msg{*** Generating the documentation driver ***}
+
+\generateFile{textmerg.drv}{f}{\from{textmerg.dtx}{driver}}
+
+\Msg{*** Generating example files ***}
+
+\generateFile{tmexamp1.tex}{f}{\from{textmerg.dtx}{examp}}
+\generateFile{tmexamp2.tex}{f}{\from{textmerg.dtx}{example}}
+\generateFile{tmexampp.tex}{f}{\from{textmerg.dtx}{plainexample}}
+
+\Msg{*** Generating data files ***}
+%%These must be verbatim copies, so...
+\makeatletter
+\let\WritePreamble\@gobble
+\let\WritePostamble\@gobble
+
+\generateFile{results.dat}{f}{\from{textmerg.dtx}{results}}
+\generateFile{silly.dat}{f}{\from{textmerg.dtx}{silly}}
+
+
+\ifToplevel{%
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the files}
+\Msg{* textmerg.sty and textmerg.tex into a directory searched by TeX.}
+\Msg{* To produce the documentation, run the file textmerg.drv through LaTeX.}
+\Msg{* To see examples, run the files tmexamp1.tex and tmexamp2.tex LaTeX,}
+\Msg{* or tmexampp.tex through plain TeX.}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/generic/wsuipa/README.wsuipa b/Master/texmf-dist/source/generic/wsuipa/README.wsuipa
new file mode 100644
index 00000000000..825e71a3ba1
--- /dev/null
+++ b/Master/texmf-dist/source/generic/wsuipa/README.wsuipa
@@ -0,0 +1,8 @@
+There are three documents which are used with the IPA. The IPAMAN.TEX document
+is written using the TEXT1 macros. The file LIPAMAN.TEX uses LaTeX. Both of
+these files imbed IPAMACS.TEX. Another set has been added: IPALMAN.TEX and
+IPALMACS.STY which are also typeset with LaTeX.
+
+For all of these documents, you will need the TFM files in this directory to
+format the documents, and the *PK files to print the files. There are also some
+DVI files supplied to make things a little easier.
diff --git a/Master/texmf-dist/source/generic/wsuipa/changes.dec93 b/Master/texmf-dist/source/generic/wsuipa/changes.dec93
new file mode 100644
index 00000000000..e871c7cb91d
--- /dev/null
+++ b/Master/texmf-dist/source/generic/wsuipa/changes.dec93
@@ -0,0 +1,11 @@
+This is a list of changes to the basic TeXT1 sources made in December 1993.
+
+There is 1 new files in the WSUIPA directory:
+ [.wsuipa]compilefonts.
+
+0 files removed:
+
+2 files were changed:
+ [.wsuipa]lipaman.dvi
+ [.wsuipa]lipaman.tex
+
diff --git a/Master/texmf-dist/source/generic/wsuipa/changes.jun91 b/Master/texmf-dist/source/generic/wsuipa/changes.jun91
new file mode 100644
index 00000000000..d3cd18e4ec5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/wsuipa/changes.jun91
@@ -0,0 +1,11 @@
+This is a list of changes to the basic TeXT1 sources made in June 1991.
+
+There are 0 new files:
+
+0 files were removed:
+
+The following files have been changed:
+ [.wsuipa]ipaman.tex % minor correction
+ [.wsuipa]lipaman.tex % minor correction
+ [.models]thesis.texinput % conforms to new WSU standards
+ [.models]thesis.texmodel % conforms to new WSU standards
diff --git a/Master/texmf-dist/source/generic/wsuipa/changes.mar91 b/Master/texmf-dist/source/generic/wsuipa/changes.mar91
new file mode 100644
index 00000000000..fa9e21936d7
--- /dev/null
+++ b/Master/texmf-dist/source/generic/wsuipa/changes.mar91
@@ -0,0 +1,10 @@
+This is a list of changes to the basic TeXT1 sources made in March 1991.
+
+There is 1 new file:
+ [.wsuipa]lipaman.tex % LaTeX version of the manual
+
+0 files were removed:
+
+The following files have been changed:
+ [.fonts]cm*.300pk % most were corrupted, so I FTPd them all again
+ [.wsuipa]*.300pk % ditto
diff --git a/Master/texmf-dist/source/generic/wsuipa/changes.may92 b/Master/texmf-dist/source/generic/wsuipa/changes.may92
new file mode 100644
index 00000000000..02ef23463cc
--- /dev/null
+++ b/Master/texmf-dist/source/generic/wsuipa/changes.may92
@@ -0,0 +1,28 @@
+This is a list of changes to the basic TeXT1 sources made in May 1992.
+
+There are 5 new files:
+ [.macros]txt1v406.tex
+ [.wsuipa]lipaman.dvi
+ [.wsuipa]readme.wsuipa
+ [.wsuipa]ipalman.tex
+ [.wsuipa]ipalmacs.sty
+
+1 file was removed:
+ [.macros]txt1v405.tex
+
+14 files were changed:
+ [.macros]text1.tex
+ [.wsuipa]iromanu.mf
+ [.wsuipa]wslipa8.tfm
+ [.wsuipa]wslipa9.tfm
+ [.wsuipa]wslipa10.tfm
+ [.wsuipa]wslipa11.tfm
+ [.wsuipa]wslipa12.tfm
+ [.wsuipa]wslipa17.tfm
+ [.wsuipa]wslipa8.300pk
+ [.wsuipa]wslipa9.300pk
+ [.wsuipa]wslipa10.300pk
+ [.wsuipa]wslipa11.300pk
+ [.wsuipa]wslipa12.300pk
+ [.wsuipa]wslipa17.300pk
+
diff --git a/Master/texmf-dist/source/generic/wsuipa/changes.nov90 b/Master/texmf-dist/source/generic/wsuipa/changes.nov90
new file mode 100644
index 00000000000..cc5a9bff2a0
--- /dev/null
+++ b/Master/texmf-dist/source/generic/wsuipa/changes.nov90
@@ -0,0 +1,17 @@
+This is a list of changes to the basic TeXT1 sources made in November 1990.
+
+There are 2 new files:
+ [.macros]txt1v402.tex
+ [.macros]txt1m402.tex
+
+2 files were removed:
+ [.macros]txt1v401.tex
+ [.macros]txt1m401.tex
+
+The following files have been changed:
+ [.fonts]cmbxti14.300pk
+ [.fonts]cmbxti14.mf
+ [.fonts]cmbxti14.tfm
+ [.wsuipa]ipaman.tex
+ [.macros]flexcol.tex
+ [.models]thesis.texinput
diff --git a/Master/texmf-dist/source/generic/xypic/CATALOG.doc b/Master/texmf-dist/source/generic/xypic/CATALOG.doc
new file mode 100644
index 00000000000..53e9d44b89b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/CATALOG.doc
@@ -0,0 +1,54 @@
+%% $Id: CATALOG.doc,v 3.6 1998/03/06 04:29:05 krisrose Exp $
+%%
+%% Xy-pic ``CTAN CATALOG description'' generation file.
+%% Copyright (c) 1994-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\documentstyle{article}
+\input{xy}
+\begin{document}
+
+\newwrite\Wout
+\def\W#1{\immediate\write\Wout{#1}}
+
+\immediate\openout\Wout=CATALOG.out
+\W{Name: xypic}
+\W{Version: \xyversion\space <\xydate>}
+\W{}
+\W{Description: Xy-pic is a package for typesetting graphs and diagrams.}
+\W{ It is structured as several modules, each defining a custom notation for}
+\W{ a particular kind of graphical object or structure. Example objects are}
+\W{ arrows, curves, frames, and colouring/rotation on drivers that support}
+\W{ it; these can be organised in matrix, directed graph, path, polygon, knot,}
+\W{ and 2-cell structure. Xy-pic works with most formats, including LaTeX,}
+\W{ AMS-LaTeX, AMS-TeX, and plain TeX, and has been used to typeset}
+\W{ complicated diagrams from many application areas including category}
+\W{ theory, automata theory, algebra, neural networks, and database theory.}
+\W{}
+\W{Keywords: diagram, picture, graph, arrow, curve, commutative diagram.}
+\W{}
+\W{Author: Kristoffer H. Rose}
+\W{Problems-To: Kristoffer.Rose@ens-lyon.fr}
+\W{Address: LIP/ENS-Lyon; 46, Allee d'Italie; 69364 Lyon 7; FRANCE}
+\W{}
+\W{<URL: http://www.ens-lyon.fr/\string~krisrose/>}
+\immediate\closeout\Wout
+
+\end{document}
diff --git a/Master/texmf-dist/source/generic/xypic/COPYING b/Master/texmf-dist/source/generic/xypic/COPYING
new file mode 100644
index 00000000000..a43ea2126fb
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/Master/texmf-dist/source/generic/xypic/ChangeLog b/Master/texmf-dist/source/generic/xypic/ChangeLog
new file mode 100644
index 00000000000..9c017d33009
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/ChangeLog
@@ -0,0 +1,788 @@
+1998-10-05 Kristoffer Rose <Kristoffer.Rose@ens-lyon.fr>
+
+ * Address of FSF changed (*). MINOR.....??
+
+1998-10-03 Kristoffer Rose <Kristoffer.Rose@ens-lyon.fr>
+
+ * xyframe.doc (\useCurveFrames): Curve, not circle [fix by George
+ C. Necula]. MINOR.
+
+ * xycurves.doc (\crvs@): \crv@defaultshape fixed [fix by George
+ C. Necula]. MINOR.
+
+ * Makefile, xynecula.doc, xysmart.doc: New options, extracted from
+ mail [by George C. Necula], added. NEW.
+
+ * xy.doc (\OBJECT@shapei): Change to implement *stylechar
+ correctly. Originally, *stylechar was behaving like shape
+ [...]. Now *stylechar is expanded immediately and is not added to
+ tokens, while shape[...] does both [fix by George C. Necula].
+ MAJOR.
+
+ * xy.doc (\checkZeroEdge@): Avoid expanding \Edge@c [fix by George
+ C. Necula]. MINOR.
+
+1998-03-18 Kristoffer Rose <Kristoffer.Rose@ens-lyon.fr>
+
+ * Makefile: New creation of fixes... NEW.
+
+ * install-tds: local variables eliminated in functions. MINOR
+ [Pieter Donche].
+
+1998-03-06 Kristoffer Rose <Kristoffer.Rose@ens-lyon.fr>
+
+ * Revision 3.6 released.
+
+ * xyframe.doc: \dotcorner@ and \dashedcorner@ defined even when
+ curves not loaded. MINOR.
+
+Wed Oct 22 18:53:12 1997 Kristoffer Rose <krisrose@ens-lyon.fr>
+
+ * xygraph.doc: Only warn user about redefining graph escapes when
+ this is indeed the case. MINOR.
+
+Mon Oct 13 12:55:36 1997 Kristoffer Rose <krisrose@ens-lyon.fr>
+
+ * Makefile, xyps-ps.doc, xydocps.doc: Version of the dictionary is
+ now controlled by the Makefile. MINOR.
+
+ * xy.doc, xyguide.man, xyrefer.man: Changed Kristoffer's address
+ to ENS-Lyon. MINOR.
+
+ * xycurve.doc, xyline.doc: line thickness now works for curves
+ (from Ross). MINOR.
+
+Thu Oct 9 02:26:45 1997 Kristoffer Rose <krisrose@ens-lyon.fr>
+
+ * Makefile (macros): LATEXINPUTDIR eliminated; PSHEADERDIR changed
+ to conform to TDS. Release targets updated for author's new
+ location @ens-lyon.fr. MINOR.
+
+Wed May 28 00:49:07 1997 Kristoffer H. Rose <krisrose@brics.dk>
+
+ * Releasing version 3.5.
+
+Tue May 27 10:42:58 1997 Kristoffer H. Rose <krisrose@brics.dk>
+
+ * Makefile, INSTALL: Removed HTML which can't be generated
+ presently. MINOR.
+
+ * xy.doc: Fixed "missing rules bug" properly: avoid premature
+ expansion of \Clast@@. Wrong "missing rules" fix undone to fix
+ new "missing breaks" bug. MAJOR.
+
+Mon May 19 17:51:03 1997 Kristoffer H. Rose <krisrose@brics.dk>
+
+ * Released version 3.4.
+
+Sun May 18 03:49:01 1997 Kristoffer H. Rose <krisrose@brics.dk>
+
+ * xymovie.doc, movie.cls, xyrefer.man: New extension...added to
+ reference manual. MINOR.
+
+Wed May 14 11:29:57 1997 Kristoffer H. Rose <krisrose@brics.dk>
+
+ * xy.doc (\xy): zero \mathsurround. MINOR.
+
+Sun May 4 14:53:59 1997 Kristoffer H. Rose <krisrose@brics.dk>
+
+ * xy.doc (\preconnect): methods should not inherit temporary
+ invisibility (fixes missing rules problem). MINOR.
+
+Tue Mar 11 21:48:50 1997 Kristoffer H. Rose <krisrose@gorm.daimi.aau.dk>
+
+ * Makefile (GFTOPK): Updated to allow using texk-7.0. MINOR:
+ - Rename filenames such as `xyrefer.doc.dvi' to `xyrefer.dvi'.
+ - Don't use (now-redundant) -v option to gftopk
+
+Tue Feb 11 19:17:50 1997 Ross Moore <ross@brics.dk>
+
+ * xycurve.doc (*crvconn@): Centers \connect@ object. MINOR.
+
+Sun Feb 9 21:04:19 1997 Kristoffer H. Rose <krisrose@brics.dk>
+
+ * xyline.doc (?): BUG: should set default line width dynamically...
+
+Thu Jan 23 22:27:06 1997 Kristoffer H. Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xycurve.doc, xyps-pro.doc, xypsdict.doc, xyidioms.doc,
+ xyps-ps.doc, xypspatt.doc: Revert to Ross' naming of DVI-time
+ hooks. MINOR.
+
+Mon Jan 6 22:08:25 1997 Kristoffer H Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xy.doc (\txt): Don't attempt recognising vmode. MINOR [Liam Healy].
+
+ * Makefile (install): Don't make install.www. MINOR [Liam Healy].
+
+Thu Dec 19 05:39:27 1996 Kristoffer H. Rose <krisrose@gorm.daimi.aau.dk>
+
+ * Release 3.3.
+
+Thu Dec 12 17:18:57 1996 Kristoffer H Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xy.doc (\ellipseInner@, \ellipsecentredInner@): Edge-finding
+ typos fixed. MINOR.
+
+Mon Dec 2 11:07:20 1996 Kristoffer H Rose <krisrose@brics.dk.daimi.aau.dk>
+
+ * xygraph.doc (\newgraphescape): never use \renewcommand. MINOR.
+
+ * xy.doc (\straightC{break,last}@@): straight connection
+ subsegments connect properly to non-rectangle objects. MAJOR.
+ * NOTE: same bug needs to be fixed for curves!
+
+Thu Nov 28 18:45:00 1996 Kristoffer H Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xyv2.doc (\morphism): updated to use new style <path>s. MINOR.
+
+Wed Nov 27 22:36:51 1996 Kristoffer H Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xy.doc (\dir): redef'd dir3{<} naively to make center line
+ segment work. MINOR.
+
+Mon Nov 25 06:08:38 1996 Kristoffer H Rose <krisrose@brics.dk.daimi.aau.dk>
+
+ * xygraph.doc (\newgraphescape): Allow [n] for argument count. NEW!
+
+ * xy.doc (\cmerge@): keep edge with new breaking principle. MINOR.
+
+Wed Nov 20 06:01:40 1996 Kristoffer H Rose <krisrose@brics.dk>
+
+ * xymatrix.doc (\xymatrix@at): @E generalised to @M/@W/@H. MINOR.
+
+ * xy.doc (\line@): downward @3{>} rotates \line@ wrong. BUG!
+
+Mon Oct 21 16:49:59 1996 Kristoffer H Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xy.doc (shapes): [r] [l] / [u] [d] behave when entry very
+ tall / wide [Michel Goossens]. MINOR.
+
+Fri Oct 11 03:58:11 1996 Kristoffer H Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xyarrow.doc (\PATHlabelalias@): save breaks properly. MINOR.
+
+Wed Oct 9 18:37:06 1996 Ross Moore <ross@mpce.mq.edu.au>
+
+ * xy.doc (\solid@): fixed `missing rules' bug. MAJOR.
+
+Wed Oct 9 18:37:06 1996 Kristoffer Høgsbro Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xy.doc (\dottedSpread@): fixed `spurious dot' bug. MAJOR.
+
+Fri Sep 20 03:33:32 1996 Kristoffer Høgsbro Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xyguide.man: Several exercises added and some love poured in.
+
+Thu Sep 5 19:57:22 1996 Kristoffer Høgsbro Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xy.doc, xyarrow.doc, xymatrix.doc: All redefinitions of \oxy@
+ now via \change@oxy@ for safety reasons. MINOR.
+
+ * xy.doc (\solidhrule@, \solidvrule@, \straight@): added
+ \straighttypeset@@ hook for line typesetting primitive. MINOR.
+
+ * xymatrix.doc: Added @M and @L spacing adjustments. MINOR.
+
+Thu Aug 15 00:03:46 1996 Kristoffer H Rose <krisrose@brics.dk>
+
+ * xy.doc: dottedSpread bails out when no filling requested. HACK.
+
+ * xycurve.doc: Avoid redefinition warning. MINOR.
+
+ * xyguide.man: Worked through; documented that line intersection
+ of curves works. MINOR.
+
+Mon Aug 13 00:00:00 EST 1996 Ross Moore <ross@mpce.mq.edu.au>
+
+ * xycurve.doc, xyline.doc, ?: Thorough recoding to respect
+ styles. MAJOR.
+
+Thu Aug 15 00:03:46 1996 Kristoffer H Rose <krisrose@brics.dk>
+
+ * xy.doc: dottedSpread bails out when no filling requested. HACK.
+
+ * xycurve.doc: Avoid redefinition warning. MINOR.
+
+ * xyguide.man: Worked through; documented that line intersection
+ of curves works. MINOR.
+
+Mon Aug 13 00:00:00 EST 1996 Ross Moore <ross@mpce.mq.edu.au>
+
+ * xycurve.doc, xyline.doc, ?: Thorough recoding to respect
+ styles. MAJOR.
+
+Sun Jun 30 21:12:35 1996 Kristoffer H|gsbro Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xyarrow.doc: Hide tips. MINOR.
+
+Tue Jun 11 01:23:46 1996 Kristoffer H|gsbro Rose <krisrose@gorm.daimi.aau.dk>
+
+ * xyarrow.doc: use \PATHcontinue@@ correctly. MAJOR.
+
+ * xy.doc: \checkXyStyle@ was never defined, now prints `?'.
+
+Fri May 24 04:27:32 1996 Kristoffer H Rose <kris@laptop (Kristoffer H Rose)>
+
+ * xyarrow.doc (*): fixed use of new kernel connect methods! MAJOR.
+
+Thu May 23 20:30:53 1996 Kristoffer H Rose <kris@laptop (Kristoffer H Rose)>
+
+ * xy.doc: SUMMARY of (functionality) KERNEL CHANGES since v3.2:
+ - (PREAMBLE) \xy*@ definitions made global.
+ - (\zz@) new almost-zero test (uses dimension register).
+ - (\xyinputorelse@) split into conditional (not loading if
+ \*loaded already defined) and unconditional (with @@).
+ - (\xymath@) use fontdimen22 to vertically adjust.
+ - (\vfromabsolute@@, \AddOp@) add 1sp ??
+ - (\preconnect, ...) setup but don't do \connect.
+ - (\OBJECT@@, \Drop@@) default is to use \styledbox@.
+ - (\OBJECT@@, \object) define \pre/postXY@style@.
+ - (\checkZeroEdge@) uses \zz@-checker.
+ - (\OBJECT@shapei) fix expandafter trickery.
+ - (\styledbox@) new wrapper for \pre/post-styles.
+ - (\checkXyStyle@, \styleDrop@, \styleConnect@) removed.
+ - (\xynamestyle@) removed warning when not redefining.
+ - (\xycompileto@) attempt to recover when compiled file truncated.
+ - (\MakeOutlines) Allow compilation of outlines only.
+ - (\no@, \line@, \solid@, \tip@) don't reset i/h flags ??
+ - (\line@, \pointlike@, \squiggle@, \[Tt]ip@, \cir@*) use \styledbox@.
+ - (\solid[vh]rule@) respect i/h flags, setup break-methods.
+ - (\xyoption) truncate right.
+ - (\xydriversselected) default to empty!
+ - (CONNECTIONS) recoded (too many changes to summarise)!
+
+Tue Jan 2 14:18:04 1996 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (\xyinputorelse@): Stop gobbling csnames like mad: use a
+ shaved version to input non-doc files. MINOR.
+
+ * xy.doc (\xydef@,...): made private definitions global. MINOR.
+
+ * xygraph.doc: do not save node ids with explicit ="...". NEW.
+
+Wed Dec 13 03:16:04 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (methods): Changed style principle such that the style is
+ always used, and such that it is reestablished. MAJOR.
+
+Mon Nov 20 23:06:26 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (shapes): Now [=...] is the same as [|=...]. MINOR.
+
+Thu Nov 16 03:12:01 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyarrow.doc (\ar): update variant more often but only when not
+ already set. MINOR.
+ From: Stefano Guerrini <guerrini@DI.Unipi.IT>
+
+Wed Nov 15 20:36:10 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (\straight@): added Cbreak@@ and Clast@@ methods! NEW.
+
+Mon Nov 13 16:14:11 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xymatrix.doc (\xymatrix@fix): Fixed @! <setup> to make row and
+ column spacing the same; added @![RC]0 and @![RC]=<dimen> to set
+ override entry size for spacing computation. MINOR, NEW..
+
+Thu Oct 26 16:09:10 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (\xycompile): add \OnlyOutlines and friends. NEW.
+
+Wed Oct 18 03:13:45 1995 Kristoffer H Rose <kris@rose.diku.dk>
+
+ * xyps-pro.doc (PS Prolog): eliminate obsolete \currentxydriver@
+ such that conditionals are right. MINOR.
+
+ * xyidioms.doc (\xysetup@@): avoid problems when Babel loaded with
+ plain TeX. MINOR.
+
+Tue Oct 17 21:38:03 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xymatrix.doc (\xymatrix@at): @1 <setup> adds math strut. NEW.
+
+ * xy.doc (\xymath@): Use axis_height (fontdimen22 of textfont2) to
+ adjust the reference point of in-math Xy-pictures. MAJOR.
+
+Mon Oct 16 20:04:25 EST 1995 Ross Moore <ross@mpce.mq.edu.au>
+
+ * xycurve.doc: improved the edge-finding capabilities. MINOR
+
+ * xyarrow.doc: removed \cmergethecz@ from path sub-segments. MINOR
+
+Wed Oct 11 08:16:27 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy*.doc: \xyinputorelse@ now skips files files that have set
+ \FILEloaded = \empty. MINOR.
+
+Tue Oct 10 20:30:16 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (\xycompileto): attempt to recover from truncated
+ .xyc-file. MINOR.
+
+ * xyv2.doc (\diagramcompileto): avoid competing compilation. MINOR.
+ (\XXtoY@, \toXY@): avoid @-names in literate code. MINOR.
+ From: Joerg Eich <jeich@wmpi13.math.uni-wuppertal.de>
+
+Mon Oct 9 20:58:13 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xymatrix.doc (entry spacing): added <setup> forms @*[shape] and
+ @*<addop><size> to set defaults for **... equivalents; also made
+ these constructions cumulative (bug: still backwards). MINOR, NEW.
+
+Thu Oct 5 16:44:09 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xymatrix.doc: changed row/column names to the user-accessible
+ \Row and \Col. MINOR.
+
+Tue Oct 3 16:33:41 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xygraph.doc (\MOVE@place): Lookahead properly after <move> of
+ the form ...!<place>. MINOR.
+
+Mon Oct 2 16:40:29 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (\vfromabsolute@@, \Addop@), xyframe.doc, xycurve.doc:
+ add new \zz@ almost-zero-test and add tiny amount to absolute
+ dimensions to make more robust and in particular circumvent bug in
+ some PostScript interpreters (!). MINOR; should also be fixed in
+ PS backends...
+
+Sat Sep 23 19:48:38 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyps-ps.doc, xyps.doc: fixed undefined \UnloadPS@@ MAJOR.
+ * xyframe.doc, xycurve.doc: problem with \L@ and \R@ MAJOR.
+ * documentation fixes; undefined references, etc. MINOR.
+
+ * altered example diagrams, due to bug in PS interpreters.
+ A better fix may be possible within xyps-ps.doc.
+
+ * Released version 3.2 on ftp.mpce.mq.edu.au
+ with above fixes and corrected manuals.
+
+Tue Sep 19 17:42:24 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * Release 3.2.
+
+ * xyframe.doc (Circles): several instances of \L@ and \R@ should
+ be \L@c and \R@c... MAJOR.
+ From: Clemens Beckstein <beckstei@mipool.uni-jena.de>
+
+Fri Sep 15 95 19:03:37 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyarrow.doc (\droplabel@): labels as objects now
+ flawless! MAJOR.
+
+Wed Sep 13 18:29:25 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyarc.doc, xytpic.doc: fixed version numbers. MINOR.
+
+ * xytile.doc: changed example code...to avoid weird Level 1
+ PostScript error. MINOR.
+
+ * xypspatt.doc: documentation now prints with GhostScript (added
+ hack to side-step bad Level 2 patterns). MAJOR.
+
+Wed Sep 13 01:54:55 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyarrow.doc: Fixed size and modifiers of labels on all
+ segments. MAJOR. From: Jürgen Koslowski <koslowj@iti.cs.tu-bs.de>
+
+Tue Sep 12 01:59:34 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyarrow.doc: added [shape]* prefix to <it>. NEW!
+
+Mon Sep 11 21:22:37 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xypspatt.doc, xypsdict.doc: fixed pattern frequencies and
+ angles. MINOR.
+
+ * xyps.doc, xyps-ps.doc, + <driver> files: isolated font/ps
+ interface. MAJOR.
+
+Fri Sep 8 18:15:33 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xycurve.doc: fixed \resetbreaks undefined w/o arrow. MINOR.
+ Fixed wrong circle-frames w/o PS. MAJOR.
+ From: Fred T. Krogh <fkrogh@math.jpl.nasa.gov>
+
+Wed Sep 6 20:48:01 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xydvidrv.doc: Changed wrong \withoption to \xywithoption. MAJOR.
+ From: Young U. Ryu <ryoung@utdallas.edu>
+
+Tue Sep 5 22:38:55 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * Release 3.1!
+
+ * xyframe.doc: added :<dimen> modifier to [F...] shapes. MINOR.
+ From: Marc Gemis <makke@pucky.uia.ac.be>
+
+ * xyarrow.doc: fixed *{x} labels to use default object
+ style. MINOR.
+
+Tue Sep 5 18:49:57 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyweb.doc, xyguide.man: fixed an example. MINOR.
+
+ * xy.doc: added method \circleProp@ for labels. MAJOR.
+
+ * xyemtex.doc, xydvidrv.doc, xydvips.doc:
+ Support for em-\TeX \special commands. NEW.
+
+Fri Sep 1 16:11:02 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyarrow.doc: added @? <form> to swap the meaning of ^ and _ for
+ an arrow. NEW!
+
+Fri Sep 1 18:46:39 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xy.doc, xyframe.doc, xyarrow.doc: frames around arrow-labels now
+ positioned better...MAJOR.
+
+Thu Aug 31 18:46:39 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xytp-f.doc: filled frames now all work. MAJOR.
+
+Tue Aug 29 15:34:25 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (\OBJECT@change): - object modifier now works. MINOR.
+
+Tue Aug 29 20:21:59 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyframe.doc, xy.doc, xycurve.doc, xyps.doc, xytp-f.doc, xytpic.doc
+ implemented some curved and oval frames using splines and/or tpic.
+ fixed some bugs in frames. MAJOR.
+
+Thu Aug 24 21:59:53 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xycolor.doc, xyline.doc, xyrotate.doc, xytile.doc: removed need
+ for obsolete style option. MINOR.
+
+ * xy.doc (define <shape>): xystyle.doc annihilated and its
+ functionality inserted with the syntax [=...] in the
+ kernel. MINOR.
+
+ * xy.doc, xytile.doc, xyrotate.doc, xyline.doc, xycolor.doc,
+ xyps-t.doc, xyps-ps.doc, xyps-c.doc: Changed \*shape@<shape>@ to
+ merely \shape [<shape>] and \*shapechar@<char>@ to \shape
+ [<char>...]. MAJOR.
+
+ * xy.doc (\xyadddriversupport@): <driver> support control sequence
+ no longer cleared upon every addition to it. MAJOR.
+
+Wed Aug 23 22:42:24 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xytp-f.doc, xytpic.doc: implements frames for TPIC NEW!
+ * xytp-f.doc: (incomplete) rectangles, not circles/ellispes. MINOR.
+
+Wed Aug 23 11:32:25 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyframe.doc, xyps-f.doc, xyps-pro.doc: added \frm{**} for
+ stroked fills. NEW!
+
+ * xy.doc: shortened the loading of drivers and removed the initial
+ ``unload''. MINOR.
+
+ * xycurve.doc: lack of invisibility, fixed. MINOR.
+
+Tue Aug 22 20:24:03 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xytpic.doc: all bugs fixed (!). MAJOR.
+ * xytpic.doc: dotted/dashed lines now work. NEW!
+ * xytpic.doc: implements \xycircle and \qspline. NEW!
+ * xyxdvi.doc: new driver. NEW!
+ * xy<driver>.doc: edits to reflect the TPIC support. MINOR.
+ * xydoc.sty: macros for driver names. MINOR.
+
+Tue Aug 22 01:09:46 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyguide.man, man2html.gawk: Several changes to make the .html
+ version of the User's Guide prettier. MINOR.
+
+Mon Aug 21 20:24:03 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xycurve.doc: Quadratic splines added: \qspline NEW!
+ * xyps-?.doc: minor edits to documentation MINOR.
+ * xyrefer.doc: moved the xyps-?.doc to Part IV MINOR.
+ * xytpic.doc: removed tracing and fixed a bug. MINOR.
+
+Fri Aug 18 17:13:01 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyframe.doc: fixed several bugs: `missing' frames now are found;
+ zero-sized frames handled properly; default `blacked' frames
+ placed correctly; frame <object>-modifiers placed BEFORE object,
+ not AFTER. MAJOR.
+
+ * xyps-f.doc, xyps-c.doc, xyps-t.doc, xyps-r.doc, xyps-l.doc:
+ ability to turn PSframes, PScolor, ... on/off. MINOR.
+
+ * xyline.doc, xy<driver>.doc: renaming of cs's for consistency.
+ MINOR.
+
+ * xy.doc: fixed bug affecting ADDOP@minus. MAJOR.
+
+Tue Aug 15 16:38:22 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyidioms.doc, xy*.doc: xysetup@ is now xysetup@@ (in other files
+ also).
+
+ * xyps-pro.doc: fixed error in PostScript for oval frames.
+
+Mon Aug 14 15:19:56 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xy<driver>.doc: removed the \global s, which were unnecessary.
+ MINOR.
+
+ * xydvitops.doc: new driver --- untested. MINOR.
+
+ * xyrotate.doc, xyps-r.doc: rationalised control sequence names.
+ MINOR.
+
+Fri Aug 11 18:25:31 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xy updated the Macintosh driver files. MAJOR.
+
+ * xycmactex.doc, xyemtex.doc: dummy drivers that simply
+ \xyrequire{dvips} (should be independent). NEW!
+
+Thu Aug 10 19:36:49 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xy.doc, xydvips.doc, xytile.doc: attempted correct
+ driver-loading sequencing for non-delayed loading. MAJOR.
+
+ * xyps-ps.doc: forgot to let \xyUnloadPS@@=\xyUnloadPS@. MINOR.
+
+Wed Aug 9 19:50:11 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ xycmtip.doc: with PS-backend, now work again. MAJOR
+
+ * xyps-ps.doc, xyps.doc, xydvips.doc: reorganised the unloading of
+ PS to simplify code in the driver-files. MINOR.
+
+ * xy.doc: reinstated \xysetup@ for single drivers. (Simply delayed
+ the action: \xydef@\selectdriver@single#1{\xysetup@{...}}. Now
+ \xyReloadDrivers happens when it should --- everything loads at
+ once, without all those repetitions as new extensions are added.
+ The remaining problem (?) is that extra requests for a new (or the
+ same) driver seem to generate an increasing number of calls to
+ \xyReloadDrivers; e.g. 1 driver ==> 1 call , 2 drivers ==> 1+2=3
+ calls , 3 drivers ==> 1+2+3=6 calls , ....). MAJOR.
+
+Mon Aug 7 16:08:06 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xy.doc, xyrecat.doc: fixed catcode loading. MAJOR.
+
+ * xycmtip.doc: do not work in the reference manual, with PS. MAJOR
+ looking at the <driver>-table --- great hacking, Kris :-)
+ it seems that cmtips needs a <driver>. Why ?
+ Could this explain its failure to load ?
+ Or is it the \xysetup@ problem again ?
+ i.e. it needs a trigger for the activation.
+
+Fri Aug 4 13:11:12 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xydvips.doc, xytextures.doc: hooks now end in @@, for
+ consistency. MINOR.
+
+ * xyframe.doc: fixed up fills, allowing non-default
+ implementations. MAJOR.
+
+ * xydvips.doc xycolor.doc: fixed colours. Problem in the
+ redefinition of unloading, etc. Fix: make unloading a hook
+ also. Drivers may redefine the hook to unload. MAJOR.
+
+Wed Jul 26 15:24:17 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyidioms.doc, *.doc: Defined \xyclosedown@@ to make it easy to
+ add important warnings to the end of the run. Renamed \xysetup@
+ to \xysetup@ with global replace in all files. MINOR.
+
+Tue Jul 25 14:52:36 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyguide.man: Index entries inserted; still needs sexy examples
+ last. MINOR.
+
+ * xyrefer.man: Inserted Preface with overview and license. MINOR.
+
+ * xy.doc (\xyoption): Do not execute \xyoption{o} until *after* o
+ has been loaded (delay definition of \xy<option>loaded). MINOR.
+ (\newdriver): Use \xywithoption{<driver>}{...} to activate. MINOR.
+
+Mon Jul 24 01:12:48 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyguide.man (Sliding arrows sideways): use the now fixed @<1ex>
+ form for sliding. MINOR.
+
+ * xyarrow.doc (note slide arrow): @<dimen> fixed such that it
+ works. MAJOR.
+
+ * xy.doc (\endxy): explicit error for unmatched \endxy. MINOR.
+
+ * xymatrix.doc (New coordinate formats): <place> accepted after
+ <hop>+. NEW!
+
+ * xy16textures.doc (Unloading): add pseudo-extension to handle
+ special \shipout undefinition. MINOR.
+
+ * xydvips.doc, xytextures.doc, xy16textures.doc, xyoztex.doc,
+ xy17oztex.doc: use new <driver> principle. NEW!
+
+ * xydoc.sty: drivers treated like other options in the reference
+ manual. MINOR.
+
+ * xycolor.doc, xyframe.doc, xyline.doc, xyps.doc: Added `unload'
+ <driver> support; removed some status messages. NEW!
+
+ * xydocps.doc: use plain TeX. MINOR.
+
+Sun Jul 23 20:35:16 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (\xyeveryrequest): execute code at every invocation of
+ an option. NEW!
+ (\xyeverywithoption): execute code at every inocation of
+ code created with \xywithoption. NEW!
+ (Driver options): completely rewrite of driver option support,
+ incorporating concepts of xydriver.doc. NEW!
+
+ * Makefile (KERNELSOURCES): xydriver.doc removed. MINOR.
+
+ * xyframe.doc: \frm{!} hack incorporated into plain frames when
+ line extension is loaded. MINOR.
+
+Sat Jul 22 14:45:44 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xy16textures.doc, xy17oztex.doc, xy2cell.doc, xyarc.doc,
+ xyarrow.doc, xycolor.doc, xydriver.doc, xyframe.doc, xyknot.doc,
+ xymatrix.doc, xyoztex.doc, xyps.doc, xytextures.doc, xyv2.doc,
+ xyweb.doc: many documentation fixes. MINOR.
+
+Fri Jul 21 18:43:14 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyidioms.doc (\xysetup@): Also delay preamble declarations for
+ the amsppt.sty style for AMS-TeX. MINOR.
+
+ * xydummy.doc: Counts its own usefulness :-). NEW!
+
+Fri Jul 21 22:23:07 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xy16textures.doc, xy17oztex.doc, xyoztex.doc, xytextures.doc:
+ removed redundant \xyuncatcodes. MINOR.
+
+Fri Jul 21 14:08:43 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.doc (\Xy-pic options): Search properly for options using all
+ possible file names. MINOR.
+
+Fri Jul 21 00:13:03 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyframe.doc: elliptical frames now work properly... MINOR
+ * xyps-f.doc: ...using PostScript.
+ still need to get them working using \xycircle, for non-PS.
+
+ * import1.eps: changed font name: MINOR
+ /courier changed to /Courier, else DPS may complain.
+
+ * xyimport.doc: made save-safe. MINOR
+ Modified to use xy@@s such that it is compile safe.
+
+Thu Jul 20 10:16:59 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * Makefile (DVIPS): Use 300 dpi and a4 paper as advertised. MINOR.
+
+ * xymatrix.doc (\xymatrix@pretypeset): Final matrix dimension set
+ after \halign.
+ Longest last row ignored. MAJOR.
+ From: Marc Gemis <makke@pucky.uia.ac.be>
+
+Wed Jul 19 17:43:25 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyframe.doc: reformulated note on using \frm{*} on
+ non-rectangular objects. MINOR
+
+Tue Jul 18 22:26:47 EST 1995 Ross R. Moore <ross@mpce.mq.edu.au>
+
+ * xyimport.doc: append .eps to example graphic's filename. MINOR
+ Added default sizes in case graphics box is empty, or has a zero
+ dimension, or coords are set at zero size.
+
+ * xyrefer.man: append .eps to graphics filenames. MINOR
+ Some implementations of LaTeX graphics may not need it, but others do.
+
+ * xydvips.doc: removed unnecessary catcode changes. MINOR
+ no longer necessary due to the fixes explained in the
+ following entry...
+
+ * xyps-l.doc, xyps-c.doc, xyps-f.doc, xyps-r.doc, xyps-t.doc,
+ xyps-t.doc, xycolor.doc, xycrayon.doc: inserted \xyuncatcodes
+ after installation --- loading options in different orders could
+ leave the catcodes set incorrectly (using plain TeX). MAJOR.
+ Lesson: \xyuncatcodes must follow any installation procedure
+ which either reads a file or creates new cs-names;
+ since it may be the last thing loaded.
+ From: Dierdrik Wiersma.
+
+ * xycurve.doc: documentation fixes: MINOR
+ Changed the `ToDo:' section for xycircle to DOCMODE2
+ Fixed bad presentation in the main display and elsewhere;
+ --- no more Underfull or Overfull boxes !!
+
+ * xyps-ps.doc: put \xyuncatcodes after dictionary loading. MINOR
+ Otherwise users can get the wrong catcodes if xypsdict.tex
+ is the last file to load.
+
+ * xyarc.doc: documentation fixes. MINOR
+ fixed the aberrant example; other cosmetic changes.
+
+Mon Jul 17 17:59:26 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * Makefile: Avoid retypesetting of manual? MINOR.
+
+ * xypic.map: Fixed PS font names (to upper-case). MINOR.
+ From: Michel Goossens <goossens@afsmail.cern.ch>
+
+Wed Jul 12 19:48:16 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xy.sty: Also apply @-active hack for `amsmath' package. MINOR.
+
+Tue Jul 11 12:25:54 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * xyframe.doc (Filled regions): Explained that non-rectangular
+ fills require backend support. MINOR.
+
+ * xy.sty: dvips document class option again loads dvips+ps. MINOR.
+
+ * xydoc.sty (\specialxyprovide): Use short \CompilePrefix{...}.
+ Bug: File names for .xyc-files of reference manual too long. MINOR.
+ From: Jörg Knappen <KNAPPEN@VKPMZD.kph.Uni-Mainz.DE>
+
+ * Makefile: use ...|while read f... instead of `...` to avoid
+ overlong lines during administrative makes. MINOR.
+
+Mon Jul 10 13:27:44 1995 Kristoffer H. Rose <kris@tyr.diku.dk>
+
+ * fix01 announced (to world since MAJOR bugs fixed).
+
+ * xyv2.doc (\framed, \Framed, ...): Removed erroneous brace level;
+ furthermore made it compile-safe.
+ Bug: Frames disappear in compatibility mode. MAJOR.
+ From: Clemens Beckstein <beckstei@mipool.uni-jena.de>
+ From: Michael J. Healy <mjhealy@espresso.rt.cs.boeing.com>
+
+ * xymatrix.doc: changed \row@/\col@ to \row@@/col@@.
+ Bug: conflict with AMS-LaTeX \row@ cs. MAJOR.
+ From: Enrico Gregorio <GREGORIO@dipmat.unict.it>
+
+ * xyarrow.doc (\PATHturn@i): Split turn code into several \xy@@s.
+ Bug: Too long lines in xyguide-30.xyc and xyguide-38.xyc. MINOR.
+ From: Jörg Knappen <KNAPPEN@VKPMZD.kph.Uni-Mainz.DE>
+
+ * xyguide.man: Set \CompilePrefix to 6-character string.
+ Bug: File names for .xyc-files of guide too long. MINOR.
+ From: Jörg Knappen <KNAPPEN@VKPMZD.kph.Uni-Mainz.DE>
+
+ * latin1.sty: Explicitly includes plain TeX's \def\copyright...
+ Bug: Can't typeset \copyright properly. MINOR.
+ From: Antonio Possolo <antonio@espresso.rt.cs.boeing.com>
+ From: Robert Kiessling <Robert.Kiessling@rrze.uni-erlangen.de>
diff --git a/Master/texmf-dist/source/generic/xypic/INSTALL b/Master/texmf-dist/source/generic/xypic/INSTALL
new file mode 100644
index 00000000000..f91c83dc335
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/INSTALL
@@ -0,0 +1,417 @@
+-*-text-*- $Id: INSTALL,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+
+
+ ================================================
+ INSTALLING THE Xy-pic DIAGRAM TYPESETTING MACROS
+ ================================================
+
+
+This file explains how you install the files in the `run' distribution of
+Xy-pic. See `README' for general information.
+
+Contents:
+
+-1- Copyleft
+-2- Overview of files and where they should be installed
+-3- Information for specific systems
+-4- Updating from version 2.6 (and earlier)
+-5- Bugs & comments
+
+
+---------------------------------------------------------------------------
+-1- COPYLEFT
+---------------------------------------------------------------------------
+
+
+Note that the entire Xy-pic package is distributed with copyleft:
+
+ Copyright (c) 1991-1998 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+ Copyright (c) 1994-1998 Ross Moore <ross@mpce.mq.edu.au>
+
+ The Xy-pic package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The Xy-pic package is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+What this means is that if you install Xy-pic then you should (1) make
+sure that the file `COPYING' is accessible to the users, and (2) be
+prepared to provide Xy-pic (including sources) to any of your users
+that request it (you may charge a fee for this if you are so
+inclined).
+
+Note: Some option files may be copyrighted by other people but the
+conditions remain the same for any file distributed as part of Xy-pic.
+
+
+---------------------------------------------------------------------------
+-2- OVERVIEW OF FILES AND WHERE THEY SHOULD BE INSTALLED
+---------------------------------------------------------------------------
+
+
+In this section we explain in 11 steps where the different groups of
+Xy-pic files in the `run' and `doc' distribution should be installed.
+For each file category we indicate the location recommended by TDS,
+the TeX Directory Standard (as formed by a TUG working group of that
+name).
+
+IMPORTANT
+---------
+If you have users currently using version 2.6 then make sure you read
+section 4! Please also check the next section for any system specific
+considerations.
+
+SPACE REQUIREMENTS
+------------------
+Installing the Xy-pic package requires almost 1MB with the macros
+macros taking up most of the space. Installing everything, including
+sources, documentation in both DVI, DVIPS, and PS, form, as well as
+bitmap fonts for several printers and in PostScript Type1 form,
+requires more than 12MB.
+
+
+Step 1. Eliminating Obsolete Files
+----------------------------------
+The new PostScript Type1 fonts contributed by Y&Y Inc. require that
+you REMOVE ALL COPIES of the following files BEFORE installing:
+
+Old font map files should be removed:
+
+ xy.map
+ xypic.map
+
+TDS directory: texmf/dvips/xypic
+
+Also be aware that some installations, for example the TeX Live 2
+CD-ROM, insert the contents of map files in `psfonts.map' (with TDS
+directory texmf/dvips/base); then you must EDIT it to remove all lines
+that start with `xy'.
+
+Remove old PostScript Type1 font files:
+
+ xyatip10.pfa
+ xybsql10.pfa
+ xybtip10.pfa
+ xycirc10.pfa
+ xycmat10.pfa
+ xycmbt10.pfa
+ xydash10.pfa
+ xyeuat10.pfa
+ xyeubt10.pfa
+
+ xyatip10.pfb
+ xybsql10.pfb
+ xybtip10.pfb
+ xycirc10.pfb
+ xycmat10.pfb
+ xycmbt10.pfb
+ xydash10.pfb
+ xyeuat10.pfb
+ xyeubt10.pfb
+
+TDS directory: texmf/fonts/type1/public/xypic
+
+Remove old `xy.sty' and `xypic.sty' files that you might have stored
+earlier in the TDS directory `texmf/tex/latex/misc'.
+
+
+[FILES IN xy*run.tar.gz:]
+
+
+Step 2. Availability & License
+------------------------------
+These eight files contain general information and should be installed
+in a publicly readable place:
+
+ README generic information on Xy-pic
+ CATALOG version information and summary
+ TRAILER announcement and availability
+ INSTALL how to install (this file)
+ MANIFEST list of all files
+ VERSIONS the RCS version ids of all source files
+ COPYING GNU General Public License
+
+TDS directory: texmf/doc/generic/xypic
+
+
+Step 3. Macros
+--------------
+Files `texinputs/*' are TeX and LaTeX macro files that must be
+installed in a place which TeX and LaTeX will search (e.g., with un*x
+TeX, a directory users include in the TEXINPUTS environment variable).
+
+The files `texinputs/*.ini'
+
+TDS directory: texmf/tex/generic/xypic
+
+
+Step 4. TeX Font Metric
+-----------------------
+Files `texfonts/*.tfm' should be installed in a directory that TeX
+will search for fonts (e.g., with un*x TeX, a directory users include
+in the TEXFONTS environment variable).
+
+TDS directory: texmf/fonts/tfm/public/xypic
+
+
+Step 5. METAFONT Sources
+------------------------
+Files `mfinputs/*.mf' should be installed in some directory where the
+METAFONT program will search for them (e.g., with un*x TeX, a
+directory included in the MFINPUTS environment variable).
+
+NOTE: The METAFONT source files are only useful on installations where
+the printer driver and previewer can utilise them to generate the
+required bitmap fonts `on-line'. If this is possible on your
+installation then please use it: it saves substantial amounts of space
+and means that you will automatically use fonts optimised for each
+printer (provided evrything is correctly set up, of course).
+
+TDS directory: texmf/fonts/source/public/xypic
+
+
+Step 6. Bitmap Fonts [Optional]
+-------------------------------
+Files matching the patterns `pkfonts/cx<N>/*.<N>pk' and
+`pkfonts/ljfour<N>/*.<N>pk', where <N> is some number, contain bitmap
+font files and should be installed where DVI previewers and printer
+drivers will find them (e.g., with un*x, the `xdvi' program should see
+them through the XDVIFONTS environment variable). (`cx' is a 300 dpi
+(dots per inch) mode and `ljfour' a 600 dpi mode.)
+
+NOTE: This step is optional because the bitmaps are only needed (and
+only recommended) for installations that can't use the METAFONT
+sources directly but do have a 300 or 600 dpi laserprinter driver that
+accepts PK bitmap font files.
+
+TDS directory: texmf/fonts/pk/cx/public/xypic/dpi<N>
+ and: texmf/fonts/pk/ljfour/public/xypic<N>
+
+
+Step 7. PostScript Type1 Fonts
+------------------------------
+Files `type1/*.pfb' contain versions of the Xy-pic fonts in special
+PostScript form that may be useful on some installations. They should
+be installed where the applications using them look for such fonts (if
+used with DVIPS then the `ps/xypic.map' file from the next group
+should also be installed).
+
+NOTE: Some installations, notably teTeX 0.4, will PREFER using these
+fonts over the METAFONT-generated equivalents (IMHO this is a bug in
+the MakeTeXPK script). On those systems we recommend that you ALSO
+install the PK fonts to circumvent the problem.
+
+IMPORTANT: Make sure that you do not have any old Xy-pic PostScript
+`xy*.pfa' fonts floating around in your system - search for and remove
+all files named `xy*.pfa' when you have installed the new fonts. One
+common way old (and wrong) fonts is manifest is when some arrowheads
+appear skewed or too thin.
+
+TDS directory: texmf/fonts/type1/public/xypic
+
+
+Step 8. Adobe Font Metric Files
+-------------------------------
+Files `afm/*.afm' are special files for the Adobe Type Manager and
+some other software. Install them if you need them.
+
+TDS directory (usually): texmf/fonts/afm/public/xypic
+
+
+Step 9. PostScript Font Metric Files
+------------------------------------
+Files `pfm/*.pfm' are special files for the Windows version of the
+Adobe Type Manager and some other software. Install them if you need
+them.
+
+TDS directory (usually): texmf/fonts/pfm/public/xypic
+
+
+Step 10. PostScript Header Files
+--------------------------------
+Files `ps/*' contain PostScript header files. If you plan to use the
+PostScript extension option then you should copy these files to a
+place where your PostScript DVI driver will find them.
+
+NOTE: For older versions of DVIPS (at least for 5.58f) you should
+replace the occurrences of `<<' with `<' in `xypic.map'.
+
+TDS directory (usually): texmf/dvips/xypic
+
+
+[FILES IN xy*doc.tar.gz:]
+
+
+Step 11. Manuals
+----------------
+The typeset User's Guide is distributed as a DVI file which you should
+be able to print (or preview) once you have installed the fonts (as
+source or bitmaps as applicable for your system):
+
+ doc/xyguide.dvi User's Guide, typeset using the kernel Xy-pic fonts
+ doc/xyguide.dvips --- using DVIPS specific `specials'
+ doc/xyguide.ps --- in PostScript (with 600dpi bitmap fonts)
+
+Similarly, the reference manual for the kernel and the distributed
+options is included in the same format:
+
+ doc/xyrefer.dvi Reference Manual, using Xy-pic fonts
+ doc/xyrefer.dvips --- using DVIPS specific `specials'
+ doc/xyrefer.ps --- in PostScript (with 600dpi bitmap fonts)
+
+Notice that only the .dvi documents are portable among all TeX
+installations.
+
+TDS directory: texmf/doc/generic/xypic
+
+
+That's all. If you want to install the Xy-pic sources (to experiment
+with development, for example), you need to get the separate
+distribution `xy*src.tar.gz'.
+
+
+---------------------------------------------------------------------------
+-3- INFORMATION FOR SPECIFIC SYSTEMS
+---------------------------------------------------------------------------
+
+
+UN*X
+----
+The above installation procedure (using the TDS recommended places) is
+encoded in the script `support/install-tds': the command
+
+ ./support/install-tds <texmf>
+
+where <texmf> is the full path name of the `texmf' directory (the root
+of the TDS tree), will install all the Xy-pic runtime files (or more
+precisely: it will perform steps 2-5 and 7-10 above).
+
+NOTE: You must MANUALLY remove obsolete files (do step 1 above)!
+
+If you get the source distribution as described in `TRAILER' and
+change the configuration section of the provided `src/Makefile' to
+reflect your local file system conventions as described in
+`src/MAKE', then the command
+
+ make TEXMF=<texmf> install
+
+will also do this (but with the generated files, of course).
+
+
+VMS
+---
+(Mon, 20 Mar 1995; thanks to Austin Benson <austin@shapel.ug.eds.com>
+and Ralf Gaertner <gaertner@cthulhu.rhein-main.de>):
+
+(1) VMS tfm and pk files are in a funny file format, which means they
+ EITHER should be generated from the mf source on a VMS machine, OR
+ be converted by a conversion program such as BILF (part of the
+ DECUS TeX distribution and the ZOO distribution although the
+ latter is reported to only work on VAXen).
+
+ FIX: Install .mf sources and pregenerate .tfm and .pk files
+ manually OR convert with BILF or a similar program.
+
+(2) At least some (OLD) versions of TeX for VMS had a `buglet' to do
+ with searching for input files: if you go \input <filename> on VMS
+ then TeX prepends the filename with a chained logical
+ "tex_inputs:" - equivalent to a Unix path. Unfortunately \openin
+ does _not_ do this - although on Unix systems \openin will search
+ the TEXINPUTS path just as \input does.
+
+ FIX: Change the following line in xy.tex
+
+\xydef@\xyinputorelse@@#1#2{\openin\xyread@=#1
+
+ TO
+
+\xydef@\xyinputorelse@@#1#2{\openin\xyread@=tex_inputs:#1
+
+
+PC WITH PCTEX
+-------------
+On PCTeX fonts should be stored in files `C:\PIXEL\DPI<dpi>\<font>.pk'
+where <dpi> and <font> are replaced by appropriate values, e.g., `600'
+and `xyatip' (thanks to Alain Amiouni <alain_amiouni@msn.com>).
+
+
+MAC WITH Textures or OzTeX
+--------------------------
+See the special files `INSTALL.Textures' and `INSTALL.OzTeX'.
+
+
+---------------------------------------------------------------------------
+-4- UPDATING FROM VERSION 2.6 (AND EARLIER)
+---------------------------------------------------------------------------
+
+
+IMPORTANT: If you have installed release 3.* or 2.7-2.12 then you can
+skip this section. If you have not, and use version 2.6, then READ IT!
+
+Xy-pic release 2.7 was almost a complete rewrite of Xy-pic; later
+releases are updates to this version. If you are using version 2.6 (or
+some earlier version) then note the following:
+
+* All the fonts have been redone AND renamed (except two that have not
+ changed). Thus installing version 3 will not break any DVI files
+ you already have that were typeset using the old fonts.
+
+ NOTE: In fact the distribution still contains the old fonts but only
+ as METAFONT sources, TFM font metrics, and PK bitmaps.
+
+* The distribution contains new versions of the files `xypic.tex' and
+ `xypic.sty' that load Xy-pic in a special compatibility mode. Thus
+ retypesetting your documents will create DVI files using the new
+ fonts. If you wish to keep the old `xypic.tex' and `xypic.sty' then
+ you should rename them before installation; we suggest naming them
+ `xypic-2.tex' and `xypic-2.sty' and REMEMBER to change the line
+ `\input xypic' in `xypic-2.sty' to `\input xypic-2' !
+
+* There are a few points where the backwards compatibility is not
+ perfect -- these are noted in the documentation.
+
+
+---------------------------------------------------------------------------
+-5- BUGS & COMMENTS
+---------------------------------------------------------------------------
+
+
+We will appreciate reports on any problems you may encounter and
+opinions you have on how the usefulness of Xy-pic can be improved.
+Please report using either
+
+ Electronic mail (Internet): krisrose@ens-lyon.fr [preferred]
+
+ Paper mail: Kristoffer H. Rose
+ Laboratoire de l'Informatique du Parallélisme
+ Ecole Normale Supérieure de Lyon
+ 46, Allée d'Italie
+ F-69364 Lyon cedex 07
+ FRANCE
+
+ Fax: +33 4 7272 8080
+
+ W3 <URL: http://www.ens-lyon.fr/~krisrose/Xy-pic.html>
+
+---------------------------------------------------------------------------
+
+This is the end of INSTALL. We hope you'll enjoy Xy-pic!
+
+ -- Ross Moore and Kristoffer Rose
+
+---------------------------------------------------------------------------
+
+Kristoffer Høgsbro Rose, Ph.D., prof.associé <Kristoffer.Rose@ENS-Lyon.FR>
+Laboratoire de l'Informatique du Parallélisme équipe PLUME, bureau LR5-026
+Ecole Normale Supérieure de Lyon; 46, Allée d'Italie; F-69364 Lyon 07 cedex
+phone: +33(0)4 7272 8642; fax:...8080 <http://www.ens-lyon.fr/~krisrose>
+
+---------------------------------------------------------------------------
diff --git a/Master/texmf-dist/source/generic/xypic/INSTALL.OzTeX b/Master/texmf-dist/source/generic/xypic/INSTALL.OzTeX
new file mode 100644
index 00000000000..23d838de562
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/INSTALL.OzTeX
@@ -0,0 +1,600 @@
+-*-text-*- $Id: INSTALL.OzTeX,v 3.4 1997/05/18 01:13:24 ross Exp $
+
+ ================================================
+ INSTALLING THE Xy-pic DIAGRAM TYPESETTING MACROS
+ ON OzTeX INSTALLATIONS
+ ================================================
+
+This file explains step by step how to install Xy-pic for use with
+OzTeX by Andrew Trevorrow. Please refer to the generic `INSTALL' file
+for details on the individual files.
+
+Contents:
+
+ -0- Comments regarding OzTeX versions
+ -1- Adding Xy-pic to the TeX search paths
+ -2- Memory requirements
+ -3- OzTeX and PostScript features
+ -4- Bugs & comments
+ -5- Config files
+
+----------------------------------------------------------------------
+ -0- COMMENTS REGARDING OzTeX VERSIONS
+----------------------------------------------------------------------
+
+Xy-pic works fine with versions of OzTeX, from 1.7 to 2.0 and later.
+With version 2.0+ of OzTeX, it is advisable to use the OzDVIPS driver.
+Similarly with versions 1.8 and 1.9, it is possible to use the DVIPS
+driver, implemented by Thomas Kiffe. These WILL handle all the effects
+such as colour, rotated text, scaled text, patterns, fills and others,
+however the OzTeX viewer cannot show these effects---you will need a
+PostScript printer or previewer such as GhostScript
+(e.g. `Mac GS Viewer', by Aladdin Enterprises).
+
+Thus to handle special effects with OzTeX 1.8+ your TeX source should
+specify \xyoption{dvips} and the `Use DVIPS' menu option should be
+selected for processing the dvi-file.
+
+The \xyoption{oztex} command should ONLY be used with OzTeX 1.8+ when
+you do not wish to use DVIPS or OzDVIPS but still want the improved
+performance of the PostScript backend (see note 3 below).
+Similarly \xyoption{17oztex} is provided for use with version 1.7.
+
+
+----------------------------------------------------------------------
+ -1- ADDING Xy-pic TO THE TeX SEARCH PATHS
+----------------------------------------------------------------------
+
+Follow these steps to make Xy-pic `visible' to OzTeX:
+
+INSTALLING MACROS:
+
+1. Create a subfolder `:TeX-inputs:Xy-pic:'.
+
+ This folder will contain the Xy-pic input files. It is NOT
+ sufficient to create an alias to an existing folder which already
+ contains these files.
+
+2. Append this directory name to the line
+
+ TeX input folder(s) = ....
+
+ in the `:Configs:Default' file.
+
+3. Within the folder `:Configs:'
+
+ EITHER create the files
+
+ :Configs:Default+Xypic
+ :Configs:Big TeX+Xypic
+ :Configs:Big Xy-TeX
+
+ which are included below (in section -5-).
+ These are modifications of Config files from OzTeX version 1.8.
+ Adaptations for version 2.0+ will be made sometime soon.
+ OR
+ read the memory requirement notes below (in section -2-)
+ and reconfigure your own config files accordingly.
+
+4. Within the folder `:TeX-inputs:Xy-pic:' place copies of all of
+ the files from `texinputs'.
+
+INSTALLING FONTS:
+
+5. Create a subfolder `:TeX-fonts:Xy-pic:'
+
+ This folder will contain the Xy-pic font metrics files. It is NOT
+ sufficient to create an alias to an existing folder which already
+ contains these files.
+
+6. Within the folder `:TeX-fonts:Xy-pic:' place copies of all of
+ the files from `texfonts'.
+
+7. For each of the subdirectories in `pkfonts': `cx300', `cx329', and
+ `cx360' copy all files to the corresponding folder
+
+ :PK-files:300:
+ :PK-files:329:
+ :PK-files:360:
+
+INSTALLING THE PostScript BACKEND:
+
+8. Within the folder `:PS-files:' place a copy of the file
+ `ps/xy34dict.pro'. This is placed here for safe-keeping only.
+
+If you DO NOT use DVIPS then ...
+
+8A. Within each directory in which you work, you will need a copy
+ of this file, renamed to be called `global.ps';
+
+ ...but if you DO use DVIPS then it is sufficient to...
+
+8B. Place a copy of `ps/xy34dict.pro' into the subfolder
+ `:Dvips:ps' where it can be found by DVIPS.
+
+ Read section -3- below, to understand what is required here.
+
+----------------------------------------------------------------------
+ -2- MEMORY REQUIREMENTS
+----------------------------------------------------------------------
+
+Xy-pic is a big package, requiring quite a lot of memory if a large
+number of diagrams, or a small number of large diagrams, are to be
+typeset.
+
+Using the `Default' configuration and `Plain' format, then Xy-pic will
+load, but expect trouble unless you need it only for small diagrams.
+With `LaTeX' then Xy-pic will NOT EVEN LOAD all of its standard
+options.
+
+Thus using `Big-TeX' should be regarded as ABSOLUTELY ESSENTIAL, to do
+any serious typesetting --- though read the rest of this section
+before doing this. Of course this will mean rebuilding the `Plain'
+and `LaTeX' formats using `INITEX' and increasing the Finder
+memory-partition from the OzTeX application's `Get Info' dialog box.
+
+Since `Big-TeX' inherits and overrides settings from `Default' it is
+not necessary to make any alterations for Xy-pic --- at least not for
+use with the `Plain' format.
+
+However even `Big-TeX' is too small, in some of its parameters, for
+`LaTeX' and Xy-pic to coexist peacefully. If you try this then the
+first type of memory to run out is the `pool size':
+
+ ! TeX capacity exceeded, sorry [pool_size=60000].
+
+To fix this requires increasing the "pool_size" parameter, to say
+160,000. Existing format files for Plain and LaTeX, compiled under
+Big-TeX with the smaller pool size WILL STILL WORK --- there is no
+need to recompile to accommodate this change.
+
+The config file `:Configs:Big TeX+Xypic' has these values.
+
+
+This should be sufficient unless the document contains large
+diagrams or diagrams such that many curves appear on the same or
+adjacent pages, and the Xy-pic PostScript back-end is NOT in use.
+Expect to encounter...
+
+ ! TeX capacity exceeded, sorry [mem_max=200000].
+
+In order to typeset such documents other memory parameters may have to
+be increased also, including "mem_top", "hash_size", "hash_prime" and
+"hyph_size". These latter changes mean that the format files have to
+be rebuilt.
+
+For example, in order to typeset the Xy-pic guide, reference manual,
+and technical documentation (700+ pages), using the Xy-pic fonts, an
+OzTeX with a finder memory partition of 8+ MBytes -- it has the
+parameter `mem_max=600000' -- was used.
+
+Please experiment with the memory parameters until you find settings
+comfortable for your requirements. The author would be happy to
+include, with future releases of Xy-pic, a listing of typical settings
+which users have found to meet their needs.
+
+----------------------------------------------------------------------
+ -3- IMPORTANT: OzTeX AND PostScript FEATURES
+----------------------------------------------------------------------
+
+Xy-pic provides improved graphics capabilities using PostScript code
+inserted into the .dvi-file using \special commands. Indeed if the
+PostScript ``backend'' is loaded, then almost all parts of diagrams
+constructed with Xy-pic can be rendered using PostScript. These extra
+features become available to Xy-pic, when `options' are requested,
+using e.g. \xyoption{ps} , \xyoption{color} , \xyoption{line} , ...
+see the User Guide and Reference manual for details.
+
+HOWEVER, one MUST also specify ONE of the following commands:
+
+ \xyoption{dvips} if ``Use DVIPS'' is checked
+ \xyoption{oztex} with versions 1.8+ of OzTeX
+ \xyoption{17oztex} with version 1.7 of OzTeX
+(these latter two are for when DVIPS will NOT process the .dvi file.)
+
+AND, if not using LaTeX, specify \XyReloadDrivers after all other
+Xy-pic options have been requested.
+
+
+
+IMPORTANT: (when OzDVIPS or DVIPS is NOT being used)
+If Xy-pic PostScript features are to be used with OzTeX,
+then two files are used frequently, namely `:PS-files:empty.ps' and
+`global.ps'. The latter must be resident in the current folder.
+
+Make sure that `empty.ps' indeed has empty contents, for the Xy-pic
+\specials depend upon this. Also, if global.ps has non-empty contents,
+then take a copy for safe-keeping, for Xy-pic will need to overwrite
+it at some point, as will now be explained.
+
+For the Xy-pic \specials to work correctly a dictionary of PostScript
+definitions must be included with every document before printing.
+These definitions are typically required on every page, so OzTeX's
+`global.ps' mechanism is used to achieve this.
+
+NOTE: It is NOT sufficient to input this dictionary as if it were
+a graphics file, residing in `:PS-files'. The `global.ps' mechanism
+is the ONLY way provided by OzTeX for this to work.
+
+Indeed Xy-pic checks that this file is available. If it does not find it,
+or finds that it is empty, then the required dictionary is written
+afresh and named `global.ps', so that OzTeX will recognize its purpose.
+
+You can force a fresh copy of the dictionary by placing the command
+ \dumpPSdict{global.ps} in the preamble section of any document.
+If your `global.ps' already has contents that you wish to continue to
+use, then copy it to somewhere safe and append its contents to the file
+created as above by Xy-pic.
+
+The dictionary is included in the package as `ps/xy34dict.pro'.
+
+LIMITATIONS: (when OzDVIPS or DVIPS is NOT being used)
+Not all of the PostScript effects that can be requested from the `line',
+`rotate' and `color' extension options are actually implementable by OzTeX.
+The limitation is due to the way in which OzTeX handles the \special
+commands, collecting them all at the beginning of the PostScript file that
+it creates, followed by the rules and characters from fonts.
+
+This means that the \special to initiate a special effect is followed
+soon after by the one necessary to revert to normal; this happens
+before any font characters are typeset. Correct sequencing is
+maintained so that diagrams constructed purely from Xy-pic objects
+such as lines, circles, curves and arrow-tips can have expanded widths
+and be coloured correctly. However rotations and scalings cannot work
+for other technical reasons. Any font characters in the diagram will
+not be expanded or coloured; this includes Xy-pic fonts.
+
+This situation is unfortunate, but nothing further can be done from
+within Xy-pic. To enjoy this aspect of working with Xy-pic, update
+to version 1.8 or later and use DVIPS or OzDVIPS.
+
+----------------------------------------------------------------------
+ -4- BUGS & COMMENTS
+----------------------------------------------------------------------
+
+Bugs and questions concerning the OzTeX implementation of Xy-pic
+should be directed to
+
+ Electronic mail (Internet): ross@mpce.mq.edu.au
+
+ Paper mail: Ross Moore
+ Mathematics Department
+ Macquarie University
+ North Ryde, Sydney
+ AUSTRALIA 2109
+
+ Fax: +61 2 9850 8114
+
+Generic bugs should be reported to Kristoffer Rose as described in the
+generic INSTALL file.
+
+----------------------------------------------------------------------
+
+This is the end of the `INSTALL.OzTeX' description; below is a section
+with the files discussed above. We hope you'll enjoy Xy-pic!
+
+----------------------------------------------------------------------
+ -5- Config FILES.
+----------------------------------------------------------------------
+
+Below is the contents of each of the files discussed in point 3 of
+section -1- above. Lines with only --s (dashes) are used to delimit
+the files.
+
+----------------------------------------------------------------------
+ :Configs:Default+Xypic
+----------------------------------------------------------------------
+% This is the default configuration file read by OzTeX 1.8.
+% Before making any changes, read the section on configuration files
+% in the OzTeX User Guide.
+%
+config files = "Big TeX" "Big TeX+Xypic" "Big Xy-TeX" |
+ -- StyleWriter ImageWriter Linotronic -- |
+ "A5 Portrait" "A4 Landscape" "US Letter" -- |
+ "View at 144 dpi" "View CM using PS" -- |
+ "Add CM/PS Fonts" "Add Lucida Fonts" "Add MathTime Fonts"
+format files = LaTeX Plain
+help files = "Questions and Answers" "Handy Hints" Problems "TeX Users Group" |
+ "Related Software" -- "Changes to OzTeX 1.42" "Changes to OzTeX 1.5" |
+ "Changes to OzTeX 1.6" "Changes to OzTeX 1.7" -- "Shareware Fee" Thanks
+printer res & mode = 300 laserwriter
+viewing res & mode = 300 laserwriter
+units = in (in/cm/mm/pc/pt/bp/px)
+paper width = 210mm (A4 width; use 8.5in for US Letter)
+paper height = 297mm (A4 height; use 11in for US Letter)
+horizontal offset = 0mm (shift pages right if +ve, left if -ve)
+vertical offset = 0mm (shift pages down if +ve, up if -ve)
+show statistics = false
+reverse page order = false (use true if pages are stacked face up)
+conserve VM = false (only for PostScript printing)
+manual feed = false (ditto)
+reserved = ignored
+%
+% Important folders and files:
+%
+Help folder = :Help-files:
+FMT folder = :TeX-formats:
+TeX input folder(s) = :TeX-inputs:*
+TFM folder(s) = :TeX-fonts:*
+PK folder(s) = :PK-files:
+PS folder(s) = :PS-files: :PS-files:Encodings:
+Text-to-PS prolog = :PS-files:TEXTtoPS.pro
+DVI-to-PS prolog = :PS-files:DVItoPS.pro
+VF folder(s) = :VF-files:
+global PS file = global.ps
+"Save OzTeX" output = Oz.text
+missing fonts file = :PK-files:missfont.log (for use by MakeTeXPK)
+pool file = :TeX-formats:TeX.pool (only used by INITEX)
+dummy TFM file = :TeX-fonts:CM:cmr10.tfm
+dummy screen font = Geneva
+%
+% Previewing colours (use "white" to make something invisible):
+%
+paper edges = blue
+\special markers = green
+missing fonts = red
+%
+% TeX parameters (the values in brackets show the possible ranges):
+%
+mem_max = 60000 (mem_top..100000000)
+font_max = 120 (1..256)
+font_mem_size = 30000 (8..100000000)
+max_strings = 5000 (1300..16382)
+string_vacancies = 20000 (0..pool_size-23500)
+pool_size = 60000 (string_vacancies+23500..100000000)
+buf_size = 1000 (120..32760)
+stack_size = 200 (1..1600)
+max_in_open = 6 (1..20)
+param_size = 60 (1..8190)
+nest_size = 40 (1..1000)
+save_size = 600 (1..4094)
+trie_size = 8000 (1..32760)
+trie_op_size = 500 (1..16382)
+%
+% If you change any of the next four parameters then you'll need
+% to run INITEX and rebuild all your format files.
+% Some people will probably want to increase the hash_size value,
+% so here are some suitable hash_prime values:
+% hash_size = 3000 4000 5000 6000 10000 20000 31000
+% hash_prime = 2551 3407 4253 5101 8501 16993 26347
+%
+mem_top = 60000 (mem_min+1100..mem_max)
+hash_size = 4000 (325..31000)
+hash_prime = 3407 (prime about 85% of hash_size)
+hyph_size = 307 (prime from 1..16382)
+%
+% Only change the next few parameters when carrying out TeX's TRIP test:
+%
+mem_min = 0 (0..mem_top-1100)
+error_line = 72 (45..32760)
+half_error_line = 42 (30..error_line-15)
+max_print_line = 79 (60..32760)
+%
+%
+% PostScript fonts (or more accurately, non-PK fonts):
+%
+== TFM Printer font Download Screen font Encoding Style
+%
+= ptmr0 Times-Roman Times Mac.enc
+= ptmri0 Times-Italic Times Mac.enc i
+= ptmb0 Times-Bold Times Mac.enc b
+= ptmbi0 Times-BoldItalic Times Mac.enc bi
+= ptmro0 Slanted-Times-Roman Times Mac.enc i
+= ptmbo0 Slanted-Times-Bold Times Mac.enc bi
+= pagk0 AvantGarde-Book "Avant Garde" Mac.enc
+= pagko0 AvantGarde-BookOblique "Avant Garde" Mac.enc i
+= pagd0 AvantGarde-Demi "Avant Garde" Mac.enc b
+= pagdo0 AvantGarde-DemiOblique "Avant Garde" Mac.enc bi
+= pbkl0 Bookman-Light Bookman Mac.enc
+= pbkli0 Bookman-LightItalic Bookman Mac.enc i
+= pbkd0 Bookman-Demi Bookman Mac.enc b
+= pbkdi0 Bookman-DemiItalic Bookman Mac.enc bi
+= pcrr0 Courier Courier Mac.enc
+= pcrro0 Courier-Oblique Courier Mac.enc i
+= pcrb0 Courier-Bold Courier Mac.enc b
+= pcrbo0 Courier-BoldOblique Courier Mac.enc bi
+= phvr0 Helvetica Helvetica Mac.enc
+= phvro0 Helvetica-Oblique Helvetica Mac.enc i
+= phvb0 Helvetica-Bold Helvetica Mac.enc b
+= phvbo0 Helvetica-BoldOblique Helvetica Mac.enc bi
+= pncr0 NewCenturySchlbk-Roman "New Century Schlbk" Mac.enc
+= pncri0 NewCenturySchlbk-Italic "New Century Schlbk" Mac.enc i
+= pncb0 NewCenturySchlbk-Bold "New Century Schlbk" Mac.enc b
+= pncbi0 NewCenturySchlbk-BoldItalic "New Century Schlbk" Mac.enc bi
+= pplr0 Palatino-Roman Palatino Mac.enc
+= pplri0 Palatino-Italic Palatino Mac.enc i
+= pplb0 Palatino-Bold Palatino Mac.enc b
+= pplbi0 Palatino-BoldItalic Palatino Mac.enc bi
+= pzcmi0 ZapfChancery-MediumItalic "Zapf Chancery" Mac.enc
+%
+% The next three TFMs do not require virtual fonts; note that their names
+% do not end with a zero:
+%
+= pzdr ZapfDingbats "Zapf Dingbats" nil
+= psyr Symbol Symbol nil
+= psyro Slanted-Symbol Symbol nil i
+%
+% The following lines use "<file" to download non-resident fonts:
+%
+= putr0 Utopia-Regular <putr.pfa Utopia Mac.enc
+= putri0 Utopia-Italic <putri.pfa Utopia Mac.enc i
+= putb0 Utopia-Bold <putb.pfa Utopia Mac.enc b
+= putbi0 Utopia-BoldItalic <putbi.pfa Utopia Mac.enc bi
+==
+
+OzTeX doesn't bother reading any stuff after the final "==", so you can
+put additional comments here without having to start each line with "%".
+
+----------------------------------------------------------------------
+ :Configs:Big TeX+Xypic
+----------------------------------------------------------------------
+% This config file sets most TeX parameters to very large values.
+% OzTeX's preferred memory size will need to be at least 3100K.
+% If you don't have enough memory then reduce the values of mem_max
+% and mem_top. Each unit reduction saves 8 bytes, so if mem_max and
+% mem_top are reduced by 100,000 then the required memory size drops
+% to about 2300K.
+%
+% If you decide to change other parameters then you'll need to adjust
+% OzTeX's memory size according to the total number of bytes saved or
+% added. To determine this number:
+% - Use "Get Info" in the Finder's File menu to see OzTeX's current
+% memory size (probably 1400K unless you changed it).
+% - Start OzTeX, run INITEX and hit Cmd-Dot when you get the "**" prompt.
+% OzTeX shows the amount of memory allocated, so note down the number.
+% - Quit OzTeX and use "Get Info" to set OzTeX's memory size as high as
+% you can.
+% - Start OzTeX again and select "Big TeX" (containing your changes)
+% from the Config menu.
+% - Run INITEX and hit Cmd-Dot. The amount of memory allocated
+% should have changed; the difference should be rounded up to the
+% nearest multiple of 10K or more (depending on how paranoid you are)
+% and used to adjust OzTeX's ORIGINAL memory size.
+%
+% You'll need to run INITEX and build the big formats listed below
+% before you can use TeX with this configuration file.
+% The OzTeX User Guide describes how to build such format files.
+% If you want to change the given list of format files, make sure
+% the new names do not contain any spaces.
+%
+config files = ignored
+format files = Big-LaTeX Big-Plain
+help files = ?
+printer resolution = ?
+viewing resolution = ?
+units = ?
+paper width = ?
+paper height = ?
+horizontal offset = ?
+vertical offset = ?
+show statistics = ?
+reverse page order = ?
+conserve VM = ?
+manual feed = ?
+reserved = ?
+Help folder = ?
+FMT folder = ?
+TeX input folder(s) = ?
+TFM folder(s) = ?
+PK folder(s) = ?
+PS folder(s) = ?
+Text-to-PS prologue = ?
+DVI-to-PS prologue = ?
+VF folder(s) = ?
+global PS file = ?
+Save OzTeX output = ?
+reserved = ?
+pool file = ?
+dummy TFM file = ?
+dummy screen font = ?
+paper edges = ?
+\special markers = ?
+missing fonts = ?
+%
+% TeX parameters:
+%
+mem_max = 200000 (mem_top..100000000)
+font_max = 256 (1..256)
+font_mem_size = 60000 (8..100000000)
+max_strings = 10000 (1300..16382)
+string_vacancies = 30000 (0..pool_size-23500)
+pool_size = 160000 (string_vacancies+23500..100000000)
+buf_size = 3000 (120..32760)
+stack_size = 600 (1..1600)
+max_in_open = 20 (1..20)
+param_size = 200 (1..8190)
+nest_size = 150 (1..1000)
+save_size = 2000 (1..4094)
+trie_size = 16000 (1..32760)
+trie_op_size = 1000 (1..16382)
+mem_top = 200000 (mem_min+1100..mem_max)
+hash_size = 10000 (325..31000)
+hash_prime = 8501 (prime about 85% of hash_size)
+hyph_size = 2551 (prime from 1..16382)
+mem_min = 0 (0..mem_top-1100)
+error_line = 72 (45..32760)
+half_error_line = 42 (30..error_line-15)
+max_print_line = 79 (60..32760)
+%
+% Keep the current set of PostScript fonts:
+%
+=!
+
+----------------------------------------------------------------------
+ :Configs:Big Xy-TeX
+----------------------------------------------------------------------
+% Sets most TeX parameters to very large values.
+% The OzTeX application memory size will need to be about 5500K.
+% (If you don't have enough memory then reduce the values of mem_max
+% and mem_top. Each unit reduction saves 8 bytes, so if mem_max and
+% mem_top are reduced by 100000 then the application memory required
+% drops to about 2300K.)
+%
+% You'll need to run INITEX and build the format files listed below
+% (with ".fmt" appended) before using TeX with this configuration file.
+% Note that format file names must not contain any spaces.
+%
+config files = ignored
+format files = Big-Xy-Plain Bigger-LaTeX Big-Xy-LaTeX
+help files = ?
+printer resolution = ?
+viewing resolution = ?
+units = ?
+paper width = ?
+paper height = ?
+horizontal offset = ?
+vertical offset = ?
+show statistics = ?
+reverse page order = ?
+conserve VM = ?
+manual feed = ?
+reserved = ?
+Help folder = ?
+FMT folder = ?
+TeX input folder(s) = ?
+TFM folder(s) = ?
+PK folder(s) = ?
+PS folder(s) = ?
+Text-to-PS prologue = ?
+DVI-to-PS prologue = ?
+VF folder(s) = ?
+global PS file = ?
+Save OzTeX output = ?
+reserved = ?
+pool file = ?
+dummy TFM file = ?
+dummy screen font = ?
+paper edges = ?
+\special markers = ?
+missing fonts = ?
+%
+% TeX parameters:
+%
+mem_max = 600000 (mem_top..100000000)
+font_max = 255 (1..255)
+font_mem_size = 60000 (8..100000000)
+max_strings = 10000 (1300..16382)
+string_vacancies = 30000 (0..pool_size-23500)
+pool_size = 160000 (string_vacancies+23500..100000000)
+buf_size = 3000 (120..32760)
+stack_size = 1600 (1..1600)
+max_in_open = 20 (1..20)
+param_size = 200 (1..8190)
+nest_size = 150 (1..1000)
+save_size = 2000 (1..4094)
+trie_size = 16000 (1..32760)
+trie_op_size = 1000 (1..16382)
+mem_top = 600000 (mem_min+1100..mem_max)
+hash_size = 10000 (325..31000)
+hash_prime = 8501 (prime about 85% of hash_size)
+hyph_size = 2551 (prime from 1..16382)
+mem_min = 0 (0..mem_top-1100)
+error_line = 72 (45..32760)
+half_error_line = 42 (30..error_line-15)
+max_print_line = 79 (60..32760)
+%
+% Keep current PostScript fonts:
+%
+=!
+
+----------------------------------------------------------------------
diff --git a/Master/texmf-dist/source/generic/xypic/INSTALL.Textures b/Master/texmf-dist/source/generic/xypic/INSTALL.Textures
new file mode 100644
index 00000000000..132fad86189
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/INSTALL.Textures
@@ -0,0 +1,393 @@
+-*-text-*- $Id: INSTALL.Textures,v 3.4 1997/05/18 01:13:24 ross Exp $
+
+ ===============================================================
+ INSTALLING THE Xy-pic DIAGRAM TYPESETTING MACROS ON A MACINTOSH
+ ===============================================================
+
+This file assumes that you have downloaded the `xy34mac.sea.hqx'
+file and have decoded this and have expanded and extracted all files
+and folders from the resulting compressed archive.
+
+It also assumes that you have the TeX application called Textures(tm),
+from Blue Sky Research, Portland, Oregon (version 1.6 or later).
+
+Finally it assumes that you have read the file INSTALL.
+
+
+The main difference between Textures(tm) and other TeX implementations
+is the way in which fonts are handled. Here we deal with Macintosh
+font suitcases containing bitmap versions of the special fonts that
+Xy-pic uses, as well as a suitcase containing the font metrics.
+
+For users of OzTeX a folder called `for OzTeX only' contains .pk fonts,
+.tfm files and some configuration files. The file `INSTALL.OzTeX'
+explains how to install these.
+
+For any other implementations of TeX on the Macintosh, there may be
+sufficient files here to install Xy-pic. If not then obtain the full
+Xy-pic distribution from one of the usual ftp sites:
+ ftp.mpce.mq.edu.au in the /pub/maths/TeX directory;
+ ftp.brics.dk in the /Staff/krisrose/TeX directory;
+ CTAN in the tex-archive/macros/generic/diagrams/xypic directory;
+ e.g. at ftp.shsu.edu, ftp.tex.ac.uk and ftp.dante.de.
+
+(If this is still insufficient, then the author would like to know
+what other resources are required and why.
+Contact him by email at the address given below.)
+
+
+From version 2.10, the source files are NOT included with the
+Macintosh Distribution, as doing this would add almost 1 MByte
+to its overall size. Obtain them from the sites listed above.
+
+
+I'll also assume that you use a 300 dots per inch laser printer
+(like the Apple laserwriter or HP laserjet).
+
+Contents:
+
+ -0- Simple Installation, for experienced users
+ -1- Copyleft
+ -2- Updating from version 2.6 (and earlier) or 2.7--2.12, 3.0--3.2
+ -3- Overview of files and where they should be installed
+ -4- Manuals and Sources
+ -5- Memory Requirements
+ -6- Bugs & comments
+
+----------------------------------------------------------------------
+ -0- SIMPLE INSTALLATION, for EXPERIENCED USERS
+----------------------------------------------------------------------
+
+If you have never used Xy-pic before and are experienced as a user
+of Textures(tm), then the following instructions should be sufficient
+to get Xy-pic installed.
+
+You should have extracted two folders called `for TeX inputs folder'
+and `for TeX fonts folder' from the Stuffit archive.
+
+Simply copy the contents of these folders to the places indicated by
+their names; namely the font suitcases go into the `TeX Fonts` folder,
+while the `xy*.tex` source code files go into the `TeX inputs` folder.
+
+
+If these instructions do not make sense to you, or you get any warning
+messages when you try to carry out these steps, then...
+
+ STOP immediately!
+
+... read the rest of this file, to learn more about Xy-pic, what all
+the files contain and how they should be installed on your Macintosh.
+
+If you had no trouble with this installation, then... enjoy Xy-pic!
+Please do us the courtesy of reading the rest of this file anyway.
+In particular please respect the following Copyright message, making
+sure that any copies that you may distribute are complete, so that
+others can equally enjoy Xy-pic (... and so that we do not get irate
+messages about missing features).
+
+----------------------------------------------------------------------
+ -1- COPYLEFT
+----------------------------------------------------------------------
+
+This distribution of the Xy-pic package is distributed with copyleft:
+
+ Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+ Copyright (c) 1994-1997 Ross Moore <ross@mpce.mq.edu.au>
+
+ The Xy-pic package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The Xy-pic package is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+What this means is that if you install Xy-pic then you should (1) make
+sure that the file COPYING is accessible to the users, and (2) be
+prepared to provide Xy-pic (including sources) to any of your users
+that request it (you may charge a fee for this if you are so inclined).
+
+----------------------------------------------------------------------
+ -2- UPDATING FROM VERSION 2.6 (AND EARLIER) OR 2.7--2.12, 3.0--3.2
+----------------------------------------------------------------------
+
+Xy-pic version 2.7 was almost a complete rewrite of Xy-pic. The update
+to version 2.8 fixed numerous small bugs and added PostScript \special
+commands that could be used instead of the Xy-pic fonts.
+In version 2.9 the PostScript functionality was extended to include
+effects such as rotation and scaling of diagrams and text, variable
+line thickness and colour support. There were also improvements in many
+other aspects of the way Xy-pic works.
+
+A Macintosh version of 2.9 was never released, as some of the claimed
+effects did not actually work. These bugs were fixed for version 2.10.
+
+Version 2.11 included the `Graph Combinator' feature which provides
+a simplified interface for many common classes of diagrams.
+Also some minor bugs were fixed, both in code and documentation.
+
+Version 2.12 is necessary to accommodate a change to AMS-LaTeX which
+otherwise seriously conflicts with internal structure of Xy-pic.
+A new `Polygon' feature has been added and many subtle bugs fixed.
+Also much of the `curve' code has been improved, especially for
+`curved arrows'.
+
+Also, versions 2.12+ provide for a new font for arrow-tips, in the style
+of those arrowheads that appear in the Computer Modern fonts.
+Fonts xycmat10 and xycmbt10 have always been included in the font
+suitcases (since version 2.6) but not used due to errors in the metrics.
+This has now been rectified --- this means that the font metric file
+`Xy-pic metrics' MUST BE REPLACED with the latest version --- having
+modification date: 20 August 1994 --- but the fonts are unchanged.
+
+Xy-pic version 3.0 was released in July 1995. New features included
+one for typesetting `crossing strings', in particular elegant
+representations of `knots', and one for `webs' or `lattices' of objects
+regularly spaced. There was no separate Macintosh distribution, but the
+macros would work with the earlier versions.
+With version 3.0 an improved option-loading mechanism was established
+for alternate dvi-drivers allowing extra effects using \special commands.
+
+To use such features place one of the following declarations in the
+document preamble:
+
+ \xyoption{textures} % with version 1.7 or later
+ \xyoption{16textures} % with version 1.6 of Textures
+
+If LaTeX is NOT being used then it is also necessary to specify
+
+ \xyReloadDrivers
+
+after all Xy-pic options have been specified.
+With LaTeX, this command occurs automatically at the \begin{document}.
+
+This version 3.4 contains just a few fixes found to necessary after
+the extensive changes of the 3.3 release. Some PostScript effects
+were broken, but now patterned tilings work again and frames are
+better than ever, even for non-PostScript effects. The old v2 macros
+which stopped working are now properly enabled.
+
+The version 3.3 was very stable for most purposes. A few bugs from
+previous versions were fixed and some new features were
+added. In particular `breaks' in connections, whether straight or
+curved, now work correctly. There is a greater variety of arrow-tips.
+Intersections between a curved connection and a straight one can
+now be located, or the point of closest approach can be located.
+
+The previous Version 3.2, followed closely after Version 3.1, fixing
+several bugs found there. Some diagrams in the documentation were
+found to not print correctly on some PostScript printers due to
+internal errors in the PostScript interpreter; these diagrams have
+been altered slightly to avoid that problem. (A future release of
+Xy-pic will attempt to sidestep such problems completely.)
+
+Indeed the Version 3.1 release fixes bugs in earlier releases,
+improves the range of available `frames' and offers a wider range
+of curved objects.
+The number of different dvi-drivers has been extended, though this
+has little bearing for Macintosh-users.
+
+
+
+If you already have version 2.7 (or later) installed then:
+
+* Copy the file: `Xy-pic metrics' , to be found in the folder called
+ `for TeX fonts folder', into your `TeX Fonts' folder.
+
++ The file `Xy-pic fonts' contains no new fonts, so need not be updated.
+
++ With version 7.1+ of the Macintosh operating system, you can place
+ font suitcases in the Fonts subfolder of the system folder.
+ However the `Xy-pic metrics' suitcase MUST be in the `TeX Fonts' folder.
+
++ Extra font sizes are available in a separate archive called `xymacxf.sit',
+ see below for more details. These can be installed locally, if desired.
+ Alternatively the extra sizes may be installed on a file-server;
+ then place an `alias' (requires system 7.0+) to them within the `TeX Fonts'
+ folder --- the server will mount when Textures is launched.
+
+
+* Copy the contents of the `for TeX inputs folder' into the
+ obvious place, i.e. the `TeX Inputs' folder, allowing these files to
+ replace the existing ones of the same name.
+
++ With the system-7 operating system, you can place the files/folders
+ elsewhere, and place aliases to them within the `TeX Inputs' folder.
+
+
+
+If you already have version 2.6 (or some earlier version) installed then
+note the following:
+
+* All the fonts have been redone AND renamed. Thus installing the new
+ version will not break any typeset files you already have that use
+ the old fonts. However if you intend to keep the old version on your
+ system then you should rename the font and metrics suitcases to
+ `Xy-pic fonts.old' and `Xy-pic metrics.old'.
+
+* The distribution contains new versions of the files `xypic.tex' and
+ `xypic.sty' that load Xy-pic 2.12 in a special compatibility mode.
+ Thus re-TeX'ing your source documents will create typeset versions
+ using the new fonts. If you wish to keep the old `xypic.tex' and
+ `xypic.sty' then you should rename them before installation.
+
+* There are a few points where the backwards compatibility is not
+ perfect -- these are noted in the documentation.
+
+
+----------------------------------------------------------------------
+ -3- OVERVIEW OF FILES AND WHERE THEY SHOULD BE INSTALLED
+----------------------------------------------------------------------
+
+The installation instructions of INSTALL apply except that
+
+MACRO FILES: are placed in the `for TeX inputs folder' and should
+normally be duplicated to the `TeX Inputs' folder (after having
+appropriately dealt with any previous version, as described above).
+
+PostScript HEADER FILES: It is not necessary to use this header file;
+furthermore the reference manual describes how it can be generated if
+needed from `xyps.tex'.
+
+Xy-pic FONTs and METRICs: the two font suitcase files, called `Xy-pic
+fonts' and `Xy-pic metrics', are found in the folder called `for TeX
+fonts folder'. Simply move these into the Textures(tm) `TeX Fonts'
+folder (after having appropriately dealt with any previous version, as
+described above).
+
+When you next launch the Textures(tm) application the following fonts will
+then be available for use in typesetting with the Xy-pic macros.
+
+ xydash10 straight line segments at 128 different angles
+ xyatip10 top half of an arrow head at 128 different angles
+ xybtip10 bottom half of arrow head at 128 different angles
+ xybsql10 small quarter turns, for hooks, turns and wavy lines
+ xycirc10 eighth-turns at 16 different radii, 8 per radius
+
+ xycmat10 Computer Modern Tips --- upper barbs
+ xycmbt10 Computer Modern Tips --- lower barbs
+ xyeuat10 Euler Tips --- upper barbs
+ xyeubt10 Euler Tips --- lower barbs
+
+These fonts are each provided in four screen sizes: 100% 120% 200% 240%
+and in one size for laser-printing at 300dpi: 417%.
+
+If more sizes are required then either:
+
+ a) get the file `xymacxf.sit.hqx' from ftp.mpce.mq.edu.au.
+ These expand to give suitcases containing the above sizes plus extra
+ laserwriter sizes, corresponding to magsteps 0.5, 1, 2, 3, 4, 5.
+ (The xycirc10 is separate since these fonts occupy more space than
+ any of the others --- 2.2 MByte!! )
+
+or...
+
+ b) generate extra sizes using Metafont.
+ The appropriate xy*.mf source files are included in the sub-directory
+ `mfinputs'. This can be obtained from the ftp sites listed above.
+
+ xydash10.mf kernel font sources
+ xyatip10.mf
+ xybsql10.mf
+ xybtip10.mf
+ xycirc10.mf
+
+With the xy*.tex and xy*.sty input files installed in the `TeX Inputs'
+folder, and the font suitcases installed in the `TeX Fonts' folder,
+you should be ready to use Xy-pic to typeset some diagrams.
+
+DOCUMENTATION: The dvi-files are provided primarily for non-Textures
+users. Using the `DVI-Tool' application, they can be converted into
+the usual form for documents typeset using Textures(tm). However this is
+not necessary as it has been done already: the `Xy-pic User's Guide'
+and `Xy-pic Reference Manual' described below.
+
+
+----------------------------------------------------------------------
+ -4- MANUALS and SOURCES
+----------------------------------------------------------------------
+
+The `Xy-pic User's Guide' and `Xy-pic Reference Manual' are provided
+with this distribution. They are in the form of pre-typeset Textures(tm)
+documents. These files are Finder-locked and should NOT be re-typeset.
+(Indeed it should not be possible to typeset this file without first
+removing the safe-guards which have been put in place.)
+
+It is a good idea to test your installation of Xy-pic by typesetting
+portions from the manuals. Of course you will first have to obtain
+these sources from one of the ftp sites listed above, or elsewhere.
+
+Alternatively you can try to typeset the complete manuals, using LaTeX,
+from the documents `xyguide.man' and `xyrefer.man' in the directory `src`
+where they are located along with all the input and non-standard style
+files that they need.
+You will need to obtain ALL the files in this directory.
+(There is a file named `xy*.doc' for each macro file `xy*.tex'
+placed in the `TeX Inputs' folder.)
+For this to be successful your Textures application will need a
+memory partition of at least 4.5 MBytes.
+
+The normal sequence should be followed: LaTeX, BibTeX, LaTeX, LaTeX
+to get all the references and the bibliography typesetting correctly.
+These manuals have been checked to work correctly with LaTeX 2.09 and
+LaTeX2e.
+
+An alternative way to get the manuals is to download the files called
+`xyguide.ps.Z' and `xyrefer.ps.Z' from one of the ftp-sites.
+These files were created using the `xyps' PostScript option, so should
+produce a higher quality printed output on a PostScript printer of
+resolution 300dpi (due to use of bitmapped Computer Modern fonts).
+
+
+----------------------------------------------------------------------
+ -5- MEMORY REQUIREMENTS
+----------------------------------------------------------------------
+
+Although many efforts have been made to make Xy-pic work quickly and
+efficiently, the nature of the diagrams for which it is designed are
+sometimes necessarily quite large and consume a significant amount of
+TeX's available memory. Do not be surprised if it takes a long time
+to typeset a diagram having several rows and columns of entries.
+
+Usually I work with a memory partition set at 4 MBytes, on a Mac IIci
+or Macintosh PowerBook. For instance, when typesetting the User's Guide,
+using LaTeX-2e and Xy-pic, nearly all of this 4 MBytes is required.
+The Reference Guide requires even more than this: allowing 8 MByte was
+a luxury that I could afford, but I suspect that 4.5 MByte would have
+been sufficient. Mind you, although shorter the Users' Guide actually
+takes significantly longer to typeset than does the Reference Manual.
+
+
+----------------------------------------------------------------------
+ -6- BUGS & COMMENTS
+----------------------------------------------------------------------
+
+Comments or reports related to the Macintosh distribution should be
+sent to Ross Moore at
+
+ Electronic mail (Internet): ross@mpce.mq.edu.au [preferred]
+
+ Paper mail: Ross Moore
+ Mathematics Department,
+ Macquarie University
+ North Ryde, NSW 2109
+ AUSTRALIA
+
+ Fax +61 2 9850 8114 attn: R.Moore
+
+----------------------------------------------------------------------
+
+This is the end of `INSTALL.Textures'. We hope you'll enjoy Xy-pic !
+
+--
+Ross MOORE Internet: ross@mpce.mq.edu.au
+Mathematics Dept, Macquarie University, Nth Ryde, NSW 2109, AUSTRALIA
+phone: +61 2 9850 8955 fax: +61 2 9850 8114
+WWW: http://www-math.mpce.mq.edu.au/~ross/
+--
diff --git a/Master/texmf-dist/source/generic/xypic/MAKE b/Master/texmf-dist/source/generic/xypic/MAKE
new file mode 100644
index 00000000000..6a2e960a936
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/MAKE
@@ -0,0 +1,259 @@
+-*-text-*- $Id: MAKE,v 3.5 1997/05/28 22:40:26 krisrose Exp $
+
+ ================================================
+ MAKE: Xy-pic diagram typesetting package SOURCES
+ ================================================
+
+Welcome to the source distribution of the Xy-pic macros for typesetting
+diagrams! Below you will find the following sections:
+
+ -1- License information
+ -2- Making the package and manual from sources
+ -3- Bugs & comments
+ -4- Distribution log
+
+Please see the file `README' for a summary of features `TRAILER' for how
+you can obtain the newest Xy-pic, and the various `INSTALL' files if you
+have already retrieved pregenerated macros and fonts.
+
+
+----------------------------------------------------------------------
+ -1- LICENSE INFORMATION
+----------------------------------------------------------------------
+
+The Xy-pic package is licensed under `GNU CopyLeft':
+
+ Xy-pic: Typesetting graphs and diagrams with TeX.
+ Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+
+ The Xy-pic macro package is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The Xy-pic macro package is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+(Some options may be copyright by other people but the conditions remain
+the same).
+
+The full text of the GNU General Public License is supplied with Xy-pic
+in the file `COPYING'.
+
+
+----------------------------------------------------------------------
+ -2- MAKING THE PACKAGE AND MANUAL FROM SOURCES
+----------------------------------------------------------------------
+
+This section describes how to make the Xy-pic package from sources on
+a un*x system. Making Xy-pic requires use (and some knowledge) of
+several standard un*x utilities; furthermore the typesetting og the
+reference manual needs a **LARGE** TeX (see below), and full
+installation requires both the plain TeX and LaTeX2e formats as well
+as METAFONT (with the plain and cm bases.
+
+NOTE FOR VMS USERS: The procedure for making the package from sources
+described below does not work on VMS, of course. You can, however,
+run the enclosed `support/doc2tex.com' procedure file contributed by
+R.Gaertner to create the .tex files from the .doc files.
+
+NOTE FOR OTHER NON-UN*X USERS: If you do not have a un*x system then
+you are best adviced to get the `ready to run' package and install it
+as described in `INSTALL'.
+
+UN*X GENERATION AND INSTALLATION STEPS:
+
+1. First make sure that you have a separate directory `src' which
+ contains all the files of the distribution (including this file).
+
+ The file `MANIFEST' contains a list of the files.
+
+2. Next you should edit the `Configuration section' of `Makefile' to fit
+ the configuration of your system by following the directions given
+ there.
+
+ When you have configured everything then just do
+
+ make
+
+ which should generate all the files needed to use the package.
+
+3. You can test the newly generated system by typesetting the User's
+ Guide which you probably want for reference anyway: do
+
+ make guide
+
+ which should produce a file `xyguide.dvi' by running LaTeX several
+ times and BibTeX once.
+
+4. If possible it is a good idea to try to preview the User's Guide (in
+ whatever way you do on your system) at this point. This is slightly
+ difficult because it uses the Xy-pic fonts which you haven't
+ installed yet, so the previewer should be instructed to look in the
+ current directory before looking in the system font directories. The
+ following show how to do this for the most common previewer (on un*x
+ systems with X windows) and might work for you:
+
+ env XDVIFONTS=.: xdvi xyguide.dvi
+
+5. You can then install the package by ensuring that the install
+ directories in `Makefile' are setup correctly and do
+
+ make install
+
+ This will replace exisiting `xypic.tex' and `xypic.sty' files with
+ the new (compatibility mode) ones; the old ones will remain available
+ with an `.orig' suffix (if you want to keep the old version then read
+ section 2 of `INSTALL').
+
+6. You can typeset the entire manual with
+
+ make manual
+
+ to create both files `xyguide.dvi' and `xyrefer.dvi'; they can be
+ installed in the TEXDOC directory with the command
+
+ make install.manual
+
+ NOTE: this requires a LARGE TeX system: the last typesetting (running
+ LaTeX on `xyrefer.man' without any driver) uses more than 600000 TeX
+ words, as noted above. Using Karl Berry's Web2C 7.0 this is
+ achieved by including the lines
+
+extra_mem_top = 400000 % extra high memory for chars, tokens, etc.
+extra_mem_bot = 400000 % extra low memory for boxes, glue, breakpoints, etc.
+
+ in the texmf.cnf file.
+
+7. You can build format files by the commands
+
+ make xytex.fmt
+ make xylatex.fmt
+
+ (the latter requires the new standard LaTeX release aka LaTeX2e).
+ These assume that the files `plain.tex' and `latex.ltx' are available
+ in the TeX search path; also you have to install the format files in
+ the appropriate place yourself.
+
+That is all.
+
+
+----------------------------------------------------------------------
+ -3- BUGS & COMMENTS
+----------------------------------------------------------------------
+
+I will appreciate reports on any problems you may encounter and
+opinions you have on how the usefulness of Xy-pic can be improved.
+Please report using either
+
+ Electronic mail (Internet): krisrose@brics.dk [preferred]
+
+ Paper mail: Kristoffer H. Rose
+ BRICS/Computer Science
+ University of Aarhus
+ Ny Munkegade, building 540
+ DK-8000 Aarhus C
+ DENMARK
+
+ Fax: +45 89423255 att. K.Rose / Karen Møller
+
+You can always get the latest news of Xy-pic from computers connected
+to the Internet by opening the Xy-pic World Wide Web page:
+
+ W3 <URL: http://www.brics.dk/~krisrose/Xy-pic.html>
+
+
+----------------------------------------------------------------------
+ -4- DISTRIBUTION LOG
+----------------------------------------------------------------------
+
+The following versions have been distributed publicly:
+
+$Log: MAKE,v $
+Revision 3.5 1997/05/28 22:40:26 krisrose
+Fixed missing breaks bug.
+
+Revision 3.3 1996/12/19 03:31:56 krisrose
+Maintenance release
+
+Revision 3.1 1995/09/05 20:31:32 kris
+Releasing!
+
+Revision 3.0 1995/07/07 20:14:21 kris
+Major release w/new User's Guide!
+
+Renamed to MAKE for version 3 source description.
+
+Revision 2.12 1994/10/25 11:34:25 kris
+Interim release just before v3 [works with AMS-LaTeX 1.2]...
+
+Revision 2.11 1994/07/05 10:37:32 kris
+Third 3beta release [bug fixes].
+Experimental graph feature included (for ECCT-94 presentation).
+
+Revision 2.10 1994/06/15 12:59:44 kris
+Second 3beta release [bug fixes].
+
+Revision 2.8 1994/04/11 09:31:09 kris
+Second (bug fix) 3alpha release [corrected].
+
+Revision 2.7 1994/03/08 02:06:01 kris
+Release 3alpha.
+
+MAJOR REWRITE of distribution to prepare for Xy-pic 3 functionality.
+Curve extension code contributed by Ross Moore <ross@mpce.mq.edu.au>;
+support funding from MURG, ARC, and equipment from DEC.
+
+Revision 2.6 1992/06/24 01:23:34 kris
+Added `hook' tips using new font xyqc10.
+Added new POSitions: * and !.
+Added triple lines \Ssolid, \Ddashed, \Ddotted, and companion \Ttip.
+Reorganised manual.
+
+Revision 2.5 1992/02/24 03:30:54 kris
+Fixed bugs in \Direction calculation logic...
+Added (FACTOR) to \rotate to allow arbitrary rotation.
+` intermediate points now accept an optional /RADIUS argument.
+Added \Tip with wide tip.
+
+Revision 2.4 1992/01/22 02:15:10 kris
+Fixed bugs [with thanks]:
+\\ works with AMS-LaTeX: don't use \Let@ [Werner Struckmann/Darrel Hankerson]
+No spurious arrow heads with LaTeX: \pit now undefined [Werner Struckmann]
+\Solid works: sets \Density [Dave Bowen]
+Short diagonal lines work...major rewrite of \connectv@ [Eric Domenjoud]
+
+Revision 2.3 1992/01/10 21:38:27 kris
+Several bugs fixed [with thanks]:
+The \ddtoX and \uutoX arrows were interchanged [Nico Verwer].
+Some diagonal lines were wrong [Eric Domenjoud].
+AMS-LaTeX users had name clash problems [Werner Struckmann].
+The installation instructions in the Makefile were buggy [Leen Torenvliet].
+
+Revision 2.2 1992/01/09 04:05:40 kris
+Patched to fix problem with \text and support AMS-LaTeX.
+
+Revision 2.1 1992/01/02 14:54:07 kris
+Release version.
+
+Revision 1.40 1991/12/17 04:53:23 kris
+Version distributed as `final draft' on Usenet.
+
+----------------------------------------------------------------------
+
+This is the end of the source overview. I hope you will enjoy Xy-pic!
+
+----------------------------------------------------------------------
+
+Kristoffer Høgsbro ROSE <krisrose@brics.dk>
+BRICS <URL: http://www.brics.dk/~krisrose/>
+Department of Computer Science B3.26, +45 89423193 (fax +45 89423255)
+University of Aarhus, Ny Munkegade, build. 540, 8000 Århus C, DENMARK
+
+----------------------------------------------------------------------
diff --git a/Master/texmf-dist/source/generic/xypic/MANIFEST b/Master/texmf-dist/source/generic/xypic/MANIFEST
new file mode 100644
index 00000000000..626876c6c12
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/MANIFEST
@@ -0,0 +1,111 @@
+-r--r--r-- 1 krisrose krisrose 2326 Feb 25 15:13 CATALOG.doc
+-r--r--r-- 1 krisrose krisrose 17982 Feb 25 15:13 COPYING
+-r--r--r-- 1 krisrose krisrose 14686 Feb 25 15:13 INSTALL
+-r--r--r-- 1 krisrose krisrose 22529 Feb 25 15:13 INSTALL.OzTeX
+-r--r--r-- 1 krisrose krisrose 17562 Feb 25 15:13 INSTALL.Textures
+-r--r--r-- 1 krisrose krisrose 9402 Feb 25 15:13 MAKE
+-rw-r--r-- 1 krisrose krisrose 53387 Feb 25 15:08 Makefile
+-r--r--r-- 1 krisrose krisrose 4025 Feb 25 15:13 README
+-r--r--r-- 1 krisrose krisrose 4176 Feb 25 15:13 TRAILER
+-r--r--r-- 1 krisrose krisrose 169792 Feb 25 15:13 YandY_xy_fonts.zip
+-r--r--r-- 1 krisrose krisrose 2806 Feb 25 15:13 doc2tex.com
+-r-xr-xr-x 1 krisrose krisrose 5096 Feb 25 15:13 dvitogif89a
+-r--r--r-- 1 krisrose krisrose 14392 Feb 25 15:13 import1.eps
+-r-xr-xr-x 1 krisrose krisrose 4825 Feb 25 15:13 install-tds
+-r--r--r-- 1 krisrose krisrose 26875 Feb 25 15:13 kris.eps
+-r--r--r-- 1 krisrose krisrose 8893 Feb 25 15:13 latin1.sty
+-r--r--r-- 1 krisrose krisrose 10562 Feb 25 15:10 movie.cls
+-r--r--r-- 1 krisrose krisrose 4888 Feb 25 15:13 pnmrawtopcropwhite.c
+-r--r--r-- 1 krisrose krisrose 21322 Feb 25 15:13 ross.eps
+-r--r--r-- 1 krisrose krisrose 292869 Feb 25 15:09 xy.doc
+-r--r--r-- 1 krisrose krisrose 3709 Feb 25 15:10 xy.sty
+-r--r--r-- 1 krisrose krisrose 9574 Feb 25 15:10 xy16textures.doc
+-r--r--r-- 1 krisrose krisrose 10061 Feb 25 15:10 xy17oztex.doc
+-r--r--r-- 1 krisrose krisrose 62605 Feb 25 15:10 xy2cell.doc
+-r--r--r-- 1 krisrose krisrose 3008 Feb 25 15:09 xyall.doc
+-r--r--r-- 1 krisrose krisrose 56008 Feb 25 15:10 xyarc.doc
+-r--r--r-- 1 krisrose krisrose 58648 Feb 25 15:10 xyarrow.doc
+-r--r--r-- 1 krisrose krisrose 2434 Feb 25 15:10 xyatip.mf
+-r--r--r-- 1 krisrose krisrose 1801 Feb 25 15:10 xyatip10.mf
+-r--r--r-- 1 krisrose krisrose 2904 Feb 25 15:10 xybsql10.mf
+-r--r--r-- 1 krisrose krisrose 2435 Feb 25 15:10 xybtip.mf
+-r--r--r-- 1 krisrose krisrose 1793 Feb 25 15:10 xybtip10.mf
+-r--r--r-- 1 krisrose krisrose 5358 Feb 25 15:10 xycirc10.mf
+-r--r--r-- 1 krisrose krisrose 1682 Feb 25 15:10 xycm.mf
+-r--r--r-- 1 krisrose krisrose 2304 Feb 25 15:10 xycmactex.doc
+-r--r--r-- 1 krisrose krisrose 1850 Feb 25 15:10 xycmat10.mf
+-r--r--r-- 1 krisrose krisrose 1477 Feb 25 15:10 xycmat11.mf
+-r--r--r-- 1 krisrose krisrose 1477 Feb 25 15:10 xycmat12.mf
+-r--r--r-- 1 krisrose krisrose 1850 Feb 25 15:10 xycmbt10.mf
+-r--r--r-- 1 krisrose krisrose 1479 Feb 25 15:10 xycmbt11.mf
+-r--r--r-- 1 krisrose krisrose 1479 Feb 25 15:10 xycmbt12.mf
+-r--r--r-- 1 krisrose krisrose 2972 Feb 25 15:09 xycmtip.doc
+-r--r--r-- 1 krisrose krisrose 12778 Feb 25 15:09 xycolor.doc
+-r--r--r-- 1 krisrose krisrose 2836 Feb 25 15:09 xycrayon.doc
+-r--r--r-- 1 krisrose krisrose 178076 Feb 25 15:09 xycurve.doc
+-r--r--r-- 1 krisrose krisrose 2743 Feb 25 15:10 xyd.mf
+-r--r--r-- 1 krisrose krisrose 2740 Feb 25 15:10 xyd2.mf
+-r--r--r-- 1 krisrose krisrose 2768 Feb 25 15:10 xydash10.mf
+-rw-r--r-- 1 krisrose krisrose 0 Feb 25 15:09 xydoc.back
+-r--r--r-- 1 krisrose krisrose 21077 Feb 25 15:13 xydoc.bib
+-r--r--r-- 1 krisrose krisrose 43418 Feb 25 15:13 xydoc.sty
+-r--r--r-- 1 krisrose krisrose 1281 Feb 25 15:13 xydocps.doc
+-r--r--r-- 1 krisrose krisrose 3133 Feb 25 15:09 xydummy.doc
+-r--r--r-- 1 krisrose krisrose 3041 Feb 25 15:10 xydvidrv.doc
+-r--r--r-- 1 krisrose krisrose 10394 Feb 25 15:10 xydvips.doc
+-r--r--r-- 1 krisrose krisrose 11156 Feb 25 15:10 xydvitops.doc
+-r--r--r-- 1 krisrose krisrose 8253 Feb 25 15:10 xyemtex.doc
+-r--r--r-- 1 krisrose krisrose 1465 Feb 25 15:10 xyeuat10.mf
+-r--r--r-- 1 krisrose krisrose 1470 Feb 25 15:10 xyeuat11.mf
+-r--r--r-- 1 krisrose krisrose 1470 Feb 25 15:10 xyeuat12.mf
+-r--r--r-- 1 krisrose krisrose 1470 Feb 25 15:10 xyeubt10.mf
+-r--r--r-- 1 krisrose krisrose 1470 Feb 25 15:10 xyeubt11.mf
+-r--r--r-- 1 krisrose krisrose 1470 Feb 25 15:10 xyeubt12.mf
+-r--r--r-- 1 krisrose krisrose 1674 Feb 25 15:10 xyeuler.mf
+-r--r--r-- 1 krisrose krisrose 42901 Feb 25 15:09 xyframe.doc
+-r--r--r-- 1 krisrose krisrose 23221 Feb 25 15:10 xygraph.doc
+-r--r--r-- 1 krisrose krisrose 65306 Feb 25 15:13 xyguide.man
+-r--r--r-- 1 krisrose krisrose 9165 Feb 25 15:09 xyidioms.doc
+-r--r--r-- 1 krisrose krisrose 9502 Feb 25 15:09 xyimport.doc
+-r--r--r-- 1 krisrose krisrose 70065 Feb 25 15:10 xyknot.doc
+-r--r--r-- 1 krisrose krisrose 2452 Feb 25 15:10 xylatex.ini
+-r--r--r-- 1 krisrose krisrose 23785 Feb 25 15:09 xyline.doc
+-r--r--r-- 1 krisrose krisrose 3752 Feb 25 15:12 xyline10.mf
+-r--r--r-- 1 krisrose krisrose 3559 Feb 25 15:09 xymacpat.xyp
+-r--r--r-- 1 krisrose krisrose 44438 Feb 25 15:09 xymatrix.doc
+-r--r--r-- 1 krisrose krisrose 4622 Feb 25 15:12 xymisc10.mf
+-r--r--r-- 1 krisrose krisrose 5035 Feb 25 15:10 xymovie.doc
+-rw-r--r-- 1 krisrose krisrose 18839 Oct 12 17:38 xynecula.doc
+-r--r--r-- 1 krisrose krisrose 10495 Feb 25 15:10 xyoztex.doc
+-r--r--r-- 1 krisrose krisrose 2438 Feb 25 15:10 xypic.doc
+-rw-r--r-- 1 krisrose krisrose 2563 Feb 25 15:06 xypic.map
+-r--r--r-- 1 krisrose krisrose 857 Feb 25 15:10 xypic.sty
+-r--r--r-- 1 krisrose krisrose 47974 Feb 25 15:10 xypoly.doc
+-r--r--r-- 1 krisrose krisrose 6929 Feb 25 15:09 xyps-c.doc
+-r--r--r-- 1 krisrose krisrose 6703 Feb 25 15:09 xyps-col.doc
+-r--r--r-- 1 krisrose krisrose 8910 Feb 25 15:09 xyps-f.doc
+-r--r--r-- 1 krisrose krisrose 6742 Feb 25 15:09 xyps-l.doc
+-r--r--r-- 1 krisrose krisrose 9744 Feb 25 15:09 xyps-pro.doc
+-r--r--r-- 1 krisrose krisrose 26581 Feb 25 15:09 xyps-ps.doc
+-r--r--r-- 1 krisrose krisrose 7876 Feb 25 15:09 xyps-r.doc
+-r--r--r-- 1 krisrose krisrose 4732 Feb 25 15:09 xyps-s.doc
+-r--r--r-- 1 krisrose krisrose 6112 Feb 25 15:09 xyps-t.doc
+-r--r--r-- 1 krisrose krisrose 43988 Feb 25 15:09 xyps.doc
+-r--r--r-- 1 krisrose krisrose 13267 Feb 25 15:09 xypsdict.doc
+-r--r--r-- 1 krisrose krisrose 6312 Feb 25 15:09 xypspatt.doc
+-r--r--r-- 1 krisrose krisrose 2866 Feb 25 15:12 xyqc10.mf
+-r--r--r-- 1 krisrose krisrose 3046 Feb 25 15:09 xyrecat.doc
+-r--r--r-- 1 krisrose krisrose 15324 Feb 25 15:13 xyrefer.man
+-r--r--r-- 1 krisrose krisrose 19231 Feb 25 15:09 xyrotate.doc
+-rw-r--r-- 1 krisrose krisrose 20780 Oct 12 16:54 xysmart.doc
+-r--r--r-- 1 krisrose krisrose 1668 Feb 25 15:10 xytech.mf
+-r--r--r-- 1 krisrose krisrose 1220 Feb 25 15:10 xytest.mf
+-r--r--r-- 1 krisrose krisrose 1838 Feb 25 15:10 xytex.ini
+-r--r--r-- 1 krisrose krisrose 9614 Feb 25 15:10 xytextures.doc
+-r--r--r-- 1 krisrose krisrose 17252 Feb 25 15:09 xytile.doc
+-r--r--r-- 1 krisrose krisrose 7651 Feb 25 15:09 xytips.doc
+-r--r--r-- 1 krisrose krisrose 10614 Feb 25 15:09 xytp-f.doc
+-r--r--r-- 1 krisrose krisrose 17502 Feb 25 15:09 xytpic.doc
+-r--r--r-- 1 krisrose krisrose 28845 Feb 25 15:10 xyv2.doc
+-r--r--r-- 1 krisrose krisrose 11373 Feb 25 15:10 xyweb.doc
+-r--r--r-- 1 krisrose krisrose 10940 Feb 25 15:10 xyxdvi.doc
diff --git a/Master/texmf-dist/source/generic/xypic/Makefile b/Master/texmf-dist/source/generic/xypic/Makefile
new file mode 100644
index 00000000000..b68afabda99
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/Makefile
@@ -0,0 +1,1528 @@
+# $Id: Makefile,v 3.7 1999/02/16 15:12:50 krisrose Exp krisrose $
+#
+# Un*x Makefile for Xy-pic macros, fonts, documentation, and distribution.
+# Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+#
+# This file is part of the Xy-pic macro package.
+# Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+# See the README and INSTALL files for further information.
+#
+# The Xy-pic package is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# The Xy-pic package is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this package; if not, write to the Free Software Foundation, Inc.,
+# 675 Mass Ave, Cambridge, MA 02139, USA.
+
+VERSION = 3.7
+SHORTVERSION = 37
+
+# CONTENTS:
+#
+# Configuration section:
+# Directories.
+# Fonts.
+# Programs.
+#
+# Generic targets.
+# Macros.
+# PostScript headers.
+# Fonts.
+# Formats.
+# Manual: User's guide and reference manual.
+# Reference manual.
+# TeXnical documentation.
+# Distribution tree.
+# Ftp'able distribution.
+# WWW publicity.
+# Announcements.
+# Tags.
+# RCS stuff.
+# Development targets.
+#
+# Log.
+
+
+#### CONFIGURATION SECTION ##################################################
+
+# Please configure as instructed below for each of the DIRECTORIES, FONTS,
+# and PROGRAMS parts by editing the definitions to fit your system.
+
+#### DIRECTORIES.
+#
+# The following variables define the directories where the various parts of
+# Xy-pic should be installed.
+#
+# You should *EITHER* set TDSROOT to the root of a TDS-compliant directory
+# tree, usually named .../texmf (if you have a TDS [TeX Directory Structure]
+# compliant system then that is in fact all you need to do):
+#
+USR = /usr/local
+TDSROOT = $(USR)/share/texmf
+#
+# *OR* you should set each of the following variables right for you system
+# (do this if your setup does not match TDS exactly):
+#
+TEXINPUTDIR = $(TDSROOT)/tex/generic/xypic
+TEXFONTDIR = $(TDSROOT)/fonts/tfm/public/xypic
+TEXDOCDIR = $(TDSROOT)/doc/generic/xypic
+MFINPUTDIR = $(TDSROOT)/fonts/source/public/xypic
+TYPE1DIR = $(TDSROOT)/fonts/type1/public/xypic
+PFMDIR = $(TDSROOT)/fonts/pfm/public/xypic
+AFMDIR = $(TDSROOT)/fonts/afm/public/xypic
+PDFDIR = $(TDSROOT)/pdftex/xypic
+PSHEADERDIR = $(TDSROOT)/dvips/xypic
+#
+# FONTDIR is the directory where bitmap fonts are stored and is special
+# (If you do not plan to install bitmap fonts because they are automatically
+# generated and remember to set the MAGS variable below to `.' then you may
+# ignore this step.)
+#
+# Since the location of individual fonts sometimes depend on properties of
+# the font, you can insert
+#
+# $${dpi} for the font resolution in `Dots Per Inch' (NOT the
+# device resolution---that should be inserted directly)
+#
+# $${mode} for the METAFONT `mode' used to generate the font
+#
+# ---what these get set to depends on the next section.
+#
+# For example, if you set FONTDIR=/usr/lib/tex/pk$${dpi} and decide in the
+# next section to generate PK fonts at 300 dpi using a generic mode
+# (localfont) then you get files named /usr/lib/tex/pk300/xy*.300pk.
+#
+# If your installation still uses the (inefficient) principle of having all
+# PK files in the same directory as the TFM files then you should just set
+# FONTDIR=$(TEXFONTDIR).
+#
+FONTDIR = $(TDSROOT)/fonts/pk/$${mode}/public/xypic/dpi$${dpi}
+
+#### FONTS.
+#
+# The METAFONT program needs to know the `mode' of your printer in order to
+# be able to generate correct fonts for it. On most installations the mode
+# `localfont' is made synonymous with the mode required for the default
+# printer; in that case you can just pick the `MODES = localfont' line. If
+# this is not the case -- or you need fonts for several output devices---then
+# you will have to consult the local METAFONT guide/guru to inquire what
+# modes are used at your site. A good place to look for the modes used is in
+# the MakeTeXPK script found on some sites.
+#
+# Set MODES to the list of printers you wish to use:
+#
+MODES = localfont
+#MODES = cx ljfour
+#
+# You should also decide which TeX \magsteps you wish the font to be
+# generated at.
+#
+# The default is . (dot) which prevents installation of any bitmaps because
+# most modern installations generate them automatically.
+#
+MAGS = .
+#MAGS = 0
+#MAGS = 0 0.5 1 2
+
+#### PROGRAMS.
+#
+# You don't have to edit the following lines unless you have a non-standard
+# un*x system or un*x TeX installation...
+#
+SHELL = /bin/sh
+#
+TEX = TEXFONTS=.:$(TEXFONTDIR):$$TEXFONTS tex
+LATEX = TEXFONTS=.:$(TEXFONTDIR):$$TEXFONTS latex
+PDFLATEX = TEXFONTS=.:$(TEXFONTDIR):$$TEXFONTS pdflatex
+BIBTEX = BIBINPUTS=. bibtex
+MAKEINDEX = makeindex
+INITEX = TEXFONTS=.:$(TEXFONTDIR):$$TEXFONTS initex
+#
+# Set MF to a command that will run plain METAFONT on your system.
+#
+MF = MFINPUTS=.:$(MFINPUTDIR):$$MFINPUTS mf
+#
+# Set GFTOPK to the command "false" and PK to "gf" if you use GF rather than PK
+# bitmap font files. There is no support for PXL-files [are they still used?].
+# (Note: the default setting of MAGS above doesn't use bitmaps at all.)
+#
+GFTOPK = gftopk
+PK=pk
+#
+#GFTOPK = false
+#PK=gf
+#
+RM = rm -fr
+CP = cp -f
+MV = mv -f
+#
+# Set the INSTALLs to cp -f if your system does not have the install command.
+#
+INSTALL = install -c -m 444
+INSTALLW = install -c -m 644
+INSTALLX = install -c -m 555
+#INSTALL = cp -f
+#INSTALLW = cp -f
+#INSTALLX = cp -f
+#
+# Set MKDIR to a mkdir command that creates intermediate directories.
+#
+MKDIR = mkdir -p -m 755
+#
+# DOC2TEX <file>: output efficient .tex file from inefficient .doc <file> with
+# inlined documentation [my favourite hack :-]. Removes all DOCMODE lines,
+# leaving only things before the first and in DOCMODE(...DOCMODE) brackets;
+# also removes all blank lines and comment lines.
+#
+# If it breaks your sed you can just set DOC2TEX to cat although that will
+# make the installed macro files three times larger and the reading of them
+# somewhat slower...so in that case you are probably better of getting the
+# `run' distribution where this has already been done for you!
+#
+DOC2TEX = sed \
+ -e '/^.DOCMODE(/b Yes' \
+ -e '/^.DOCMODE/b No' \
+ -e 'x' \
+ -e '/%%DONTCOPY%%/b Ignore' \
+ -e 'x' \
+ -e 's/[ ][ ]*/ /g' \
+ -e 's/{%.*$$/{%/' -e 's/}%.*$$/}%/' -e 's/ %.*$$//' \
+ -e '/^ *%$$/d' -e '/^ *$$/d' -e '/^ *%[^%]/d' \
+ -e 's/^%% \$$Id/%% $@ from $$Id/' \
+ -e 's/REPLACEWITHVERSION/$(VERSION)/' \
+ -e 's/REPLACEWITHSHORTVERSION/$(SHORTVERSION)/' \
+ -e 'b End' \
+ -e ': No' -e 's/.*/%%DONTCOPY%%/' -e 'x' -e 'd' \
+ -e ': Yes' -e 's/.*//' -e 'x' -e 'd' \
+ -e ': Ignore' -e 'x' -e 'd' \
+ -e ': End'
+#
+# MF2TFM script: make .tfm file and all requested bitmap files from .mf
+# file by executing METAFONT with $${mode} and $${dpi} as described above.
+#
+# NOTE: for use as implicit make rule; do not modify unless you are sure you
+# need to!
+#
+MF2TFM = set -x; for mode in $(MODES); do \
+ if [ "$(MAGS)" = "." ]; then \
+ $(MF) "\\mode=$$mode; input $<";\
+ $(RM) $*.*gf;\
+ else \
+ for mag in $(MAGS); do \
+ $(MF) "\\mode=$$mode; mag=magstep($$mag); input $<"; done;\
+ for f in $*.*gf; do if test -f "$$f"; then \
+ if $(GFTOPK) ./$$f; then $(RM) $$f; fi; else :; fi; done;\
+ fi; done
+
+#### END OF CONFIGURATION SECTION ###########################################
+
+
+# GENERIC TARGETS.
+#
+all: macros fonts obsoletefonts
+.PHONY: all install clean realclean sterile world
+#
+install: all install.macros install.trailer \
+ install.fonts install.obsoletefonts \
+ install.ps install.psfonts
+#
+clean:
+ $(RM) *.aux *.toc *.lof *.blg *.log *.idx *.ilg *.fmt \
+ *.ps *.ppm *.nops *.tmp *.ans *.xyc *.xyd \
+ ./#* *~ core *.BAK *JNL xytest.*gf out
+#
+realclean: clean
+ $(RM) MANIFEST VERSIONS CATALOG
+ $(RM) xydoc.back; touch xydoc.back
+ $(RM) *.bbl *.glo *.ind \
+ *.tfm *.*gf *.*pk *.tex *.dvips *.dvi *.pdf *.last *.pro \
+ *.gif *.epsf *.size *.pbm *.ppm \
+ *.afm *.pfm *.pfb *.asc
+ $(RM) xyguide-html index*
+ $(RM) pnmrawtopcropwhite
+#
+sterile: realclean rcsclean
+ $(RM) xydoc.back make.* TAGS
+ $(MAKE) Makefile xydoc.sty xydoc.bib
+#
+world: realclean rcsclean
+ time $(MAKE) all ftp ftpdoc www 2>&1 |tee make.world
+
+
+# MACROS.
+#
+TRAILERSOURCES = TRAILER COPYING CATALOG.doc \
+ MAKE README Makefile $(INSTALLSTAR)
+
+INSTALLSTAR = INSTALL INSTALL.OzTeX INSTALL.Textures
+
+KERNELSOURCES = xy.doc xyidioms.doc xyrecat.doc
+
+OPTIONSOURCES = \
+ xyframe.doc xycmtip.doc xytips.doc xycurve.doc \
+ xyline.doc xyrotate.doc xycolor.doc xycrayon.doc xytile.doc \
+ xyimport.doc xytpic.doc xytp-f.doc \
+ xyps.doc xyps-ps.doc xyps-pro.doc xyps-col.doc xyps-c.doc xyps-f.doc \
+ xyps-l.doc xyps-r.doc xyps-s.doc xyps-t.doc \
+ xypsdict.doc xypspatt.doc xydocps.doc \
+ xydummy.doc xyall.doc xymatrix.doc xyarrow.doc xygraph.doc \
+ xy2cell.doc xypoly.doc xyarc.doc xyknot.doc xyweb.doc \
+ xydvips.doc xytextures.doc xy16textures.doc xyoztex.doc xy17oztex.doc \
+ xycmactex.doc xydvitops.doc xyemtex.doc xydvidrv.doc xyxdvi.doc \
+ xymovie.doc xyv2.doc xypic.doc \
+ xynecula.doc xysmart.doc
+
+FORMATSOURCES = xytex.ini xylatex.ini
+
+LATEXSTYLES = xy.sty xypic.sty movie.cls
+OPTIONDATA = xymacpat.xyp
+
+MACROSOURCES = $(TRAILERSOURCES) $(KERNELSOURCES) $(LATEXSTYLES) \
+ $(OPTIONSOURCES) $(OPTIONDATA) $(FORMATSOURCES)
+
+TRAILERRUN = TRAILER COPYING CATALOG README \
+ $(INSTALLSTAR) VERSIONS
+
+KERNELRUN = xy.tex xyidioms.tex xyrecat.tex
+
+OPTIONRUN = \
+ xyframe.tex xycmtip.tex xytips.tex xycurve.tex \
+ xyline.tex xyrotate.tex xycolor.tex xycrayon.tex xytile.tex \
+ xyimport.tex xytpic.tex xytp-f.tex \
+ xyps.tex xyps-ps.tex xyps-pro.tex xyps-col.tex xyps-c.tex xyps-f.tex \
+ xyps-l.tex xyps-r.tex xyps-s.tex xyps-t.tex \
+ xypsdict.tex xypspatt.tex $(OPTIONDATA) \
+ xydummy.tex xyall.tex xymatrix.tex xyarrow.tex xygraph.tex \
+ xy2cell.tex xypoly.tex xyarc.tex xyknot.tex xyweb.tex \
+ xydvips.tex xytextures.tex xy16textures.tex xyoztex.tex xy17oztex.tex \
+ xycmactex.tex xydvitops.tex xyemtex.tex xydvidrv.tex xyxdvi.tex \
+ xymovie.tex xyv2.tex xypic.tex \
+ xynecula.tex xysmart.tex
+
+MACRORUN = $(KERNELRUN) $(OPTIONRUN) $(FORMATSOURCES) \
+ $(LATEXSTYLES)
+PSRUN = xy$(SHORTVERSION)dict.pro
+
+SUPPORT = install-tds doc2tex.com \
+ dvitogif89a pnmrawtopcropwhite.c
+
+# Macros have .tex suffix and are generated from the .doc files.
+#
+.SUFFIXES: .tex .doc
+.doc.tex:; $(DOC2TEX) $< > $@
+#
+.PHONY: macros install.macros
+#
+macros: $(MACRORUN)
+install.macros: $(MACRORUN)
+ -test -d $(TEXINPUTDIR) || $(MKDIR) $(TEXINPUTDIR)
+ for f in $(MACRORUN); do $(INSTALL) $$f $(TEXINPUTDIR)/$$f; done
+#
+# Kernel dependencies:
+#
+xy.tex: xy.doc
+xyidioms.tex: xyidioms.doc
+xyrecat.tex: xyrecat.doc
+#
+# Extension option dependencies:
+#
+xyframe.tex: xyframe.doc
+xytips.tex: xytips.doc
+xycmtip.tex: xycmtip.doc
+xycurve.tex: xycurve.doc
+xyline.tex: xyline.doc
+xyrotate.tex: xyrotate.doc
+xycolor.tex: xycolor.doc
+xycrayon.tex: xycrayon.doc
+xyimport.tex: xyimport.doc
+xytile.tex: xytile.doc
+#
+xytpic.tex: xytpic.doc
+xytp-f.tex: xytp-f.doc
+#
+xyemtex.tex: xyemtex.doc
+#
+xyps.tex: xyps.doc
+xyps-ps.tex: xyps-ps.doc
+xyps-pro.tex: xyps-pro.doc
+xyps-col.tex: xyps-col.doc
+xyps-c.tex: xyps-c.doc
+xyps-f.tex: xyps-f.doc
+xyps-l.tex: xyps-l.doc
+xyps-r.tex: xyps-r.doc
+xyps-s.tex: xyps-s.doc
+xyps-t.tex: xyps-t.doc
+xypsdict.tex: xypsdict.doc
+xypspatt.tex: xypspatt.doc
+#
+# Feature option dependencies:
+#
+xydummy.tex: xydummy.doc
+xyall.tex: xyall.doc
+#
+xymatrix.tex: xymatrix.doc
+xyarrow.tex: xyarrow.doc
+xygraph.tex: xygraph.doc
+xy2cell.tex: xy2cell.doc
+xypoly.tex: xypoly.doc
+xyarc.tex: xyarc.doc
+xyknot.tex: xyknot.doc
+xyweb.tex: xyweb.doc
+#
+# Driver option dependencies:
+#
+xycmactex.tex: xycmactex.doc
+xydvips.tex: xydvips.doc
+xydvitops.tex: xydvitops.doc
+xydvidrv.tex: xydvidrv.doc
+xydocps.tex: xydocps.doc
+xytextures.tex: xytextures.doc
+xy16textures.tex: xy16textures.doc
+xyoztex.tex: xyoztex.doc
+xymovie.tex: xymovie.doc
+xy17oztex.tex: xy17oztex.doc
+xyxdvi.tex: xyxdvi.doc
+#
+# Backwards compatibility dependencies:
+#
+xyv2.tex: xyv2.doc
+xypic.tex: xypic.doc
+#
+# Required documentation files
+#
+install.trailer: $(TRAILERRUN)
+ -test -d $(TEXDOCDIR) || $(MKDIR) $(TEXDOCDIR)
+ for f in $(TRAILERRUN); do $(INSTALL) $$f $(TEXDOCDIR)/$$f; done
+
+
+# PostScript HEADERS:
+#
+.PHONY: install.ps
+install.ps: $(PSRUN)
+ test -d $(PSHEADERDIR) || $(MKDIR) $(PSHEADERDIR)
+ for f in $(PSRUN); do $(INSTALL) $$f $(PSHEADERDIR)/$$f; done
+
+
+# FONTS.
+#
+.PHONY: mfinputs texfonts $(PK)fonts fonts install.fonts \
+ psfonts install.psfonts obsoletefonts install.obsoletefonts
+#
+METAFONTS = \
+ xydash10.mf xybsql10.mf xyd2.mf \
+ xyatip10.mf xybtip10.mf xytech.mf xyatip.mf xybtip.mf xyd.mf \
+ xycirc10.mf \
+ xycmat10.mf xycmbt10.mf xycmat11.mf xycmbt11.mf \
+ xycmat12.mf xycmbt12.mf xycm.mf \
+ xyeuat10.mf xyeubt10.mf xyeuat11.mf xyeubt11.mf \
+ xyeuat12.mf xyeubt12.mf xyeuler.mf
+#
+TEXFONTRUN = \
+ xydash10.tfm xybsql10.tfm xyatip10.tfm xybtip10.tfm xycirc10.tfm \
+ xycmat10.tfm xycmbt10.tfm xycmat11.tfm xycmbt11.tfm \
+ xycmat12.tfm xycmbt12.tfm \
+ xyeuat10.tfm xyeubt10.tfm xyeuat11.tfm xyeubt11.tfm \
+ xyeuat12.tfm xyeubt12.tfm
+#
+# Note: we only depend on the tfm-files, so you must remove them to
+# regenerate the fonts at all desired magnifications.
+#
+.SUFFIXES: .mf .tfm
+.mf.tfm:; $(MF2TFM)
+#
+mfinputs: $(METAFONTS)
+#
+texfonts $(PK)fonts fonts: $(METAFONTS) $(TEXFONTRUN)
+install.fonts: fonts
+ if test -n "$(MFINPUTDIR)"; then \
+ test -d $(MFINPUTDIR) || $(MKDIR) $(MFINPUTDIR); \
+ for f in $(METAFONTS);do $(INSTALL) $$f $(MFINPUTDIR)/$$f;done; fi
+ -test -d $(TEXFONTDIR) || $(MKDIR) $(TEXFONTDIR)
+ for f in $(TEXFONTRUN); do $(INSTALL) $$f $(TEXFONTDIR)/$$f; done
+ #
+ [ "$(MAGS)" = "." ] || \
+ for mode in $(MODES); do for mag in $(MAGS); do \
+ $(RM) xytest.*gf xytest.*tfm;\
+ $(MF) "\\mode=$$mode; mag=magstep($$mag); input xytest";\
+ dpi="`expr xytest.*gf : 'xytest\.\([0-9]*\)gf'`";\
+ for f in $(TEXFONTRUN); do \
+ f="`expr $$f : '\([a-z0-9]*\)\.tfm'`.$${dpi}$(PK)" ;\
+ if [ ! -f $$f ]; then echo "ERROR: FONT $$f NOT GENERATED";\
+ else test -d "$(FONTDIR)" || $(MKDIR) $(FONTDIR);\
+ $(INSTALL) $$f $(FONTDIR)/$$f; fi; done; done; done
+#
+xydash10.tfm: xydash10.mf xyd2.mf xytest.mf
+xybsql10.tfm: xybsql10.mf xyd.mf xytest.mf
+xycirc10.tfm: xycirc10.mf xytest.mf
+xyatip10.tfm: xyatip10.mf xytech.mf xyatip.mf xyd.mf xytest.mf
+xybtip10.tfm: xybtip10.mf xytech.mf xybtip.mf xyd.mf xytest.mf
+xycmat10.tfm: xycmat10.mf xyatip.mf xyd.mf xytest.mf
+xycmbt10.tfm: xycmbt10.mf xybtip.mf xyd.mf xytest.mf
+xyeuat10.tfm: xyeuat10.mf xyatip.mf xyd.mf xytest.mf
+xyeubt10.tfm: xyeubt10.mf xybtip.mf xyd.mf xytest.mf
+#
+# Obsolete fonts (from 2.6 and before).
+#
+OBSOLETEMETAFONTS = xyline10.mf xyqc10.mf xymisc10.mf
+OBSOLETETEXFONTRUN = xyline10.tfm xyqc10.tfm xymisc10.tfm
+#
+obsoletefonts: $(OBSOLETEMETAFONTS) $(OBSOLETETEXFONTRUN)
+#
+install.obsoletefonts: obsoletefonts
+ if test -n "$(MFINPUTDIR)"; then \
+ test -d $(MFINPUTDIR) || $(MKDIR) $(MFINPUTDIR); \
+ for f in $(OBSOLETEMETAFONTS);do $(INSTALL) $$f $(MFINPUTDIR)/$$f;done; fi
+ -test -d $(TEXFONTDIR) || $(MKDIR) $(TEXFONTDIR)
+ for f in $(OBSOLETETEXFONTRUN); do \
+ $(INSTALL) $$f $(TEXFONTDIR)/$$f; done
+ #
+ [ "$(MAGS)" = "." ] || \
+ for mode in $(MODES); do for mag in $(MAGS); do \
+ $(RM) xytest.*gf xytest.*tfm;\
+ $(MF) "\\mode=$$mode; mag=magstep($$mag); input xytest";\
+ dpi="`expr xytest.*gf : 'xytest\.\([0-9]*\)gf'`";\
+ for f in $(OBSOLETETEXFONTRUN); do \
+ f="`expr $$f : '\([a-z0-9]*\)\.tfm'`.$${dpi}$(PK)" ;\
+ if [ ! -f $$f ]; then echo "ERROR: FONT $$f NOT GENERATED";\
+ else test -d "$(FONTDIR)" || $(MKDIR) $(FONTDIR);\
+ $(INSTALL) $$f $(FONTDIR)/$$f; fi; done; done; done
+#
+xyline10.tfm: xyline10.mf xytest.mf
+xyqc10.tfm: xyqc10.mf xytest.mf
+xymisc10.tfm: xymisc10.mf xytest.mf
+
+# PostScript fonts w/support files...from Y&Y.
+#
+TYPE1FONTS = \
+ xyatip10.pfb xybsql10.pfb xybtip10.pfb xycirc10.pfb xydash10.pfb \
+ xycmat10.pfb xycmbt10.pfb xyeuat10.pfb xyeubt10.pfb
+#
+PFMFONTS = \
+ xyatip10.pfm xybsql10.pfm xybtip10.pfm xycirc10.pfm xydash10.pfm \
+ xycmat10.pfm xycmbt10.pfm xyeuat10.pfm xyeubt10.pfm
+#
+AFMFONTS = \
+ xyatip10.afm xybsql10.afm xybtip10.afm xycirc10.afm xydash10.afm \
+ xycmat10.afm xycmbt10.afm xyeuat10.afm xyeubt10.afm
+#
+YANDYFONTS = $(TYPE1FONTS) $(AFMFONTS) $(PFMFONTS)
+#
+psfonts: $(YANDYFONTS)
+#
+$(YANDYFONTS): YandY_xy_fonts.zip
+ unzip -aoL YandY_xy_fonts.zip
+ touch $(YANDYFONTS)
+#
+install.psfonts: psfonts xypic.map
+ test -d $(TYPE1DIR) || $(MKDIR) $(TYPE1DIR)
+ test -d $(PFMDIR) || $(MKDIR) $(PFMDIR)
+ test -d $(AFMDIR) || $(MKDIR) $(AFMDIR)
+ test -d $(PDFDIR) || $(MKDIR) $(PDFDIR)
+ for f in $(TYPE1FONTS); do $(INSTALL) $$f $(TYPE1DIR)/$$f; done
+ for f in $(PFMFONTS); do $(INSTALL) $$f $(PFMDIR)/$$f; done
+ for f in $(AFMFONTS); do $(INSTALL) $$f $(AFMDIR)/$$f; done
+ test -d $(PSHEADERDIR) || $(MKDIR) $(PSHEADERDIR)
+ $(INSTALL) xypic.map $(PSHEADERDIR)/xypic.map
+#
+# All together...
+#
+FONTSOURCES = $(METAFONTS) $(OBSOLETEMETAFONTS) xytest.mf \
+ YandY_xy_fonts.zip xypic.map
+
+# FORMATS:
+#
+# Build formats...
+#
+.SUFFIXES: .ini .fmt
+.ini.fmt:; $(INITEX) $<
+#
+xytex.fmt: xytex.ini macros
+xylatex.fmt: xylatex.ini macros
+#xyamslatex.fmt: xyamslatex.ini macros
+#xydoc.fmt: xydoc.ini macros
+
+
+# MANUAL: USER'S GUIDE AND REFERENCE MANUAL.
+#
+# Note: the first generations use the DVIPS backend to run faster.
+#
+.PHONY: guide manual install.manual manual.ps
+#
+MANUALDATA = ross.eps kris.eps import1.eps
+MANUALSOURCES = \
+ xyguide.man xydoc.sty latin1.sty xydoc.bib xydoc.back \
+ xyrefer.man $(KERNELSOURCES) $(LATEXSTYLES) $(OPTIONSOURCES) \
+ $(OPTIONDATA) $(MANUALDATA)
+#
+MANUALRUN = xyguide.dvi xyrefer.dvi
+#
+.SUFFIXES: .man .dvips .dvi .pdf
+.man.dvips:
+ $(MAKE) macros fonts
+ echo "\\xyoption{dvips}\xyoption{ps}" > xydoc.back
+ $(LATEX) $<
+ @-$(CP) $<.dvi $*.dvi ; $(CP) $<.aux $*.aux ; $(CP) $<.idx $*.idx
+ $(BIBTEX) $*
+ @-$(CP) $*.bbl $<.bbl
+ [ -f $*.idx ] && $(MAKEINDEX) $* || :
+ @-$(CP) $*.ind $<.ind
+ echo "\\xyoption{dvips}\xyoption{ps}" > xydoc.back
+ $(LATEX) $<
+ @-$(CP) $<.dvi $*.dvi ; $(CP) $<.aux $*.aux ; $(CP) $<.idx $*.idx
+ [ -f $*.idx ] && makeindex $* || :
+ @-$(CP) $*.ind $<.ind
+ echo "\\xyoption{dvips}\xyoption{ps}" > xydoc.back
+ $(LATEX) $<
+ @-$(CP) $<.dvi $*.dvi ; $(CP) $<.aux $*.aux ; $(CP) $<.idx $*.idx
+ mv $*.dvi $*.dvips
+ touch $*.dvips
+#
+.dvips.dvi:
+ echo '' > xydoc.back
+ $(LATEX) $*.man
+ @-$(CP) $*.man.dvi $*.dvi ; $(CP) $*.man.aux $*.aux ; $(CP) $*.man.idx $*.idx
+ touch $*.dvi
+#
+.dvips.pdf:
+ echo '' > xydoc.back
+ $(PDFLATEX) $*.man
+ @-$(CP) $*.man.pdf $*.pdf ; $(CP) $*.man.aux $*.aux ; $(CP) $*.man.idx $*.idx
+ touch $*.pdf
+#
+guide: xyguide.dvi
+#
+manual: $(MANUALRUN)
+install.manual: manual
+ -test -d $(TEXDOCDIR) || $(MKDIR) $(TEXDOCDIR)
+ for f in $(MANUALRUN); do $(INSTALL) $$f $(TEXDOCDIR)/$$f; done
+#
+xyguide.dvips: xyguide.man xydoc.sty latin1.sty xydoc.bib version.tex
+xyrefer.dvips: xyrefer.man xydoc.sty latin1.sty xydoc.bib version.tex \
+ $(KERNELSOURCES) $(OPTIONSOURCES) $(MANUALDATA)
+xytest.dvips: xytest.man xydoc.sty latin1.sty xydoc.bib version.tex \
+ $(KERNELSOURCES) $(OPTIONSOURCES) $(MANUALDATA)
+#
+xyguide.dvi: xyguide.dvips version.tex
+xyrefer.dvi: xyrefer.dvips version.tex
+xytest.dvi: xytest.dvips version.tex
+#
+xyguide.pdf: xyguide.dvips version.tex
+xyrefer.pdf: xyrefer.dvips version.tex
+xytest.pdf: xytest.dvips version.tex
+#
+version.tex: version.doc
+ $(LATEX) version.doc
+#
+.SUFFIXES: .pro
+xy$(SHORTVERSION)dict.pro: xydocps.tex xypsdict.tex xypspatt.tex xyps-pro.tex
+ -$(RM) xy$(SHORTVERSION)dict.pro
+ $(TEX) xydocps.tex
+#
+# PostScript targets:
+#
+# DVIPS should be Tom Rokicki's dvips PostScript DVI driver as a filter.
+DVIPS = dvips -D600 -f
+#
+.SUFFIXES: .ps
+.dvips.ps:; $(DVIPS) < $< > $@
+#
+xyguide.ps: xyguide.dvips $(PSRUN)
+xyrefer.ps: xyrefer.dvips $(PSRUN)
+#
+manual.ps: xyguide.ps xyrefer.ps
+
+
+# TeXNICAL DOCUMENTATION.
+#
+.PHONY: TeXnical
+TeXnical: xysource.ps xysource.dvi xysource.pdf
+#
+TeXNICALSOURCES = xysource.man COPYING.patch xydoc.back
+#
+TeXNICALAUX = \
+ TRAILER CATALOG README $(INSTALLSTAR) MAKE MANIFEST \
+ COPYING.tex
+#
+xysource.dvips: xysource.man macros.tmp \
+ macros fonts obsoletefonts $(ALLSOURCES) $(TeXNICALAUX)
+xysource.ps: xysource.dvips
+xysource.dvi: xysource.dvips
+xysource.pdf: xysource.dvips
+#
+xywork.dvips: xywork.man macros.tmp \
+ macros fonts obsoletefonts $(ALLSOURCES) $(TeXNICALAUX)
+xywork.ps: xywork.dvips
+xywork.dvi: xywork.dvips
+xywork.pdf: xywork.dvips
+#
+COPYING.tex: COPYING COPYING.patch
+ patch COPYING -o COPYING.tex < COPYING.patch
+#
+FONTCOPYING.tex: FONTCOPYING FONTCOPYING.patch
+ patch FONTCOPYING -o FONTCOPYING.tex < FONTCOPYING.patch
+#
+# Macro index...requires GNU AWK (gawk) or (in a pinch) NAWK.
+#
+GAWK = gawk
+#
+macros.tmp: $(KERNELSOURCES) $(LATEXSTYLES) $(OPTIONSOURCES) $(METAFONTS)
+ -$(RM) macros.tmp
+ for f in $(KERNELSOURCES) $(LATEXSTYLES) $(OPTIONSOURCES) $(METAFONTS);\
+ do $(GAWK) '\
+ func err(s) { printf("%s,%d: %s\n",FILENAME,FNR,s) >>"/dev/stderr"};\
+ func prt(s,i) { \
+ printf("\\filelinedef{%s}{%d}\\index def{%s}\n",FILENAME,FNR,s) };\
+ func prtdef(i) { t = substr($$0,i);\
+ if (match(t,/[\\|][a-zA-Z@]*|\\.|[^\\|]|{([^{}]|\\{|\\})*}/) != 1) \
+ err("Weird TeX token");\
+ else prt(substr($$0,i,RLENGTH),i) };\
+ func prtcsdef(i) { t = substr($$0,i);\
+ if (match(t,/{([^{}]|\\{|\\})*}|{([^{}]|\\{|\\})*{([^{}]|\\{|\\})*}([^{}]|\\{|\\})*}/) != 1) \
+ err("Weird TeX cs name token");\
+ else prt(substr($$0,i+1,RLENGTH-2),i) };\
+ /^\\let[^A-Za-z@]/ ||\
+ /^\\def[^A-Za-z@]/ { prtdef(5); next };\
+ /^\\gdef[^A-Za-z@]/ ||\
+ /^\\edef[^A-Za-z@]/ ||\
+ /^\\xdef[^A-Za-z@]/ { prtdef(6); next };\
+ /^\\newif[^A-Za-z@]/ { prtdef(7); next };\
+ /^\\xydef@[^A-Za-z@]/ ||\
+ /^\\xylet@[^A-Za-z@]/ { prtdef(8); next };\
+ /^\\xyfont@[^A-Za-z@]/ { prtdef(9); next };\
+ /^\\global\\let[^A-Za-z@]/ { prtdef(12); next };\
+ /^\\xywarnifdefined[^A-Za-z@]/ { prtdef(17); next };\
+ /^\\ifx\\undefined[^A-Za-z@]/ { prtdef(15); next };\
+ /^\\xynew@{[^{}]*}/ { prtdef(index($$0,"}")+1); next };\
+ /^\\xydefcsname@{/ { prtcsdef(14); next };\
+ /^\\xyletcsnamecsname@{/ { prtcsdef(20); next }' $$f;\
+ done | sed -e 's,\\{,\\\\otherebgroup,' -e 's,\\},\\\\otheregroup,' \
+ > macros.tmp
+
+###printf("\\macroentry{%s}{%s}{%d}\n",s,FILENAME,FNR) };\
+
+
+# Xy-pic the MOVIE :)
+#
+.SUFFIXES: .texmovie .gif
+#
+.texmovie.gif:
+ $(LATEX) '\documentclass[dvips]{movie}' \
+ '\usepackage[all]{xy}' \
+ '\begin{document}' \
+ '\input{$*.texmovie}' \
+ '\end{document}'
+ @-[ -f texput.dvi ] && $(MV) texput.dvi $*.dvi && $(MV) texput.size $*.size
+ @-[ -f movie.cls.dvi ] && $(MV) movie.cls.dvi $*.dvi && $(MV) movie.cls.size $*.size
+ @-[ -f movie.dvi ] && $(MV) movie.dvi $*.dvi && $(MV) movie.size $*.size
+ ./dvitogif89a $*.dvi
+#
+.texmovie.dvi:
+ $(LATEX) '\documentclass{article}' \
+ '\usepackage[movie,all]{xy}' \
+ '\begin{document}' \
+ '\title{Storyboard for ``$*.''}' \
+ '\maketitle' \
+ '\input{$*.texmovie}' \
+ '\end{document}'
+#
+dragon.gif: dragon.texmovie movie.cls dvitogif89a
+dragon.dvi: dragon.texmovie movie.cls
+#
+sesam.gif: sesam.texmovie movie.cls dvitogif89a
+sesam.dvi: sesam.texmovie movie.cls
+#
+gasket.dvi: gasket.texmovie movie.cls dvitogif89a
+gasket.gif: gasket.texmovie movie.cls
+
+
+# DISTRIBUTION TREE.
+#
+DISTDIR = $(FTPROOT)/xy-$(VERSION)
+DISTFONTDIR = $(DISTDIR)/$(PK)fonts/$${mode}$${dpi}
+#
+# Files:
+#
+SOURCES = $(MACROSOURCES) $(FONTSOURCES) $(MANUALSOURCES) $(SUPPORT)
+#
+# Commands:
+#
+# TAR <files> output tar archive with <files>
+# GZIP compression filter
+# GZ filename extension appropriate for compressed files
+#
+# TODO: change compression to proper GNU gzip once everyone supports it...
+#
+TAR = tar cvf -
+GZIP = gzip -v9
+GZ = .gz
+#
+# Targets:
+#
+.PHONY: dist dist-$(VERSION) distsrc distrun distdoc
+#
+dist dist-$(VERSION):
+ cd $(DISTDIR);\
+ find . -type f -print | sed 's,^./,,' | sort > MANIFEST
+ $(INSTALL) README $(DISTDIR)/README
+#
+distsrc: $(DISTDIR)/src
+#
+distrun: $(DISTDIR)/CATALOG \
+ $(DISTDIR)/TRAILER \
+ $(DISTDIR)/README \
+ $(DISTDIR)/INSTALL \
+ $(DISTDIR)/VERSIONS \
+ $(DISTDIR)/texinputs \
+ $(DISTDIR)/texfonts \
+ $(DISTDIR)/mfinputs \
+ $(DISTDIR)/$(PK)fonts \
+ $(DISTDIR)/doc/xyguide.dvi \
+ $(DISTDIR)/doc/xyrefer.dvi \
+ $(DISTDIR)/doc/xysource.dvi \
+ $(DISTDIR)/ps \
+ $(DISTDIR)/type1 \
+ $(DISTDIR)/pfm \
+ $(DISTDIR)/afm \
+ $(DISTDIR)/COPYING \
+ $(DISTDIR)/support
+#
+distdoc: $(DISTDIR)/doc/xyguide.dvips \
+ $(DISTDIR)/doc/xyguide.ps \
+ $(DISTDIR)/doc/xyguide.pdf \
+ $(DISTDIR)/doc/xyrefer.dvips \
+ $(DISTDIR)/doc/xyrefer.ps \
+ $(DISTDIR)/doc/xyrefer.pdf \
+ $(DISTDIR)/doc/xysource.dvips \
+ $(DISTDIR)/doc/xysource.ps
+#### CURRENTLY BROKEN:
+# $(DISTDIR)/doc/xyguide-html \
+#
+# Explanation targets:
+#
+# CATALOG is automatically generated:
+#
+$(DISTDIR)/CATALOG: CATALOG $(DISTDIR)
+ $(INSTALL) CATALOG $(DISTDIR)/CATALOG
+#
+CATALOG: CATALOG.doc
+ $(LATEX) CATALOG.doc
+ mv -f CATALOG.out CATALOG
+
+$(DISTDIR)/TRAILER: TRAILER $(DISTDIR)
+ $(INSTALL) TRAILER $(DISTDIR)/TRAILER
+
+$(DISTDIR)/README: README $(DISTDIR)
+ $(INSTALL) README $(DISTDIR)/README
+
+$(DISTDIR)/VERSIONS: VERSIONS $(DISTDIR)
+ $(INSTALL) VERSIONS $(DISTDIR)/VERSIONS
+
+$(DISTDIR)/INSTALL: $(INSTALLSTAR) $(DISTDIR)
+ for f in $(INSTALLSTAR); do if test -f "$$f"; then \
+ $(INSTALL) $$f $(DISTDIR)/$$f; else :; fi; done
+
+$(DISTDIR)/COPYING: COPYING $(DISTDIR)
+ $(INSTALL) COPYING $(DISTDIR)/COPYING
+
+$(DISTDIR)/FONTCOPYING: FONTCOPYING $(DISTDIR)
+ $(INSTALL) FONTCOPYING $(DISTDIR)/FONTCOPYING
+#
+# Directory targets:
+#
+$(DISTDIR):
+ -test -d $(DISTDIR) || $(MKDIR) $(DISTDIR)
+
+$(DISTDIR)/src: $(SOURCES) MANIFEST VERSIONS ChangeLog $(DISTDIR)
+ -test -d $(DISTDIR)/src || $(MKDIR) $(DISTDIR)/src
+ for f in $(SOURCES); do echo $$f; done | sort -fu |\
+ while read u; do $(INSTALL) $$u $(DISTDIR)/src/$$u; done
+ echo '' > xydoc.back
+ $(INSTALLW) xydoc.back $(DISTDIR)/src
+ $(INSTALLW) MANIFEST VERSIONS ChangeLog $(DISTDIR)/src
+
+xydoc.back:
+ echo '' > xydoc.back
+#
+# The MANIFEST in src is just a list of the distributed source files.
+#
+MANIFEST: $(SOURCES)
+ ls -alg `for f in $(SOURCES); do echo $$f; done | sort -fu` >MANIFEST
+#
+# The VERSIONS is just a list of the RCS versions.
+#
+VERSIONS: $(SOURCES)
+ sed -n 's/^.*\([$$]Id[:][^$$]*[$$]\).*$$/\1/p' \
+ `for f in $(SOURCES); do echo $$f; done | sort -u` >VERSIONS
+
+$(DISTDIR)/texinputs: macros $(DISTDIR)
+ -test -d $(DISTDIR)/texinputs \
+ || $(MKDIR) $(DISTDIR)/texinputs
+ for f in $(MACRORUN) $(LATEXSTYLES); \
+ do $(INSTALL) $$f $(DISTDIR)/texinputs/$$f; done
+
+$(DISTDIR)/texfonts: texfonts obsoletefonts $(DISTDIR)
+ -test -d $(DISTDIR)/texfonts \
+ || $(MKDIR) $(DISTDIR)/texfonts
+ for f in $(TEXFONTRUN) $(OBSOLETETEXFONTRUN); \
+ do $(INSTALL) $$f $(DISTDIR)/texfonts/$$f; done
+
+$(DISTDIR)/mfinputs: mfinputs $(OBSOLETEMETAFONTS) $(DISTDIR)
+ -test -d $(DISTDIR)/mfinputs || $(MKDIR) $(DISTDIR)/mfinputs
+ for f in $(METAFONTS) $(OBSOLETEMETAFONTS); \
+ do $(INSTALL) $$f $(DISTDIR)/mfinputs/$$f; done
+
+$(DISTDIR)/$(PK)fonts: $(PK)fonts $(DISTDIR)
+ -test -d $(DISTDIR)/$(PK)fonts || $(MKDIR) $(DISTDIR)/$(PK)fonts
+ :
+ for mode in $(MODES); do for mag in $(MAGS); do \
+ $(RM) xytest.*gf xytest.*tfm;\
+ $(MF) "\\mode=$$mode; mag=magstep($$mag); input xytest";\
+ dpi="`expr xytest.*gf : 'xytest\.\([0-9]*\)gf'`";\
+ for f in $(TEXFONTRUN); do \
+ f="`expr $$f : '\([a-z0-9]*\)\.tfm'`.$${dpi}$(PK)" ;\
+ if [ ! -f $$f ]; then echo "ERROR: FONT $$f NOT GENERATED";\
+ else test -d "$(DISTFONTDIR)" || $(MKDIR) $(DISTFONTDIR);\
+ $(INSTALL) $$f $(DISTFONTDIR)/$$f; fi; done; done; done
+
+$(DISTDIR)/ps: xy$(SHORTVERSION)dict.pro xypic.map $(DISTDIR)
+ -test -d $(DISTDIR)/ps || $(MKDIR) $(DISTDIR)/ps
+ $(INSTALL) xy$(SHORTVERSION)*dict.pro $(DISTDIR)/ps
+ $(INSTALL) xypic.map $(DISTDIR)/ps
+
+$(DISTDIR)/type1: $(TYPE1FONTS) $(DISTDIR)
+ -test -d $(DISTDIR)/type1 || $(MKDIR) $(DISTDIR)/type1
+ for f in $(TYPE1FONTS) ; \
+ do $(INSTALL) $$f $(DISTDIR)/type1/$$f; done
+
+$(DISTDIR)/pfm: $(PFMFONTS) $(DISTDIR)
+ -test -d $(DISTDIR)/pfm || $(MKDIR) $(DISTDIR)/pfm
+ for f in $(PFMFONTS) ; \
+ do $(INSTALL) $$f $(DISTDIR)/pfm/$$f; done
+
+$(DISTDIR)/afm: $(AFMFONTS) $(DISTDIR)
+ -test -d $(DISTDIR)/afm || $(MKDIR) $(DISTDIR)/afm
+ for f in $(AFMFONTS) ; \
+ do $(INSTALL) $$f $(DISTDIR)/afm/$$f; done
+
+$(DISTDIR)/pdftex: $(DISTDIR) xypic.map
+ -test -d $(DISTDIR)/pdftex || $(MKDIR) $(DISTDIR)/pdftex
+ $(INSTALL) xypic.map $(DISTDIR)/pdftex
+
+$(DISTDIR)/support: $(SUPPORT)
+ -test -d $(DISTDIR)/support || $(MKDIR) $(DISTDIR)/support
+ for f in $(SUPPORT) ; \
+ do $(INSTALLX) $$f $(DISTDIR)/support/$$f; done
+
+# Document targets:
+#
+$(DISTDIR)/doc/xyguide.dvi: xyguide.dvi $(DISTDIR)/doc
+ $(INSTALL) xyguide.dvi $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xyguide.dvips: xyguide.dvips $(DISTDIR)/doc
+ $(INSTALL) xyguide.dvips $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xyguide.pdf: xyguide.pdf $(DISTDIR)/doc
+ $(INSTALL) xyguide.pdf $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xyguide.ps: xyguide.ps $(DISTDIR)/doc
+ $(INSTALL) xyguide.ps $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xyguide-html: xyguide-html $(DISTDIR)/doc
+ tar cf - xyguide-html | (cd $(DISTDIR)/doc; tar xpvf -)
+
+$(DISTDIR)/doc/xyrefer.dvi: xyrefer.dvi $(DISTDIR)/doc
+ $(INSTALL) xyrefer.dvi $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xyrefer.dvips: xyrefer.dvips ross.eps kris.eps import1.eps \
+ $(DISTDIR)/doc
+ $(INSTALL) xyrefer.dvips ross.eps kris.eps import1.eps $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xyrefer.pdf: xyrefer.pdf ross.eps kris.eps import1.eps \
+ $(DISTDIR)/doc
+ $(INSTALL) xyrefer.pdf $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xyrefer.ps: xyrefer.ps $(DISTDIR)/doc
+ $(INSTALL) xyrefer.ps $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xyrefer-html: xyrefer-html $(DISTDIR)/doc
+ $(INSTALL) xyrefer-html $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xysource.dvi: xysource.dvi $(DISTDIR)/doc
+ $(INSTALL) xysource.dvi $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xysource.dvips: xysource.dvips ross.eps kris.eps import1.eps \
+ $(DISTDIR)/doc
+ $(INSTALL) xysource.dvips ross.eps kris.eps import1.eps $(DISTDIR)/doc
+
+$(DISTDIR)/doc/xysource.ps: xysource.ps $(DISTDIR)/doc
+ $(INSTALL) xysource.ps $(DISTDIR)/doc
+
+$(DISTDIR)/doc:
+ -test -d $(DISTDIR)/doc || $(MKDIR) $(DISTDIR)/doc
+
+
+# FTP'ABLE DISTRIBUTION.
+#
+FTPROOT = $$HOME/public_ftp/TeX
+FTPDOCDIR = $(FTPROOT)/xy-$(VERSION)/doc
+#
+.PHONY: ftp ftp-$(VERSION) ftpsrc ftprun ftpdoc ftpunpacked
+#
+ftp ftp-$(VERSION): ftpsrc ftprun ftpdoc ftpunpacked
+ $(INSTALL) TRAILER $(FTPROOT)/xy$(SHORTVERSION).TRAILER
+#
+ftpsrc $(FTPROOT)/xy$(SHORTVERSION)src.tar$(GZ): distsrc
+ cd $(DISTDIR)/.. ;\
+ $(TAR) xy-$(VERSION)/src \
+ | $(GZIP) > $(FTPROOT)/xy$(SHORTVERSION)src.tar$(GZ)
+#
+ftpdoc $(FTPROOT)/xy$(SHORTVERSION)doc.tar$(GZ): distrun distdoc
+ cd $(DISTDIR)/.. ;\
+ $(TAR) xy-$(VERSION)/doc \
+ | $(GZIP) > $(FTPROOT)/xy$(SHORTVERSION)doc.tar$(GZ)
+ $(GZIP) < xyguide.dvi > $(FTPROOT)/xyguide.dvi$(GZ)
+ $(GZIP) < xyguide.dvips > $(FTPROOT)/xyguide.dvips$(GZ)
+ $(GZIP) < xyguide.ps > $(FTPROOT)/xyguide.ps$(GZ)
+ $(GZIP) < xyguide.pdf > $(FTPROOT)/xyguide.pdf$(GZ)
+ $(GZIP) < xyrefer.dvi > $(FTPROOT)/xyrefer.dvi$(GZ)
+ $(GZIP) < xyrefer.dvips > $(FTPROOT)/xyrefer.dvips$(GZ)
+ $(GZIP) < xyrefer.ps > $(FTPROOT)/xyrefer.ps$(GZ)
+ $(GZIP) < xyrefer.pdf > $(FTPROOT)/xyrefer.pdf$(GZ)
+ $(GZIP) < xysource.dvi > $(FTPROOT)/xysource.dvi$(GZ)
+ $(GZIP) < xysource.dvips > $(FTPROOT)/xysource.dvips$(GZ)
+ $(GZIP) < xysource.ps > $(FTPROOT)/xysource.ps$(GZ)
+# $(TAR) xyguide-html | $(GZIP) > $(FTPROOT)/xyguide-html.tar.gz
+#
+ftprun $(FTPROOT)/xy$(SHORTVERSION)run.tar$(GZ): distrun
+ cd $(DISTDIR)/.. ;\
+ $(TAR) \
+ `for f in $(TRAILERRUN); do echo xy-$(VERSION)/$$f; done` \
+ xy-$(VERSION)/texinputs xy-$(VERSION)/mfinputs \
+ xy-$(VERSION)/texfonts xy-$(VERSION)/$(PK)fonts \
+ xy-$(VERSION)/ps xy-$(VERSION)/type1 xy-$(VERSION)/pfm \
+ xy-$(VERSION)/afm \
+ xy-$(VERSION)/support \
+ | $(GZIP) > $(FTPROOT)/xy$(SHORTVERSION)run.tar$(GZ)
+#
+ftpunpacked: dist
+ test $(DISTDIR) = $(FTPROOT)/xy-$(VERSION) || \
+ (cd $(DISTDIR)/.. ; tar cf - xy-$(VERSION) |(cd $(FTPROOT); tar xvf -))
+ cd $(FTPROOT); rm -f xy; ln -fs xy-$(VERSION) xy
+
+
+# WWW/HTML DOCUMENTATION & HYPE.
+#
+WWWDIR = $$HOME/public_html
+#
+WWWSOURCES = Xy-pic.html Xy.doc Xy.xy \
+ man2html.gawk man2html-post.gawk .latex2html-init
+#
+.PHONY: guide.html www install.www
+#
+LATEX2HTML = latex2html
+#
+LATEX2HTMLICONDIR = $$HOME/src/latex2html-96.1/icons
+LATEX2HTMLICONDIR2 = $$HOME/CV
+#
+man2html = $(GAWK) -f man2html.gawk
+man2htmlpost = $(GAWK) -f ../man2html-post.gawk
+#
+guide.html: xyguide-html
+#
+xyguide-html.tex: xyguide.dvips xyguide.man $(WWWSOURCES)
+ $(man2html) <xyguide.aux >xyguide-html.aux
+ $(man2html) <xyguide.bbl >xyguide-html.bbl
+ @-$(CP) xyguide.man.ans xyguide.ans
+ @-$(CP) xyguide.man.idx xyguide.idx
+ @-$(CP) xyguide.man.ind xyguide.ind
+ $(man2html) <xyguide.ans >xyguide-html.ans
+ $(man2html) <xyguide.idx >xyguide-html.idx
+ $(man2html) <xyguide.ind | sed 's/"/|/g' >xyguide-html.ind
+ $(man2html) <xyguide.man >xyguide-html.tex
+#
+xyguide-html-act: xyguide-html.tex version.tex
+ echo "\\xyoption{dvips}\xyoption{ps}" > xydoc.back
+ $(LATEX2HTML) xyguide-html.tex
+#
+xyguide-html: xyguide-html.tex xyguide-html-act
+ (cd xyguide-html; \
+ for f in *.html; do mv $$f $$f~; \
+ $(man2htmlpost) <$$f~ \
+ | sed -e 's/``/"/g' -e "s/''/\"/g" -e 's/ [>] />/g' >$$f; done; \
+ (cd $$HOME/W3; tar cf - COPYING) | tar xpf - )
+ :
+ cp "$(LATEX2HTMLICONDIR2)/18pt.html" xyguide-html
+ cat xyguide-html/*.html \
+ | tr '"' "\n" \
+ | sed -n 's;[.][/]\([a-z_]*[.]gif\);\1;p' | sort -u \
+ | while read f ;\
+ do if [ -f "$(LATEX2HTMLICONDIR2)/$$f" ]; \
+ then echo "[$$f]"; cp $(LATEX2HTMLICONDIR2)/$$f xyguide-html ; \
+ elif [ -f "$(LATEX2HTMLICONDIR)/$$f" ]; \
+ then echo "[$$f]"; cp $(LATEX2HTMLICONDIR)/$$f xyguide-html ; \
+ fi ; done
+ :
+ (cd xyguide-html; \
+ $(RM) .I* .O* *.ppm *.xyc *.ans *.aux *.idx *.bbl *.log *.tex *~)
+#
+Xy.tex: Xy.doc
+Xy.dvi: Xy.tex Xy.xy macros; $(LATEX) Xy
+Xy.ps: Xy.dvi; $(DVIPS) Xy.dvi -oXy.ps
+#
+PNMCROP = ./pnmrawtopcropwhite | pnmcrop
+PGMTOGIF = pgmtoppm rgbi:1/1/1 | ppmtogif -interlace -transparent rgbi:1/1/1
+#
+Xy.gif: Xy.ps pnmrawtopcropwhite
+ echo '' | \
+ gs -sDEVICE=pbmraw -r300 \
+ -sOutputFile='|$(PNMCROP) >Xy.pbm' \
+ -q - Xy.ps
+ cat Xy.pbm | $(PGMTOGIF) >Xy.gif
+#
+pnmrawtopcropwhite: pnmrawtopcropwhite.c
+#
+www: Xy-pic.html Xy.gif
+####BROKEN##### guide.html
+#
+install.www: www
+ $(INSTALL) Xy-pic.html Xy.gif $(WWWDIR)
+# $(RM) $(WWWDIR)/xyguide-html
+# $(MKDIR) $(WWWDIR)/xyguide-html
+# tar -cf - xyguide-html | (cd $(WWWDIR); tar xvpf -)
+
+
+# ANNOUNCEMENTS.
+#
+MAILSOURCES = TRAILER Users mail.Users
+#
+.PHONY: announce
+announce: $(MAILSOURCES)
+ @./mail.Users
+
+
+# TAGS for Emacs.
+#
+TAGS: $(SOURCES)
+ -$(RM) TAGS
+ for f in `for ff in $(SOURCES); do echo $$ff; done |sort -u`;\
+ do\
+ $(GAWK) '\
+ func err(s) { printf("%s,%d: %s\n",FILENAME,FNR,s) >>"/dev/stderr"};\
+ func prt(s,n) { printf("%s\177%d,%d\n",s,FNR,c+n) };\
+ func prtdef(i) { t = substr($$0,i);\
+ if (match(t,/[\\|][a-zA-Z@]*|\\.|[^\\|]|{([^{}]|\\{|\\})*}/) != 1) \
+ err("Weird TeX token");\
+ else prt(substr($$0,1,i+RLENGTH),i) };\
+ func prtcsdef(i) { t = substr($$0,i);\
+ if (match(t,/{([^{}]|\\{|\\})*}|{([^{}]|\\{|\\})*{([^{}]|\\{|\\})*}([^{}]|\\{|\\})*}/) != 1) \
+ err("Weird TeX cs name token");\
+ else prt(substr($$0,1,i+RLENGTH),i) };\
+ func fin() { c += length($$0) + 1; next };\
+ BEGIN { c = 0 };\
+ /^\\let[^A-Za-z@]/ ||\
+ /^\\def[^A-Za-z@]/ { prtdef(5); fin() };\
+ /^\\gdef[^A-Za-z@]/ ||\
+ /^\\edef[^A-Za-z@]/ ||\
+ /^\\xdef[^A-Za-z@]/ { prtdef(6); fin() };\
+ /^\\newif[^A-Za-z@]/ { prtdef(7); fin() };\
+ /^\\xydef@[^A-Za-z@]/ ||\
+ /^\\xylet@[^A-Za-z@]/ { prtdef(8); fin() };\
+ /^\\xyfont@[^A-Za-z@]/ { prtdef(9); fin() };\
+ /^\\global\\let[^A-Za-z@]/ { prtdef(12); fin() };\
+ /^\\xywarnifdefined[^A-Za-z@]/ { prtdef(17); fin() };\
+ /^\\ifx\\undefined[^A-Za-z@]/ { prtdef(15); fin() };\
+ /^\\xynew@{[^{}]*}/ { prtdef(index($$0,"}")+1); fin() };\
+ /^\\xydefcsname@{/ { prtcsdef(14); fin() };\
+ /^\\xyletcsnamecsname@{/ { prtcsdef(20); fin() };\
+ /\?\?\=\[/ { s = $$0; i = 0;\
+ while (first = index(s, "\?\?=[")) {\
+ s = substr(s,first+4); i += first+4;\
+ if (j = index(s, "]")) prt(substr($$0,1,i+j-1),i);\
+ else printf("Unmatched []s") }; fin() };\
+ /^@[A-Za-z]*{/ { prt($$0,index($$0,"{")+1); fin() };\
+ { fin() }' $$f >TAGS.tmp ;\
+ wc -c TAGS.tmp|$(GAWK) '{printf "\f\n%s,%s\n","'"$$f"'",$$1}'>>TAGS;\
+ cat TAGS.tmp >>TAGS ;\
+ done
+ $(RM) TAGS.tmp
+
+
+# RCS STUFF:
+#
+.PHONY: ci ci-$(VERSION) cici rcscheck \
+ rcslist rcslockedlist rcsunlockedlist \
+ rcscleanlist rcsuncleanlist rcsclean rcsdep
+#
+ALLSOURCES = $(TRAILERSOURCES) $(SOURCES) $(MANUALSOURCES) $(TeXNICALSOURCES) \
+ $(WWWSOURCES) $(MAILSOURCES) $(OBSOLETEMETAFONTS) $(TYPE1FONTS) \
+ $(SUPPORT) xypic.map
+#
+ROSSSOURCES = INSTALL.OzTeX INSTALL.Textures import1.eps ross.eps \
+ xy16textures.doc xy17oztex.doc xy2cell.doc xyarc.doc \
+ xycolor.doc xycrayon.doc xycurve.doc \
+ xydvips.doc xyimport.doc xyknot.doc xyline.doc \
+ xymacpat.xyp xyoztex.doc xypoly.doc xyps-c.doc xyps-col.doc \
+ xyps-f.doc xyps-l.doc xyps-pro.doc xyps-ps.doc xyps-r.doc \
+ xyps-s.doc xyps-t.doc xyps.doc xypsdict.doc xypspatt.doc xyrotate.doc \
+ xytextures.doc xytile.doc xytpic.doc xyemtex.doc xyweb.doc \
+ xydvidrv.doc xyxdvi.doc xydvitops.doc xytp-f.doc xycmactex.doc
+#
+YANDYSOURCES = \
+ xyatip10.pfa xybsql10.pfa xybtip10.pfa xycirc10.pfa xycmat10.pfa \
+ xycmbt10.pfa xydash10.pfa xyeuat10.pfa xyeubt10.pfa \
+#
+ci ci-$(VERSION): $(ALLSOURCES) cici Makefile
+cici:
+ -rcs -l `for f in $(ALLSOURCES); do echo $$f; done | sort -u`
+ -ci -u$(VERSION) `$(MAKE) rcslockedlist`
+#
+rcscheck: $(ALLSOURCES)
+ @locked="`$(MAKE) rcslockedlist`"; \
+ unlocked="`$(MAKE) rcsunlockedlist`"; \
+ echo "Missing write permission on locked files:"; \
+ for f in $$locked; do [ -w "$$f" ] || echo ' '$$f; done; \
+ echo "Wrong write permission on unlocked files:"; \
+ for f in $$unlocked; do [ -w "$$f" ] && echo ' '$$f; done; \
+ echo "Wrong/missing locks on ross's files:"; \
+ for f in $(ROSSSOURCES); \
+ do lock=; \
+ for ff in $$locked; \
+ do if [ "$$f" = "$$ff" ]; then lock=' ross'; fi; done; \
+ fgrep -s " ross Exp$$lock "'$$' $$f \
+ ||(/bin/echo ' '$$f': \c' && grep 'Id[:].* Exp ' $$f || echo '?'); \
+ done; \
+ echo "Wrong/missing locks on krisrose's files:"; \
+ for f in `$(MAKE) rcslist`; \
+ do for ff in $(ROSSSOURCES); \
+ do if [ "$$f" = "$$ff" ]; then continue 2; fi; done; \
+ lock=; \
+ for ff in $$locked; \
+ do if [ "$$f" = "$$ff" ]; then lock=' krisrose'; fi; done; \
+ fgrep -s " krisrose Exp$$lock "'$$' $$f \
+ || (/bin/echo ' '$$f' \c' && grep 'Id[:].* Exp ' $$f || echo ''); \
+ done
+#
+rcslist:
+ -@rlog -R `for f in $(ALLSOURCES); do echo $$f; done | sort -u` \
+ 2>/dev/null | sed 's;RCS/\(.*\),v;\1;'
+#
+rcslockedlist:
+ -@rlog -R -L `for f in $(ALLSOURCES); do echo $$f; done | sort -u` \
+ 2>/dev/null | sed 's;RCS/\(.*\),v;\1;'
+#
+rcsunlockedlist:
+ -@locked="`$(MAKE) rcslockedlist`"; \
+ $(MAKE) rcslist | while read f; \
+ do echo=echo; for ff in $$locked; \
+ do if [ "$$f" = "$$ff" ]; then echo=:; fi; done; \
+ $$echo $$f; done
+#
+rcscleanlist:
+ -@$(MAKE) rcslist \
+ | while read f; do if test -w "$$f" -o "$$f" = Makefile; then :; \
+ else echo $$f; fi; done
+#
+rcsuncleanlist:
+ -@$(MAKE) rcslist \
+ | while read f; do if test -w "$$f" -o "$$f" = Makefile; \
+ then echo $$f; fi; done
+#
+rcsclean:
+ -@$(MAKE) rcscleanlist | while read f; do $(RM) $$f; done
+#
+# Dependencies...
+#
+rcsdep:
+ $(MAKE) rcslist | while read f; do \
+ echo "$$f: RCS/$$f,v; test -d RCS && co $$f || :"; done
+
+.late2html-init:; test -d RCS -a -f RCS/.late2html-init,v && co .late2html-init || :
+CATALOG.doc:; test -d RCS -a -f RCS/CATALOG.doc,v && co CATALOG.doc || :
+COPYING.patch:; test -d RCS -a -f RCS/COPYING.patch,v && co COPYING.patch || :
+COPYING:; test -d RCS -a -f RCS/COPYING,v && co COPYING || :
+FONTCOPYING.patch:; test -d RCS -a -f RCS/FONTCOPYING.patch,v && co FONTCOPYING.patch || :
+FONTCOPYING:; test -d RCS -a -f RCS/FONTCOPYING,v && co FONTCOPYING || :
+INSTALL.OzTeX:; test -d RCS -a -f RCS/INSTALL.OzTeX,v && co INSTALL.OzTeX || :
+INSTALL.Textures:; test -d RCS -a -f RCS/INSTALL.Textures,v && co INSTALL.Textures || :
+INSTALL:; test -d RCS -a -f RCS/INSTALL,v && co INSTALL || :
+MAKE:; test -d RCS -a -f RCS/MAKE,v && co MAKE || :
+Makefile:; test -d RCS -a -f RCS/Makefile,v && co Makefile || :
+README:; test -d RCS -a -f RCS/README,v && co README || :
+TRAILER:; test -d RCS -a -f RCS/TRAILER,v && co TRAILER || :
+Users:; test -d RCS -a -f RCS/Users,v && co Users || :
+Xy-pic.blurb:; test -d RCS -a -f RCS/Xy-pic.blurb,v && co Xy-pic.blurb || :
+Xy-pic.html:; test -d RCS -a -f RCS/Xy-pic.html,v && co Xy-pic.html || :
+Xy-pic.xbm:; test -d RCS -a -f RCS/Xy-pic.xbm,v && co Xy-pic.xbm || :
+Xy.doc:; test -d RCS -a -f RCS/Xy.doc,v && co Xy.doc || :
+Xy.xy:; test -d RCS -a -f RCS/Xy.xy,v && co Xy.xy || :
+YandY_xy_fonts.zip:; test -d RCS -a -f RCS/YandY_xy_fonts.zip,v && co YandY_xy_fonts.zip || :
+doc2tex.com:; test -d RCS -a -f RCS/doc2tex.com,v && co doc2tex.com || :
+dvitogif89a:; test -d RCS -a -f RCS/dvitogif89a,v && co dvitogif89a || :
+gasket.texmovie:; test -d RCS -a -f RCS/gasket.texmovie,v && co gasket.texmovie || :
+import1.eps:; test -d RCS -a -f RCS/import1.eps,v && co import1.eps || :
+install-tds:; test -d RCS -a -f RCS/install-tds,v && co install-tds || :
+kris.eps:; test -d RCS -a -f RCS/kris.eps,v && co kris.eps || :
+latin1.sty:; test -d RCS -a -f RCS/latin1.sty,v && co latin1.sty || :
+mail.Users:; test -d RCS -a -f RCS/mail.Users,v && co mail.Users || :
+man2html-post.gawk:; test -d RCS -a -f RCS/man2html-post.gawk,v && co man2html-post.gawk || :
+man2html.gawk:; test -d RCS -a -f RCS/man2html.gawk,v && co man2html.gawk || :
+movie.cls:; test -d RCS -a -f RCS/movie.cls,v && co movie.cls || :
+pnmrawtopcropwhite.c:; test -d RCS -a -f RCS/pnmrawtopcropwhite.c,v && co pnmrawtopcropwhite.c || :
+ross.eps:; test -d RCS -a -f RCS/ross.eps,v && co ross.eps || :
+version.doc:; test -d RCS -a -f RCS/version.doc,v && co version.doc || :
+xy.doc:; test -d RCS -a -f RCS/xy.doc,v && co xy.doc || :
+xy.sty:; test -d RCS -a -f RCS/xy.sty,v && co xy.sty || :
+xy16textures.doc:; test -d RCS -a -f RCS/xy16textures.doc,v && co xy16textures.doc || :
+xy17oztex.doc:; test -d RCS -a -f RCS/xy17oztex.doc,v && co xy17oztex.doc || :
+xy2cell.doc:; test -d RCS -a -f RCS/xy2cell.doc,v && co xy2cell.doc || :
+xyall.doc:; test -d RCS -a -f RCS/xyall.doc,v && co xyall.doc || :
+xyamslatex.ini:; test -d RCS -a -f RCS/xyamslatex.ini,v && co xyamslatex.ini || :
+xyarc.doc:; test -d RCS -a -f RCS/xyarc.doc,v && co xyarc.doc || :
+xyarrow.doc:; test -d RCS -a -f RCS/xyarrow.doc,v && co xyarrow.doc || :
+xyatip10.mf:; test -d RCS -a -f RCS/xyatip10.mf,v && co xyatip10.mf || :
+xybsql10.mf:; test -d RCS -a -f RCS/xybsql10.mf,v && co xybsql10.mf || :
+xybtip10.mf:; test -d RCS -a -f RCS/xybtip10.mf,v && co xybtip10.mf || :
+xycirc10.enc:; test -d RCS -a -f RCS/xycirc10.enc,v && co xycirc10.enc || :
+xycirc10.mf:; test -d RCS -a -f RCS/xycirc10.mf,v && co xycirc10.mf || :
+xycm.mf:; test -d RCS -a -f RCS/xycm.mf,v && co xycm.mf || :
+xycmactex.doc:; test -d RCS -a -f RCS/xycmactex.doc,v && co xycmactex.doc || :
+xycmat10.mf:; test -d RCS -a -f RCS/xycmat10.mf,v && co xycmat10.mf || :
+xycmat11.mf:; test -d RCS -a -f RCS/xycmat11.mf,v && co xycmat11.mf || :
+xycmat12.mf:; test -d RCS -a -f RCS/xycmat12.mf,v && co xycmat12.mf || :
+xycmbt10.mf:; test -d RCS -a -f RCS/xycmbt10.mf,v && co xycmbt10.mf || :
+xycmbt11.mf:; test -d RCS -a -f RCS/xycmbt11.mf,v && co xycmbt11.mf || :
+xycmbt12.mf:; test -d RCS -a -f RCS/xycmbt12.mf,v && co xycmbt12.mf || :
+xycmtip.doc:; test -d RCS -a -f RCS/xycmtip.doc,v && co xycmtip.doc || :
+xycolor.doc:; test -d RCS -a -f RCS/xycolor.doc,v && co xycolor.doc || :
+xycrayon.doc:; test -d RCS -a -f RCS/xycrayon.doc,v && co xycrayon.doc || :
+xycurve.doc:; test -d RCS -a -f RCS/xycurve.doc,v && co xycurve.doc || :
+xyd.enc:; test -d RCS -a -f RCS/xyd.enc,v && co xyd.enc || :
+xyd.mf:; test -d RCS -a -f RCS/xyd.mf,v && co xyd.mf || :
+xyd2.enc:; test -d RCS -a -f RCS/xyd2.enc,v && co xyd2.enc || :
+xyd2.mf:; test -d RCS -a -f RCS/xyd2.mf,v && co xyd2.mf || :
+xydash10.mf:; test -d RCS -a -f RCS/xydash10.mf,v && co xydash10.mf || :
+xydoc.bib:; test -d RCS -a -f RCS/xydoc.bib,v && co xydoc.bib || :
+xydoc.sty:; test -d RCS -a -f RCS/xydoc.sty,v && co xydoc.sty || :
+xydocps.doc:; test -d RCS -a -f RCS/xydocps.doc,v && co xydocps.doc || :
+xydriver.doc:; test -d RCS -a -f RCS/xydriver.doc,v && co xydriver.doc || :
+xydummy.doc:; test -d RCS -a -f RCS/xydummy.doc,v && co xydummy.doc || :
+xydvidrv.doc:; test -d RCS -a -f RCS/xydvidrv.doc,v && co xydvidrv.doc || :
+xydvips.doc:; test -d RCS -a -f RCS/xydvips.doc,v && co xydvips.doc || :
+xydvitops.doc:; test -d RCS -a -f RCS/xydvitops.doc,v && co xydvitops.doc || :
+xyemtex.doc:; test -d RCS -a -f RCS/xyemtex.doc,v && co xyemtex.doc || :
+xyeuat10.mf:; test -d RCS -a -f RCS/xyeuat10.mf,v && co xyeuat10.mf || :
+xyeuat11.mf:; test -d RCS -a -f RCS/xyeuat11.mf,v && co xyeuat11.mf || :
+xyeuat12.mf:; test -d RCS -a -f RCS/xyeuat12.mf,v && co xyeuat12.mf || :
+xyeubt10.mf:; test -d RCS -a -f RCS/xyeubt10.mf,v && co xyeubt10.mf || :
+xyeubt11.mf:; test -d RCS -a -f RCS/xyeubt11.mf,v && co xyeubt11.mf || :
+xyeubt12.mf:; test -d RCS -a -f RCS/xyeubt12.mf,v && co xyeubt12.mf || :
+xyeuler.doc:; test -d RCS -a -f RCS/xyeuler.doc,v && co xyeuler.doc || :
+xyframe.doc:; test -d RCS -a -f RCS/xyframe.doc,v && co xyframe.doc || :
+xygraph.doc:; test -d RCS -a -f RCS/xygraph.doc,v && co xygraph.doc || :
+xyguide.man:; test -d RCS -a -f RCS/xyguide.man,v && co xyguide.man || :
+xyidioms.doc:; test -d RCS -a -f RCS/xyidioms.doc,v && co xyidioms.doc || :
+xyimport.doc:; test -d RCS -a -f RCS/xyimport.doc,v && co xyimport.doc || :
+xyknot.doc:; test -d RCS -a -f RCS/xyknot.doc,v && co xyknot.doc || :
+xylatex.ini:; test -d RCS -a -f RCS/xylatex.ini,v && co xylatex.ini || :
+xyline.doc:; test -d RCS -a -f RCS/xyline.doc,v && co xyline.doc || :
+xyline10.mf:; test -d RCS -a -f RCS/xyline10.mf,v && co xyline10.mf || :
+xymacpat.xyp:; test -d RCS -a -f RCS/xymacpat.xyp,v && co xymacpat.xyp || :
+xymatrix.doc:; test -d RCS -a -f RCS/xymatrix.doc,v && co xymatrix.doc || :
+xymisc10.mf:; test -d RCS -a -f RCS/xymisc10.mf,v && co xymisc10.mf || :
+xymovie.doc:; test -d RCS -a -f RCS/xymovie.doc,v && co xymovie.doc || :
+xyoztex.doc:; test -d RCS -a -f RCS/xyoztex.doc,v && co xyoztex.doc || :
+xypic.doc:; test -d RCS -a -f RCS/xypic.doc,v && co xypic.doc || :
+xypic.map:; test -d RCS -a -f RCS/xypic.map,v && co xypic.map || :
+xypic.sty:; test -d RCS -a -f RCS/xypic.sty,v && co xypic.sty || :
+xypoly.doc:; test -d RCS -a -f RCS/xypoly.doc,v && co xypoly.doc || :
+xyps-c.doc:; test -d RCS -a -f RCS/xyps-c.doc,v && co xyps-c.doc || :
+xyps-col.doc:; test -d RCS -a -f RCS/xyps-col.doc,v && co xyps-col.doc || :
+xyps-dto.doc:; test -d RCS -a -f RCS/xyps-dto.doc,v && co xyps-dto.doc || :
+xyps-dvi.doc:; test -d RCS -a -f RCS/xyps-dvi.doc,v && co xyps-dvi.doc || :
+xyps-f.doc:; test -d RCS -a -f RCS/xyps-f.doc,v && co xyps-f.doc || :
+xyps-l.doc:; test -d RCS -a -f RCS/xyps-l.doc,v && co xyps-l.doc || :
+xyps-one.doc:; test -d RCS -a -f RCS/xyps-one.doc,v && co xyps-one.doc || :
+xyps-oz.doc:; test -d RCS -a -f RCS/xyps-oz.doc,v && co xyps-oz.doc || :
+xyps-pro.doc:; test -d RCS -a -f RCS/xyps-pro.doc,v && co xyps-pro.doc || :
+xyps-ps.doc:; test -d RCS -a -f RCS/xyps-ps.doc,v && co xyps-ps.doc || :
+xyps-pub.doc:; test -d RCS -a -f RCS/xyps-pub.doc,v && co xyps-pub.doc || :
+xyps-r.doc:; test -d RCS -a -f RCS/xyps-r.doc,v && co xyps-r.doc || :
+xyps-s.doc:; test -d RCS -a -f RCS/xyps-s.doc,v && co xyps-s.doc || :
+xyps-t.doc:; test -d RCS -a -f RCS/xyps-t.doc,v && co xyps-t.doc || :
+xyps-txo.doc:; test -d RCS -a -f RCS/xyps-txo.doc,v && co xyps-txo.doc || :
+xyps-txt.doc:; test -d RCS -a -f RCS/xyps-txt.doc,v && co xyps-txt.doc || :
+xyps-wdo.doc:; test -d RCS -a -f RCS/xyps-wdo.doc,v && co xyps-wdo.doc || :
+xyps.doc:; test -d RCS -a -f RCS/xyps.doc,v && co xyps.doc || :
+xypsdict.doc:; test -d RCS -a -f RCS/xypsdict.doc,v && co xypsdict.doc || :
+xypspatt.doc:; test -d RCS -a -f RCS/xypspatt.doc,v && co xypspatt.doc || :
+xyqc10.mf:; test -d RCS -a -f RCS/xyqc10.mf,v && co xyqc10.mf || :
+xyrecat.doc:; test -d RCS -a -f RCS/xyrecat.doc,v && co xyrecat.doc || :
+xyrefer.man:; test -d RCS -a -f RCS/xyrefer.man,v && co xyrefer.man || :
+xyrotate.doc:; test -d RCS -a -f RCS/xyrotate.doc,v && co xyrotate.doc || :
+xysmart.doc:; test -d RCS -a -f RCS/xysmart.doc,v && co xysmart.doc || :
+xysource.man:; test -d RCS -a -f RCS/xysource.man,v && co xysource.man || :
+xystyle.doc:; test -d RCS -a -f RCS/xystyle.doc,v && co xystyle.doc || :
+xytech.mf:; test -d RCS -a -f RCS/xytech.mf,v && co xytech.mf || :
+xytest.mf:; test -d RCS -a -f RCS/xytest.mf,v && co xytest.mf || :
+xytex.ini:; test -d RCS -a -f RCS/xytex.ini,v && co xytex.ini || :
+xytextures.doc:; test -d RCS -a -f RCS/xytextures.doc,v && co xytextures.doc || :
+xytile.doc:; test -d RCS -a -f RCS/xytile.doc,v && co xytile.doc || :
+xytips.doc:; test -d RCS -a -f RCS/xytips.doc,v && co xytips.doc || :
+xytp-f.doc:; test -d RCS -a -f RCS/xytp-f.doc,v && co xytp-f.doc || :
+xytpic.doc:; test -d RCS -a -f RCS/xytpic.doc,v && co xytpic.doc || :
+xyv2.doc:; test -d RCS -a -f RCS/xyv2.doc,v && co xyv2.doc || :
+xyweb.doc:; test -d RCS -a -f RCS/xyweb.doc,v && co xyweb.doc || :
+xyxdvi.doc:; test -d RCS -a -f RCS/xyxdvi.doc,v && co xyxdvi.doc || :
+
+
+# DEVELOPMENT TARGETS:
+#
+.PHONY: Install.macros Install Ftpsrc Ftpdoc Ftp World Minor
+
+Install.macros:
+ $(MAKE) USR=$$HOME/pub install.macros
+
+Install:
+ $(MAKE) USR=$$HOME/pub install
+
+Ftpsrc:
+ $(MAKE) MODES='ljfour cx' \
+ MAGS='0 0.5 1 2' \
+ FTPROOT=$$HOME/public_ftp/TeX ftpsrc
+
+Ftpdoc:
+ $(MAKE) MODES='ljfour cx' \
+ MAGS='0 0.5 1 2' \
+ FTPROOT=$$HOME/public_ftp/TeX ftpdoc
+
+Ftp:
+ $(MAKE) MODES='ljfour cx' \
+ MAGS='0 0.5 1 2' \
+ FTPROOT=$$HOME/public_ftp/TeX ftp
+
+Www:
+ $(MAKE) WWWROOT=$$HOME/public_html install.www
+
+World:
+ $(MAKE) LATEX='time latex' \
+ MODES='ljfour cx' \
+ MAGS='0 0.5 1 2' world
+ mv make.world make.World
+
+TMPFTPROOT = $$HOME/tmp/new-ftp-root
+
+Minor:
+ $(MKDIR) $(TMPFTPROOT)
+ $(MAKE) LATEX='time latex' \
+ MODES='ljfour cx' \
+ MAGS='0 0.5 1 2' \
+ FTPROOT=$(TMPFTPROOT) world
+ mv make.world make.Minor
+#
+ @echo "Making patch:";\
+ cd $(TMPFTPROOT); \
+ diff -urN $(FTPROOT)/xy-$(VERSION) xy-$(VERSION) > FIX; \
+ n=`cd $(FTPROOT);ls xy$(SHORTVERSION)fix* | wc -w 2>/dev/null`; \
+ n=`expr $$n + 1`; \
+ fix=$(FTPROOT)/xy$(SHORTVERSION)fix`printf '%.2d' $$n`; \
+ cp -vf FIX $$fix; gzip -v9 $$fix
+#
+ @echo "Updating real ftp archive $(FTPROOT):";\
+ cd $(TMPFTPROOT); \
+ find xy* -type f -print \
+ | while read f;\
+ do cmp -s $$f $(FTPROOT)/$$f\
+ || { echo $$f; $(MKDIR) `dirname $(FTPROOT)/$$f`;\
+ if [ -w $$f ]; then $(INSTALLW) $$f $(FTPROOT)/$$f;\
+ else $(INSTALL) $$f $(FTPROOT)/$$f;\
+ fi; };\
+ done
+ $(RM) $(TMPFTPROOT)
+
+
+# LOG
+#
+# $Log: Makefile,v $
+# Revision 3.7 1999/02/16 15:12:50 krisrose
+# Interim release (Y&Y fonts now free).
+#
+# Revision 3.6 1998/03/06 01:28:05 krisrose
+# Releasing (with Y&Y fonts).
+#
+# Revision 3.5 1997/05/28 13:05:01 krisrose
+# Fixed missing breaks bug.
+#
+# Revision 3.4 1997/05/18 03:04:44 krisrose
+# Essential bugfixes.
+# And movies now included!
+#
+# Revision 3.3 1996/12/19 17:05:13 krisrose
+# Maintenance release!
+#
+# Revision 3.2 1995/09/19 18:22:27 kris
+# Bug fix release.
+#
+# Revision 3.1 1995/09/05 20:31:32 kris
+# Releasing!
+#
+# Revision 3.0 1995/07/07 20:14:21 kris
+# Major release w/new User's Guide!
+#
+# Revision 2.14 1995/07/06 02:56:02 kris
+# Buglets...
+#
+# Revision 2.13 1995/07/04 15:10:01 kris
+# Ready to release v3?
+#
+# Revision 2.12 1994/10/25 11:46:25 kris
+# Interim release just before v3 [works with AMS-LaTeX 1.2]...
+#
+# Revision 2.11 1994/07/05 10:37:32 kris
+# Third 3beta release [bug fixes].
+# Experimental graph feature included (for ECCT-94 presentation).
+#
+# Revision 2.10 1994/06/15 13:35:19 kris
+# Second 3beta release [bug fixes].
+#
+# Revision 2.9 1994/06/09 14:53:07 kris
+# Release 3beta.
+#
+# Revision 2.8 1994/04/08 04:30:00 kris
+# Second (bug fix) 3alpha release.
+#
+# Revision 2.7 1994/03/08 02:06:01 kris
+# Release 3alpha.
+#
+# Revision 2.6.9.1 1994/03/07 04:22:46 kris
+# Last internal 3alpha and pre-2.7 release.
+#
+# MAJOR REORGANISATION for version 2.7...
+#
+# Revision 2.6 1992/06/24 01:23:34 kris
+# Ready to release v.2.6.
+#
+# Revision 2.5 1992/02/24 03:30:54 kris
+# Default magsteps now just 0, 0.5, 1, and 2.
+#
+# Revision 2.3 1992/01/13 02:12:28 kris
+# Fixed installation instructions and other details.
+#
+# Revision 2.1 1992/01/02 14:54:07 kris
+# Release version.
+#
+# Revision 1.6 1991/12/17 04:51:16 kris
+# Version distributed with `final draft' on Usenet.
+
+# Tell Emacs that this is a Makefile and how it is formatted:
+# Local Variables:
+# mode:fundamental
+# fill-prefix:"# "
+# fill-column:77
+# End:
diff --git a/Master/texmf-dist/source/generic/xypic/README b/Master/texmf-dist/source/generic/xypic/README
new file mode 100644
index 00000000000..9cb813a4cb6
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/README
@@ -0,0 +1,106 @@
+-*-text-*- $Id: README,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+
+ ======================================================
+ THE Xy-pic PACKAGE FOR TYPESETTING GRAPHS AND DIAGRAMS
+ ======================================================
+
+Xy-pic is a package for typesetting graphs and diagrams with TeX.
+
+It works with most formats, including LaTeX (both 2.09 and 2e),
+AMS-LaTeX, AMS-TeX, and plain TeX.
+
+It has been used to typeset complicated diagrams from many application
+areas including category theory, automata theory, algebra, neural
+networks, and database theory.
+
+ - o -
+
+See below in this file for an overview of the structure and features!
+See CATALOG for up to date version information!
+See TRAILER for author and accessibility information!
+See COPYING for the conditions for redistribution and modification!
+See MANIFEST for a complete file list!
+See VERSIONS for the exact list of the versions of all source files!
+See the various INSTALL files for how to install Xy-pic on your system!
+See the W3 <URL: http://www.ens-lyon.fr/~krisrose/Xy-pic.html> for news!
+
+ - o -
+
+Xy-pic is structured as a `kernel' and several orthogonal modules called
+`options', each defining a custom notation for a particular kind of
+graphical object or structure.
+
+These (combinable) structures are available:
+
+* A graph combinator mode where diagrams are specified the way they are
+ composed as graphs.
+
+* A matrix-like mode where the dimensions of the drawing are computed by
+ aligning diagram entries in rows and columns (this is the `diagram'
+ mode Xy-pic version 2 users are used to).
+
+* A polygon mode where diagrams shaped as regular polygons are entered
+ in a simple way.
+
+* A mode for typesetting beautiful knots and links.
+
+* A general object-oriented `turtle graphic' drawing language for
+ specifying graphs with objects and connections between them in a
+ manner independent of orientation.
+
+The following objects may be used:
+
++ Positions can be given in variety of formats (extendable) including
+ user defined coordinates (x,y) and relative to previous positions,
+ objects, object edges, and points on connections.
+
++ Objects may be circular, elliptic, or rectangular (more shapes can be
+ added) and adjusted in several ways.
+
++ Large library of objects with mnemonic names.
+
++ Objects that orient themself along a connection when placed relative
+ to it, e.g., `\dir{|-}' is like \vdash but thus oriented; new such
+ objects can be defined in a convenient way.
+
++ TeX `boxes', i.e., text and mathematical formulae.
+
++ Includes circle segments and optionally arbitrary elliptical,
+ quadratic, and cubic arcs.
+
++ Connections are aligned between the reference points of objects but
+ start and end on the edges.
+
++ Any object can be used to build a connection (using `diagonal
+ filling'); library objects provide common line types.
+
++ Flexible notation for drawing arrows and general paths with tail,
+ stem, and head built from any object(s). Special support for arrows
+ that cross each other, arrows that `go by' other entries, paired
+ arrows (including support for 2-cells), curved arrows, and arrows with
+ bends.
+
++ Library of frames and braces.
+
++ Special notation for rotation, scaling, colour, and line thickness.
+ The correct typesetting of these features requires a backend that
+ supports it (i.e., PostScript) but even when this is not available
+ Xy-pic tries to approximate what is requested such that at least the
+ picture size is stable (and thus page breaks).
+
++ Output can use PostScript for drawing (several \special formats are
+ supported: dvips, Textures, and OzTeX -- more are being added
+ continuously: contact Ross Moore <ross@mpce.mq.edu.au> for the current
+ list). Notation for inclusion of literal PostScript is available.
+
+* Other graphics can be imported and then `decorated' using Xy-pic.
+
+All object forms may be used with all structures.
+
+ - o -
+
+Finally, enjoy Xy-pic!
+
+Sincerely,
+ Kristoffer H. Rose <krisrose@ens-lyon.fr>
+ Ross Moore <ross@mpce.mq.edu.au>
diff --git a/Master/texmf-dist/source/generic/xypic/TRAILER b/Master/texmf-dist/source/generic/xypic/TRAILER
new file mode 100644
index 00000000000..0910c672a83
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/TRAILER
@@ -0,0 +1,91 @@
+-*-text-*- $Id: TRAILER,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+
+=======================================================================
+ ANNOUNCING the Xy-pic version 3.7 DIAGRAM TYPESETTING PACKAGE
+=======================================================================
+
+This is to announce a release of my diagram typesetting package Xy-pic.
+
+With version 3.7 we explicitly grant permission to use the unmodified
+Xy-pic fonts and specials in distributed documents.
+
+-----------------------------------------------------------------------
+ GENERAL
+-----------------------------------------------------------------------
+
+Xy-pic is a package for typesetting a variety of graphs and diagrams
+with TeX. Xy-pic works with most formats (including LaTeX, AMS-LaTeX,
+AMS-TeX, and plain TeX), in particular Xy-pic is provided as a LaTeX2e
+`supported package' (following the `CTAN LaTeX2e bundle' standard).
+
+Further specifics of the package are in the distribution README file.
+
+-----------------------------------------------------------------------
+ NEWS
+-----------------------------------------------------------------------
+
+The primary purpose of release 3.7 is the granting of special permission
+to copy the Xy-pic fonts and graphic specials inside documents, for
+example in DVI, PostScript, and PDF files. This has no practical
+significance except making current (reasonable) practice explicitly
+legal.
+
+Release 3.7 furthermore fixes a few bugs in release 3.6 and adds a few
+features: a "smart turning path" feature and an extension with macro
+expansion in kernel expressions and polygon shapes by George C. Necula,
+and the beginnings of an emulation of LaTeX picture mode proposed by
+Paul Burchard and Bill Richter.
+
+Special thanks to George Necula for the bug fixes and impressive
+extensions, to Bill Richter for extending Paul Burchard's pb-diagram to
+use Xy-pic as a backend and for contributing the `picture' feature, to
+Berthold Horn of Y&Y Inc. for releasing the copyright on their
+PostScript fonts, and to Pieter Donche and Marcelo Cunha dos Santos for
+the bug reports.
+
+-----------------------------------------------------------------------
+ AVAILABILITY
+-----------------------------------------------------------------------
+
+Xy-pic can be retrieved through the World Wide Web Xy-pic `home page':
+
+ URL: http://www.ens-lyon.fr/~krisrose/Xy-pic.html
+
+as well as by anonymous ftp from
+
+ CTAN: macros/generic/diagrams/xypic
+
+Check the README file in each location for specifics, in particular
+check that you have reached a version 3.7 copy (some archives take a
+while to mirror the latest files)!
+
+-----------------------------------------------------------------------
+ HISTORY & CREDITS
+-----------------------------------------------------------------------
+
+The first public release (version 1.40) of Xy-pic was created by
+Kristoffer H. Rose, DIKU, U of Copenhagen (now ENS-Lyon, France) and
+distributed via Usenet on December 19, 1991. This quickly became
+version 2 of which version 2.6 was the stable for sevarl years.
+
+The thorough rewrite that became version 3 is a continued
+collaboration with Ross Moore, Macquarie U, Sydney, initiated through
+a visit to Macquarie (Jan-May 1994 supported by the Australian
+Research Council, Macquarie University, and using donated DEC
+equipment). However, full backwards compatibility is maintained
+(except for the unavoidable but fully documented obscure cases).
+
+Xy-pic is Copyright (c) 1991-1998 by Kristoffer H. Rose and 1994-1998
+by Ross Moore under GNU COPYLEFT (GPL) which means that you can use
+the package for any purpose but if you provide the macros or any code
+derived from them to a third party then you are obliged to include the
+entire Xy-pic package (full details in the file COPYING). The
+PostScript fonts are additionally Copyright (c) 1997 Y&Y Inc. The
+FONTCOPYING file details the special permissions to distribute fonts
+without the full requirements of the GPL.
+
+-----------------------------------------------------------------------
+
+ This is the end of the announcement. Enjoy Xy-pic!
+
+-----------------------------------------------------------------------
diff --git a/Master/texmf-dist/source/generic/xypic/VERSIONS b/Master/texmf-dist/source/generic/xypic/VERSIONS
new file mode 100644
index 00000000000..8dd98c1cd2e
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/VERSIONS
@@ -0,0 +1,103 @@
+$Id: CATALOG.doc,v 3.6 1998/03/06 04:29:05 krisrose Exp $
+$Id: INSTALL,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+$Id: INSTALL.OzTeX,v 3.4 1997/05/18 01:13:24 ross Exp $
+$Id: INSTALL.Textures,v 3.4 1997/05/18 01:13:24 ross Exp $
+$Id: MAKE,v 3.5 1997/05/28 22:40:26 krisrose Exp $
+$Id: Makefile,v 3.7 1999/02/16 15:12:50 krisrose Exp krisrose $
+$Id: README,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+$Id: TRAILER,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: dvitogif89a,v 3.5 1997/05/28 13:05:01 krisrose Exp $
+$Id: install-tds,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: latin1.sty,v 3.4 1997/05/18 03:04:44 krisrose Exp $
+$Id: movie.cls,v 3.4 1997/05/18 01:14:25 krisrose Exp $
+$Id: pnmrawtopcropwhite.c,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: pnmrawtopcropwhite.c,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xy.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xy.sty,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xy16textures.doc,v 3.3 1996/12/18 14:21:23 ross Exp $
+$Id: xy17oztex.doc,v 3.3 1996/12/18 14:21:23 ross Exp $
+$Id: xy2cell.doc,v 3.3 1996/12/18 14:21:23 ross Exp $
+$Id: xyall.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xyarc.doc,v 3.4 1997/05/18 01:13:24 ross Exp $
+$Id: xyarrow.doc,v 3.5 1997/05/28 13:05:01 krisrose Exp $
+$Id: xyatip.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyatip10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xybsql10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xybtip.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xybtip10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycirc10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycm.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycmactex.doc,v 3.3 1996/12/18 08:54:25 ross Exp $
+$Id: xycmat10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycmat11.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycmat12.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycmbt10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycmbt11.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycmbt12.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xycmtip.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xycolor.doc,v 3.3 1996/12/19 03:50:08 ross Exp $
+$Id: xycrayon.doc,v 3.3 1996/12/18 08:58:16 ross Exp $
+$Id: xycurve.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyd.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyd2.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xydash10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xydoc.bib,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+$Id: xydoc.sty,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xydocps.doc,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+$Id: xydummy.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xydvidrv.doc,v 3.3 1996/12/18 09:12:40 ross Exp $
+$Id: xydvips.doc,v 3.3 1996/12/18 09:13:14 ross Exp $
+$Id: xydvitops.doc,v 3.3 1996/12/18 09:14:36 ross Exp $
+$Id: xyemtex.doc,v 3.3 1996/12/18 09:18:00 ross Exp $
+$Id: xyeuat10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyeuat11.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyeuat12.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyeubt10.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyeubt11.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyeubt12.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyeuler.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyframe.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xygraph.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyguide.man,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+$Id: xyidioms.doc,v 3.4 1997/05/18 01:14:25 krisrose Exp $
+$Id: xyimport.doc,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+$Id: xyknot.doc,v 3.4 1997/05/18 01:13:24 ross Exp $
+$Id: xylatex.ini,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xyline.doc,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+$Id: xyline10.mf,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xymacpat.xyp,v 3.3 1996/12/18 09:25:21 ross Exp $
+$Id: xymatrix.doc,v 3.4 1997/05/18 01:14:25 krisrose Exp $
+$Id: xymisc10.mf,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xymovie.doc,v 3.5 1997/05/28 13:05:01 krisrose Exp $
+$Id: xyoztex.doc,v 3.3 1996/12/18 09:26:26 ross Exp $
+$Id: xypic.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xypic.map,v 3.7 1999/02/16 15:12:50 krisrose Exp krisrose $
+$Id: xypic.sty,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xypoly.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-c.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-col.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-f.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-l.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-pro.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-ps.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-r.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-s.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps-t.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyps.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xypsdict.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xypspatt.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyqc10.mf,v 3.0 1995/07/07 20:14:21 kris Exp $
+$Id: xyrecat.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xyrefer.man,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xyrotate.doc,v 3.3 1996/12/18 09:40:16 ross Exp $
+$Id: xytech.mf,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+$Id: xytest.mf,v 3.3 1996/12/19 04:33:25 krisrose Exp $
+$Id: xytex.ini,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+$Id: xytextures.doc,v 3.3 1996/12/18 09:41:45 ross Exp $
+$Id: xytile.doc,v 3.4 1997/05/18 01:13:24 ross Exp $
+$Id: xytips.doc,v 3.3 1996/12/19 04:12:13 krisrose Exp $
+$Id: xytp-f.doc,v 3.3 1996/12/18 09:49:07 ross Exp $
+$Id: xytpic.doc,v 3.3 1996/12/18 09:50:38 ross Exp $
+$Id: xyv2.doc,v 3.4 1997/05/18 01:14:25 krisrose Exp $
+$Id: xyweb.doc,v 3.3 1996/12/18 09:52:11 ross Exp $
+$Id: xyxdvi.doc,v 3.3 1996/12/18 09:53:22 ross Exp $
diff --git a/Master/texmf-dist/source/generic/xypic/doc2tex.com b/Master/texmf-dist/source/generic/xypic/doc2tex.com
new file mode 100644
index 00000000000..c8d8f04f8be
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/doc2tex.com
@@ -0,0 +1,114 @@
+$!+++
+$!
+$! DOC2TEX.COM
+$!
+$! This procedure creates the *.TEX files from the *.DOC files of the XYpic
+$! package. It must be run from the XYpic source directory.
+$!
+$! R.Gaertner, based on personal communication with K.H.Rose
+$!
+$!---
+$ set noon
+$!
+$! loop over all files
+$!
+$file_loop:
+$ file = f$search("*.doc",1)
+$ if file .nes. ""
+$ then
+$ write sys$output "processing ''file' ..."
+$ !
+$ ! get the filename and open a temporary work file
+$ !
+$ name = f$parse(file,,,"NAME")
+$ open/write tmp 'name'.tmp
+$ open/read src 'file'
+$ !
+$ ! set control flags
+$ !
+$ hdr = "TRUE"
+$ skip = "FALSE"
+$ !
+$ ! loop through the source file
+$ !
+$ line = ""
+$loop:
+$ read/end=end_loop src line
+$ if hdr
+$ then ! copy the lines from start to the first "\DOCMODE" line
+$ if (f$length(line) .ge. 8) .and. (f$extract(0,8,line) .eqs. "\DOCMODE")
+$ then hdr = "FALSE"
+$ skip = "TRUE" ! stop copying
+$ goto loop
+$ endif
+$ ! the first \DOCMODE-line may also indicate the start of the body part
+$ if (f$length(line) .ge. 9) .and. (f$extract(0,9,line) .eqs. "\DOCMODE(")
+$ then skip = "FALSE" ! start copying
+$ goto loop
+$ endif
+$ else ! extract the lines between "\DOCMODE(" and "\DOCMODE)"
+$ if (f$length(line) .ge. 9) .and. (f$extract(0,9,line) .eqs. "\DOCMODE(")
+$ then skip = "FALSE" ! start copying
+$ goto loop
+$ endif
+$ if (f$length(line) .ge. 9) .and. (f$extract(0,9,line) .eqs. "\DOCMODE)")
+$ then skip = "TRUE" ! stop copying
+$ goto loop
+$ endif
+$ endif
+$ !
+$ ! skip empty lines
+$ !
+$ if f$edit(line,"COLLAPSE") .eqs. "" then goto loop
+$ !
+$ ! skip comment lines (starting with a single percent character)
+$ !
+$ if (line .eqs. "%") .or. -
+ ((f$length(line) .ge. 2) .and. -
+ (f$extract(0,1,line) .eqs. "%") .and. -
+ (f$extract(1,1,line) .nes. "%")) then goto loop
+$ !
+$ ! all preprocessing & checks done, copy the input line
+$ !
+$ if .not. skip then write tmp line
+$ goto loop
+$ !
+$ ! close source & work file
+$ !
+$end_loop:
+$ close tmp
+$ close src
+$ !
+$ ! convert the work file to standard text format and delete the work file
+$ !
+$ if f$search("text.fdl",2) .eqs. ""
+$ then create text.fdl
+SYSTEM
+ SOURCE OpenVMS
+
+FILE
+ ORGANIZATION sequential
+
+RECORD
+ BLOCK_SPAN yes
+ CARRIAGE_CONTROL carriage_return
+ FORMAT variable
+ SIZE 0
+
+$ endif
+$ convert/fdl=text.fdl 'name'.tmp 'name'.tex
+$ delete/nolog 'name'.tmp;*
+$ !
+$ ! process the next source
+$ !
+$ goto file_loop
+$ endif
+$ write sys$output "all done"
+$!
+$! clean up
+$!
+$ delete/nolog text.fdl;*
+$
+$ exit
+$!
+$! End of DOC2TEX.COM
diff --git a/Master/texmf-dist/source/generic/xypic/dvitogif89a b/Master/texmf-dist/source/generic/xypic/dvitogif89a
new file mode 100644
index 00000000000..f413b853fa9
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/dvitogif89a
@@ -0,0 +1,207 @@
+#!/bin/sh
+# $Id: dvitogif89a,v 3.5 1997/05/28 13:05:01 krisrose Exp $
+#
+# Pack consecutive pages of TeX DVI file as GIF89a animation.
+# Copyright (c) 1996-1997 Kristoffer H. Rose <krisrose@brics.dk>
+#
+# This file is part of the Xy-pic macro package.
+# Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+# See the README and INSTALL files for further information.
+#
+# The Xy-pic package is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# The Xy-pic package is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this package; if not, write to the Free Software Foundation, Inc.,
+# 675 Mass Ave, Cambridge, MA 02139, USA.
+
+NAME=`basename $0`
+SYNOPSIS="Usage: $NAME file[.dvi]"
+DESCRIPTION="Pack consecutive pages of TeX DVI file as GIF89a animation."
+
+# Crop efficiently if possible.
+#
+if [ -n "`which pnmrawtopcropwhite`" ]
+then
+ cropwhite="pnmrawtopcropwhite |pnmcrop -white"
+elif [ -x ./pnmrawtopcropwhite ]
+then
+ cropwhite="./pnmrawtopcropwhite |pnmcrop -white"
+else
+ cropwhite="pnmcrop -white"
+fi
+
+# Check files.
+#
+ok=yes
+#
+if [ $# -ne 1 ]; then ok=no; fi
+#
+dvi="$1.dvi"
+if [ ! -f "$dvi" ]
+then
+ dvi="$1"
+ if [ ! -f "$dvi" ]; then ok=no; fi
+fi
+#
+base=`basename "$dvi" .dvi`
+size="$base.size"
+#
+if [ ! -f "$size" ]
+then
+ echo $NAME": could not find $size file!" >&2
+ ok=no
+else
+ eval `cat "$size"`
+ if [ -z "$dpi" -o -z "$delay" ]
+ then
+ echo $NAME": could not interpret $size file!" >&2
+ ok=no
+ fi
+fi
+#
+if [ $ok = no ]
+then
+ echo $SYNOPSIS >&2; exit 2
+fi
+
+# Initialise.
+#
+echo "${NAME}: Animating $base."
+rm -f $base.ps $base.[0-9][0-9][0-9].*
+#
+exec 2>"$base.log"
+set -x
+#
+date "+${NAME} Animating $dvi (log started %c)" >&2
+
+# Produce PostScript file!
+#
+echo -n "Producing PostScript..."
+echo "Producing PostScript:" >&2
+dvips -D $dpi "$base.dvi" -o "$base.ps"
+if [ $? -ne 0 ]; then echo "failed, aborting"; exit 1; else echo "done"; fi
+echo '' >&2
+
+# Produce PPM files!
+#
+echo -n "Producing PPMs"
+echo "Producing PPMs:" >&2
+echo '' \
+| gs -sOutputFile="|$cropwhite >$base.%03d.ppm" \
+ -sDEVICE=ppmraw -r$dpi - "$base.ps" 2>&1 \
+| while read ln; do
+ echo "$ln" >&2
+ case "$ln" in
+ *cols*off*the*left) echo -n . ;;
+ esac
+ done
+if [ $? -ne 0 ]; then echo "failed, aborting"; exit 1; else echo "done"; fi
+echo '' >&2
+
+# Measure first image and alert user.
+#
+top=0 bottom=0 left=0 right=0 height=0 width=0
+eval `pnmcrop -black "$base.001.ppm" |pnmfile |\
+ sed -n -e 's/.*[ \t]\([0-9]*\) by \([0-9]*\).*$/ width=\1 height=\2/p'`
+length=`echo $base.[0-9][0-9][0-9].ppm | wc -w | tr -d " \t"`
+#
+echo "Animation has $length frames of ${width}x${height}."
+echo "Length: $length" >&2
+echo "Image size: ${width}x${height}" >&2
+
+# Convert to incremental GIFs!
+#
+echo -n "Producing GIFs"
+lastppm=
+for ppm in $base.[0-9][0-9][0-9].ppm
+do
+
+ echo -n "."
+ echo -e "\nImage: $ppm" >&2
+
+ # filenames
+ gif="`basename $ppm .ppm`.gif"
+
+ # crop black border [sic]
+ mv $ppm $base.000.ppm
+ pnmcrop -black $base.000.ppm >$ppm
+
+ # produce smallest GIF image and add to gifpack command
+ if [ -z "$lastppm" ]
+ then
+
+ # first bitmap is used directly
+ ppmtogif $ppm > $gif
+ gifpack="gifpack -delay $delay $loop -output $base.gif $gif"
+
+ else
+
+ # measure unchanged border
+ top=0 bottom=0 left=0 right=0 height=0 width=0
+ measures="\
+ `( pnmarith -difference $lastppm $ppm | pnmcrop | pnmfile )2>&1 \
+ | sed -n \
+ -e 's/.*cropping \([0-9]*\) .* \([a-z]*\)$/\2=\1/p' \
+ -e 's/.* \([0-9]*\) by \([0-9]*\).*$/width=\1 height=\2/p'`"
+ eval "$measures"
+
+ # if no change just pass top left pixel
+ if [ $width -lt 1 -o $height -lt 1 ]
+ then
+ width=1; height=1; left=1; top=1
+ fi
+
+ # add GIF with changed rectangle to animation
+ pnmcut $left $top $width $height $ppm | ppmtogif >$gif
+ gifpack="$gifpack +$left,+$top $gif"
+
+ fi
+
+ # prepare next image
+ lastppm=$ppm
+
+done
+echo "done"
+echo '' >&2
+
+echo -n "Packing GIFs..."
+echo -e "\nPacking animation:" >&2
+eval $gifpack >&2
+if [ $? -ne 0 ]; then echo "failed, aborting"; exit 1; else echo "done"; fi
+echo '' >&2
+
+# Clean up.
+#
+rm -f $base.[0-9][0-9][0-9].*
+
+# Done.
+#
+echo Done. >&2
+exit
+
+# $Log: dvitogif89a,v $
+# Revision 3.5 1997/05/28 13:05:01 krisrose
+# Fixed missing breaks bug.
+#
+# Revision 3.4 1997/05/18 01:14:25 krisrose
+# Essential bugfixes.
+#
+# Revision 1.3 1997/05/01 21:32:32 krisrose
+# Changed to exploit pnmrawtopcropwhite hack if available...
+# Output cleaned up; uses log file for the rest.
+#
+# Revision 1.2 1997/05/01 19:23:16 krisrose
+# Doesn't quite work...
+#
+# Revision 1.1 1997/02/11 04:19:23 krisrose
+# Initial revision
+#
+# Based on MakeTeXmovie...
diff --git a/Master/texmf-dist/source/generic/xypic/import1.eps b/Master/texmf-dist/source/generic/xypic/import1.eps
new file mode 100644
index 00000000000..8f0b61238b3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/import1.eps
@@ -0,0 +1,1550 @@
+%!PS-Adobe-2.0 EPSF-1.2
+%%BoundingBox: 0 0 261 261
+%%Creator: Macintosh Mathematica Notebook Front End Version 2.2
+%%Title: Clipboard
+%%CreationDate: Thursday, 29 June 1995 7:24:17 PM
+%%EndComments
+150 dict begin
+/Mfixwid true def
+/Mrot 0 def
+/Mpstart {
+ MathPictureStart
+} bind def
+/Mpend {
+ MathPictureEnd
+} bind def
+/Mscale {
+ 0 1 0 1
+ 5 -1 roll
+ MathScale
+} bind def
+/Plain /Courier findfont def
+/Bold /Courier-Bold findfont def
+/Italic /Courier-Oblique findfont def
+/MathPictureStart {
+ /Mimatrix
+ matrix currentmatrix
+ def
+ gsave
+ newpath
+ Mleft
+ Mbottom
+ translate
+ 1 -1 scale
+ /Mtmatrix
+ matrix currentmatrix
+ def
+ Plain
+ Mfontsize scalefont
+ setfont
+ 0 setgray
+ 0 setlinewidth
+} bind def
+/MathPictureEnd {
+ grestore
+} bind def
+/MathSubStart {
+ Momatrix
+ Mgmatrix Mtmatrix
+ Mleft Mbottom
+ Mwidth Mheight
+ 9 -2 roll
+ moveto
+ Mtmatrix setmatrix
+ currentpoint
+ Mgmatrix setmatrix
+ 11 -2 roll
+ moveto
+ Mtmatrix setmatrix
+ currentpoint
+ 2 copy translate
+ /Mtmatrix matrix currentmatrix def
+ /Mleft 0 def
+ /Mbottom 0 def
+ 3 -1 roll
+ exch sub
+ /Mheight exch def
+ sub
+ /Mwidth exch def
+} bind def
+/MathSubEnd {
+ /Mheight exch def
+ /Mwidth exch def
+ /Mbottom exch def
+ /Mleft exch def
+ /Mtmatrix exch def
+ dup setmatrix
+ /Mgmatrix exch def
+ /Momatrix exch def
+} bind def
+/Mdot {
+ moveto
+ 0 0 rlineto
+ stroke
+} bind def
+/Mtetra {
+ moveto
+ lineto
+ lineto
+ lineto
+ fill
+} bind def
+/Metetra {
+ moveto
+ lineto
+ lineto
+ lineto
+ closepath
+ gsave
+ fill
+ grestore
+ 0 setgray
+ stroke
+} bind def
+/Mistroke {
+ flattenpath
+ 0 0 0
+ {
+ 4 2 roll
+ pop pop
+ }
+ {
+ 4 -1 roll
+ 2 index
+ sub dup mul
+ 4 -1 roll
+ 2 index
+ sub dup mul
+ add sqrt
+ 4 -1 roll
+ add
+ 3 1 roll
+ }
+ {
+ stop
+ }
+ {
+ stop
+ }
+ pathforall
+ pop pop
+ currentpoint
+ stroke
+ moveto
+ currentdash
+ 3 -1 roll
+ add
+ setdash
+} bind def
+/Mfstroke {
+ stroke
+ currentdash
+ pop 0
+ setdash
+} bind def
+/Mrotsboxa {
+ gsave
+ dup
+ /Mrot
+ exch def
+ Mrotcheck
+ Mtmatrix
+ dup
+ setmatrix
+ 7 1 roll
+ 4 index
+ 4 index
+ translate
+ rotate
+ 3 index
+ -1 mul
+ 3 index
+ -1 mul
+ translate
+ /Mtmatrix
+ matrix
+ currentmatrix
+ def
+ grestore
+ Msboxa
+ 3 -1 roll
+ /Mtmatrix
+ exch def
+ /Mrot
+ 0 def
+} bind def
+/Msboxa {
+ newpath
+ 5 -1 roll
+ Mvboxa
+ pop
+ Mboxout
+ 6 -1 roll
+ 5 -1 roll
+ 4 -1 roll
+ Msboxa1
+ 5 -3 roll
+ Msboxa1
+ Mboxrot
+ [
+ 7 -2 roll
+ 2 copy
+ [
+ 3 1 roll
+ 10 -1 roll
+ 9 -1 roll
+ ]
+ 6 1 roll
+ 5 -2 roll
+ ]
+} bind def
+/Msboxa1 {
+ sub
+ 2 div
+ dup
+ 2 index
+ 1 add
+ mul
+ 3 -1 roll
+ -1 add
+ 3 -1 roll
+ mul
+} bind def
+/Mvboxa {
+ Mfixwid
+ {
+ Mvboxa1
+ }
+ {
+ dup
+ Mwidthcal
+ 0 exch
+ {
+ add
+ }
+ forall
+ exch
+ Mvboxa1
+ 4 index
+ 7 -1 roll
+ add
+ 4 -1 roll
+ pop
+ 3 1 roll
+ }
+ ifelse
+} bind def
+/Mvboxa1 {
+ gsave
+ newpath
+ [ true
+ 3 -1 roll
+ {
+ Mbbox
+ 5 -1 roll
+ {
+ 0
+ 5 1 roll
+ }
+ {
+ 7 -1 roll
+ exch sub
+ (m) stringwidth pop
+ .3 mul
+ sub
+ 7 1 roll
+ 6 -1 roll
+ 4 -1 roll
+ Mmin
+ 3 -1 roll
+ 5 index
+ add
+ 5 -1 roll
+ 4 -1 roll
+ Mmax
+ 4 -1 roll
+ }
+ ifelse
+ false
+ }
+ forall
+ { stop } if
+ counttomark
+ 1 add
+ 4 roll
+ ]
+ grestore
+} bind def
+/Mbbox {
+ 1 dict begin
+ 0 0 moveto % str
+ /temp (T) def
+ { gsave
+ currentpoint newpath moveto
+ temp 0 3 -1 roll put temp
+ false charpath flattenpath currentpoint
+ pathbbox
+ grestore moveto lineto moveto} forall
+ pathbbox
+ newpath
+ end
+} bind def
+/Mmin {
+ 2 copy
+ gt
+ { exch } if
+ pop
+} bind def
+/Mmax {
+ 2 copy
+ lt
+ { exch } if
+ pop
+} bind def
+/Mrotshowa {
+ dup
+ /Mrot
+ exch def
+ Mrotcheck
+ Mtmatrix
+ dup
+ setmatrix
+ 7 1 roll
+ 4 index
+ 4 index
+ translate
+ rotate
+ 3 index
+ -1 mul
+ 3 index
+ -1 mul
+ translate
+ /Mtmatrix
+ matrix
+ currentmatrix
+ def
+ Mgmatrix setmatrix
+ Mshowa
+ /Mtmatrix
+ exch def
+ /Mrot 0 def
+} bind def
+/Mshowa {
+ 4 -2 roll
+ moveto
+ 2 index
+ Mtmatrix setmatrix
+ Mvboxa
+ 7 1 roll
+ Mboxout
+ 6 -1 roll
+ 5 -1 roll
+ 4 -1 roll
+ Mshowa1
+ 4 1 roll
+ Mshowa1
+ rmoveto
+ currentpoint
+ Mfixwid
+ {
+ Mshowax
+ }
+ {
+ Mshoway
+ }
+ ifelse
+ pop pop pop pop
+ Mgmatrix setmatrix
+} bind def
+/Mshowax {
+ 0 1
+ 4 index length
+ -1 add
+ {
+ 2 index
+ 4 index
+ 2 index
+ get
+ 3 index
+ add
+ moveto
+ 4 index
+ exch get
+ show
+ } for
+} bind def
+/Mshoway {
+ 3 index
+ Mwidthcal
+ 5 1 roll
+ 0 1
+ 4 index length
+ -1 add
+ {
+ 2 index
+ 4 index
+ 2 index
+ get
+ 3 index
+ add
+ moveto
+ 4 index
+ exch get
+ [
+ 6 index
+ aload
+ length
+ 2 add
+ -1 roll
+ {
+ pop
+ Strform
+ stringwidth
+ pop
+ neg
+ exch
+ add
+ 0 rmoveto
+ }
+ exch
+ kshow
+ cleartomark
+ } for
+ pop
+} bind def
+/Mwidthcal {
+ [
+ exch
+ {
+ Mwidthcal1
+ }
+ forall
+ ]
+ [
+ exch
+ dup
+ Maxlen
+ -1 add
+ 0 1
+ 3 -1 roll
+ {
+ [
+ exch
+ 2 index
+ {
+ 1 index
+ Mget
+ exch
+ }
+ forall
+ pop
+ Maxget
+ exch
+ }
+ for
+ pop
+ ]
+ Mreva
+} bind def
+/Mreva {
+ [
+ exch
+ aload
+ length
+ -1 1
+ {1 roll}
+ for
+ ]
+} bind def
+/Mget {
+ 1 index
+ length
+ -1 add
+ 1 index
+ ge
+ {
+ get
+ }
+ {
+ pop pop
+ 0
+ }
+ ifelse
+} bind def
+/Maxlen {
+ [
+ exch
+ {
+ length
+ }
+ forall
+ Maxget
+} bind def
+/Maxget {
+ counttomark
+ -1 add
+ 1 1
+ 3 -1 roll
+ {
+ pop
+ Mmax
+ }
+ for
+ exch
+ pop
+} bind def
+/Mwidthcal1 {
+ [
+ exch
+ {
+ Strform
+ stringwidth
+ pop
+ }
+ forall
+ ]
+} bind def
+/Strform {
+ /tem (x) def
+ tem 0
+ 3 -1 roll
+ put
+ tem
+} bind def
+/Mshowa1 {
+ 2 copy
+ add
+ 4 1 roll
+ sub
+ mul
+ sub
+ -2 div
+} bind def
+/MathScale {
+ Mwidth
+ Mheight
+ Mlp
+ translate
+ scale
+ /yscale exch def
+ /ybias exch def
+ /xscale exch def
+ /xbias exch def
+ /Momatrix
+ xscale yscale matrix scale
+ xbias ybias matrix translate
+ matrix concatmatrix def
+ /Mgmatrix
+ matrix currentmatrix
+ def
+} bind def
+/Mlp {
+ 3 copy
+ Mlpfirst
+ {
+ Mnodistort
+ {
+ Mmin
+ dup
+ } if
+ 4 index
+ 2 index
+ 2 index
+ Mlprun
+ 11 index
+ 11 -1 roll
+ 10 -4 roll
+ Mlp1
+ 8 index
+ 9 -5 roll
+ Mlp1
+ 4 -1 roll
+ and
+ { exit } if
+ 3 -1 roll
+ pop pop
+ } loop
+ exch
+ 3 1 roll
+ 7 -3 roll
+ pop pop pop
+} bind def
+/Mlpfirst {
+ 3 -1 roll
+ dup length
+ 2 copy
+ -2 add
+ get
+ aload
+ pop pop pop
+ 4 -2 roll
+ -1 add
+ get
+ aload
+ pop pop pop
+ 6 -1 roll
+ 3 -1 roll
+ 5 -1 roll
+ sub
+ div
+ 4 1 roll
+ exch sub
+ div
+} bind def
+/Mlprun {
+ 2 copy
+ 4 index
+ 0 get
+ dup
+ 4 1 roll
+ Mlprun1
+ 3 copy
+ 8 -2 roll
+ 9 -1 roll
+ {
+ 3 copy
+ Mlprun1
+ 3 copy
+ 11 -3 roll
+ /gt Mlpminmax
+ 8 3 roll
+ 11 -3 roll
+ /lt Mlpminmax
+ 8 3 roll
+ } forall
+ pop pop pop pop
+ 3 1 roll
+ pop pop
+ aload pop
+ 5 -1 roll
+ aload pop
+ exch
+ 6 -1 roll
+ Mlprun2
+ 8 2 roll
+ 4 -1 roll
+ Mlprun2
+ 6 2 roll
+ 3 -1 roll
+ Mlprun2
+ 4 2 roll
+ exch
+ Mlprun2
+ 6 2 roll
+} bind def
+/Mlprun1 {
+ aload pop
+ exch
+ 6 -1 roll
+ 5 -1 roll
+ mul add
+ 4 -2 roll
+ mul
+ 3 -1 roll
+ add
+} bind def
+/Mlprun2 {
+ 2 copy
+ add 2 div
+ 3 1 roll
+ exch sub
+} bind def
+/Mlpminmax {
+ cvx
+ 2 index
+ 6 index
+ 2 index
+ exec
+ {
+ 7 -3 roll
+ 4 -1 roll
+ } if
+ 1 index
+ 5 index
+ 3 -1 roll
+ exec
+ {
+ 4 1 roll
+ pop
+ 5 -1 roll
+ aload
+ pop pop
+ 4 -1 roll
+ aload pop
+ [
+ 8 -2 roll
+ pop
+ 5 -2 roll
+ pop
+ 6 -2 roll
+ pop
+ 5 -1 roll
+ ]
+ 4 1 roll
+ pop
+ }
+ {
+ pop pop pop
+ } ifelse
+} bind def
+/Mlp1 {
+ 5 index
+ 3 index sub
+ 5 index
+ 2 index mul
+ 1 index
+ le
+ 1 index
+ 0 le
+ or
+ dup
+ not
+ {
+ 1 index
+ 3 index div
+ .99999 mul
+ 8 -1 roll
+ pop
+ 7 1 roll
+ }
+ if
+ 8 -1 roll
+ 2 div
+ 7 -2 roll
+ pop sub
+ 5 index
+ 6 -3 roll
+ pop pop
+ mul sub
+ exch
+} bind def
+/intop 0 def
+/inrht 0 def
+/inflag 0 def
+/outflag 0 def
+/xadrht 0 def
+/xadlft 0 def
+/yadtop 0 def
+/yadbot 0 def
+/Minner {
+ outflag
+ 1
+ eq
+ {
+ /outflag 0 def
+ /intop 0 def
+ /inrht 0 def
+ } if
+ 5 index
+ gsave
+ Mtmatrix setmatrix
+ Mvboxa pop
+ grestore
+ 3 -1 roll
+ pop
+ dup
+ intop
+ gt
+ {
+ /intop
+ exch def
+ }
+ { pop }
+ ifelse
+ dup
+ inrht
+ gt
+ {
+ /inrht
+ exch def
+ }
+ { pop }
+ ifelse
+ pop
+ /inflag
+ 1 def
+} bind def
+/Mouter {
+ /xadrht 0 def
+ /xadlft 0 def
+ /yadtop 0 def
+ /yadbot 0 def
+ inflag
+ 1 eq
+ {
+ dup
+ 0 lt
+ {
+ dup
+ intop
+ mul
+ neg
+ /yadtop
+ exch def
+ } if
+ dup
+ 0 gt
+ {
+ dup
+ intop
+ mul
+ /yadbot
+ exch def
+ }
+ if
+ pop
+ dup
+ 0 lt
+ {
+ dup
+ inrht
+ mul
+ neg
+ /xadrht
+ exch def
+ } if
+ dup
+ 0 gt
+ {
+ dup
+ inrht
+ mul
+ /xadlft
+ exch def
+ } if
+ pop
+ /outflag 1 def
+ }
+ { pop pop}
+ ifelse
+ /inflag 0 def
+ /inrht 0 def
+ /intop 0 def
+} bind def
+/Mboxout {
+ outflag
+ 1
+ eq
+ {
+ 4 -1
+ roll
+ xadlft
+ leadjust
+ add
+ sub
+ 4 1 roll
+ 3 -1
+ roll
+ yadbot
+ leadjust
+ add
+ sub
+ 3 1
+ roll
+ exch
+ xadrht
+ leadjust
+ add
+ add
+ exch
+ yadtop
+ leadjust
+ add
+ add
+ /outflag 0 def
+ /xadlft 0 def
+ /yadbot 0 def
+ /xadrht 0 def
+ /yadtop 0 def
+ } if
+} bind def
+/leadjust {
+ (m) stringwidth pop
+ .5 mul
+} bind def
+/Mrotcheck {
+ dup
+ 90
+ eq
+ {
+ yadbot
+ /yadbot
+ xadrht
+ def
+ /xadrht
+ yadtop
+ def
+ /yadtop
+ xadlft
+ def
+ /xadlft
+ exch
+ def
+ }
+ if
+ dup
+ cos
+ 1 index
+ sin
+ Checkaux
+ dup
+ cos
+ 1 index
+ sin neg
+ exch
+ Checkaux
+ 3 1 roll
+ pop pop
+} bind def
+/Checkaux {
+ 4 index
+ exch
+ 4 index
+ mul
+ 3 1 roll
+ mul add
+ 4 1 roll
+} bind def
+/Mboxrot {
+ Mrot
+ 90 eq
+ {
+ brotaux
+ 4 2
+ roll
+ }
+ if
+ Mrot
+ 180 eq
+ {
+ 4 2
+ roll
+ brotaux
+ 4 2
+ roll
+ brotaux
+ }
+ if
+ Mrot
+ 270 eq
+ {
+ 4 2
+ roll
+ brotaux
+ }
+ if
+} bind def
+/brotaux {
+ neg
+ exch
+ neg
+} bind def
+/Mabsproc {
+ 0
+ matrix defaultmatrix
+ dtransform idtransform
+ dup mul exch
+ dup mul
+ add sqrt
+} bind def
+/Mabswid {
+ Mabsproc
+ setlinewidth
+} bind def
+/Mabsdash {
+ exch
+ [
+ exch
+ {
+ Mabsproc
+ }
+ forall
+ ]
+ exch
+ setdash
+} bind def
+/MBeginOrig { Momatrix concat} bind def
+/MEndOrig { Mgmatrix setmatrix} bind def
+/sampledsound where
+{ pop}
+{ /sampledsound {
+exch
+pop
+exch
+5 1 roll
+mul
+4 idiv
+mul
+2 idiv
+exch pop
+exch
+/Mtempproc exch def
+{ Mtempproc pop }
+repeat
+} bind def
+} ifelse
+% Here are the short operators
+/g { setgray} bind def
+/k { setcmykcolor} bind def
+/m { moveto} bind def
+/p { gsave} bind def
+/r { setrgbcolor} bind def
+/w { setlinewidth} bind def
+/C { curveto} bind def
+/F { fill} bind def
+/L { lineto} bind def
+/P { grestore} bind def
+/s { stroke} bind def
+
+/MFill {
+ 0 0 moveto
+ Mwidth 0 lineto
+ Mwidth Mheight lineto
+ 0 Mheight lineto
+ fill
+} bind def
+
+/MPlotRegion {
+ 3 index
+ Mwidth mul
+ 2 index
+ Mheight mul
+ translate
+ exch sub
+ Mheight mul
+ /Mheight
+ exch def
+ exch sub
+ Mwidth mul
+ /Mwidth
+ exch def
+} bind def
+
+/Mcharproc
+{
+ currentfile
+ (x)
+ readhexstring
+ pop
+ 0 get
+ exch
+ div
+} bind def
+
+/Mshadeproc
+{
+ dup
+ 3 1
+ roll
+ {
+ dup
+ Mcharproc
+ 3 1
+ roll
+ } repeat
+ 1 eq
+ {
+ setgray
+ }
+ {
+ 3 eq
+ {
+ setrgbcolor
+ }
+ {
+ setcmykcolor
+ } ifelse
+ } ifelse
+} bind def
+
+/Mrectproc
+{
+ 3 index
+ 2 index
+ moveto
+ 2 index
+ 3 -1
+ roll
+ lineto
+ dup
+ 3 1
+ roll
+ lineto
+ lineto
+ fill
+} bind def
+
+/Mcolorimage
+{
+ 7 1
+ roll
+ pop
+ pop
+ matrix
+ invertmatrix
+ concat
+ 2 exch exp
+ 1 sub
+ 3 1 roll
+ 1 1
+ 2 index
+ {
+ 1 1
+ 4 index
+ {
+ dup
+ 1 sub
+ exch
+ 2 index
+ dup
+ 1 sub
+ exch
+ 7 index
+ 9 index
+ Mshadeproc
+ Mrectproc
+ } for
+ pop
+ } for
+ pop pop pop pop
+} bind def
+
+/Mimage
+{
+ pop
+ matrix
+ invertmatrix
+ concat
+ 2 exch exp
+ 1 sub
+ 3 1 roll
+ 1 1
+ 2 index
+ {
+ 1 1
+ 4 index
+ {
+ dup
+ 1 sub
+ exch
+ 2 index
+ dup
+ 1 sub
+ exch
+ 7 index
+ Mcharproc
+ setgray
+ Mrectproc
+ } for
+ pop
+ } for
+ pop pop pop
+} bind def
+
+/Mnodistort true def
+/colorimage {Mcolorimage} bind def
+/image {Mimage} bind def
+/Mleft 0.000000 def
+/Mbottom 261.000000 def
+/Mwidth 261.000000 def
+/Mheight 261.000000 def
+/Mfontsize 12 def
+/Plain /Courier findfont def
+0 Mbottom Mheight neg add 2 mul Mheight add translate
+1 -1 scale
+%!
+%%Creator: Mathematica
+%%AspectRatio: 1
+MathPictureStart
+%% Graphics
+/Courier findfont 10 scalefont setfont
+% Scaling calculations
+0.378378 0.27027 0.378378 0.27027 [
+[ -0.001 -0.001 0 0 ]
+[ 1.001 1.001 0 0 ]
+] MathScale
+% Start of Graphics
+1 setlinecap
+1 setlinejoin
+newpath
+[ ] 0 setdash
+0 g
+p
+p
+.002 w
+.10811 .37838 m
+.10811 .38463 L
+s
+P
+p
+.002 w
+.24324 .37838 m
+.24324 .38463 L
+s
+P
+p
+.002 w
+.51351 .37838 m
+.51351 .38463 L
+s
+P
+p
+.002 w
+.64865 .37838 m
+.64865 .38463 L
+s
+P
+p
+.002 w
+.78378 .37838 m
+.78378 .38463 L
+s
+P
+p
+.002 w
+.91892 .37838 m
+.91892 .38463 L
+s
+P
+p
+.002 w
+0 .37838 m
+1 .37838 L
+s
+P
+p
+.002 w
+.37838 .10811 m
+.38463 .10811 L
+s
+P
+p
+.002 w
+.37838 .24324 m
+.38463 .24324 L
+s
+P
+p
+.002 w
+.37838 .51351 m
+.38463 .51351 L
+s
+P
+p
+.002 w
+.37838 .64865 m
+.38463 .64865 L
+s
+P
+p
+.002 w
+.37838 .78378 m
+.38463 .78378 L
+s
+P
+p
+.002 w
+.37838 .91892 m
+.38463 .91892 L
+s
+P
+p
+.002 w
+.37838 0 m
+.37838 1 L
+s
+P
+P
+0 0 m
+1 0 L
+1 1 L
+0 1 L
+closepath
+clip
+newpath
+p
+p
+p
+p
+p
+.006 w
+s
+s
+s
+s
+s
+s
+s
+0 .95591 m
+.04471 .93809 L
+s
+.04471 .93809 m
+.10223 .92042 L
+.16426 .90735 L
+.22976 .89945 L
+.29759 .89604 L
+.36661 .89539 L
+.43563 .89515 L
+.50347 .89293 L
+.56897 .88661 L
+.631 .87445 L
+.68851 .85514 L
+.74051 .82769 L
+.78612 .79131 L
+.82454 .74525 L
+.85514 .68851 L
+.87737 .61911 L
+.89086 .53158 L
+.89539 .38059 L
+s
+P
+P
+p
+p
+.006 w
+.89539 .37617 m
+.89664 .27804 L
+.90039 .21894 L
+.90657 .16913 L
+.91507 .12436 L
+.92574 .08289 L
+.93841 .0438 L
+.95286 .00657 L
+s
+.9558 0 m
+.95286 .00657 L
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+P
+P
+P
+P
+p
+p
+p
+p
+p
+.002 w
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+.69595 1 m
+.77208 .69545 L
+s
+.77208 .69545 m
+.85135 .37838 L
+.92484 .08443 L
+s
+.94595 0 m
+.92484 .08443 L
+s
+s
+s
+s
+s
+s
+s
+s
+P
+P
+P
+p
+p
+p
+.002 w
+s
+s
+s
+s
+s
+s
+0 .93436 m
+.03574 .92926 L
+s
+.03574 .92926 m
+.10219 .91976 L
+.17568 .90927 L
+.25494 .89794 L
+.33864 .88599 L
+.42532 .8736 L
+.51351 .861 L
+.60171 .8484 L
+.68839 .83602 L
+.77208 .82407 L
+.85135 .81274 L
+.92484 .80224 L
+.99129 .79275 L
+s
+1 .79151 m
+.99129 .79275 L
+s
+s
+s
+s
+s
+s
+s
+P
+P
+P
+p
+p
+p
+.002 w
+s
+s
+s
+s
+s
+s
+.02703 1 m
+.03574 .99129 L
+s
+.03574 .99129 m
+.10219 .92484 L
+.17568 .85135 L
+.25494 .77208 L
+.33864 .68839 L
+.42532 .60171 L
+.51351 .51351 L
+.60171 .42532 L
+.68839 .33864 L
+.77208 .25494 L
+.85135 .17568 L
+.92484 .10219 L
+.99129 .03574 L
+s
+1 .02703 m
+.99129 .03574 L
+s
+s
+s
+s
+s
+s
+s
+P
+P
+P
+p
+p
+p
+.002 w
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+s
+.56757 1 m
+.60171 .96586 L
+s
+.60171 .96586 m
+.68839 .87918 L
+.77208 .79548 L
+.85135 .71622 L
+.92484 .64273 L
+.99129 .57628 L
+s
+1 .56757 m
+.99129 .57628 L
+s
+s
+s
+s
+s
+s
+s
+P
+P
+P
+p
+p
+p
+.002 w
+s
+s
+s
+s
+s
+s
+s
+s
+.15505 1 m
+.17568 .97937 L
+s
+.17568 .97937 m
+.25494 .90011 L
+.33864 .81641 L
+.42532 .72973 L
+.51351 .64154 L
+.60171 .55334 L
+.68839 .46666 L
+.77208 .38297 L
+.85135 .3037 L
+.92484 .23021 L
+.99129 .16376 L
+s
+1 .15505 m
+.99129 .16376 L
+s
+s
+s
+s
+s
+s
+s
+P
+P
+P
+P
+P
+.02 w
+.10811 .91892 Mdot
+.91892 .10811 Mdot
+.73874 .82883 Mdot
+.82883 .73874 Mdot
+.25747 .89758 Mdot
+.89758 .25747 Mdot
+P
+% End of Graphics
+MathPictureEnd
+%%PSTrailer
+end
+
+%%EPS Trailer
diff --git a/Master/texmf-dist/source/generic/xypic/install-tds b/Master/texmf-dist/source/generic/xypic/install-tds
new file mode 100644
index 00000000000..da1dd268d46
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/install-tds
@@ -0,0 +1,147 @@
+#!/bin/sh
+# $Id: install-tds,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+#
+# sh(1) installation of Xy-pic into a TeX Directory Structure system.
+# Copyright (c) 1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+#
+# This file is part of the Xy-pic macro package.
+# Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+# See the README and INSTALL files for further information.
+#
+# The Xy-pic package is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# The Xy-pic package is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this package; if not, write to the Free Software Foundation, Inc.,
+# 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# check that we are in the right place (and get version :)
+
+# greet
+echo ''
+echo ' Welcome to the Xy-pic TDS-compliant installation script!'
+echo ' Copyright (c) 1997-1998 by Kristoffer.Rose@ENS-Lyon.FR'
+echo ' Xy-pic is free software: see the User's Guide for details.'
+echo ''
+echo ' The author has seriously tried to ensure the portability of'
+echo ' this script among all un*x platforms, however, if you experience'
+echo ' problems then don't hesitate to contact me.'
+echo ''
+echo ' See the file INSTALL for details about what this script does.'
+
+# record the argument as TEXMF
+: ${TEXMF:=$1}
+
+# if no TEXMF specified try to figure it out
+: ${TEXMF:=`kpsewhich --expand-var='$TEXMFMAIN' 2>/dev/null`}
+: ${TEXMF:=`kpsexpand '$TEXMFMAIN' 2>/dev/null`}
+: ${TEXMF:=`kpsewhich --expand-var='$TEXMF' 2>/dev/null`}
+: ${TEXMF:=`kpsexpand '$TEXMF' 2>/dev/null`}
+
+if [ -d "$TEXMF" ]
+then
+ echo ''
+ echo "TEXMF directory $TEXMF found."
+else
+ echo ''
+ echo 'ERROR: I could not find the TEXMF directory (tried '"$TEXMF"')!' >&2
+ echo 'Usage: ./support/install-tds [TEXMF]' >&2
+ echo 'Xy-pic installation aborted.'
+ exit 2
+fi
+
+# get confirmation
+echo ''
+echo ' This script will install Xy-pic under the indicated TEXMF tree.'
+echo ' We assume that it is the root of a standard TeX Directory Structure.'
+echo ''
+echo ' Also we asume that the commands find, grep, mkdir, and cp, conform'
+echo ' to their POSIX specification and can be found in the standard path.'
+echo ''
+echo 'Type <enter> to continue (anything else to stop - this is your last chance):'
+read reply
+if [ -z "$reply" ];
+then
+ echo ''
+ echo 'Thanks: proceeding with the installation.'
+else
+ echo 'Xy-pic installation aborted.'
+ exit 1
+fi
+
+# warn user about obsolete files
+echo ''
+echo 'Checking for obsolete files.'
+if [ -d "$TEXMF/dvips/xypic" ]
+then
+
+ files=`find "$TEXMF/dvips" -name "xy*.map" -print 2>/dev/null`
+ if [ -n "$files" ]
+ then
+ echo 'WARNING: xy*.map files exist:'
+ echo $files
+ fi
+
+ files=`find "$TEXMF/dvips" -name psfonts.map -print 2>/dev/null`
+ files=`grep -svl '^xy' $files /dev/null`
+ if [ -n "$files" ]
+ then
+ echo 'WARNING: psfonts.map xy*-font mappings exist in:'
+ echo "$files"
+ fi
+
+ files=`find "$TEXMF/fonts/type1" -name "xy*.pf?" -print 2>/dev/null \
+ | grep -v "$TEXMF/fonts/type1/public/xypic/xy.*[.]pfb"`
+ if [ -n "$files" ]
+ then
+ echo 'WARNING: xy*.pfa or xy*.pfb files exist:'
+ echo "$files"
+ fi
+
+fi
+
+# function for installing simple files in a directory
+installd () {
+ text=$1; shift
+ dir=`eval 'echo ${'$#'}'` # extract last parameter
+ echo "Installing $text in $dir."
+ if mkdir -p "$dir"; then cp -f "$@"
+ else
+ echo ' WARNING: could not make directory - files not installed.'
+ fi
+}
+
+# do the actual installation
+echo ''
+echo 'Installing Xy-pic!'
+
+installd "administrivia" \
+ README CATALOG TRAILER INSTALL* MANIFEST VERSIONS COPYING \
+ "$TEXMF/doc/generic/xypic"
+
+installd "macros" texinputs/* "$TEXMF/tex/generic/xypic"
+installd "font metrics" texfonts/*.tfm "$TEXMF/fonts/tfm/public/xypic"
+installd "font sources" mfinputs/*.mf "$TEXMF/fonts/source/public/xypic"
+installd "ps type1 fonts" type1/*.pfb "$TEXMF/fonts/type1/public/xypic"
+installd "ps pfm fonts" pfm/*.pfm "$TEXMF/fonts/pfm/public/xypic"
+installd "ps afm metrics" afm/*.afm "$TEXMF/fonts/afm/public/xypic"
+installd "ps headers" ps/* "$TEXMF/dvips/xypic"
+
+[ -d doc ] && installd "manuals" doc/* "$TEXMF/doc/generic/xypic"
+
+# done
+echo "Xy-pic installation done."
+exit
+
+# $Log: install-tds,v $
+# Revision 3.7 1999/02/16 15:12:50 krisrose
+# Interim release (Y&Y fonts now free).
+#
+# New with release 3.5...changed significantly for 3.6.
diff --git a/Master/texmf-dist/source/generic/xypic/kris.eps b/Master/texmf-dist/source/generic/xypic/kris.eps
new file mode 100644
index 00000000000..173f4e20770
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/kris.eps
@@ -0,0 +1,587 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: /net/tyr/home/tyr1/kris/Kris/pictures/kris-icon.ps
+%%Creator: XV Version 3.10a Rev: 12/29/94 - by John Bradley
+%%BoundingBox: 0 0 66 86
+%%Pages: 1
+%%DocumentFonts:
+%%EndComments
+%%BeginPreview: 92 119 1 119
+% 5490000000003fffffffffff
+% 5249000080123fffffffffff
+% a924000124085fffffffffff
+% 5210800041412fffffffffff
+% 55450005bebb5bffffffffff
+% a810802af7fed5ffffffffff
+% 52a20017ffff7affffffffff
+% 550840b5ffffedffffffffff
+% 905100afffff573fffffffff
+% 550485bffffffeefffffffff
+% a950417fffffff5fffffffff
+% 920217dffffffd7fffffffff
+% 54a88abfffffb2afffffffff
+% a90457fffffffc7fffffffff
+% 52522efffffffffaffffffff
+% 94809fffffffffffbff7524f
+% 29143ffffffffffffffc000f
+% a522d5fffffffffffffa800f
+% 284977fffffffffff4fe040f
+% a510adffffffffffdd3f010f
+% 2a4357fffffffffff36fa00f
+% 512a57ffffa75ffebcbf800f
+% 5484b6ffff54af53febf400f
+% 89156affff454dedd56fc00f
+% 522aedfffe9256b6ff9fe00f
+% 95456bfffd44894d766fe40f
+% 201b72fff5505202addfe00f
+% 048a7fdffa0204295b37708f
+% 0014eabfd550008255dbb22f
+% 000afd57a02008095137a88f
+% 005cbd3fe808000254afd00f
+% 005aa92a80020000a12ad00f
+% 003ab555e1002204a84fd00f
+% 005e2ea1000000414801a88f
+% 0078f50a480000045257500f
+% 00fb9ae000000002a002f80f
+% 00f6fc90000000080883524f
+% 00fff54000000012a029f5bf
+% 01fff948000001200003bfff
+% 03fef42000000000a909ffff
+% 03fff940000000804005efff
+% 07fd7a12000000000883ffff
+% 03fdfc40000000001003f7ff
+% 07fff11000000000452cffff
+% 07fffa40000000001242bfff
+% 07fff9900000000000a8dfff
+% 07fffb400000000008053fff
+% 07ffffa0000000000000afff
+% 03fd6ba00000000000023fff
+% 03dcffc20000000040005fff
+% 039836d0000000000080bfff
+% 03525f800000001000093fff
+% 03009f1a0000490000003fff
+% 0300bf06800914000002bfff
+% 03102c41d0402a4800007fff
+% 030055003401ff0200b73fff
+% 050001000c0755a0022d7fff
+% 020004200304022009ffffff
+% 05000100008bc89003efffff
+% 03000000006282004f80ffff
+% 05000100002280081650ffff
+% 03008400002022400d667fff
+% 050000400000080819ccf3ff
+% 01000004002000080886ffff
+% 004000000040000010097fff
+% 02800400000000080920ffff
+% 008001000020000000047fff
+% 00c0000000211012044107ff
+% 006000040020000010100fff
+% 00e000000000000001000fff
+% 007001000010008008020fff
+% 007808000008000000405fff
+% 047c0000000401200408bfff
+% 003e0000000294000402ffff
+% 007c8100000000000301ffff
+% 003c000000000000014bffff
+% 007c0800000000080010ffff
+% 003e0020000000000200ffff
+% 003c0200000000800444ffff
+% 001c0000000000010800ffff
+% 002c0000000000083401ffff
+% 00090000000000015013ffff
+% 00180200002000004505ffff
+% 00040000000800001043ffff
+% 00080800002080000007ffff
+% 001a0100000210045427ffff
+% 000c000000100121000fffff
+% 003c000000000004680fffff
+% 003d040000040011c00fffff
+% 003e010000008000201fffff
+% 002f000000000000809fffff
+% 002f000000022001403fffff
+% 003b80000000000a803fffff
+% 001fc10000000002417fffff
+% 000ca0400000012080ffffff
+% 000ce0000000000502ffffff
+% 000350000000000011ffffff
+% 0002a8000000002487ffffff
+% 0000d4100000000007ffffff
+% 0200aa00000000010fffffff
+% 00004504000000841fffffff
+% 00002a81000000201fffffff
+% 00001540000020013fffffff
+% 00000540400000043fffffff
+% 00000a50000000007fffffff
+% 000000a810000000ffffffff
+% 0000010200200004ffffffff
+% 0000008a02000000ffffffff
+% 0000001480080401ffffffff
+% 0000002540020007ffffffff
+% 0000000aa0800017fffffdff
+% 000000012001508ffffa00ff
+% 0000000290040b7fffd100ff
+% 000000002000eafffff400ff
+% 00000000200255ffffc840ff
+% 00000000500082fdfff512ff
+% 00000000200000fffffb55ff
+% 00000000000003ffefffffff
+% 000000000000077fffffffff
+%%EndPreview
+%%EndProlog
+
+%%Page: 1 1
+
+% remember original state
+/origstate save def
+
+% build a temporary dictionary
+20 dict begin
+
+% define space for color conversions
+/grays 92 string def % space for gray scale line
+/npixls 0 def
+/rgbindx 0 def
+
+% lower left corner
+0 0 translate
+
+% size of image (on paper, in 1/72inch coords)
+66.24000 85.68000 scale
+
+% define the colormap
+/cmap 256 string def
+
+
+% load up the colormap
+currentfile cmap readhexstring
+00 01 02 03 04 05 06 07 08 09
+0a 0b 0c 0d 0e 0f 10 11 12 13
+14 15 16 17 18 19 1a 1b 1c 1d
+1e 1f 20 21 22 23 24 25 26 27
+28 29 2a 2b 2c 2d 2e 2f 30 31
+32 33 34 35 36 37 38 39 3a 3b
+3c 3d 3e 3f 40 41 42 43 44 45
+46 47 48 49 4a 4b 4c 4d 4e 4f
+50 51 52 53 54 55 56 57 58 59
+5a 5b 5c 5d 5e 5f 60 61 62 63
+64 65 66 67 68 69 6a 6b 6c 6d
+6e 6f 70 71 72 73 74 75 76 77
+78 79 7a 7b 7c 7d 7e 7f 80 81
+82 83 84 85 86 87 88 89 8a 8b
+8c 8d 8e 8f 90 91 92 93 94 95
+96 97 98 99 9a 9b 9c 9d 9e 9f
+a0 a1 a2 a3 a4 a5 a6 a7 a8 a9
+aa ab ac ad ae af b0 b1 b2 b3
+b4 b5 b6 b7 b8 b9 ba bb bc bd
+be bf c0 c1 c2 c3 c4 c5 c6 c7
+c8 c9 ca cb cc cd ce cf d0 d1
+d2 d3 d4 d5 d6 d7 d8 d9 da db
+dc dd de df e0 e1 e2 e3 e4 e5
+e6 e7 e8 e9 ea eb ec ed ee ef
+f0 f1 f2 f3 f4 f5 f6 f7 f8 f9
+fa fb fc fd fe ff
+pop pop % lose return values from readhexstring
+
+
+% rlecmapimage expects to have 'w h bits matrix' on stack
+/rlecmapimage {
+ /buffer 1 string def
+ /rgbval 3 string def
+ /block 384 string def
+
+ % proc to read a block from file, and return RGB data
+ { currentfile buffer readhexstring pop
+ /bcount exch 0 get store
+ bcount 128 ge
+ { % it's a non-run block
+ 0 1 bcount 128 sub
+ { currentfile buffer readhexstring pop pop
+
+ % look up value in gray map
+ /rgbval cmap buffer 0 get 1 getinterval store
+
+ % and put it in position i in block
+ block exch rgbval putinterval
+ } for
+ block 0 bcount 127 sub getinterval
+ }
+
+ { % else it's a run block
+ currentfile buffer readhexstring pop pop
+
+ % look up value in graymap
+ /rgbval cmap buffer 0 get 1 getinterval store
+
+ 0 1 bcount { block exch rgbval putinterval } for
+
+ block 0 bcount 1 add getinterval
+ } ifelse
+ } % end of proc
+ image
+} bind def
+
+
+92 119 8 % dimensions of data
+[92 0 0 -119 0 119] % mapping matrix
+rlecmapimage
+
+887b857f84988b9c96988b989d999ab1bbbca8bde2efee01ee8ef4f2f1dfe1e0ddccb1ab
+aac7dbe0cb83cbcccdcc8dcca5bab0b5b7bf945b020403000283020001001f00
+8a768378809e99989c9ea29889989cafb6b7b1bfd8f0ee01ee8eeff1f0dfe1dad7c9b6a9
+bdc8cfd1cc8ecccdced0cca6b0adb6bbba8f6a080004008103001f00
+847f787283948a949993a7a69a9b9dabacad84adb9deefee01ee9eedefebe0dcdddacaa7
+969aadb9beaeb7c3c9cdc0a5acafb4b6bd91740a08008400030502002000
+9482897a8a96959996ab9aa39da5aeaaaba6bcd9f1ee01eea1f1e9e3e0ddd8c3b4928999
+a5b5cab4a8a0a9b7b6a3a2a9aaa6aea58a8169412d10002200
+01800177909899989da8a299a0aaacaaabaab6d1ebee96eeeff2d9e2cfb0b4a594757173
+5d7278616c6d6374696c8f6c88728d9c84776d6859563428320600010082020100830002
+01001600
+8e8e82817e96989a9eaca3a4aca8abaa01aaacb4cfeaf0eeeddcd3cfae9f968877725049
+2e4e58413b12275a182c5844564d656b776f73868e593225000b0e0001008102001900
+8f8081837f9a959a99a89f9ea4a5aaabaa9baab1cce8f0ece0dec0c59d7f6a65575c2317
+0914230b1306253f000d960d3b091c53516a4e606b807231432903060100010e09001800
+
+8f898a8d849d979c98a696abaaa3aaabaaa3aab0cae8ece2d7c3a97d6c75887354200403
+000100010400030100090004012345476a6682666b6685665d45310400870003010a0009
+16001600
+a086958b8c9a9c9a96aca9a7a9aaacabada9b3cdeadad5a9957173816e433b3300028102
+000b009a4b77736f576c53656e706252583a37223005150a0d0005040002001100
+8986818c83988e9597a5a901a995a8aaacb6ada9c8e0c9a79173706f5c4b3b1b06020900
+0b009b022c60413c4d502b535774716d585c3d300610323f4b00020a0204001100
+a184998d869a9c9e979b9fa6a9a4a9aeb7b0a8c1c9a496806d69424d571e0d030b040009
+0001020100824811008f00333f5b5567635a6b31170002001100010083081e0e001200
+81848783878b949998999caea9a5b0aaaba7abada9b4ab9a7e736e585566401929000d00
+81020083001f36048b0433536d68706255452e01008100010301840f2b260c0085000301
+000200030084030002010082000401
+908f8487898f9b9998a79fa9a59faab1b9ac01ac8b99806162427177591a0003000d0001
+019108103d4166767d9998747162560a130001000300870900051e180b06000800850102
+00010401
+8282838882888d9997999aaba0a499a3abadb2aca09b956f43415e6647090001000e0081
+02008700100d22466a8b9c849c756a545f895f4f463c281b030100048604000c18305e00
+82000200040081010001008102000000
+9c8e8287898f9b9896a4a6aaa0abadaaaeaa9c8e84493b495929160306000f0001028200
+04009c0003060d0b0a0604082f55686a675d36050401030008110c284f1f050481040302
+03870b1710191f2e2f36
+86898b8981909a999799a7a6a3a79eabafaca39587692c445e33110018003d17001b0089
+03072a38423e634a0f00900003000102123e565365697c898b90958f858f9294929ea5
+9b938f908993999a999fa9ac9da7aeb9b499836e4d353f4d25002a4e0282021a001b0001
+0294002a1a343a2b23162d190f000530366273799faab888b8bbb7bcc4c9c3cbc900c9
+8e999790889b97989aa9a8a999aaada98fa97d7155506c754a241130191e0007001b0081
+03000100921e31324443556f35310423000435608ba7bece01ce86cbcdcfcecfcdcf00cf
+
+9e89938c879398969aacad9b9a9faba89472635f586266333f0002052a00030081000181
+010004008c03060100010004000100010300830001050002009c09000110222741486460
+857832160007121f5395c4cbcecbcccbcac9cc01cc00ce
+a0898e838a9c9d9896a2aba6989aaa9d857f7b777977525f180600082604000102038103
+0005008603050d0002000301038105010101820003009e00080b040300023e514d466974
+948f987852300d3c3563c5cccbc7cccbcacc81cccb81cbcc
+988b8f878e9897969aada6aea3a9a3837c897e8482686b2f010081000383030002008100
+018101000100910500060b0416461700204124140302010002810200980006010e062f19
+4b3c4e426f797781808273624a352c3493cb82cbcecd01cd84d0cdcecfcb
+9e8c9c85899799979aabaea5a7978582a28b8d797b845b0c2c2d03002429040181010381
+03000200b5030a56697fa1683047748492696809061831394c4146524660535b5a442a62
+6b828d75654c4e4a1600426ea1d3d6d9dadbdad9dde2dd
+858880858689999a9996a4a89d9e8e8b8e9887826c628747467c21001758310c00010003
+00b61c002f768295a69563827c7b928184443f474b5963607081513a5369555335536070
+8589695150152510226087c8d0ded8dbd4dadfd4d7
+8a9794928d9c9a969eaca9a197a19e85977e7a6e2d8166688b961706034a180902000402
+008e00085035668e8fa7aca57b8c957b89a28986674b504642525e696a696e3631495149
+545169718f785d4f2e1924122d60b7d9d086d0e1dadcd7cadc
+9d9095948e8f9a989aa8aa9d9c84816c8b754f237f4f8596540c214a2101008200010002
+00b70b614e748192a5aaa4918d989188909967656f7e6765676067625b6d272b51453943
+5d70818872643d3505140324a9c6d9d0ddded7d0cbcf
+9d8a968a9190969b99afab9ba08c5c7c78634d387b7a9c5b462d00080006008100018201
+2100b8003c667f667d8398b4b99e9687a0a79e91888e84968c8a858a7879855d5f3a6758
+5b525a7170847163242146130a216fd3d5cddadde0d4cbd9
+b1989e9d9aa09ca0a7afa9ae9775848075844a425b8d88453c4d200c143b0d000218341d
+42556b9596938b97929da9b2b1aa9aa79aa891a698aeb3b4bca997958a887c785f617c4e
+546178678c64531d0a2e4f2e3d90cfd5d7e0d0dd81ddd0
+babcbebfc0bcbfc1beb2b1a59c6e82689b8852223773625475251e542c54000600114c53
+4f7a628b97b09cabb2a8aab9c0c8c1bdba9a989da9aabdbba0bb929798908788786c866e
+4c4d985e616c6f26031b7344267ecdcac8c5cad0cdc5
+96eeedf3f5e9eaebe8ddcdbc977072989d783e2e645b5468bf68676b615e4a0f00021a42
+655f9b9597a1a9a6999fc6cfd9dad3cdd3c3b0abadbeaebab7b0a9a1999d8a7c7f719188
+835475745d5663720a1167714467a8aaae84aeaca1a0a9
+dbeeedf3f6ebecede5dbcfc587727ca89a62223a414b5669819b8470575f150e083b646c
+939db5b8aeac9d999ccddddbdcdad2dcd0c1c4d1cac8bac1bba5aa9d94837e7b769a9b97
+7d78766c5f665b4b004b896f6aa5afb0b4b0b3b8bd
+afebecedecefeeebdab089975c648a9895545e662f49608f90999c6b4a434c5037456287
+9aafbdc4cec4bcc2c3bcc0d2dea5dedbd2d4c7c6dbdccfcdc7caa8aba5949285898f92af
+a7a07e877b66564b5339047e8a7ababb85bbc0bfbdbbc3
+02f09aefedeee9daaa807a4e6188809b787e6155698e94929f94746a686592655f3a889f
+b0cdc8cec9cfcdd2dacdbbb9c7db8bdbcccfd4c7d8ded9e0dfd1b198b1ac9e8d7a8d9c90
+b0c0b39e8f958c66564a57125a9f77bccd82cdcecd82cdcfd1
+aae4dae9f0edf1e8d9a88e6a376e687e8fa188566389878a838788718b91856973536ba7
+cdcad2ced3cbd6dbb0dbdfdcd1c4b7c3c2c8e0cbd5d8d6d9ded1bbaea9978487899b91ae
+bebaa9a1a297695d675c425a8674b6d0ded6cccacdde
+a6dabce8ebecedddd2b4926c353e5494a99b8267716a5e78828c8f97a2a398847a939d91
+adbecdcc82ccdedf82dfdbdd94dddbd9d1cad3dee1d9d1d2d8d3dbd9bcadaa9599898489
+9299b9bb94bbb8a9a7ac99776b4968588d7baed0cdd7cfd2cfd4
+acdab1e6edebecddd1a0643c184477a39a837d776a50736f7f95aaa5aaa9a3aca3afb9bc
+b8bcb7d0cadbdce2e0de02de9ad9dadfd9dbe1d6c8ced7e0dac0aea19a968b868da4bbc2
+c4b8b4aa90aa9d7f6e576b598370b2cacdcbcfcdcfcd
+a5e3d5edebedefdbc368241c2f6b7e6a65567865396a7d8b8f6a7093a3b3bccbd3c7d6d3
+dee1de81dee387e3dedce4dee8f0ec85ece5e4f2e6df93dfddd1cfc3b9a698979d8a8e9b
+9cb3bdb8c6bebb91bbbfb59d33597d51674aa3cbc8ccc7cdcccd
+9fe6dbecedf2efe6ba2a0e2d1f536e6a6c63573c445a67a3946c8592a4bac3cbd688d6e1
+dcdfdee8e9ecf19ef1e9e3edefebe1edecf0ebeeefe5e3ddd9bcc09baa9f9b9496a0acb4
+cac2bc93bcbdb7c9c1ab5a49796671468bbdb9bbb9bbb8b9
+84e6d8eaedf29cf2d88f000400063052483c472c2b3c5076ad858782a0b1becac9d4dedb
+81dbde01de87e8f0e9e5f1efeae7a2e7edeee7e8f1efeee4dccebcccb79ea8abb8a3adaa
+a8b8bdd0c3b4bfb8bfbcc38628528a526655747c726a686a6760
+a0e3d4e8edefdcc25f0c00070035131f184207182e4b92b78c848da9b1c5cfcbceda86da
+dbdee1e6eaeeb2eee4ecedf1f0eeedeeebdfdee0ded4c4c5bda79ba4b2c0d1aaaca7aebd
+cdc9bfb6bbb9bfb4aa90132841513f480d00010001000000
+88eedae9eee8bb6808000100960301032d660f1423027095a79d8b9a95b9bdcfcededadd
+83dde1e7ef88efeeeceeecedf1f0ee89eeeff0ecdcccbfb2acaa84aab7c1d3dc97dccdb2
+9da5a9becad3c1babcb7ab9c958a6b0b06425256058105000300
+87ebdee9f3dfaa28000200960100385966323c121171969ba69899a5b8c3d0cedadfdb86
+dbdae9e3ebedee06ee81edef9eefe8d6c7b7bec8cddcdbdddee0d8bf96a6a5bbc5cacbbb
+cccac8be9d9c330086003d554d0301000300
+a9f0e0e5f6cd823000150200012d49666a55493201648baeb0ac94a9adc1cdcad9dddcdf
+e1eeecf0eeedee05ee86edeeeae0d5ccd485d4dddbdddbdc85dcdedbcba79c889cb1b7ca
+d0c2c5cbc98ac9ae5e000d0325475a02000400
+89efe0e5eed4830900190001008e42566862534b3849558dadb6b79eaa8eaabdcdcedfdd
+dfdce3ede9edecf0ee06ee8bedece6e9efe5dedbdcdedfde92dedbddc6be9d98a2a8b9cf
+cacdcec5b78139188618070e556908000400
+86ece3e5e9c84e0002009b0108121f454845000a416eb0a1adbbabb2abc8ced5dbdfdee2
+f0f6ed82edeaee02ee86edeff0edefeeef85efedf2e5dedb82dbdcdd03dd93c0cfbbada8
+948d97becab4a089918f933b42004083400002000300
+88f0dfe4ebad4f0701008200030085000b231b19009500357db58483b2a5aaa9d0ddd9dc
+dedcedecedf2ebee09ee01ef87edeee2dcdfdedcdd01dd97dbdecccbc9baa9b49e8a8f99
+9899979ea79e5467425224018101000300
+88f3dde7efb94a1f01000100850a06110607008d00191370aa65679f8dacbbd7e3de8ade
+dddcf4e6dae4e5f0e2ee01ee8fefeeeceaedf0edf0eeefecede3dfdedd02dd81dacc01cc
+8db6acb8b5aa969d9a999497a597758375644a058105000400
+86f1dee2e8bf2e00820004008200120001009a010200140a4c974e278178a9b9ccdcdedd
+dedfe4ebece1e8eee9ee01ee88edefebe1ebf1ecf0ee86eeefeeeae1d9dd03dd81c5cd94
+cdcfbbbdb7b6bec7bec0a9a09c94868070650001000400
+8af1e1d8f3d4522d0e0006009300030007110c1f0f3c2c6750017778a5bbe2d7dd02dd83
+e3e8e3e48fe4f6e4e9f1f0ebeeefe3e8f1eeedefeca1eceef0eaddd8e1dbdfdebcd1cbcc
+d1d6cdbebbcdcacdc5ba9e979e8a7772090203000300
+9ef1eae0f1db7c2205010b381a00176e574359427a56594c044f6d96b7d2dfdd04dd89e6
+eadbe8e1dbe7e4f0ed85edecefeaefed81edff83fff6eeef82efe4dc9adcdeddd3caccca
+d8dcdececddbd9cdccc4afa5ac986855000201000300
+81efee85eeebe8a5340096005c7c1c1571b4d36e4538347156400f22749abad1d6dd02dd
+01e081dfde84dee5dcdbe682e6edef88efe0e9f0ecf0f8feff92ffefeeefdce0dbdfddd9
+cbd1cfd8dbdedad5dd85ddd2c9bfb1ab84ab97574300820003000300
+9eeef1f0eceabd240b2d8994324c94bfe186695903550065701475a0bbcfccdd03dd86e6
+ded9e0dde0dd8addedeeefeee2dee2efeced83edfaffef9eeff0dfdedcdddee0dddfe0de
+e0dbdecedde0dcd1bfafa8a789361d010001000300
+01eea5ecefecbb560269afae6f8eb9acbb9a927f3c2901002192a1acc5c6cad7dbe0e3df
+dee5dddedd84dde1e2eae08ae0d9d3dfdbd8e1dee1e8eb85ebecebdbdfdd06dd8fe1e0e1
+d4dbdadccec3b1a5aa936211000600
+01eebcecefe8ba6301b4cfcdbbbfb7a095acba8c660c0004599db6a862509bb9e1dfddde
+dbdfdee7deddded3d1d2c9cbcec2b9baa9bbb8babdcfdce9d9dadbdd06dd83dfdbcedd01
+dd83cbc7b0a984a98a7201000600
+01eeacecefe6ae5329c8d2cabddfddc99c8981603c2b43407bb2bdcebf8549477bcce3de
+dbdfdadeddd7d3c9c7c5c4bf8fbfb4a69b8c949eabbbc3c1bec6c5d9dd05dd01da8dd0ca
+d5d8e0ccbdaca9a2825c01000600
+89eceef2efe3a74a47dbdab7dac8dfdad9baad79655733578885b8c9cad1cac3a1653a8d
+b7d4e3e0d9dac8ccbdc3bdc7b7b8a9a37f8c868289a6bac7aab9c3cfd6dfe0de86dedfda
+e3d0cbcc01cc88c4b7ae9baca57e19000700
+acf9f5f0efe098595cdde0d7c9dcded5c7abb29697757e8c87b2c7d1d0d2dddbc5946b3f
+67c4bfd1cdc6d6dadbcf93cfbe7f34190c110b15326ab0b7bcbea8b6ccdedc81dcdb8fdb
+ddd1ccc0b8ae9c84987678919f7a000800
+a8f0ecf0efd7976f6cdcdfd4d5ece3e2d1bbc7c0bbac9daa9dc5cecbdadddedfded8c1ad
+714a60b2d3d9aad9e0e5d0824d5d86958980746f7561529fbfbbbcc3cee1dfdddfd8d7bf
+bba39f988a664b677a86957f04000700
+9fecfdf3f0cb988d8adedbd3e0f1e5d6ced2e3d0d6cbb3ac9dbec9cccedddfe0deaadee1
+e2dfcaa46463cadcdadf876493a7a4ada8a5b19c9ea3b28d5db8d4dddfdee5d9d4ccc6a8
+9973492d07890709023743524b0002000600
+8df1f2f1eebb8f7f70e5dbe0eee0dd03dd8adacfc9bb9d9ac2cecbd0dd04ddb2dadee5dd
+c9979fbce2d69e774d8e718fc4ada2aba1aab4b2988cdbdde2f3e6d4d0caae7b53270a27
+58755a3b330500150001000600
+98f7eff5efb88a774edfdee9e4d7e1dfe1dbded3c9cfbaa6a3c985c9d2d7dddedd03dd93
+e4dfdeddd08f6d77d5b19d5789739ddef4b2a9a89da8bebdc1a2d9deebe0ccc4b9ae8471
+10047794a1b5b9ada96e37040201000600
+88f6eef2eeac8b753fdb93dbe2d7e7eff0ded6ded4d6d8c9b9b8c7cadfdcde81dedd02dd
+81dbed9bedf2dddbcdc067a2c5b6896b7cb3f1e1cfaea5b7d0c4cab6acdddedc95dcc4b4
+7b9d47248d9f999da2afbbc0ae6200010001000500
+9bfdebeae8a08e7537d5dddeddeeedf2e8cdd4e7dad7c8b5bccccfdadd05dd97d9deebec
+efeae2cb6dc7dbdde0d6cac3b9c1b6bebcc9cecc9cccd198ccdce1ddd4bc95635a78857a
+4fa0af718a91b1770706014903000400
+95fff8ecd9a2958547ccdddadcedefeceed8e0eee0dcca02ca82d7dedd05ddafd7deeef2
+eae8dda885d1dfdddfe0cecac0b8b3b8bec9dddacec988cbdcdedddac36366b68b58335c
+aad3756587957a048504018d9b54000300
+9bf1e9eddbc1b6a96fc6dbdde6e4f2edefdde9f1e0dbc9cfcaccdbd6dd05dd8dd9e4f0ec
+e5eeeaa3acdedcdbd8cc88cccecabfb7bfccd8db98dbd2b286d3dddcdddec35b79aea49c
+768ebcc382685e977b038403005a44000400
+82f0eee996e9dac9c69aa5d6dce3dde4e1e5d9ecf0ded3d0c9cccfda81dadd05dd8adfea
+e9eeefeee3a2aae0dc01dca8d5cdcac4c8d0d9dfe1d6deddcc95c2dcdedddccb769fbdcb
+d2baa9afad9f978aa778040500040005000300
+01ee8beff0e1dcc8b37accdfd6ddec87ecddc7e6f0decacc8fcccad0d7dfded4ccdbe0dc
+dee0edeff08df0e8deaeabdcdad6cbcdd4dedcde95dedcddd6d4dddcc8a7cdd8dddcd6c8
+a5b4babeb8b9bc01bc8bb0aab6b9440e2300170004000300
+01ee01ef89e9dbd0c05e99d4dde4f091f0ebd3eeefe5cacccbcad0d2d9d6d0cdd9dc83dc
+dde0edb2edecf2e8e6b08fdee3dad3dadfdedfdadbdedacededddbb1c1cdcfd9ddd7cfa9
+b4babcbbb4bbb9b7adb0bcb8685a720f5b01000400
+02ee01ea89dbd3c35f50c0e0ecf0ed8cedd9ecede1cbcccbcdd0ddd9d588d5d3dddee9e8
+edf1f0b2f0eee7dcc976d2dddeddd0dcdad3ccdcdddbcedcded9a1c6d7d1d8e0ded1b2b0
+bbc8c2babbbab8c2bebcb6b0c4c683840002000300
+01ee96f0eaecdbd7ca81088bdaeeefecf2deecf1dfcbcccacbd881d8de86decad0dcdef0
+ef81efeb8aebeff1ddf0e26cc4ddd9de84dedfdad4e08ce0dbdfd8d9e4dda5c9dbe0dfdd
+83ddcfb8bc83bcc0cdbb02bb8acdcec9bdd6f9fbe04603000400
+02ee8aeff1eee1ce890927bce7ef97efeaefe1efdfcdc9c6cedddbdce0ccd8dce2dfe4e9
+e6e8ef87efece5d8a69edfde82dedbd085d0cbdfe0dbe1a0e1dcedcbd2dae0d8d1d8d3d1
+c6afc2c7beb6bec3c9cdc7bfc2f3fdffe84d0004000300
+05ee8bdecfa6010035d0e0dcdeebf08bf0e0c9cabccadfdce0dbcddda2dde5eee0dee8f0
+efeeedefe9daa4d8e0dbded5d4d7dfecf0f3dec5b0d5e1dbe1dedadc95dcd5c9afb7c9ce
+cac2c6bfc4c9b9c0fcebcfbd0003000400
+01ee88ecefe5e0d7ceab320092008dd2dfdeebecf1dfc9cecacdd4deddded8df92dfdeee
+def0f4e2eaedefedf6e8daa0d5dcdfda98dae0dde5e0dcbcb3cbcfd1cbd4dee0dedfdad8
+aeb9c8cbcacc8bccc9bcccc4b996a0ab4907000500
+01ee88eff2d2acd2cbb476028b021589c9deeee9f4d9dfd2cabccadadce2e0d9e2eadcdd
+e3e6f0dde8edf0edeceee9b896c9dfdbdcd6dfddd9a09dcecdc7cdcad7dbdedfdadcd7b5
+adcbcacbcecbcac0b9bca84f964e000700
+01fc89fdffdbbae0dabd8d0c008c00389accdce1dfddd3cdc6d1dd8fdddcdddbdfe1e4f0
+efeeede6ebeceeef81eff08ff0e7ba898cbccabdbc969bb9cccec9cd99cdd6dfdadcdfd8
+dcd8bd67bdc9ccc8cbcacbc0b89d79320004000600
+01fe01ff82e2bede8adec38e07040132b3bab8bb94bbc9cbcdcacbd4dedfdbdddcdee0ed
+eeecf1e7eeef02ef8eeee9e7dcd6c8bbbcc7ced8c1c6dddc85dcded0daddde95deede5dd
+d7cba3678dc6cecbcacbc1ac6a00060007000600
+01ff89feffebcde3dcbf8c0d008b003bb3cadde0dfcac9cdcacc84ccd8dcdedd9adddbe2
+f1edeff0ebedf0f1ecedeadde2dbcad0dfe6f2e0e4cacedf01df90dbdedde0dcdbf3eadd
+d5ccaeb07f8faab685b6a185505f0082000d000700
+03ff90e7cde1dac4810a070041a9cbdcddded2cd01cd8ccad9e0dddbdedde4ebedefeaef
+02ef8ce4dfdde2dfd2cad4daedebefdd87ddd9cbdbe0dbdcdd95dddee0e2efecd9ddc8ac
+b9ccaf968b7f8ba2aeaf03018101000700
+03ff90ebd6e6dfd09811010044adccdbdadedbcda8cdcac9dedcdddcdee2eaf0eeede4e6
+f1ebeee4eae9ddd9c9d1e0def1ecede2dce0d3c5ced8dbdadfdc82dce3ef8fefdde1c9a6
+b4cacfd5cdc8c9ceb8ab028102000800
+03ffc5ecd3e5dcc9b143000449b3c6dddcdddec7cec9cad9dcdddcdee0e6eff1f0e6dde1
+e0e4eee0dcd1c8d4d9dfdaecf0eadadedce0dbc6cfcec0cad2d9e0e2e3dcdbb999a6cacc
+ce88ced3ccc8b7ae0003000800
+01ff98f4f6ecdae2dbc7bf93320576acc8dddbe1dcc0c9cecbd9dddc91dce4e8f0f4ebef
+e3f6e7dddee0c9cad4dedd01dd8be4f6eee3dbebdee1dedcddd985d9bec4c0bed090d0cb
+b8738dbdcccacdcecccecab5a802000900
+90fefdf7fdecdbeaddcdc0a1810582b7c9dc90dce0dcc5cccfced7dcdedcdee6efedefec
+90ecf0ebdbe1cddad9dbdfdddbdfe0e4dfeb96ebeee5e4dbd9decdcfcdc2b4bdc5b49161
+92acc3ccc9cb87cbcdcbbcad5502000900
+01ff98fbffecdff3e5d8bab6883d92b6ccdadddfddc5cbcccfd6dbdf8fdfdde4efebede3
+e1e2eadfd9cde0dedc02dca3dedddee1f3efeeedefebd9e2d6cccdbeaaa5947e6885a9b7
+bdc7cbcccdc7bcb2a51501000900
+92fafffdffecdfeeeadad0bb886e98bbc6d8dedd83ddc3cacc8eccd8dcdde2e7e4eaf0ef
+eddfeeefdc84dcd5ced5dba0dbd9e2dadfe6e3ecf0efecf3eddcdedbceccc8d4c2aea3a6
+95afacb9c2cccbc2bb84bbae7a07000a00
+03ff8cede1f0eedfdac19d86afc4d1dc84dcdeddc0cb88cbcdd0dedcdeebe7ee02ee99f0
+ede8e1d9d3c0bcbbced6dbdadfd8dbdfe6e7edefedf0dedad981d9ce92ceccc1bab2a6a5
+aebabdc9bcbbb9b39f0f01000a00
+82fcfdff8effeddff0eee4deccae629dbccfdfdc8cdcdbbfc3cccbd4dedcdadcddee04ee
+8defe2dbdecec2a19db0b6b7c0c7cb86cbcedee0e3dfd983d9e4dfd692d6cbccc9b7b4ab
+afb9bcbac3bdbcc1bb7307000b00
+82fbfdff99ffeddef1edeae4cea23397bad0d8dddfdac9c4cfcbd2dae0dae381e3ee02ee
+a0f1efedf1e3dadeccb0afc2b3aeaab9b7bcc9cdcfd0cbd0cecadbd4d1c7ccc0b7ac84ac
+aebec4ca88cac4bfd1aa1b0003000a00
+03ff95edddf2ecede1d165238cbdcbdddbdedfd0c5cec7dade02de81e0ee02ee01ec01ee
+a7eadce8e7d4bce1d3dfd0cac0babecacecbcdc2bdbac0bdbbbcabac9b9d9aa6bfccd7c9
+cbd0cb9300820008000a00
+02ff84fde8dfeff089f0df9121236bb6d2d6de90deddd8c8cbcdd7dde0dddfebf0f1efed
+ee02ee92ecdbefeee9d4cbc3e7deddd5e4ead5dbd2bbc382c3b5a891a8aba69a8c88858f
+b7cdddd6cfc7d5bf1300820004000a00
+03ff83ecdfeff08ef0db54072327a8cacedcdfded8c8cb83cbd3dade87dedbe6e3f0efea
+ee01eeabefece0efedf0e4bdbbc8c9dbd7e3f1e3efeadef0e8d4b6bfb0a390685e8bbcdc
+dddee0c9cdbfb702050002000a00
+87fdfbfffeeddfeff091f0ba3550082b55b4cad8dcdfdccecccdd9df88dfdcdbdcdff0ee
+edee01ee01eb8ee5eaedeeecd0c2bbb6c9cae1efeeef90efecfffaeedfe9deb5c37b98ab
+c6dcdedc85dcc9c4be8800820002000b00
+82fefbff97ffe8dff7f5eb95409e322f359acfdeddf2dbd5c7cbd8ddde87dedddbe9eff1
+eaee01ee95ecf3ebedeff0ecd9cac4bcb9bccfdddeefeceefbfaed8aedf3dac8b9889eb6
+d0dedc01dc84c8b8aa39000e00
+81fbff01ff92f2e6fbf4f09c2f5c324c2651d5d0dbece2d9cc88ccd8dddedfdae3d7e882
+e8f0ee02ee85f0e9efeeefed98eddbcec4bac0cdcabfdbe1e8eceee8f0edc5988a8f97ba
+d7de86dedcd7c1b288000f00
+82fbfcff97fff6eaf1faf0b9552e2c54293c69d1d8dfead8d4cedadedd82dddbe584e5de
+f1ebee01ee84efedecefeea2eeefeeebe3dacac5cfd8cfc8cecfcdd2d3c7af988f988f9a
+c8dedddcdecdaaa90201000e00
+81f8ff93fffeeef2edfde1cba24a162e39315180d9deeedb8cdbd0dadedddbdedddbdee8
+f0ee01ee01ec83eeecf0ee98eeedf1ece0dbd5d0ddd9d4d3bbbec3c0c4b7aa9a8d8ea9cf
+dd88dde0d4b7a50f000a000e00
+82f8fcff95ffeeebf1efc9dfdd943d509ba0545b8becdfe8dacedb82dbe0dd01dd88e3e2
+ecefeee1eeefee82eef0ee01ee81f0ee8ceee8e4dddcddd8cdc9b8bab8b987b9acab9e90
+98b8ce87cedbd6b9a05505001000
+9bfcfffefff1eff2eed5e4e3d46863a999545260a6f0ede6e0d9dbdcdd01dd87ded9e6ed
+f0e1e5ef01ef81edee02ee9bedefeae1dedcdfdbdad2cacdcac2b4ada0908d9dc3cecfcd
+b7a19a00820003000f00
+81feff01ff96fbeaefdbedf0ebf1d682656d72637367d5e8efdfced8dd02dd8ad8dee2da
+dfebe3e8ecf0ee02ee81efec87eceaf0eadcdedfdd94dde1cccecbceb8b7adabb8bccacb
+c6ac980a0601001000
+81feffa2fffef9e9dacbe0dfdde6e7c3747f6c767b7d90bcfaf5dcdedddadddedfdedbde
+dfe0da81daef8eeff2eff0eedbeae6eeefedeadfdbde91dedccccbc9cec1bac2b6bfbdd4
+cba9a11b028102001100
+81fcff01ff88f2dbc2c6ede0c6d2f090f0b97769748779747bbcf8e4ddd3d7d8dd01dd01
+de8ce1e2dde1deefedeeeceee2eef081f0ee97eef0eddcdeddcccbc3cfcdc1bbb9b0bccc
+d1ce89150002001200
+a5f7fefffce9dcc7d8eddfdbeadcf3f4ad7277829a777b88c2feedd8d4dee0e2dddfdbdf
+e0dddc8bdce4eff1ecf2e3e4e7f1eeec87eceedcdedcd5cdcc8cccc9bebac0bfc2cbcac1
+3005001400
+89fcfdf5edddccd9c9dfd99ad9f3eef4feeb7f7d93ea977b8284dffff3e3cecdd6cedcde
+dcdddc8fdcdfdee7f0edf0dae0dce8edf0eceedd89dddbcecccacccabfbcba85bacbccc0
+9d00820001028102001100
+81f0eca2ecf2d9ddd6d1ead8e0f0f3edf1fef19a89907672778c87bbfffbf3d5cecad4e1
+dedcdd03dd01ef8dedeee4dfdcdfe4dddfdbdfd7c8ca8bcac4c7c8bfbbbcd1cca0100016
+00
+82efebeda1ede5ece2ddece0eeeadee8f1f9ffe999837b7a7d748e87bdfcf5f2d6cdcecc
+d9dfdd03dd84e1ecefdddb82dbdfdd85dddadfdcded981d9cb01cb88c5bcbeb8c3cebc68
+001700
+02ef9dfadbdcdde9f1e4f5e8e9e2ebf5f8f9f09c878c827e878398b0fffbffd8cb84cbd0
+dddcdd02dd8bdce0efdfdbe1dfdedddedfdd88dddcdfd1cfcccdbfae87aec8c7a8000801
+001500
+8eeff5fcfdf3e6dcdfe1d7f4f6e1dbf181f1ff01ff85ee8f9c88828785878a8dbff7ff86
+ffddd1ccd1dedd02dd8edadddff0e5f0e2dcdddedbdedddedb8ddbddd7d2c8bcb8bcba76
+0a0007001500
+04ff81f7ec8aecf0d3d4d8ecf0e1f0eefdaffdffefaa8f9087998b8c849bc2f7faf4dbc7
+d5dddfd9d2d9dedfdbdde7eae2e0e3e2e1dfdddadddedddaccc3babb81001900
+01fd02ff8cfce6ddf9d8f2ebe1e8f4f7f1ff01ff99fcf3b08d93e2de9b968c9ab8fafffa
+dacbcfd9d4dcd2c9d1dddc8adce7ebe9efede7dbdddcde84dedde0c9c183c1af50001900
+
+03ff87fefffadef0dcecfb87fbecedf8f2fffeff8dfffafeb194d5da98918d869ee3ff94
+fff6d0cbcecacfcbcfced7e1dcdeecefeef0e2dcdd83dddfdedd87ddd5c1b0be00080018
+00
+05ff8ffef9f7deefecfff9eff1eff5fffdfffd93fdfaaa9d9b9295848f8290d5fdffe9ce
+c8ccc6cd86cdcbc7d9dfdbdd91dddfdedadedde1dce0dbdfc4b89f5b0005000500010183
+02000200860001000100010001008302000600
+06ff8cfeffe1faffefeaf1edd5dae6ff81fffe88fefcfbe1a7958d868b818b8c838c9cde
+fc84fce2cccace86cec7babec6d0e082e0dee081e0da8adadddfd9ded2bb992407000c00
+820102008200030003008304000300
+08ff8ce8fae5e9e0f1ecd9e9e7e9feff02ff85fde8af93898585858c8586b0ff90fff8e3
+ccc9ceccbcbabdbfcccfcdd4d1cf8ccfd7d0ced3bea2320c04000a000100030181030001
+0084030408253d833d5d63718371650001810100
+07ff8dfdebf1edebdcf0ece2ebfdfffdff01ff8cfbfffefaa79c9686838d88a9ff01ff91
+f5ddd2c9cfbebbbaaeabb1b0babcc7ccbcbd84bdb1a321008400026b020001000301900b
+294c667d8699a0acbab8bfccc3b214000100
+08ff85fae0f7eeeaef84efe0e6fdff82fffaff04ff90e4b59189a5aa8b9afefffdffede3
+d4cfb9acb9b4afa19c968a868a87927c6367530a0100164a0402082a243e33273c6a7d95
+a4a9adb9bbc4cecdcfceca08000100
+09ff8aefdaf4f9eaf6e8e3ecefff05ffa3fcffeecc8febe6949ffffefffefffadecac2b8
+a69b867f778f86858a68405a27220003009a00030001000a280f0022435f7e96a0adb1c1
+c7c9cbccd0d2ca0001810100
+08ff81feff8bffdbebf4fef1f2f6f9ecf3ff03ff82fefdfe84fef39689868286f9ff01ff
+93fefcffe7c1bdb2a88b6e8988918786622c2605008a000d0900040001000911088c0823
+4874829aa3acb9c5c7c9cb81cbcd85cdae01000300
+0bff8bfdf0ecedeefbf5e5ebfffcff05ff86feffe08e7271ff04ff90fefad1b7c0ac99a7
+c8c2a89e8d793e0e0001008559a516000100050090244f668695a1a7b4bbbebdbbb9bea5
+08000100
+0cff8afdfffde7f0fcf2e6eceeff05ff81fdff85ffefa687fbff05ff8defe4bfc4abd1f1
+ece8dec1850300020087236e070100021b0003008a03051a5460686d7a82888985898281
+4103000100
+0cff8aefe2f4e3d3eefedce4f2ff05ff81fdff01ff82fbc0ff05ff8efcfaebe4bfc2e7f0
+efeecf862f04000100810600820002008300057b00040081030003008406050301038403
+060001000100
+0cff8afaebefe7ebeae5f6f3eeff06ff81feff83fffcfdff03ff99fefffedfeef4dfceff
+f3ed8335371d890602010201000a00010006008104008200010082000100820002000400
+810200
+
+%
+% Compression made this file 93.96% of the uncompressed size.
+%
+
+
+showpage
+
+% stop using temporary dictionary
+end
+
+% restore original state
+origstate restore
+
+%%Trailer
diff --git a/Master/texmf-dist/source/generic/xypic/latin1.sty b/Master/texmf-dist/source/generic/xypic/latin1.sty
new file mode 100644
index 00000000000..c337fb139e9
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/latin1.sty
@@ -0,0 +1,242 @@
+%% $Id: latin1.sty,v 3.4 1997/05/18 03:04:44 krisrose Exp $
+%%
+%% TeX 3 support for ISO 8859-1 (Latin 1) characters.
+%% Copyright (c) 1990-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is not part of the Xy-pic package for graphs and diagrams in
+%% TeX but is distributed with it on the same conditions.
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+
+% NOTE: THIS FILE CONTAINS NON-ASCII 8BIT CHARACTERS!
+
+% USAGE: This should be input using the command
+%
+% \input latin1
+%
+% This will then make those ISO 8859-1 (Latin 1) characters that are present
+% in plain TeX available, and for AMS-TeX users, those available there as
+% well (these are marked %%AMS below).
+
+% First we pull the standard trick of dropping out if already loaded or if
+% this is not TeX 3...
+%
+\ifx\inputlineno\undefined
+ \errhelp{You may continue but some things will not typeset right.}%
+ \errmessage{latin1.sty requires TeX version 3---please update}%
+ \endinput\fi
+\expandafter\ifx\csname latin1.tex\endcsname\relax
+\else \message{[already loaded]}\endinput \fi
+\expandafter\edef\csname latin1.tex\endcsname{%
+ \catcode`\noexpand\@\the\catcode`\@\space
+ \expandafter\let\csname latin1.tex\endcsname=\noexpand\empty}
+\catcode`\@=11
+%
+% Next we define some shorthands that users might like as well.
+%
+\def\forcemathdef#1#2{\gdef#1{\relax\ifmmode#2\else{$#2$}\fi}}
+\def\forcemathchardef#1="#2#3#4#5{\forcemathdef#1{\mathchar"#2#3#4#5 }}
+%
+\def\mathtextdef#1#2#3{%
+ \gdef#1{\relax\ifmmode\def\next{#2}\else\def\next{#3}\fi\next}}
+%
+\def\missingchardef#1{\gdef#1{\space}}
+%
+% Code for slashed fractions [from TeXcercise 11.6]:
+%
+\def\slashedfrac#1#2{\hbox{\kern.1em %
+ \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.11em %
+ /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}}
+%
+% Assumes that columns 3-8 are already set up as ASCII.
+%
+% ISO 8859-1 column 10
+%
+\catcode`\ =\active \let =~
+\catcode`\¡=\active \chardef¡='074
+\catcode`\¢=\active
+ \forcemathdef¢{\mathord{\mathpalette\c@ncel{\fam=0\mkern2mu c}}}
+\catcode`\£=\active \forcemathchardef£="0424
+\catcode`\¤=\active \missingchardef¤ %%Missing: currency
+\catcode`\¥=\active \def¥{\yen} %%AMS (msam)
+\catcode`\¦=\active \missingchardef¦ %%Missing: brokenbar
+\catcode`\§=\active \def§{\S}
+\catcode`\¨=\active \mathtextdef¨\ddot\"
+\catcode`\©=\active \def©{\copyright}
+\def\copyright{{\ooalign{\hfil\raise.07ex\hbox{c}\hfil\crcr\mathhexbox20D}}}
+\catcode`\ª=\active \forcemathdefª{^{\textrm{\b a}}}
+\catcode`\«=\active \missingchardef« %%Missing: guillemotleft
+\catcode`\¬=\active \forcemathchardef¬="023A
+\catcode`\­=\active \missingchardef­
+\catcode`\®=\active \def®{\circledR} %%AMS (msam)
+\catcode`\¯=\active \mathtextdef¯\bar\B %%AMS
+%
+% ISO 8859-1 column 11
+%
+\catcode`\°=\active \forcemathdef°{^\circ}
+\catcode`\±=\active \forcemathchardef±="2206
+\catcode`\²=\active \forcemathdef²{^2}
+\catcode`\³=\active \forcemathdef³{^3}
+\catcode`\´=\active \let´=\'
+\catcode`\µ=\active \forcemathchardefµ="0116
+\catcode`\¶=\active \def¶{\P}
+\catcode`\·=\active \forcemathchardef·="2201
+\catcode`\¸=\active \let¸=\c
+\catcode`\¹=\active \forcemathdef¹{^1}
+\catcode`\º=\active \forcemathdefº{^{\textrm{\b o}}}
+\catcode`\»=\active \missingchardef» %%Missing: guillemotright
+\catcode`\¼=\active \def¼{\slashedfrac14}
+\catcode`\½=\active \def½{\slashedfrac12}
+\catcode`\¾=\active \def¾{\slashedfrac34}
+\catcode`\¿=\active \chardef¿='076
+%
+% ISO 8859-1 columns 12-15, by letter:
+%
+\catcode`\à=\active \defà{\`a}
+\catcode`\À=\active \defÀ{\`A}
+\ifx\inputlineno\undefined\else\uccode`\à=`\À \lccode`\À=`\à \fi
+\catcode`\á=\active \defá{\'a}
+\catcode`\Á=\active \defÁ{\'A}
+\ifx\inputlineno\undefined\else\uccode`\á=`\Á \lccode`\Á=`\á \fi
+\catcode`\â=\active \defâ{\^a}
+\catcode`\Â=\active \defÂ{\^A}
+\ifx\inputlineno\undefined\else\uccode`\â=`\Â \lccode`\Â=`\â \fi
+\catcode`\ã=\active \defã{\~a}
+\catcode`\Ã=\active \defÃ{\~A}
+\ifx\inputlineno\undefined\else\uccode`\ã=`\Ã \lccode`\Ã=`\ã \fi
+\catcode`\ä=\active \defä{\"a}
+\catcode`\Ä=\active \defÄ{\"A}
+\ifx\inputlineno\undefined\else\uccode`\ä=`\Ä \lccode`\Ä=`\ä \fi
+\catcode`\å=\active \letå=\aa
+\catcode`\Å=\active \letÅ=\AA
+\ifx\inputlineno\undefined\else\uccode`\å=`\Å \lccode`\Å=`\å \fi
+%
+\catcode`\æ=\active \chardefæ="1A
+\catcode`\Æ=\active \chardefÆ="1D
+\ifx\inputlineno\undefined\else\uccode`\æ=`\Æ \lccode`\Æ=`\æ \fi
+\uccode"1A="1D \lccode"1D="1A % Scandinavian...
+%
+\catcode`\ç=\active \defç{\c c}
+\catcode`\Ç=\active \defÇ{\c C}
+\ifx\inputlineno\undefined\else\uccode`\ç=`\Ç \lccode`\Ç=`\ç \fi
+%
+\catcode`\è=\active \defè{\`e}
+\catcode`\È=\active \defÈ{\`E}
+\ifx\inputlineno\undefined\else\uccode`\è=`\È \lccode`\È=`\è \fi
+\catcode`\é=\active \defé{\'e}
+\catcode`\É=\active \defÉ{\'E}
+\ifx\inputlineno\undefined\else\uccode`\é=`\É \lccode`\É=`\é \fi
+\catcode`\ê=\active \defê{\^e}
+\catcode`\Ê=\active \defÊ{\^E}
+\ifx\inputlineno\undefined\else\uccode`\ê=`\Ê \lccode`\Ê=`\ê \fi
+\catcode`\ë=\active \defë{\"e}
+\catcode`\Ë=\active \defË{\"E}
+\ifx\inputlineno\undefined\else\uccode`\ë=`\Ë \lccode`\Ë=`\ë \fi
+%
+\catcode`\ì=\active \defì{\`\i}
+\catcode`\Ì=\active \defÌ{\`I}
+\ifx\inputlineno\undefined\else\uccode`\ì=`\Ì \lccode`\Ì=`\ì \fi
+\catcode`\í=\active \defí{\'\i}
+\catcode`\Í=\active \defÍ{\'I}
+\ifx\inputlineno\undefined\else\uccode`\í=`\Í \lccode`\Í=`\í \fi
+\catcode`\î=\active \defî{\^\i}
+\catcode`\Î=\active \defÎ{\^I}
+\ifx\inputlineno\undefined\else\uccode`\î=`\Î \lccode`\Î=`\î \fi
+\catcode`\ï=\active \defï{\"\i}
+\catcode`\Ï=\active \defÏ{\"I}
+\ifx\inputlineno\undefined\else\uccode`\ï=`\Ï \lccode`\Ï=`\ï \fi
+%
+\catcode`\Ð=\active \missingchardefÐ %%Missing: Eth
+\catcode`\ð=\active \missingchardefð %%Missing: eth
+\ifx\inputlineno\undefined\else\uccode`\Ð=`\ð \lccode`\ð=`\Ð \fi
+%
+\catcode`\ñ=\active \defñ{\~n}
+\catcode`\Ñ=\active \defÑ{\~N}
+\ifx\inputlineno\undefined\else\uccode`\ñ=`\Ñ \lccode`\Ñ=`\ñ \fi
+%
+\catcode`\ò=\active \defò{\`o}
+\catcode`\Ò=\active \defÒ{\`O}
+\ifx\inputlineno\undefined\else\uccode`\ò=`\Ò \lccode`\Ò=`\ò \fi
+\catcode`\ó=\active \defó{\'o}
+\catcode`\Ó=\active \defÓ{\'O}
+\ifx\inputlineno\undefined\else\uccode`\ó=`\Ó \lccode`\Ó=`\ó \fi
+\catcode`\ô=\active \defô{\^o}
+\catcode`\Ô=\active \defÔ{\^O}
+\ifx\inputlineno\undefined\else\uccode`\ô=`\Ô \lccode`\Ô=`\ô \fi
+\catcode`\õ=\active \defõ{\^o}
+\catcode`\Õ=\active \defÕ{\^O}
+\ifx\inputlineno\undefined\else\uccode`\õ=`\Õ \lccode`\Õ=`\õ \fi
+\catcode`\ö=\active \defö{\"o}
+\catcode`\Ö=\active \defÖ{\"O}
+\ifx\inputlineno\undefined\else\uccode`\ö=`\Ö \lccode`\Ö=`\ö \fi
+\catcode`\ø=\active \chardefø="1C
+\catcode`\Ø=\active \chardefØ="1F
+\ifx\inputlineno\undefined\else\uccode`\ø=`\Ø \lccode`\Ø=`\ø \fi
+\uccode"1C="1F \lccode"1F="1C % I'm Danish!
+%
+\catcode`\ù=\active \defù{\`u}
+\catcode`\Ù=\active \defÙ{\`U}
+\ifx\inputlineno\undefined\else\uccode`\ù=`\Ù \lccode`\Ù=`\ù \fi
+\catcode`\ú=\active \defú{\'u}
+\catcode`\Ú=\active \defÚ{\'U}
+\ifx\inputlineno\undefined\else\uccode`\ú=`\Ú \lccode`\Ú=`\ú \fi
+\catcode`\û=\active \defû{\^u}
+\catcode`\Û=\active \defÛ{\^U}
+\ifx\inputlineno\undefined\else\uccode`\û=`\Û \lccode`\Û=`\û \fi
+\catcode`\ü=\active \defü{\"u}
+\catcode`\Ü=\active \defÜ{\"U}
+\ifx\inputlineno\undefined\else\uccode`\ü=`\Ü \lccode`\Ü=`\ü \fi
+%
+\catcode`\Ý=\active \defÝ{\'Y}
+\catcode`\ý=\active \defý{\'y}
+\ifx\inputlineno\undefined\else\uccode`\Ý=`\ý \lccode`\ý=`\Ý \fi
+\catcode`\ÿ=\active \defÿ{\"y}
+%
+\catcode`\Þ=\active \missingchardefÞ %%Missing: Thorn
+\catcode`\þ=\active \missingchardefþ %%Missing: thorn
+\ifx\inputlineno\undefined\else\uccode`\þ=`\Þ \lccode`\Þ=`\þ \fi
+%
+\catcode`\ß=\active \letß=\ss
+%
+% ISO 8859-1 columns 12-15, symbols:
+%
+\catcode`\×=\active \forcemathchardef×="2202
+\catcode`\÷=\active \forcemathchardef÷="2204
+%
+\csname latin1.tex\endcsname
+
+% $Log: latin1.sty,v $
+% Revision 3.4 1997/05/18 03:04:44 krisrose
+% Package, now...
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.8 1994/11/07 04:40:31 kris
+% Abandoned.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% New for Xy-pic 2.7 based on latin1.doc of the XPPT distribution.
diff --git a/Master/texmf-dist/source/generic/xypic/movie.cls b/Master/texmf-dist/source/generic/xypic/movie.cls
new file mode 100644
index 00000000000..7c3f29d73f6
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/movie.cls
@@ -0,0 +1,325 @@
+%% $Id: movie.cls,v 3.4 1997/05/18 01:14:25 krisrose Exp $ -*-latex-*-
+%%
+%% ``LaTeX Movie'' document class for DVI animations.
+%% Copyright (c) 1994-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\NeedsTeXFormat{LaTeX2e}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Version.
+
+\def\next$#1: #2 #3${#2}
+\edef\next{\noexpand\ProvidesClass{movie}%
+ [\next$Date: 1997/05/18 01:14:25 $
+ Movies in LaTeX v.\next$Revision: 3.4 $.]}\next
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Options.
+
+% nocaption (omit caption at lower left; default)
+% caption (include caption)
+\newif\ifm@caption
+\DeclareOption{nocaption}{\m@captionfalse}
+\DeclareOption{caption}{\m@captiontrue}
+
+% nocount (omit count at lower left; default)
+% count (include count)
+\newif\ifm@count
+\DeclareOption{nocount}{\m@countfalse}
+\DeclareOption{count}{\m@counttrue}
+
+% notime (omit elapsed time in "seconds"; default)
+% time (include elapsed time)
+\newif\ifm@time
+\DeclareOption{notime}{\m@timefalse}
+\DeclareOption{time}{\m@timetrue}
+
+% loop (make the animation loop; default)
+% once (don't loop)
+\def\loop@@{-ns2}
+\DeclareOption{loop}{\def\loop@@{-ns2}}
+\DeclareOption{once}{\def\loop@@{-once}}
+
+% Paper size (ignored since result is never printed).
+\DeclareOption{a4paper}{}
+\DeclareOption{a5paper}{}
+\DeclareOption{b5paper}{}
+\DeclareOption{letterpaper}{}
+\DeclareOption{legalpaper}{}
+\DeclareOption{executivepaper}{}
+\DeclareOption{landscape}{}
+
+%\vsize=9in \voffset=0in
+%\hsize=7in \hoffset=0in % safe? :)
+
+\newdimen\textheight \textheight=\vsize
+\newdimen\textwidth \textwidth=\hsize
+
+% Font size.
+\renewcommand\normalsize{\fontsize{10}{12}\selectfont}
+\DeclareOption{10pt}{\renewcommand\normalsize{\fontsize{10}{12}\selectfont}}
+\DeclareOption{11pt}{\renewcommand\normalsize{\fontsize{11}{13}\selectfont}}
+\DeclareOption{12pt}{\renewcommand\normalsize{\fontsize{12}{14}\selectfont}}
+
+% Driver (passed on to packages).
+\DeclareOption{cmactex}{\OptionNotUsed}
+\DeclareOption{dvips}{\OptionNotUsed}
+\DeclareOption{dvitops}{\OptionNotUsed}
+\DeclareOption{emtex}{\OptionNotUsed}
+\DeclareOption{ln}{\OptionNotUsed}
+\DeclareOption{oztex}{\OptionNotUsed}
+\DeclareOption{textures}{\OptionNotUsed}
+\DeclareOption{xdvi}{\OptionNotUsed}
+
+% ...remaining options are numeric assignments...
+\def\m@keys{}
+\def\add@m@keys#1{\expandafter\def\expandafter\m@keys\expandafter{\m@keys,#1}}
+\DeclareOption*{\expandafter\add@m@keys\expandafter{\CurrentOption}}
+
+\ProcessOptions*
+
+\LoadClass{article}
+\pagestyle{empty}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Dependencies.
+
+\RequirePackage{keyval} % key=value pair support
+\input xy % Xy-pic kernel (not package to prevent clash)
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Parameters (set via options or the setup).
+
+% pixel=<dimen> (makes \pixels{<number>} a valid <dimen>; default: 1in/300)
+% dpi=<number> (dots per inch ~ pixel=1in/number)
+\newdimen\m@pixel \m@pixel=0.0033333333in
+\define@key{movie}{pixel}{\m@pixel=#1\relax}
+\define@key{movie}{dpi}{\m@pixel=1in \divide \m@pixel by #1\relax}
+
+% height=<dimen>
+% width=<dimen>
+\newdimen\m@height \m@height=2in
+\newdimen\m@width \m@width=2in
+\define@key{movie}{height}{\m@height=#1\relax}
+\define@key{movie}{width}{\m@width=#1\relax}
+
+% tick=<fraction> (set the duration of each frame to <fraction> seconds)
+% fps=<number> (frames per second ~ tick=1/number)
+\newdimen\m@tick \m@tick=0.083333333pt
+\define@key{movie}{tick}{\m@tick=#1pt\relax}
+\define@key{movie}{fps}{\m@tick=1pt \divide \m@tick by #1\relax}
+
+\def\next#1{\setkeys{movie}{#1}}
+\expandafter\next\expandafter{\m@keys}
+\let\m@keys=\undefined
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Setting parameters explicitly...
+
+\def\MovieSetup#1{\setkeys{movie}{#1}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Internals.
+
+\def\m@caption{}
+
+\countdef\m@scene=1 % count1 = scene#
+\countdef\m@frame=2 % count2 = frame# (in scene)
+
+\font\fiverm=cmr5 % safe small font
+
+\newdimen\m@total \m@total=0pt % total elapsed time
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% User accessible progress macros:
+
+\def\theFrame{0}
+\def\theScene{0}
+
+\def\theF{0}
+\def\theFr{1}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% User command: \scene [<fraction>] {...}
+%
+% Produce scene of <fraction> seconds (default: 1.0) with each frame produced
+% by ... centered in vertical mode.
+
+\newif\iflastframe@
+\newdimen\m@length % duration of scene
+\newdimen\m@init % start of zoom
+
+\newcommand\scene{%
+ \@ifnextchar*{\lastframe@true \DN@*{\scene@i}\next@}%
+ {\lastframe@false \scene@i}}
+
+\newcommand\scene@i[1][1]{\scene@ii{#1}}
+
+\def\setm@caption#1{\xdef\m@caption{#1}}
+
+\long\def\scene@ii#1#2{{%
+ \let\caption=\setm@caption
+ \global\advance\m@scene\@ne \edef\theScene{\the\m@scene}%
+ \global\m@frame=\z@ \m@length=#1pt \m@init=\z@
+ \loop
+ \dimen@=\m@frame\m@tick
+ \ifdim\dimen@<\m@length
+ \scene@frame{#2}%
+ \repeat
+ \iflastframe@ \scene@frame{#2}\fi
+ \dimen@=#1pt \advance\dimen@ by -\m@frame\m@tick
+ \ifdim.1\m@tick<\ifdim\dimen@<\z@-\fi\dimen@
+ \dimen@=\m@frame\m@tick
+ \@warning{scene \the\m@scene\space rounded from #1 to
+ \expandafter\unPT@\the\dimen@\space seconds}%
+ \fi}\ignorespaces}
+
+\def\scene@frame#1{\frame@compute
+ \null
+ \vfill
+ \hrule width\m@width
+ \hbox to\m@width{\hss
+ \vbox to\m@height{\hsize=\m@width \null\vfil{#1}\vfil\null}%
+ \hss}%
+ \setbox0=\hbox{%
+ \setbox0=\hbox to\m@width{\hss\fiverm\strut
+ \ifm@caption \m@caption \fi
+ \ifm@time \quad \m@nicetotal s \fi
+ \ifm@count \quad \the\m@scene.%
+ \ifnum\m@frame<100 0\ifnum\m@frame<10 0\fi\fi\the\m@frame\fi}%
+ \dimen0=\dp0 \ht0=0pt \dp0=0pt \raise\dimen0\box0}%
+ \ht0=0pt \dp0=0pt \box0\relax
+ \hrule width\m@width
+ \global\advance\m@frame\@ne
+ \global\advance\m@total\m@tick
+ \eject}
+
+\def\frame@compute{%
+ \edef\theFrame{\the\m@frame}%
+ \dimen@=\m@frame\m@tick \advance\dimen@-\m@init
+ \ifdim\dimen@<\z@ \dimen@=\z@ \fi
+ \ifdim\dimen@>\m@length \dimen@=\m@length \fi
+ \quotient@\theF\dimen@\m@length
+ \dimen@=-\dimen@ \advance\dimen@\m@length
+ \quotient@\theFr\dimen@\m@length}
+
+\def\m@nicetotal{%
+ \edef\tmp{\expandafter\removePT@\the\m@total}%
+ \expandafter\twodecimals@\tmp 00@}
+\def\twodecimals@#1.#2#3#4@{#1.#2#3}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Triggers.
+%
+% Triggers are used to make the individual frames in a scene different! :)
+
+% \F{C} expands to C(F) where F = (#frames / frame#) ; 0.0 < F <= 1.0 .
+% \Fr{C} expands to C(Fr) where Fr = 1 - F .
+
+\def\F{\expandafter\F@\expandafter{\theF}}
+\def\Fr{\expandafter\F@\expandafter{\theFr}}
+
+\def\F@#1#2{#2(#1)}
+
+% \Zoom[A;B]{C} expands C zooming onto the interval [A;B], i.e., within C the
+% interval [0;1] really denotes the (current) interval [A;B] ...
+
+% Specifically: F F inside [A;B]
+% 0;A 0
+% A;B F-A / B-A
+% B;1 1
+
+\newcommand\Zoom[1][0;1]{\Zoom@#1;}
+\def\Zoom@#1;#2;#3{{%
+ \dimen@=#1\m@length \advance\dimen@\m@init
+ \m@length=#2\m@length \advance\m@length\m@init
+ \advance\m@length-\dimen@ \m@init=\dimen@
+ \frame@compute #3}}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Preliminary FADING support...
+%
+% by Ross Moore; depends on Xy-pic `ps' backend...
+%
+% use as a <shape> modifier: \drop[<colour>][!\F\lighten]<object>
+% use as a <shape> modifier: \drop[<colour>][!\F\darken}]<object>
+%
+% \lighten(1) = white \lighten(0) = natural colour
+% \darken (1) = black \darken (0) = natural colour
+%
+\def\lighten@(#1){/@col #1 def{1 sub 1 @col sub mul 1 add}settransfer}
+\def\darken@(#1){/@col #1 def{1 @col sub mul}settransfer}
+
+\xywithoption{ps}{\let\lighten=\lighten@ \let\darken=\darken@}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Dump size file.
+%
+\AtEndDocument{\dumpsizefile}
+
+\newwrite\m@write
+
+{\catcode`p=12 \catcode`t=12 \gdef\unPT@#1pt{#1}}
+
+\def\dumpsizefile{\immediate\openout\m@write=\jobname.size
+%
+ \dimen@=1in \divide\dimen@\m@pixel
+ \immediate\write\m@write{dpi=\number\dimen@}%
+%
+ \dimen@=\m@tick \multiply\dimen@ by 1000\advance\dimen@.5\m@tick
+ \divide\dimen@\p@ \immediate\write\m@write{delay=\number\dimen@}%
+%
+ \immediate\write\m@write{loop=\loop@@}%
+%
+ \immediate\closeout\m@write}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Misc. class-provided commands...
+
+\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
+\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% The End.
+
+\endinput
+
+% $Log: movie.cls,v $
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 1.5 1997/05/13 12:36:26 krisrose
+% Intermediate version; factors function nicely.
+%
+% Revision 1.4 1997/05/01 21:55:44 krisrose
+% Works again.
+%
+% Revision 1.3 1997/02/11 04:20:19 krisrose
+% Fits new dvitogif89a 1.1 :)
+%
+% Moved to Xy-pic hierarchy.
diff --git a/Master/texmf-dist/source/generic/xypic/pnmrawtopcropwhite.c b/Master/texmf-dist/source/generic/xypic/pnmrawtopcropwhite.c
new file mode 100644
index 00000000000..a575cfd2b80
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/pnmrawtopcropwhite.c
@@ -0,0 +1,175 @@
+/* $Id: pnmrawtopcropwhite.c,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+**
+** Crop off top white lines from raw PBM file (efficiently :)
+** Copyright (c) 1991-1998 Kristoffer H. Rose <krisrose@brics.dk>
+**
+** This file is part of the Xy-pic package for graphs and diagrams in TeX.
+** Copyright (c) 1991-1998 Kristoffer H. Rose <krisrose@brics.dk>
+**
+** The Xy-pic package is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2 of the License, or (at your
+** option) any later version.
+**
+** The Xy-pic package is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+** or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+** for more details.
+**
+** You should have received a copy of the GNU General Public License along
+** with this package; if not, write to the Free Software Foundation, Inc.,
+** 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+static const char Id[] =
+"@(#)$Id: pnmrawtopcropwhite.c,v 3.7 1999/02/16 15:12:50 krisrose Exp $\n";
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+/* Globals */
+
+#define PBMRAWMAGIC "P4" /* Portable BitMap magic cookie */
+#define PGMRAWMAGIC "P5" /* Portable GrayMap magic cookie */
+#define PPMRAWMAGIC "P6" /* Portable PixMap magic cookie */
+#define MAGICSIZE 2
+
+static char *me; /* program name */
+
+/* Subroutines */
+
+void oops(void) {
+ fprintf(stderr, "Usage: %s\n", me);
+ exit(1);
+}
+
+void panic(const char *mess) {
+ fprintf(stderr, "Error: %s\nUsage: %s\n", mess, me);
+ exit(2);
+}
+
+void skipcomment(void) {
+ int c;
+ while(1) {
+ switch (c = getchar()) {
+ case EOF: panic("premature EOF on input"); break;
+ case '\n': return;
+ default: break;
+ }
+ }
+}
+
+void skipwhite(void) {
+ int c;
+ while(1) {
+ switch (c = getc(stdin)) {
+ case EOF: panic("premature EOF on input"); break;
+ case ' ': case '\t': case '\r': case '\n': break;
+ case '#': skipcomment(); break;
+ default: ungetc(c, stdin); return;
+ }
+ }
+}
+
+int nextint(const char *what) {
+ int i;
+ skipwhite();
+ if (!scanf("%d", &i)) panic(what);
+ return i;
+}
+
+/* Program */
+
+int main (int argc, char *argv[]) {
+
+ char magic[MAGICSIZE];
+ enum { PBM, PGM, PPM } which;
+ int width, height, newheight, pixelmax;
+
+ int linelength;
+ char *line, *whiteline;
+
+ /* establish identity and proper usage */
+ me = argv[0];
+ if (argc != 1) oops();
+
+ /* magic */
+ if (!fread(magic, 1, MAGICSIZE, stdin))
+ panic("no magic (nothing on standard input)");
+
+ if (!memcmp(magic, PBMRAWMAGIC, MAGICSIZE))
+ which = PBM;
+ else if (!memcmp(magic, PGMRAWMAGIC, MAGICSIZE))
+ which = PGM;
+ else if (!memcmp(magic, PPMRAWMAGIC, MAGICSIZE))
+ which = PPM;
+ else
+ panic("bad magic (standard input not a raw anymap)");
+
+ /* width and height */
+ width = nextint("pixelwidth integer");
+ height = nextint("pixelheight integer");
+ switch (which) {
+ case PBM: pixelmax = 0; break; /* hack (used by memset below) */
+ case PGM: case PPM:
+ pixelmax = nextint("pixelmax integer");
+ if (pixelmax > 255) panic("pixelmax larger than 255");
+ }
+ if (getchar() != '\n')
+ panic("something not a simple newline after width height [pixelmax]");
+
+ /* allocate pixel line */
+ switch (which) {
+ case PBM: linelength = (width + 7) / 8; break;
+ case PGM: linelength = width; break;
+ case PPM: linelength = width * 3; break;
+ }
+ line = (char*)malloc(linelength);
+ if (!line) panic("could not allocate pixel line");
+ whiteline = (char*)malloc(linelength);
+ if (!whiteline) panic("could not allocate white pixel line");
+ memset(whiteline, pixelmax, linelength);
+
+ /* skip white pixel lines */
+ newheight = height;
+ while (fread(line, linelength, 1, stdin)
+ && !memcmp(line, whiteline, linelength)) {
+ newheight--;
+ if (newheight <= 0) panic("entire image blank");
+ }
+
+ /* output revised header */
+ if (newheight < height)
+ fprintf(stderr,"%s: cropping %d rows off the top\n", me, height-newheight);
+ printf("%.*s\n%d %d\n", MAGICSIZE, magic, width, newheight);
+ switch (which) {
+ case PBM: break;
+ case PGM: case PPM:
+ printf("%d\n", pixelmax); break;
+ }
+
+ /* output remainder of image */
+ do {
+ if (!fwrite(line, linelength, 1, stdout)) panic("could not write");
+ } while (fread(line, linelength, 1, stdin));
+ if (!feof(stdin)) panic("input not exhausted");
+
+ return(0);
+}
+
+
+/*
+** $Log: pnmrawtopcropwhite.c,v $
+** Revision 3.7 1999/02/16 15:12:50 krisrose
+** Interim release (Y&Y fonts now free).
+**
+** Revision 1.3 1997/05/01 20:59:51 krisrose
+** Works for all three raw formats now.
+**
+** Revision 1.2 1997/05/01 17:34:58 krisrose
+** Extended to raw PGM and PPM in addition to PBM.
+**
+** Revision 1.1 1997/04/30 21:30:31 krisrose
+** Initial revision
+*/
diff --git a/Master/texmf-dist/source/generic/xypic/ross.eps b/Master/texmf-dist/source/generic/xypic/ross.eps
new file mode 100644
index 00000000000..53b25317b8f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/ross.eps
@@ -0,0 +1,397 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: /net/tyr/home/tyr1/kris/Kris/pictures/rmoore-icon.ps
+%%Creator: XV Version 3.10a Rev: 12/29/94 - by John Bradley
+%%BoundingBox: 0 0 62 84
+%%Pages: 1
+%%DocumentFonts:
+%%EndComments
+%%EndProlog
+
+%%Page: 1 1
+
+% remember original state
+/origstate save def
+
+% build a temporary dictionary
+20 dict begin
+
+% define string to hold a scanline's worth of data
+/pix 86 string def
+
+% define space for color conversions
+/grays 86 string def % space for gray scale line
+/npixls 0 def
+/rgbindx 0 def
+
+% lower left corner
+0 0 translate
+
+% size of image (on paper, in 1/72inch coords)
+61.92000 84.24000 scale
+
+86 117 8 % dimensions of data
+[86 0 0 -117 0 117] % mapping matrix
+{currentfile pix readhexstring pop}
+image
+
+bac0d8d8c5c0c0c5988e7124241d4f63a87a637375c0dacac0c0987a638e9090baa8afaf
+9898c5da8eba8e9ab1bac5c5c5b92438716971a284137138c038385a383c5a381d383838
+3c3c47697e696969696969695a5a
+b9cfc5bac5c0c5b5b171713824244f4f71716f8c94d8d8cae1c0756d75988cc8bac8afb9
+af635a5a47987c9aa8a2c5a8a8cf5a2669386f908e3c6956718e1938383c4f5a5a233c3c
+3c4f5a565a696d5a695a5a695a69
+9abababababaa89a8e7c5a3838324f5375759aafb9e9d7e9b198637ca8e9caccbecfc8ba
+bc445a385a989a909abaa2baa8ba9c2638267e9ab198385a5a7e283838415a41325a383c
+5a4f5a5a697e71697e7e69715a5a
+afa0bac5a8a49aa873713cd8daeadac5ccf0f0ebf1d8f5f0f0f0f3f0d7f1d8d8ebd7ba4f
+38c5afba7c63a28a8ea8babaa2c5e95a3871246da8a226385a23a82438415a5a45453c3c
+413c4f4f5a637e7171697e715a6d
+a2cabcba9aa88e8e7c6369455a4f5a5a4f71b1cce9f0ebddeaeaf0f0ddf1ddddebebf04f
+4f5a6d6d69716d6f6f79b1b1b1babaa8328e245a8e982d135638562438385a5a6d71718e
+7169715a5a7171717e718471716d
+1d385a32382a3824241d243838384f4f383838384f325a5a909098b5cfd8ddeed8cd635a
+5a5a696d715a715a697e718e8e8ea2a87169418e84a869244f3c3838385a1d1d1d1d1d38
+23715a717aa8a29aa8a2bca498a2
+a2c5a2a2b5a8a86f5a38383832381d241d1d1d381d38381d1d2a251d1d2a38385a4f415a
+3838383c415a5a323c56699898a27a8e7e7e563c848e9098715a3c3869a8633838413853
+555a69715a71716f71716d8e6d90
+a8a8a8a8a29a8e8e5a3832381d32381d381d3838381d381d383838384141414f383c6956
+565a565a71717179845a413c38418e7e8e71715a8e8e8e71716d69697cbeafbaaf98af98
+a898afa8a8988ca89c8ea8a89aa8
+24242419242424381d1d38381d381d38382a3838383838383c3c4f4f4153565a413c2338
+38382d381d3841695a3c383c56716f6f8e8e71716956715a2425387cbebac5b998bab9c5
+baa2b998c5c5c0ccbabaa8985a5a
+2a412a283838262424261d1d3232381d381d3823383c32413c53413c535a414124192441
+3c69714f5a3c382a385571413838698e718e7e71714f5a5a3c382a69635a695a5a5a5a5a
+5a6d5a5a696d7e9090908e8e98a2
+382a38382a1d2426261d1a1d243824381d1d245a41414f4f41475a3c411d2a1d3c3c6969
+715a71715a715a69412a4171413c233c698e8e7169713c5a695a382a2426715a5a715a71
+5a715a6d6d7e71b1a890a88e8e98
+55987179719871415a5a32383c38383838381d383c4f3c38415a4138415a5a5a535a4f5a
+4f5a5a5a5a3c41695a69413838411d2a382d4f90b17e41715a5a3c383824906d9075908e
+7a8e907c8a7c908ea8a88e737175
+6971908e6d713c5a5a414f5a3238384f382424415a3c2d38413838415641414f41414f53
+5a4f5a3c3838383c3c41533c281d38382a38415a6da85a4f71565a413838a8ba9898b998
+a89c8a9aa8a0a0b7989498b9c8c8
+5a5a69695a5371716d711d5a5a5a5a5a381d413c41234141413c3c4f3c3c38413c413841
+5a3c414141411d1d3838254141411d4141382a3841415a8e324156715a475a7c907c9063
+636d6d634f7590a8a89890989875
+716971715a5a5a6d6d6d3c5a4f5a5a71383c3c383c3c41413c415a4f413c3c3c3c413c5a
+3c413c2d1d41381d38383c3c234141253c25383828383c697141415a5a5a475a6d6d7171
+7c71906d6d6d8ea8989c8a9aa8a8
+7169716971416d7e7e5a5a3c6d5a5a4f3c414138413c2a416956413841414f412d381d1d
+383841413c2a41381d413c3c3c3c3c3c3c413c2a41383c41697141554f41475a716d5a5a
+6963714f636f6d909aa89aa8a4c0
+988ea898986d38715a7e715a5a5a4f3c382a3841414f4f413c411d414138254125384141
+3c41413c41413c41414f695a715a71717171713c4141413c413c71382a3c415a3c413819
+24243826242a24415a4f41474169
+8e8e9890987e5a6338383c566d71473838412a41534f415a1d242a3c3c2541414141413c
+413c5641694f4f564f567171715e79799a5e79715656413c41383c413838413853234138
+1d242438242a38414147533c3c47
+719aa2908a8e5a4f6d715a4f32383838414138694f4f4141413c3c5a1d3856415a567171
+7171717e98798e8e7aa4a2a4baa4a4a4a2a4ba9a797e714f3c3c2d414141384141696938
+38382438242a243841533c534738
+6db1908e8e7e5a6d6d386d5a71381d38414f41413c5341413c4f4f38413c5a7171717179
+8aa2a4a2a2a2a4a2a4a2c0a8baa4c0bca4babaa4a27971714f3c41413c382538385a7156
+3838381d3824382a383c535a4147
+6da2908e987171696d5a4f5a32382a3c414f69533c5a2a414169413c415571988aa4a4a2
+a2a4c7a4c0a8bcc7c7c7c7c7c7c7c7bca4a6bcbca4a28e79714f4f413c3c4138383c695a
+3241383824242a38383c53413824
+9a98a898908e69717138693823383c3c4f41474f4153414169414f717e7e92c0c7baccc7
+cccce0d8d7d8d8d8c2c2e0c3c3d7c7c7c7c3d7bcbcbca49a987171415a41414141415a71
+5a41415324241d1d38414f53a4a8
+a8558e8e8e715a32714f5a383838413c5a3c416969415a69715a417ea492c0c7cccce2d8
+d7d8c2d5d8d7d8d8d7c2c2d7c2d7c3c3d7c3c7c7bcc7a4a4a27e8e5a4141414f56413869
+695a5332382424242a41415ae1b5
+8e717e8e717e3c4f4f5a5a38384141533c4169697156557156716592c0aac7c3d8c3d8d8
+d8d8d8d8d8c3d7d8d7d7d7c2c2d7d7c7ccb9c3a6bcc7bcc7a4a4a27171565a4f5a695a69
+71695a3c38191d38262a1d28c5b5
+8e71719071695a4f5a5a381d41413c3c4f716956717171717171a4c0a4c3c3ccd8e2d8d7
+d8edd8d8d8d8d8d8d8c2d8d7c2c2c3c3c3b9bcbca6d7c7a6c0a4b59a71845a5a5a7e6d5a
+5a69414f41795e7179865524d8c5
+8e90719098713c537e3838414141414171557171717171715ea2a4a8a8c2c2d5d8d8d7ed
+d7d8d7ebebd8d7c2d8d7e0c2d7d7e0c3e0c3b9c3bcc7d7a6a4baa4a28e71715a695a7169
+5a5a4f41535620414f715519ccd2
+908e718e715a5a4732382a3c413c416971697179717171717ea4c0c3c7c2e5d8d7d8d8e6
+d7e5d8d8d7ebd7d8d8c2d8d8c2d7c3c3c3c7c3d7aac7c7bcbaa4c0baa29871564f5a715a
+5a4f5a5a6971323c41887119d8b1
+8e986d8e847e714f5a2a41283c533c715671717198797171a2a4aac3c7d7d8d7e4ede4d7
+e4e4e6d7d7d8d8d8d8d8c2c2d8c2c3c3d7c3c3c7c3c3c3c7c7a4baa4b5a2717e5a4f695a
+5a5a4f697171414153ad7119d8c2
+98a88e8e8e987169412423414141417198717e7e7e84718ea4aac3d8c3d8d7d8e6e4dde6
+e4eae4ead7e6d7d8d7d8d7c2d7c2d8d7ccc2d7d7ccc3c3c3b9bca4c0c0a2717e695a5a69
+5a5a4f4f565a694153b17e24c5c0
+a298a8b5b1b1905a1d3841383c414169717e798a9898717ec7ccd8d8ccd8d7edede6ddd8
+e4e4eae4edeaddeaead8e6d8d7d8d8c2c2c2c2ccd7ccc3c3c7a6bca492a298565a556971
+5a69566969416955539c692acfb5
+c5bac0b5c0c0715a38383c41384169567ea4a2a2a48e71a2ccccc2d8c3d7d7d7d7eadde4
+eae4e9e9e4e4e4eae4ddd8ebd8d7d8d8d8d8d7c2c3d7d7c3c7bcbc92c0c098717e565a71
+5a5a7169715a696941d5692deac2
+a2bab598c5c05a38413c414123415a71a2a4a4a48e7a98a4ccc2d8d8d8d7e4d8d7eaede4
+eae9e9e9e9e9eae6e6d7e6d8d7ebd8d7d8d8c3d7c2d7c3c3aad7c7bca4a2a4717171717e
+715a69696971693c41e16938e9b5
+a8b1a271a8b53c383c3c3838383c5671a2a48ea4797179a4d8d8c2d8d8d7d7d8e4d8d8ea
+edeaeae0eae4e9eadde4d8d7edd8c2c2d5d8c2d8d8c3e0c3c7aacdbcc0a28e987e556956
+715a3c71715a5a5a7ed26953cfcc
+a8b5b169a89a38413c41381d253c71a4a4a4a4a4798e7acdc2d8d8d8c8d7ddd7eae0e0f5
+e0eae9e4e9e0eaeae4eae4e6d7d7d8d8d8c2d7d8ccd7c3d8e0c7c7c7c0a2799871716984
+7156695669696969a8d17741d8a2
+8e988e5a849a38385a383c2a233c7ea2c0a2a4a279797ec2d5c2d7edd8e4d8e4e4eae4eb
+e9e9e4e9e9e9e0e0e9eaead8edede6d8d8c2d8d8c3d7c2d7c3c7bccdbaa27e9871717190
+717155717171716398ad3838e1a2
+909879715ab538383c38381d385aa4a4a4a4a4c0797aa4d8d8d7d7d8d7eaead7e4e0eae9
+e9e9e0e9e9e9e0fde9e4e0eaedd7d8d7d7d7f3d8c2d8d7ccc2c7bca8c0a48e7171846971
+9c718469717e7e7198d2413cd8d8
+98909a8e6998382338233838417ea4a4a4a4c7a47e86d7d8d7d7edead7eaece0e0e0efef
+efefefefefefebefefe0f5e0e4e5d8d8d7d8d8d8d8d8d8c2c3c7aac0a4a47e8e71697171
+9c717171717171539cb5243cccb5
+b1a8b5a28471413c41382a2356a4a4a4a292d7c07ea4d8d7edd8e4d7ede9e9e9e9efefef
+efeff5efeff5efefefe9edededd8d7d7ebe6d7d8d7d8c2d8c3ccc7bca2a48e7169717184
+7198717e90987147b1d22441cfb1
+b1a8a2b58e69384138381d3871a4a4a4bcc7c2a479aae5d8e4ede4d8e4e0e0efe0e0efef
+eff5f5f5f5f5eff5fdebebe4e4d7d7edd7ebd7d8d8d8d8d8d7d7c7c7a4a271715a557156
+719898847198905addbc1d41e1b5
+a2b1b1c0a27e3c38381d3856a2a4c092c7c7d8a479ccd8d7d7edeaedede7e9e9e9efebef
+efefeff5f5fdefefefe9e0d8edd7d8d7edd7e5d8d8d7d7e2c3e0c7c7a4a28e7141696956
+5671988471717153c2d5383cd8b1
+a898b1a8a8711d411d382a7ea4c0cdc7a6c3cca47ed5d8d8d7edd7d8e0e9efefefebefe9
+efeff5eff5f5efefede0e4ede4d7e5d7d7e6d8d7ebd8d8e0ccc3c3c7bca4715a4f41695a
+697171986971698484d22469c0b5
+9a8ea898988e383c381d1da4a4a4a8c7c7ccc2a4bcd8e0d7edd8d8e6d8e0efe0efe9efeb
+e9efefefefe9ebebebede0e0e4d8edd7edd7d8d8d7d8e0d8e2c3c7c0bca271693c416941
+41416984695a5a5a88b51d47d890
+8e798e8e8ea85a23381d3ca4a4a4a8c7c7c2e0cda8d8d8d8d7e6d8d7e4e9f5e9e9efefef
+efe9efeffde7e0fde9e0edd7edd7ebd7e6d7ebd8d8d8d8d8d7ccd7c7baa48e563c41413c
+534f55564153564190a88e84b571
+5353415a5a2338411d3841a4a4babcc7c7c3ccc7c2d8d5d8e5d8d7e6eae0e0e0efebeffd
+efefebefe7e9e9e9e0e9e0e4d7edd7e6d8d8ddd8d8d8d7d8ccc3d7c0a4a4717141414138
+41415a556941564f90ccc0b5a898
+41383c413c53413c1d2371a4a4c0c7c7cce0e0e0ccd8d5d8d7d8edd7eaebece9eff5efef
+efe0efebeff5e9e9efe9edd8edd7d7d8edd8ebd8ddd8d8d5c2d7c7bcc0c0a28e693c4153
+3c5341416971717190b1b1908e8e
+3c4153473c3c473c38235aa2a4c0a8c7bac3c3ccc2d8c2d8d7d7d8ede0e0e9e9e0e9e9eb
+efe0e9efefe9e9e0e9e0e9d7d7ededd7d8d8d7d7e2d8d8d8c3d7c3c7c7a4a27969414141
+41694153717e5e717e192a3c4138
+414141473c474141413c69a2a4a4bca8c7c3c2e0c3bcd8e2d8d7d7d7edf5e9e0e9e9e9ef
+eff5efebefe0e9efeaedd8d7e6d8d8d7d8d7d8d7d8e5d8cce0c7ccbac0a4a29a694f3828
+3871557e7ea47e92a8c0b9c5baa8
+41533c5a41414f471d38567ea4a4bcc7c7aae0c3c2d8d8e5d7d7ddede4e9e0efefe0efef
+f5efe0efefefebe0f5ede0d7d8d7edd8ebd8d8e2d8d8d8d7c3c7bcbcc0a4a47e55414138
+41556971867e7ea8a8bac5bab5ba
+3838414147474f41382a5a79a2a4a4c7aac7c7cce0c2d8d8d7e6d8d7ede0e0efe0e9f5ef
+f5ebefefebefeff5e0e4e5e5edddd8d7d8d8d8e2d8c3c3d7c3c7c7c7c0a4a49a56535a41
+23696956a4a47992aac0cfc5b9ba
+413c533c3c47415a38383c7a86a2c0c7c7c7c7c3ccc2d8d8d7d7edd7eaebe9e9f5e0eae0
+e0ebe0e0eff5efeaf5d7eaebd8d8d7c3d7c7c7c2d8c2c3c3c7cccdc7a8a4a2a271693c25
+41416971c7a87aa8c2baa0c88a90
+4153414153413c6941384171a2a4bcbaa6c7aaaad7d8d5d8d8d7deded8ecebe9ebefeaed
+e0e9efe0ebebebedd8e5ebd8d8d5c7c7baa4a4c3c7c3b9c3bcc7c0c0c0c0a4a271564141
+3c3c698ea8a88ea8c2bedddaddf0
+715a717171717a5a4138387179a4a4a2a4cdcdc3cce0c3e2d7d8e0d8d7e0e9ebefebd7e0
+e0f5eceadee0ebded8cdcda2a4a4cda8b5c7c0a4a6c7a4a8a8bcc7c0c0a4b5b5797a4141
+415571a29aaa92bad7e4d8baa88e
+32383838325a3838843c38718e867979a4a4a4cdc7ccccd8d8d5d7d8d8e0e0e0ebe0d8ed
+f5e0e5e4e5e5d8cce0a4a48e987ebacdbaa4a4c0c0a8c792a4cdc0c0c0c0c0a2987a6941
+254fa4bac7c3a8c7c3b1ccd8ddeb
+38381d1d382a537171693871717e8e9879a2a2a4a4c3cce0d8ccd8d8e0d8f5e9e0e0e5e0
+e0e0d7d8e0d8a4a2a4985e715671c7a8bca4cda4a4c0cdc092c092a4c0c0a4b5a4718441
+416979c7aac3aaa8c37190717171
+24261326241d3841a2843c695671799898a28e8e8e8e989aa4c0c7c7d8d8d7e0e0e0d8ed
+d7e5d8d8c3cd7171563c414156418e71797998798e86a2a4a4c0c0bac092a4c0a271692a
+3856a4bac3bac2a4987198987169
+13262413262a5a717e5a3c416971798a7e7e79717171565a7e86a4bacdccc2d8eaead8e5
+edd8e2e0bac08e56565671715a56718e7171a4a4a4a486a4a492c0c0c0c0cda4a28e7138
+2556babac2c2c2a4798e98713c69
+988e247119388ea4a898713c5a56565e71717171715a4f413c3c5a71a2cdaad8d8e0edd7
+e0d8c2baa4a4bac092a4b5e9f5eb71716969697ea4a4a4a4a4bac7c7cdc7c7c0a2987141
+4155c2ded7cdd7a8719c98984171
+b5a2197e264190907c8e71415a414171987171717171717a71795e7171a4c0c3d7ead7d7
+e5d5e0a4a492c7a8a4a4cdffffffbcc25555717198a4cd92bac7cdccc3d7bcc7a4985e38
+3c56c0d7d7c2c8928ea2b1a25a71
+9ab1383226988e9ac5bab13c414f568e7171717aa47a9871a486a49a7e797ec7d7d8e0ed
+e0c2babaa4cd9292c0a4e2ffffffe5f85a71717e71a4c7bac7d8ccd7c3d7c7c0a4a27141
+3c71a4c3c2c2c2a479b1b1b15a90
+a484412a3841718471715632568e797971715e71e4e288718a4184a4a4a49a7ed8d8e0ea
+edd7c7a4cdbabaaabac2e5fdffff8888717aa4a4a292aac7ccc3e2d8e0c3c7bca27e7141
+388ebcc3bcc2c26571a4b1b17190
+b55a411d38698e8e908e9838568ea2988e563cd2e9d58855e94171b7a4cd7e86d7d7e0e0
+e4cca8a4baaac2a4cda6d1e5f5f5bca49cb7a28ea4c7ccc2c2d8d8d8c3d7bcc0b5a2843c
+38c0c792a8c3c27e8498b1a25ab1
+c05a552438567e8e79988e4169797ea4714171cdd7bc98713c4171d5cdbaa479d8d7e4ed
+dec3c7a4bac7cca8de8ea8aae0bacda4a4a492a4baccc3c2e2d8d8d7d8c3cda4a2a2713c
+41d1d1c7bababa7171a2b1a269a2
+c024711a5369718e718e7169418e8ea48e71718aa2baa288a4a4a4a49292a4a2c3c2d8d7
+d8c3bca8a4bac2d1aa9292a8baa4c0a4bababac7c2c2d8ccd8d8d7d7c2e0babaa298563c
+98cccdc2e2a4bc5a7198a2a269a2
+a82490266956718e8e8e8e715a71a4a47e7998a47e7ea4a2a4a4a4a4baa8a49aa8c2d7d7
+d8ccbabcbcc7d1bac7cdc7c3c3c2c2c2c2c3c3c3c3aad8d8d8d8d7f3d8e0c0a4a27a7155
+a2cdd1d7d8c792236990b1988498
+712d5a71718e8e8e8e98987e5a71a4a4a4a4a2a4a4a4aac0cda892a8baa47979c3bcd8d7
+c2aac2c7bca892cdc7cdaaaac3babaccc7d5ccd8d8d8d7d7edd7ebd8d8cca4b598988e98
+b7e0d8d8e2e0cd477198a29884a2
+413828384141414f697163905671a4a2a47ea4a4a4ba92bca892cda6c0a47979c3c2c8c8
+d8b9c3a6a8a6c7c7c7c3c7cdaae0d5e0d5d8ccd8d7d7d8d7d7ead8d8ccc3a4a479719898
+a4d1d8d8d8c2cd69908eb1b584a2
+412a242a2a382d2a2a2a38243869a4a4a2a2a2a492c092c0c792c792c079797ec2c2c2c8
+c2c3aac7bca6ccc2c3c2c2d5ccccd5d8ccd8d8d7d7d8eae4ebedead8d8e0c0a28e8e9898
+a4d5e2c2d7baa45a719ab1a271b1
+242a2a2a2a2d2a382a382a2a2a84a4cdcda4c0c0a4baa4a8c7a8c7bca48e8e7ec3c2d7c8
+d7c2a8c3a6c7c3c2d7d5d7d8d7d8d8d7d7d7c2d7d8d7edd8ead7edd8d8c7a49a798e7e8e
+a4d8e0d5c7a498848ea8a2b1a8b5
+192a3c2d2a2a2a2a2d2a2d3c245aa4a4babaa492c0a8a8bcc7a8a8a892797e86a6c2d8c8
+d7c2c3a8c3a8c2c2d8d8e0d7d8d8d7d7d8d7d7d7ead7d8ead8edd7d8d8c7a479798e8e7e
+cdc2c2c3a498a27e8ea890b18ea2
+19382841192a2a2a2d2a2a2a2471a492c7c7b9aac7aacda8aac7c2c7a6a47ea4a8c2e0d7
+c2c2c2c3c2aac2c2c2d7d7d7d8d8e0ede0e0e4ece0e5d7ead8e6d8d8d5d77e79988ea48a
+c0c2cd928e8e9871a8a89a98a298
+2a2a2a2a382a2a2d2a2a2a2a2a71a4c0bac7c3ccc3aac3c7ccaac2c3a479a47e92d8d8d8
+d7c3c2c2c3c3aac2c2d7d8d8edeae0d8e9e0eaede0ededd7d8edd8d8ccba9a717ea4a498
+92d1a47e90a2a88e9898a898a88e
+252d2a2a2a2a2a2a382a2a2a2498a492a8c3c7c3baccc3c2c3c3cca8a8a27ea2bcc2d8d7
+d7c3aac2c2c3c2c2c2d8d8edd7d7e4e0e0e0e9e0e0ecd7d7edd8d8cce0c77e717e989898
+a2868e8e8e90a271a8a298908e7a
+1d2a2a191d192a2a2a2a2a2a2498b1a4a4a6c7aac3c2c2c2c3c2c3c7bca2a48ea8c2d7d7
+d7c3aab9c3c2c2c8d8d7d7d7d8e0e0e9ede0e4e4ead7d7edd8d8d8e0d7c779719aa49898
+a271699890a8988a98a88e718e8e
+38192a2a24242424192a242a243f69a292c0aaccc2c2c2c2c3aac3c3c7a48e98a8c2d8d7
+c2ccc3a6c3c2c2d5c2d7d7e0e0d8e0e9e0e0ead8d7d7d8ddd8e2d7c7c7cd8e71a2989898
+a2798e988e8e988ea8a88e718e7e
+382a2a2a2a2a2a2a2a2a2a382a2a3856a4cda6c3c2c2ccccc2adc2c2c3a49aa4c2c2e4d7
+d8c2c3c3bac7c3aac7c2d7d8d7d7e0e4ece0d8d8d7d8d8d8d8c7c3cdc0ba988ea498a2a4
+ba9a988e8e9a9090a88ea8717990
+2a2a242d192a2d2a2a2a2d2a2a3c3841a492c7aabac2c2c2a8c2bac2c779a4a4c2d7d8d8
+d8c2c3c3c7c2c3c7a8aad7c2c2d8d7d7d8ece0d7d7d7d7d8c3e0aabcc0c098798ea498a4
+a4a2908ea8988e8e8ea88e719869
+2d2a2a2a2a2a2a242a24382a2a411938a2c0a8c7c3c2c2c2c2bac2c3a4a47e92c2c2d8e0
+d8d5d8babac2c2c3c7c7ccccc3c2d7d7e0d7ede6d8ebd8c2e0c7c7c792c0987a8ea2a4a4
+c0a28e8e8e8e8e79a88e8e698e8e
+2a2a3838192a25242a242a2a38532a3898a4a4a6c3c2ccc3aac7aaa4a4a2a4c3c2d8d7d8
+d8c2ccaaa8ccc2c2c7c2d8d7d8d8c2ccd7d8d8d8d8d8d8cccccdd7cda4a2989898a498a4
+a4a2a85e8e987190b1a89863908e
+382a2a2a2a2a2a2a2a38192a2a382a38797e92a8aac2babaaac7aaa4a2a492c7c2d8d7e5
+d7d8d8c3aac2c2aac7d5d7edd7d7d5c2d8d5d8d8d8d8cce0c7c0c7a4b5c0987e9898a2a2
+baa28e7198a88e8ea2988e69a86f
+242a192a2a192a2a1924242a24382a2a418ea4bac7bac7c2c7c2c3c0a47ea4c3d7d7deeb
+e0d8c2c2c3c2c3c792d7e5e0d8d8d8d8d8d8d8ccccc2e2cccdc0cdc0a4b598988ea2a2a4
+b5ba7e63988e9090a2a2907e908e
+1d242a2a382a2a2a242a2a2a242a2a2a3c717ea492c7c7c7ccc3aaa8a4a2a4c2c2d7ebef
+e0c2c2cdc3c2baa4bad8d5d8d8d8e0d8d5e2e0cce0d1d8e0c7c0cdc0a4b59898a4a2a4a2
+c0bca28469847e9890a8717e7190
+2a241924131919242a242a2a2a382a2a386979a2c092c7c7c3bac792a479a4aac8d7efef
+ded5c2baaababacdc2ccd5ccccc7cce0e0e0cce0cccdc3e0cdc0cdcdb7b57198a2a4b1a2
+a4a49a7a5353697e908e717e8e71
+3c38413c41233c413c2d413841382a3c383856a4a4a4a8c7cda4c0a4a4b7a4a4bac2cdcd
+bac0a4a2bababac7bae0baccc3c7e0ccc7d7d1ccc3c7e0c7c0a4cdc0a4b57198a2a4e0a4
+c0c0a4a441536369698e6d719071
+4141413c4138382a38414141413c413c413c41a2a4b5c0aac0c0a4a4a2a4a4a4babacccd
+c0a4cdbac7ccccbae0d1d5cccdbac2d1d1c2d1e0ccd7d5ccc0b5cdcda4b58e98a2b7cca2
+a4a4a2b57153696969845a90906d
+382a381938285341262424241d2a23382d415a79a4a4b5a4a4a2a2a4a4a4a4bca4cdbccd
+bad1cdcdd1c2d1cccccccccccdbaa8bac7cdbaccd8ccd5d7a4b5bac0b7a48ea4a4d1e0a2
+cda4baa48e695c535c843869715a
+191a2a98a4903c84714138382424241d242a2d71a2b5a4a4a4a4a286a4a4b7a4a4bcbac2
+d5bad1bad5d5c2e0d5d5c2c2aacda2a492bac7a8c2e0d8ccc0a4c0b7a2a498a4b5e0d1a2
+cca4a2c069696969698438262624
+b5d2bc71533f5c53719c693c41532a2624242469a2a4a2a2a2a2a4a286a492a4bcbcd5d5
+d8d5bacdd5d7d7cdd5c2cccdbaa479a4a492cdc3d8d8d5d7a4c0c0b5b1a48ab1c3d8cda2
+e0c0a4927e695c69846941381d24
+413c3c3c41413c413c41535369555371719c69697ea4a4b5a2a4a47e7e7ea492a8aaccd1
+cdcdcdc2aacda8a4b7bccda47e8abaccccd7c7c2e2e0d1baa4a4b7b5a2a4a2b1d5e0a2c7
+ccc0ba98715c715c845c695c2a19
+533c53413c3c3c3c413c413c41533c2d383c534169b5c0a4a2a4a4cda47e79988ea4a4ba
+92bacda49acdcde0e9d7e28e657ec2d8d5d1c2d5d8d8e0d1a4b5c0b5a48ea4a2d5c0a4c7
+c7cd7e715c715c5c5c5c69696941
+53413c3c3c3c413c2d3c5341413c41533c533c3c53a4a4a4c0b7a4bcba8a4171c0cdd1cd
+babc9acdece5e4f0f5a4928ea4bad5d7c2ccc7cce2d8bac0b5a2a4b7a27a98b5e0c07ec2
+bcc771695c5c69845c84535c7ec5
+41533c3c533c533c3c533c3c2a5569698e8e798ea290a4a4bacda4c0bc86796b6b71cdd1
+dee9cdbce9e5798e869292c7c3d5d7d5c2bad5cccccccda4a4a2a4b79879bce2cda29ccc
+c0c069555c5c695c5c695c698469
+53472d3c413c413c3c3f535341698ea4a28e989898698aa4cda4bca4a4a486656b658aa4
+a4c08671a48e798c92aabac2ccd8d8d5d8e0ccd1cce0cda4a4a4b5a27a98cdd5a4a4a4aa
+c0a45355695c69695c5c5c5c535c
+718441413c413c383c6990b5a2a8989a7e5a41262d418498b5a4a4a4a4a48686866b8c8c
+a692929292aac3aabac2ccc2c3d8e2d8c3bac3cdcdbac0a4a4a2bc987aa2e0e0a47ecccd
+cd7e5353695c6969695c7e4f5c7e
+b1a4a2a29890848e989aa29aa8a2a85a2a415a98b1c09879a4a4c0a4a4a4a4a47e8ca692
+adadc2adc2c2c2c2c2c2cdccccccd5c2ccc7ccc7cccdc0a498a4a49c98b7d1cca2a2cccd
+cd5569535c715c695369535c695c
+a2a2b1a8a2a29898b198a8b59aa22a3c98b1b5a2c5c5b590a4a4a4a4a4a4a2868e8c92aa
+adc2c2adc2c2c2c2c2c2aaaac2ccd5ccccccc7cdc7c0a4a29aa4a271a4cdd5c7a4c7d8bc
+cd53555c695c5c5c5c535c69635c
+a2a2a298a298b1a2a2cdc04169b5d8d8e9cfcc8456325a3c8e8aa4a4a4a4a48ea4a48c92
+9292aaaa92adbababababac3c2bac2ccccccc092c0c7a2a4b1a2a4a2e0e0cdc0c7d7e0cd
+a25c695c69695c5c697e695c695c
+416998a2b1989c90b5a869c2ead7e1e0474153694f383c3c717186a4a4baa27ea4a4a48c
+a49aa49aa4a4bababaaac7bac2c2c2c3cccdcdcdc0baa48e7a9898cdcdd5d1a4ccd8c3c0
+6969534f5c5c69696969695c6984
+7e7169695353533c69a2c0d7d7e02a38535c69716d5a695a719098a2a4a4a4a48ca49292
+c0c0babac2c2aaaaccaac3bac3c3c3ccc7bacdc0a4b57a8e9871b7d5e0c3c0c0d8d8d771
+696953555c535c5c5c5c695c845c
+d8cfc5716969697ec0e1d7d7e1b57198b5b5d2b5b59a906f7c8e718aa4b7a4a4a4a4c0ba
+a492babad1c2ccbac2cdbaaaccbac3bac7c7cdc0a4a2717198bccde0d5d1cdbae5d8d169
+5c556953555c5c695c5c695c695c
+d8d8bcc0d8c5a2d8e9d8ead7d8a2c5cdcfc0a28e715a7e715a71717ea4a4bca4a4a4baa4
+bababaaac2c2c2c3c2c2c2bac7c2e0aacdc092a4a4a471988acdbad1c2d7d1cce5d8c755
+69535c4f5c6953695c5c5c715c69
+d8c5c0bcd8d8d8d8c0d8e19090a2a8bad8cdd8383253694f98a8a28e7aa4a4a4a4a4c092
+cdbac7bac2c2c2cccdc7c2baccd1ccc7c7a4c0a47e7171a2ccc2d1d1d1cce0e2d8e08a55
+55555353695c555c5355535c6969
+c5c5c0d8c0c0d8d8d8d8cd90c0ccd7d8e1c0988ea2c0c56f1d5a4f717aa492b5a4a492c0
+a8aac2c2ccc2d8c2d5c2aac3c2c2bac7babca4a29871a4c0d1d1d1baccbac2edd7c07153
+53535c55534f5c5355535c555c53
+a8a2c5a2bab1c5a86f6990d8bcd8e9c09090b5c5c0c0bac03c412841718aa4a4a4a492a4
+baccc2d5c2d5ccd8c2c2d1c7aacdaac0c7b5a47a98a4babacce0bad1cdc2ecedd1693f53
+556953555c6953695c53555c5c69
+c0c2b5c2a8baa2cca2c5b5b5c5c0c5a89abac5c0d8c0c5b1413c3c3c418a86a2a4a4a4ba
+bac2c2d5d5ccc2e0c2d5c2ccd1c2c7c0baa47e7ea4cdc7ccccd1ccc2d7d5edf38a556953
+554f5c5c5353555353555c5c6953
+c0c5c5c5b5c5c0a2b1c5c0c5c0c5c5c0c0c5c5c5c5c0c541413c3c3c418e8aa2b7a4bc92
+bac2c2c2c2d1c2d1c2c2d5c2cdbaba92c08698a4bca8aacdcccccdccccd8ecd884535355
+535c5553555c535c5553535c5353
+c5d2c5c0c0c0c0ccd8c5c0c5ccc5c0d8c0ccc5c0c598414141414141413f5698a4a4bcbc
+baccc2c2ccd1ccccc2ccccbabac7a4b7a2a4b592c0bacdcdcccdccd5e5ebedd553535553
+554f5c555c53535c53555c5c5355
+5a4f6da8c0c0d8c0c0c0c0c0c0c5c0a2b1a89a8e9a5541283c2541254141417a86a4a4c0
+cdd1d1c2cdbabcbaccd1c2c7a4a4b7a48ea4bcc0cda492e0d1d1ccccd8edf3b555535355
+695553535c693f5353695c534153
+717171719071449a908e5a73b9afbaa2a2a88e557e3c3c3c3c2d533c3c41412a718a8aa4
+a4cdbaa4bcbcbac0baa8c0a48aa47ea4a4a4cdc0ba92baccd1d1c2d8d8e5cd415341535c
+5553555353555355555353533f3f
+5a5a6d8e8ea8e9d7dacfd7cdcccfb99869381d192441413c3c4128413c3c414155718a8a
+a4a4a4bca4b7a49ab7b7a498a498a4a4a4cd92cdcdcdcdc7cccccce5d8d88e53534f5553
+535c4f5c55535c5353555355533f
+26383871757cc5bac5cfcad7dad8d8da735a381d383c412841282d2841533c2d41537171
+79a49886a4a4a4a4a27a7e8a9ca4a4a4a4c0cda8cda8bacde0ccd8e2e5d8565353415353
+5c535c415c534f534f533f5c3c3f
+4141532d2a2a24383c5a8ea8bac5ba4f7a9a8e3c41233c25284141413c413c413c41413c
+3c4171a2a4a4a4a4a4a4a4a4a4a2a4a2a4a4a4a8cda8d1bad5d8e2d8f0d73f4f53415c55
+554f555c5c55534f41555c553c3c
+a2c2a88ea8988e71534141718e8e7c6f902d242a283c2a282828283c53412a3c3c3c533c
+3c536971a4a4a4b5b7a4a4a2a4a4a4b5bac0babac0c7baccd5e2d8e0d5cd53553f535553
+4f534f5c5553535369533c41282a
+ccb5c5b5c5c0b5c5c5c0b1b5a2b1909c715a532d3c3c3c3c282d413c41413c413c41413f
+3c414155987e8aa4a4a486a4a4a4b5b5a4a4cdbac7baccd5d8e2e2e2cd553f533f555553
+535c5553533c53553c3c3c383c41
+b5ccccc5c0b5c0ccb5b5b5b5b1b5b1a25a6d712a2d2828282828415328413c3c3c413f53
+3c41535671717988a48aa4a4a4a4a4c0a4cdbacdaae0e0d5e0d5e0e09c3c41535c53534f
+5c535c3f2a5355533c3c2a2a5553
+c0b5ccccc0c0b5c0ccc2a2b5b5b1b1907e7171284141253c4141253c413c4141413c3c3c
+282841555671987a86a4a4a4a4a2a4a4a492cdbacdd1e0d1e0e2d8cd7153533f53535555
+53553c2d555c53413f2a413f3f55
+8eb5bacde1cde1cfb5cca2b5b5b58e90636d7e1d2828282a3c2a284153412841413c3c28
+41254171717171987ea498a2a4a4b5a4c0c0c0cdaad7cce0e2e2e0563c4155535553535c
+55555371533c3f282a3f41414141
+714f3c4f5a6f98adbcc2a2c5ccc08e71717e713c3c3c3c3c3c2d414128413c413c3f4128
+284155847171717e88a47e86a4b7a4b7a4cdbac7bacccce0e0c3cd5341535553535c555c
+553f555c3c3f3c2a5c553f3f5641
+
+showpage
+
+% stop using temporary dictionary
+end
+
+% restore original state
+origstate restore
+
+%%Trailer
diff --git a/Master/texmf-dist/source/generic/xypic/xy.doc b/Master/texmf-dist/source/generic/xypic/xy.doc
new file mode 100644
index 00000000000..54ac9fca7d0
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xy.doc
@@ -0,0 +1,8324 @@
+%% $Id: xy.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Basic Xy-pictures: Xy-pic bootstrap and kernel macros.
+%% Copyright (c) 1991-1999 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% Copyright (c) 1991-1999 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined\else\message{not reloaded}\endinput\fi
+\let\xyloaded=\relax
+
+% NOTE: Apart from the actual macros (as also found in xy.tex), this file
+% contains both the Xy-pic kernel reference manual and TeXnical documentation.
+% See xyrefer.man and xysource.man for how to typeset this information.
+
+\message{Bootstrap\string'ing\string:}
+
+{\catcode96 12\catcode`\#6\catcode`\.12\catcode`\:12\catcode`\'12\catcode`\@11
+\ifx\xywarnifdefined\undefined\else \immediate\write16{}%
+ \immediate\write16{Xy-pic Warning: \string\xywarnifdefined\space redefined.}%
+ \immediate\write16{}\fi
+\gdef\xywarnifdefined#1{\ifx#1\undefined\else \immediate\write16{}%
+ \immediate\write16{Xy-pic Warning: `\string#1' redefined.}%
+ \immediate\write16{}\fi}
+\xywarnifdefined\xydef@ \gdef\xydef@#1{\xywarnifdefined#1\gdef#1}
+\xywarnifdefined\xylet@ \gdef\xylet@#1{\xywarnifdefined#1\global\let#1}
+\xywarnifdefined\xynew@
+ \gdef\xynew@#1#2{\xywarnifdefined#2\csname new#1\endcsname#2}}
+
+\message{catcodes\string,}
+
+\xywarnifdefined\xyuncatcodes
+\xywarnifdefined\xyreuncatcodes \def\xyreuncatcodes{\edef\xyuncatcodes{%
+ \catcode92 0 \catcode123 1 \catcode125 2 \catcode37 14
+ \catcode 9 \the\catcode 9 \catcode10 \the\catcode10 \catcode12 \the\catcode12
+ \catcode35 \the\catcode35 \catcode36 \the\catcode36 \catcode38 \the\catcode38
+ \catcode43 \the\catcode43 \catcode45 \the\catcode45 \catcode46 \the\catcode46
+ \catcode47 \the\catcode47
+ \catcode60 \the\catcode60 \catcode61 \the\catcode61 \catcode62 \the\catcode62
+ \catcode64 \the\catcode64 \catcode96 \the\catcode96
+ \newlinechar \the\newlinechar \endlinechar \the\endlinechar }}
+\xyreuncatcodes
+
+\xywarnifdefined\xycatcodes \def\xycatcodes{%
+ \catcode 9 10
+ \catcode 35 6 \catcode 36 3 \catcode 38 4
+ \catcode 43 12 \catcode 45 12 \catcode 46 12 \catcode 47 12
+ \catcode 60 12 \catcode 61 12 \catcode 62 12
+ \catcode 64 11 \catcode 96 12 }
+
+\xycatcodes
+
+\message{docmode,}
+
+{\catcode`\|0 \xywarnifdefined|DOCMODE
+\gdef|DOCMODE#1{\ifx(#1\relax \xycatcodes \expandafter\ignorespaces
+ \else \skipspecials@ \expandafter\docm@\fi}%
+
+\xywarnifdefined\skipspecials@
+\gdef\skipspecials@{%
+ \catcode`\\12 \catcode`\{12 \catcode`\}12 \catcode`\#12 \catcode`\%12
+ \catcode`\^^L12 \endlinechar`\^^J }%
+
+\catcode`\/=12 \lccode`\/`\\%
+\lccode`\D`\D \lccode`\O`\O \lccode`\C`\C \lccode`\M`\M \lccode`\E`\E
+\lowercase{%
+\xywarnifdefined\docm@ \gdef\docm@{\docm@i}%
+\xywarnifdefined\docm@i \gdef\docm@i#1^^J{\docm@ii#1/DOCMODE\docm@iii}%
+\xywarnifdefined\docm@ii
+ \gdef\docm@ii#1/DOCMODE{\def\next@{#1}\futurelet\next\docm@iii}%
+\xywarnifdefined\docm@iii \gdef\docm@iii#1\docm@iii{%
+ \ifx\next\docm@iii \let\next\next@ \docecho@ \let\next@\docm@
+ \else\ifx\next@\empty \let\next@\docfinish@
+ \else \edef\next@{\noexpand\docm@iv\next@/DOCMODE#1\noexpand\docm@iv}%
+ \fi\fi \next@}%
+\xywarnifdefined\docm@iv
+ \gdef\docm@iv#1/DOCMODE\docm@iv{\def\next{#1}\docecho@ \docm@}}%
+
+\xywarnifdefined\docecho@ \global\let\docecho@\relax
+\xywarnifdefined\docfinish@ \gdef\docfinish@{\xyuncatcodes|DOCMODE\next}}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ After giving an overview of the \Xy-pic environment in \S??[env],
+ this \FILE\ document the basic concepts of \Xy-picture construction
+ in \S??[basics], including the maintained `graphic state'. The
+ following sections give the precise syntax rules of the main \Xy-pic
+ constructions: the position language in~\S??[pos], the object
+ constructions in~\S??[object], and the picture `decorations'
+ in~\S??[decor]. \S??[objectlib] presents the kernel repertoire of
+ objects for use in pictures; \S??[option] documents the interface to
+ \Xy-pic options like the standard `feature' and `extension' options.
+
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Details of the implementation are not discussed here but in the
+ complete \TeX\-nical documentation~\cite{RM95:Xy-picCSTC}.
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Section \S??[algo] documents the more complicated algorithms used to
+ compute directions, edges, and connections.
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section{The \Xy-pic implementation}
+??=[env]
+
+ This section briefly discusses the various aspects of the present
+ \Xy-pic kernel implementation of which the user should be aware.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Loading \Xy-pic}
+??=[env.loading]??w[loading]
+
+ \Xy-pic is careful to set up its own environment in order to function
+ with a large variety of formats. For most formats a single line with
+ the command
+$$
+ ??c![\input xy]
+$$
+ in the preamble of a document file should load the kernel (see
+ `integration with standard formats' below for variations possible
+ with certain formats, in particular \LaTeX~\cite{L94:LaTeX}).
+
+ The rest of this section describes things you must consider if you
+ need to use \Xy-pic together with other macro packages, style
+ options, or formats. The less your environment deviates from plain
+ \TeX\ the easier it should be.
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Consult the \TeX\-nical documentation~\cite{RM95:Xy-picCSTC} for the
+ exact requirements for other definitions to coexist with \Xy-pic.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{File header:}
+??w[file header]
+
+ Here is what actually happens in the header of |xy.doc|. It contains
+ the copyright message, protection against ??w![loading] the file more
+ than once, and then bootstrap code to handle category codes and the
+ ??c![DOCMODE] format---we explain each separately below:
+
+\DOCHEADER
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Privacy:}
+??w[privacy]
+
+ \Xy-pic will warn about control sequences it redefines---thus you can
+ be sure that there are no conflicts between \Xy-pic-defined control
+ sequences, those of your format, and other macros, provided you
+ load??w[loading] \Xy-pic last and get no ??w![warning
+ messages] like
+$$
+ |Xy-pic Warning: `|\dots|' redefined.|??w[redefined]
+$$
+ In general the \Xy-pic kernel will check all control sequences it
+ redefines "except" that (1)~generic temporaries like ??c![\next] are
+ not checked, (2)~predefined font identifiers (see~\S??[env.fonts])
+ are assumed intentionally preloaded, and (3)~some of the more exotic
+ control sequence names used internally (like |@{-}|) are only
+ checked to be different from ??c![\relax].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This is handled by ??c![\xywarnifdefined]---after we have ensured
+ that it is unique itself\footnote{This may seem paranoid but in fact
+ many inconvieniences in the \TeX\ world stem from the fact that
+ somebody copied somebody elses definition of, say,
+ {\tt\string\xywarnifdefined}, modified it, and then used it in
+ something that somehow got distributed! The `flat name space'
+ problem remains \TeX\ largest problem as a programming language in
+ this \TeX\ hackers opinion.}. ??c![\xydef@], ??c![\xylet@], and
+ |\xynew@{|<type>|}|??c[\xynew@] are abbreviations used to this end
+ throughout \Xy-pic instead of ??c![\let], ??c![\def], and the
+ |\new|<type> commands.
+
+ Next some auxilliaries: |\xydefcsname@| is similar to |\xydef@|
+ except that it builds the control sequence with ??c![\csname] \dots\
+ ??c![\endcsname] which means that it is |\relax| when undefined---there
+ is thus no way to prevent redefinition of control sequences bound to
+ ??c![\relax]~\frowny.
+
+\DOCMODE(
+\xydef@\xydefcsname@#1{\DN@{#1}\DNii@##1{%
+ \ifx ##1\relax\else \xywarning@{\string`\string##1\string' redefined}\fi
+ \def##1}%
+ \expandafter\nextii@\csname\codeof\next@\endcsname}
+\DOCMODE)
+
+ |\xyletcsnamecsname@| is to ??c![\let] one weird control sequence
+ be the same as another using several |\expandafter|s:
+
+\DOCMODE(
+\xydef@\xyletcsnamecsname@#1#2{\def\1{#1}\def\2{#2}\DN@##1##2{%
+ \ifx ##1\relax\else \xywarning@{`\string##1\string' redefined}\fi
+ \let##1=##2}%
+ \expandafter\expandafter\expandafter\next@
+ \expandafter\csname\expandafter\codeof\expandafter\1\expandafter\endcsname
+ \csname\codeof\2\endcsname}
+\DOCMODE)
+
+ Finally ??c![\codeof]: a useful hack used to allow any characters in
+ control sequences: ??c![\codeof]<cs> expands to the characters of the
+ control sequence <cs> as a string of `other' characters, \ie, all of
+ category 12 and with a \verb*/ /$_{12}$ after every control sequence.
+ The <cs> must be a macro or it blows up.
+
+\DOCMODE(
+\xywarnifdefined\codeof
+\xywarnifdefined\codeof@
+{\catcode`\:=12 % to ensure that all of :-> and <-: are other :-)
+ \gdef\codeof#1{\expandafter\codeof@\meaning#1<-:}
+ \gdef\codeof@#1:->#2<-:{#2}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Category codes:\ }
+
+ The situation is complicated by the flexibility of
+ \TeX's input format. The culprit is the `??w![category code]'
+ concept of \TeX\ (\cf~\cite[p.37]{K84:TeXbook}): when loaded \Xy-pic
+ requires the characters {\tt\char32}|\{}%| (the first is a space) to
+ have their standard meaning and all other printable characters to
+ have the "same category as when \Xy-pic will be used"---in particular
+ this means that (1)~you should surround the ??w![loading] of \Xy-pic
+ with ??c![\makeatother] \dots\ ??c![\makeatletter] when loading it
+ from within a \LaTeX\ package, and that (2)~\Xy-pic should be loaded
+ after files that change category codes like the ??c![german.sty] that
+ makes |"| active??w[active characters]. Some styles require that you
+ reset the catcodes for every diagram, \eg, with ??c![french.sty] you
+ should use the command |\english| before every |\xymatrix|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ We define ??c![\xyuncatcodes] to restore the current catcodes, and
+ ??c![\xycatcodes] to install our own.
+
+ Here is an exact list of the category codes which \Xy-pic requires
+ (all standard in plain \TeX):
+$$
+\vcenter{\tabskip=.5em plus1fil \halign to\displaywidth{#\hfil&&\hfil#\hfil\cr
+ character(s) &|\| &|{| &|}| &CR &TAB SP&|A|--|Z| |a|--|z| &|0|--|9| &|%| \cr
+ category code & 0 & 1 & 2 & 5 & 10 & 11 & 12 & 14 \cr}
+}$$
+ Furthermore none of the remaining printable ASCII characters
+$$
+ |!"#$&'()*,/:;?@[]^_`||~|
+$$
+ may be of category 0, 1, 2, 9, 14, or 15, because all should be
+ tokens allowed in the replacement text of a |\def|---this also means
+ that they may not be active characters defined to be ``|\outer|''!
+
+ All other catcodes needed are established using ??c![\xycatcodes]
+ defined above---this is the reason the macros must be loaded at a
+ time where the category codes are stable (otherwise it will make them
+ stable!).
+
+ Internally \Xy-pic enforces the following category codes:
+$$
+\vcenter{\tabskip=.5em plus1fil \halign to\displaywidth{#\hfil&&\hfil#\hfil\cr
+ character &|#|&|$|&|&|&|'|&|+|&|-|&|.|&|<|&|=|&|>|&|@|&|`|\cr
+ ASCII code & 35& 36& 38& 39& 43& 45& 46& 60& 61& 62& 64& 96\cr
+ category code& 6 & 3 & 4 & 12& 12& 12& 12& 12& 12& 12& 11& 12\cr
+ abbreviation&|HASH|&|DOLL|&|AND|&|RQ|&|PLUS|&|DASH|&|DOT|
+ &|LT|&|EQ|&|GT|&|AT|&|LQ|\cr}
+}$$
+ with special control sequences named |\add|<abbreviation>|@| that
+ take an argument and expand to it followed by the original character
+ token, \ie, many tests throughout the program look like |\addDOT@|
+ |\ifx| |\next| \dots
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xywarnifdefined\addAT@
+\xywarnifdefined\addHASH@
+\xywarnifdefined\addDOLL@
+\xywarnifdefined\addAND@
+\xywarnifdefined\addRQ@
+\xywarnifdefined\addPLUS@
+\xywarnifdefined\addDASH@
+\xywarnifdefined\addDOT@
+\xywarnifdefined\addLT@
+\xywarnifdefined\addEQ@
+\xywarnifdefined\addGT@
+\xywarnifdefined\addLQ@
+
+\xydef@\xymakeADD@#1#2 #3 {\ifnum\catcode#3=6 \def#1##1{##1#2#2}%
+ \else \def#1##1{##1#2}\fi}
+
+\xydef@\xyrecat@{\xymakeADD@\addAT@}
+\xydef@\xyrecat{\xyrecat@}
+\xydef@\xyresetcatcodes{\def\xyrecat{\xyrecat@}\xyreuncatcodes
+ \input xyrecat \relax \xyuncatcodes}
+
+\xyuncatcodes \xyresetcatcodes \xycatcodes
+
+\xydef@\testAND@{{\aftergroup\ifx
+ \addAND@\ifx\next\addFalse@\else\addTrue@\fi}}
+\xydef@\addFalse@{\aftergroup\iffalse}
+\xydef@\addTrue@{\aftergroup\iftrue}
+\DOCMODE)
+
+\inputdoc!{xyrecat.doc}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The last block of the \Xy-pic header bootstraps the ``??c![DOCMODE]
+ format'' used in |.doc| variants of \Xy-pic macro files in order to
+ keep documentation and macros together in a literal programming style
+ (this is redundant in the |xy.tex| macro file where all instances of
+ |DOCMODE| have been eliminated (see chapter \S??g[:Makefile] for how
+ this is accomplished) but it is included anyway since users may load
+ options still in |DOCMODE| format). The details of |DOCMODE| are
+ described in |xydoc.sty|, a special \LaTeX\ package used to typeset
+ \Xy-pic documentation; please read it if you intend to write \Xy-pic
+ options.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Integration with standard formats}
+??w[formats]
+%
+ This is handled by the |xyidioms.tex| file and the integration as a
+ \LaTeX~\cite{L94:LaTeX} package by |xy.sty|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ We input |xyidioms.tex| from the kernel:
+
+\DOCMODE(
+\input xyidioms
+\DOCMODE)
+
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{xyidioms.tex:}
+??c[xyidioms.tex]%
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{xyidioms.doc:}
+??c[xyidioms.doc]%
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\inputdoc!{xyidioms.doc}
+
+\paragraph{xy.sty:}
+??c[xy.sty]%
+%%
+ If you use ??w![\LaTeX] then this file makes it possible to
+ load??w[loading] \Xy-pic as a `??w![package]' using the
+ ??w![\LaTeXe]~\cite{L94:LaTeX} ??c![\usepackage] command:
+%
+\begin{defs1}
+??c![\usepackage] |[|<option>|,|\dots|]| |{xy}|
+\end{defs1}
+\noindent\unskip
+%
+ where the <option>s will be interpreted as if passed to
+ ??c![\xyoption] (\cf~\S??[option]).
+
+ The only exceptions to this are the options having the same names as
+ those driver package options of \GROUP~??g[:drivers], which appear in
+ \cf~\cite[table 11.2, p.317]{GMS94:LaTeXC} or the \LaTeXe\ |graphics|
+ bundle. These will automatically invoke any backend extension
+ required to best emulate the \LaTeXe\ behaviour. (This means that,
+ \eg, ??C![dvips] and ??C![textures] can be used as options to the
+ ??c![\documentclass] command, with the normal effect.)
+
+ The file also works as a \LaTeX~2.09~\cite{L86:LaTeX} `??w![style
+ option]' although you will then have to load options with the
+ |\xyoption| mechanism described in \S??[option].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Here is the raw source of |xy.sty|.
+
+\inputdoc0{xy.sty}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Logo, version, and messages}
+??=[env.logo]
+
+ Loading \Xy-pic prints a ??w![banner] containing the version and
+ author of the kernel; small progress ??w![messages] are printed when
+ each major division of the kernel has been loaded. Any options
+ loaded will announce themself in a similar fashion.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Of these, ??c![\stripRCS] is a very useful hack for extracting the
+ first component of an RCS |$|\dots|$| keyword value.
+
+\DOCMODE(
+\xydef@\stripRCS$#1${\stripRCS@#1: @@ @@@}
+\xydef@\stripRCS@#1: #2@ #3@@@{%
+ \ifx @#2\string?\else\ifx :#2\else\stripRCS@@#2\fi\fi}
+\xydef@\stripRCS@@#1 #2: @{#1}
+
+\edef\next{\stripRCS$Revision: 3.7 $}
+\xylet@\xyversion=\next
+
+\edef\next{\stripRCS$Date: 1999/02/16 15:12:50 $}
+\xylet@\xydate=\next
+
+\xydef@\Xygreet@{%
+ \W@{}%
+ \W@{ Xy-pic version \xyversion\space<\xydate>}%
+ \W@{ Copyright (c) 1991-1998 by Kristoffer H. Rose <krisrose@ens-lyon.fr>}%
+ \W@{ Xy-pic is free software: see the User\string's Guide for details.}%
+ \W@{}}
+\Xygreet@
+\expandafter\everyjob\expandafter{\the\everyjob\Xygreet@}
+
+\message{Loading kernel:}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ If you refer to \Xy-pic in your written text (please do~\smiley~)
+ then you can use the command ??c![\Xy]|-pic| to typeset the
+ ``??w![\Xy-pic]'' ??w![logo]. The ??w![version] of the kernel is
+ typeset by ??c![\xyversion] and the release date by ??c![\xydate] (as
+ found in the banner). By the way, the \Xy-pic "name"\footnote{No
+ description of a \TeX\ program is complete without an explanation of
+ its name.} originates from the fact that the first version was
+ little more than support for $(x,y)$ coordinates in a configurable
+ coordinate system where the main idea was that "all" operations could
+ be specified in a manner independent of the orientation of the
+ coordinates. This property has been maintained except that now the
+ package allows explicit absolute orientation as well.
+
+\DOCMODE(
+\xydef@\Xy{\leavevmode
+ \hbox{\kern-.1em X\kern-.3em\lower.4ex\hbox{Y\kern-.15em}}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Messages that start with ``|Xy-pic| ??c![Warning]'' are indications
+ that something needs your attention; an ``|Xy-pic| ??c![Error]'' will
+ stop \TeX\ because \Xy-pic does not know how to proceed.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ We use the input line number if available and rudimentary help in the
+ form of a reference to the manual if no specific help string is
+ given. ??c![\newlinechar] is set locally to |^^J| while writing such
+ that messages of several lines can be written.
+
+\DOCMODE(
+\message{messages;}
+
+\xywarnifdefined\thelineno@
+\ifx\inputlineno\undefined \edef\thelineno@{\string?}
+\else \def\thelineno@{\the\inputlineno}\fi
+\xydef@\xytracelineno@{ \string[\jobname:\thelineno@\string]}
+
+\xydef@\xywarning@#1{{\newlinechar=10 %
+ \W@{}\W@{Xy-pic Warning: #1\xytracelineno@.}\W@{}}}
+
+\xydef@\xyerror@#1#2{\if\inxy@\xy@{ERROR #1}{}\fi
+ {\def\2{#2}\newlinechar=10 %
+ \ifx\2\empty \errhelp{See the Xy-pic manual for further information.}%
+ \else \errhelp{#2}\fi
+ \errmessage{Xy-pic error: #1}}}
+\DOCMODE)
+
+ Finally one that I hope will never get expanded~\frowny
+
+\DOCMODE(
+\xydef@\xybug@#1{{\newlinechar=10 %
+ \errhelp{This is a bug in Xy-pic and should not happen!^^J%
+If it did then please send a bug report with the offending Xy-pic code^^J%
+to the author of Xy-pic, krisrose@ens-lyon.fr.}%
+ \errmessage{Xy-pic BUG: #1 -- notify krisrose@ens-lyon.fr.}}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Fonts}
+??=[env.fonts]
+
+ The \Xy-pic kernel implementation makes its drawings using five
+ specially designed ??w![fonts]:%
+%
+??w[dashes]??w[tips]??w[circles]??w[hooks]??w[squiggles]
+$$
+\begin{array}{\otherbar c\otherbar c\otherbar l\otherbar}
+\hline
+ \hbox{Font} & \hbox{Characters} & \hbox{Default}\\
+\hline
+ ??c![\xydashfont]& \hbox{dashes} & ??c![xydash10]\\
+ ??c![\xyatipfont]& \hbox{arrow tips, upper half} & ??c![xyatip10]\\
+ ??c![\xybtipfont]& \hbox{arrow tips, lower half} & ??c![xybtip10]\\
+ ??c![\xybsqlfont]& \hbox{quarter circles for\qquad} & ??c![xybsql10]\\
+ & \hbox{\qquad hooks and squiggles} &\\
+ ??c![\xycircfont]& \hbox{$1/8$ circle segments} & ??c![xycirc10]\\
+\hline
+\end{array}
+$$
+ The first four contain variations of characters in a large number of
+ directions, the last contains 1/8 circle segments.
+
+\paragraph*{Note:}
+ The default fonts are not part of the \Xy-pic kernel "specification":
+ they just set a standard for what drawing capabilities should at
+ least be required by an \Xy-pic implementation. Implementations
+ exploiting capabilitites of particular output devices are in use.
+ Hence the fonts are only loaded by \Xy-pic if the control sequence
+ names are undefined---this is used to preload them at different sizes
+ or prevent them from being loaded at all.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ To be more precise, \Xy-pic requires ??c![\xydashfont] to be a
+ "??w![semidirectional]" font as \MF\ will generate with the driver
+ file ??c![xyd2.mf]---this is very important because the "??w![italic
+ corrections]" of the characters in this particular font are used to
+ approximate trigonometric computations, so if you replace
+ ??c![\xydashfont] be sure to replace it with another semidirectional
+ font! Similarly, the three fonts ??c![\xyatipfont],
+ ??c![\xybtipfont], and ??c![\xybsqlfont] should be
+ "??w![directional]" as \MF\ will generate with the driver file
+ ??c![xyd.mf].
+
+ Finally, ??c![\xycircfont] should contain $1/8$ circle segments of
+ various radii as described in |xycirc10.mf|.
+
+ The following code loads the fonts "unless it was already loaded" and
+ defines some associated dimensions for ??c![\xydashfont] and
+ ??c![\xybsqlfont]: for each of these $f$ we define $f_\ell$ as the
+ length of a unit in the current direction (used when juxtaposing for
+ connections), $f_h$ as the height of the unit (used for several
+ parallel connections), and $f_w$ as the `line width' of the unit (to
+ know how to interface to rules).
+
+\DOCMODE(
+\message{fonts;}
+
+\xydef@\xyfont@#1{\ifx#1\undefined \DN@{\global\font#1}\expandafter\next@
+ \else \xywarning@{Using previously loaded \string#1\space font}\fi}
+
+\xyfont@\xydashfont=xydash10
+\xydef@\xydashl@{\fontdimen6\xydashfont}
+\xydef@\xydashh@{\fontdimen5\xydashfont}
+\xydef@\xydashw@{\fontdimen8\xydashfont}
+
+\xyfont@\xyatipfont=xyatip10
+\xyfont@\xybtipfont=xybtip10
+
+\xyfont@\xybsqlfont=xybsql10
+\xydef@\xybsqll@{\fontdimen6\xybsqlfont}
+\xydef@\xybsqlh@{\fontdimen5\xybsqlfont}
+\xydef@\xybsqlw@{\fontdimen8\xybsqlfont}
+
+\xyfont@\xycircfont=xycirc10
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Allocations}
+??=[env.alloc]??w[allocation]
+
+ One final thing that you must be aware of is that \Xy-pic allocates a
+ significant number of dimension registers and some counters, token
+ registers, and box registers, in order to represent the state and do
+ computations. The current kernel allocates 4~counters,
+ 28~dimensions, 2~box registers,4~token registers, 1~read channel, and
+ 1~write channel (when running under \LaTeX; some other formats use
+ slightly more because standard generic temporaries are used).
+ Options may allocate further registers (currently loading
+ "everything" loads 6~dimen-, 3~toks-, 1~box-, and 9~count-registers
+ in addition to the kernel ones).
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\message{allocations:}
+\DOCMODE)
+
+ See \S??[env.loading] for scratch register allocations.
+
+\paragraph*{Picture state:}
+
+ These realise the picture state as described in \S??[basics.state]:
+ $c$, $p$, the "base", and the picture size:
+
+\DOCMODE(
+\message{state,}
+
+\xynew@{dimen}\X@c
+\xynew@{dimen}\Y@c
+\xynew@{dimen}\U@c
+\xynew@{dimen}\D@c
+\xynew@{dimen}\L@c
+\xynew@{dimen}\R@c
+\xynew@{toks}\Edge@c
+
+\xynew@{dimen}\X@p
+\xynew@{dimen}\Y@p
+\xynew@{dimen}\U@p
+\xynew@{dimen}\D@p
+\xynew@{dimen}\L@p
+\xynew@{dimen}\R@p
+\xynew@{toks}\Edge@p
+
+\xynew@{dimen}\X@origin \X@origin=\z@
+\xynew@{dimen}\Y@origin \X@origin=\z@
+\xynew@{dimen}\X@xbase \X@xbase=1mm
+\xynew@{dimen}\Y@xbase \Y@xbase=\z@
+\xynew@{dimen}\X@ybase \X@ybase=\z@
+\xynew@{dimen}\Y@ybase \Y@ybase=1mm
+
+\xynew@{dimen}\X@min
+\xynew@{dimen}\Y@min
+\xynew@{dimen}\X@max
+\xynew@{dimen}\Y@max
+\DOCMODE)
+
+\paragraph*{Drop and connect:}
+
+ |\lastobjectbox@| stores the most recently dropped
+ object.??c[\lastobject]
+
+\DOCMODE(
+\xynew@{box}\lastobjectbox@
+\DOCMODE)
+
+ |\zerodotbox@|??c[\zerodot] is of zero size with a `dot' in the form
+ of a rule the width and height as the line width of the line font;
+ ??c![\zz@] is `almost-zero-check'.
+
+\DOCMODE(
+\xynew@{box}\zerodotbox@
+\setbox\zerodotbox@=\hbox{\dimen@=.5\xydashw@
+ \kern-\dimen@ \vrule width\xydashw@ height\dimen@ depth\dimen@}
+\wd\zerodotbox@=\z@ \ht\zerodotbox@=\z@ \dp\zerodotbox@=\z@
+
+\xynew@{dimen}\almostz@ \almostz@=50sp
+\xydef@\zz@#1{\ifdim#1<\z@-\fi#1<\almostz@\relax}
+
+\xynew@{if}\iftmp@
+\DOCMODE)
+
+\paragraph*{Direction state:}
+
+ The ??w![direction] state is rather complicated and described in
+ detail in~\S??[algo.direction].
+
+\DOCMODE(
+\message{direction,}
+
+\xynew@{dimen}\d@X
+\xynew@{dimen}\d@Y
+\xydef@\sd@X{}
+\xydef@\sd@Y{}
+
+\xynew@{count}\K@ \K@=1024
+\xynew@{count}\KK@ \KK@=32
+
+\xynew@{count}\Direction
+\xynew@{dimen}\K@dXdY
+\xynew@{dimen}\K@dYdX
+
+\xydef@\cosDirection{}
+\xydef@\sinDirection{}
+
+\xywarnifdefined\DirectionChar
+\xywarnifdefined\SemiDirectionChar
+\DOCMODE)
+
+\paragraph*{Miscellaneous:}
+
+ Finally some generic allocations used in the following:
+
+\DOCMODE(
+\xynew@{read}\xyread@ % for `safe input'
+\xynew@{write}\xywrite@ % for `saving' to .xyc file
+
+\xynew@{count}\csp@ % for `control stack pointer'
+\xynew@{dimen}\quotPTK@ % for `fractions'
+\DOCMODE)
+
+ The required temporaries are defined by |xyidioms.tex|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Utility macros}
+??=[env.util]
+
+ Finally we define some utility macros.
+
+\DOCMODE(
+\message{utility macros;}
+\DOCMODE)
+
+\paragraph*{Simple queue:}
+??w[queue]
+
+ Just appending to the ??c![\toks@] list.
+
+\DOCMODE(
+\xydef@\addtotoks@#1{\toks@=\expandafter{\the\toks@#1}}
+\DOCMODE)
+
+\paragraph*{Safe input:}
+
+ Check that file is available before input. Tries the alternate
+ extension |.doc| in case the |.tex| file is not there. The second is
+ the lowest level function used when the desired files cannot be
+ preloaded and do not exist in |.doc| form.
+
+\DOCMODE(
+\xydef@\xyinputorelse@#1#2{%
+ \expandafter\let\expandafter\next@\csname#1loaded\endcsname
+ \ifx\next@\empty \else
+ \DN@{\xyinputorelse@@{#1}{\xyinputorelse@@{#1.doc}{#2}}}%
+ \fi \next@}
+
+\xydef@\xyinputorelse@@#1#2{\openin\xyread@=#1 %
+ \ifeof\xyread@ \DN@{#2}\else \DN@{\closein\xyread@\input#1 }\fi \next@}
+\DOCMODE)
+
+\paragraph*{Continuation stack:}
+
+ This is used to `??w![enter]' a new ??w![context] and `??w![leave]'
+ to the previous context. It works as a stack defining a control
+ sequence for each level, thus using a counter as the stack pointer.
+ Defines the following
+%
+\begin{defs}
+ |\csp@| & `Continuation Stack Pointer' \cr
+ |\enter@{|<code>|}| & Enter new block with <code> expanded as continuation\cr
+ |\nter@{|<code>|}| & Enter new block with<code> as continuation\cr
+ |\dontleave@| & Execute continuation without leaving block\cr
+ |\unenter@| & Leave block without executing its continuation\cr
+ |\leave@| & Leave block (execute its continuation)\cr
+\end{defs}
+
+ So |\enter@{}\leave@| is a noop and |\leave@| is the same as
+ |\dontleave@\unenter@|.
+
+\DOCMODE(
+\global\csp@=\z@
+
+\xydef@\enter@#1{\global\advance\csp@\@ne
+ \expandafter\xdef\csname cs@\number\csp@\endcsname{#1}\ignorespaces}
+
+\xydef@\nter@#1{\global\advance\csp@\@ne
+ \expandafter\gdef\csname cs@\number\csp@\endcsname{#1}\ignorespaces}
+
+\xydef@\dontleave@{\csname cs@\number\csp@\endcsname}
+
+\xydef@\unenter@{\global\advance\csp@\m@ne}
+
+\xydef@\leave@{\expandafter\unenter@\csname cs@\number\csp@\endcsname}
+\DOCMODE)
+
+\paragraph*{Fractions:}
+??w[fraction computation]
+
+ Below we often use a factor on the form of a quotient $A/B$. Here is
+ a hack to get it; it is not very precise but suffices for our needs.
+%
+\begin{defs}
+ |\quotient@| <cs> |{|$A$|}| |{|$B$|}| &
+ Defines <cs> to expand (immediately) to the factor corresponding to
+ $A/B$; $A$, $B$ must be dimensions where $\abs{A}\lt|\maxdimen|/|KK|$
+ and $\abs{B}\gt|KK|$
+\cr
+ |\quotient@@| <cs> |{|$A$|}| |{|$B$|}| &
+ Same, but uses $8|KK|$ for |KK|.
+\cr
+\end{defs}
+%
+ "Notes": (1) If |\c| is a count register, then |{1\c}| is a legal
+ dimension. (2) Really computes
+$$
+ \left((A*\abs{|KK|}) / (B/\abs{|KK|})\right) * \left(|1pt|/\abs{|K|}\right)
+$$
+ and then defines <cs> to expand to the resulting |pt| value. This
+ means that results are only reasonable for
+ $\abs{A}\ll|\maxdimen|/|KK|$ and $\abs{B}\gg|KK|$.
+
+\DOCMODE(
+\quotPTK@=\p@ \divide\quotPTK@\K@
+\xylet@\quotsign@@=\empty
+\xywarnifdefined\removePT@
+{\catcode`p=12 \catcode`t=12 \gdef\removePT@#1pt{#1}}
+
+\xydef@\quotient@#1#2#3{\A@=#2\relax \B@=#3\relax
+ \ifdim\A@<\z@\def\quotsign@@{-}\else\def\quotsign@@{+}\fi
+ \ifdim\quotsign@@\A@<15pt \multiply\A@\K@
+ \else\ifdim\quotsign@@\A@<511pt \multiply\A@\KK@
+ \advance\B@\ifdim\B@<\z@-\fi 16sp \divide\B@\KK@
+ \else
+ \advance\B@\ifdim\B@<\z@-\fi 512sp \divide\B@\K@
+ \fi\fi
+ \ifdim\ifdim\B@<\z@-\fi\B@<\quotPTK@ \xywarning@{division overflow}%
+ \else \advance\A@.5\B@ \divide\A@\B@ \fi
+ \multiply\A@\quotPTK@ \edef#1{\expandafter\removePT@\the\A@}}
+
+\xydef@\quotient@@#1#2#3{\A@=#2\relax \B@=#3\relax \multiply\A@\KK@
+ \advance\B@\ifdim\B@<\z@-\fi 128sp \divide\B@\KK@ \divide\B@ 8 %
+ \ifdim\B@=\z@\else \advance\A@.5\B@ \divide\A@\B@ \fi
+ \B@=.125\quotPTK@ \multiply\A@\B@ \edef#1{\expandafter\removePT@\the\A@}}
+\DOCMODE)
+
+\paragraph*{Loops:}
+
+ \Xy-pic uses its own |\loop@| to avoid interference with plain
+ ??c![\loop].
+
+\DOCMODE(
+\xydef@\loop@#1\repeat@{\def\body@{#1}\iterate@}\xylet@\repeat@=\fi
+\xydef@\iterate@{\body@\expandafter\iterate@\else\fi}
+\DOCMODE)
+
+\paragraph*{Execution:}
+
+ All ??w![execution] of \Xy-commands should be `indirect', \ie,
+ execute
+$$
+ |\xy@{|<source>|}{|<internal commands>|}|
+$$
+ where the <internal commands> directly do the desired operation(s).
+ This is used for tracing and can be used to separate parsing and
+ execution by changing |\xy@|; |\oxy@| is kept stable such that
+ |\let\xy@=\oxy@| will reestablish a sane state; it should only be
+ changed with |\change@oxy@| to make this easy to verify.
+
+\DOCMODE(
+\xydef@\xyinitial@#1#2{\DN@{#1}%
+ \xyerror@{command used out of context: \codeof\next@}{}}
+
+\xylet@\xy@=\xyinitial@
+\xylet@\oxy@=\xy@
+
+\xydef@\change@oxy@#1{\let\oxy@=#1\relax
+% \W@{*OXY@:=\meaning\oxy@}%
+}
+\DOCMODE)
+
+ This is also used to check whether an \Xy-picture is already
+ active; use as |\if\inxy@|\dots|\else|\dots|\fi|:
+
+\DOCMODE(
+\xydef@\inxy@{T\ifx\xy@\xyinitial@ F\else T\fi}
+\DOCMODE)
+
+ The final execution command is a trick used to put bits of the user's
+ input inside the |\next@| scratch macro "with the user's catcodes
+ intact": |\xy@@ix@{|\dots|}| is the same as
+ |\xy@@{\global\toks9={|\dots|}}| except for the category codes used
+ for the \dots.
+
+\DOCMODE(
+\xydef@\xyxy@@ix@{\begingroup
+ \xyuncatcodes\afterassignment\endgroup\global\toks9=}
+\DOCMODE)
+
+ This to save some tokens -- maybe not worth it:
+
+\DOCMODE(
+\xydef@\xy@@{\xy@{}}
+\DOCMODE)
+
+ Finally this to establish a sane state -- only use within a group!
+
+\DOCMODE(
+\xydef@\plainxy@{\let\xy@=\xyxy@ \change@oxy@\xy@ \let\xy@@ix@=\xyxy@@ix@}
+\DOCMODE)
+
+ \TODO: Clean up all uses of these such that <source> is always that
+ and only that. Define a method for `inner' \aka\ `implied' <source>
+ that doesn't really count in that it is a consequence of some other
+ source\dots
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section{Picture basics}
+??=[basics]
+
+ The basic concepts involved when constructing \Xy-pictures are
+ positions and objects, and how they combine to form the state used by
+ the graphic engine.
+
+ The general structure of an \Xy-picture is as follows:
+%
+\begin{defs1}
+%
+ ??c![\xy] <pos> <decor> ??c![\endxy] \cr
+%
+\end{defs1}
+\noindent\unskip
+%
+ builds a box with an \Xy-picture (\LaTeX\ users may substitute
+ |\begin{xy}| \dots\ |\end{xy}| if they prefer).
+
+ <pos> and <decor> are components of the special `graphic language'
+ which \Xy-pictures are specified in. We explain the language
+ components in general terms in this \S\ and in more depth in the
+ following \S\S.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The code for the |\xy|\dots|\endxy| command is presented last in this
+ section.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Positions}
+??=[basics.pos]
+
+ All "??w![positions]" may be written |<|$X$|,|$Y$|>| where ??w![$X$]
+ is the \TeX\ dimension distance "right" and ??w![$Y$] the distance
+ "up" from the "??w![zero position]" ??c![0] of the \Xy-picture (|0|
+ has coordinates |<0mm,0mm>|, of course). The zero position of the
+ \Xy-picture determines the box produced by the
+ ??c![\xy]\dots??c![\endxy] command together with the four parameters
+ ??w![$X_{\min}$], ??w![$X_{\max}$], ??w![$Y_{\min}$], and
+ ??w![$Y_{\max}$] set such that all the objects in the picture are
+ `contained' in the following rectangle:
+$$
+\xy.(-13,-12).(25,15)="b"*\frm{-}*@{o},
+ "b"+<2pc,-.8pc>*{|0|};"b"*{}**@{.},
+ "b"+L+<-2pc,-.8pc>*!UR\txt{\TeX\ reference point};"b"+L*@{*}**@{.},
+ "b"+0;
+ "b"+L **@{-} ?>*@{>} ?*++!U{X_{\min}},
+ "b"+R **@{-} ?>*@{>} ?(.7)*++!U{X_{\max}},
+ "b"+D **@{-} ?>*@{>} ?(.7)*++!L{Y_{\min}},
+ "b"+U **@{-} ?>*@{>} ?*++!L{Y_{\max}}
+\endxy
+$$
+ where the distances follow the ``up and right~$\gt0$'' principle,
+ \eg, the indicated \TeX\ reference point has coordinates
+ |<|$X_{\min}$|,0pt>| within the \Xy-picture. The zero position does
+ not have to be contained in the picture, but $X_{\min} \le X_{\max}
+ \land Y_{\min} \le Y_{\max}$ always holds. The possible positions
+ are described in detail in~\S??[pos].
+
+ When an \Xy-picture is entered in "??w![math mode]" then the
+ reference point becomes the ``vcenter'' instead, \ie, we use the
+ point |<|$X_{\min}$|,-\the\fontdimen22>| as reference point.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Objects}
+??=[basics.object]
+
+ The simplest form of putting things into the picture is to `drop' an
+ "??w![object]" at a position. An object is like a \TeX\ box except
+ that it has a general "??w![Edge]" around its reference point---in
+ particular this has the "??w![extents]" (\ie, it is always contained
+ within) the dimensions ??w![$L$], ??w![$R$], ??w![$U$], and ??w![$D$]
+ away from the reference point in each of the four directions left,
+ right, up, and down. Objects are encoded in \TeX\ boxes using the
+ convention that the ??w![\TeX\ reference point] of an object is at
+ its left edge, thus shifted |<|${-}L$|,0pt>| from the center---so a
+ \TeX\ box may be said to be a rectangular object with $L=|0pt|$.
+ Here is an example:
+$$
+ \let\objectstyle=\scriptstyle
+ \xy(0,0).(-10,-5).(15,8)*\frm{-}="box"*@{o}+0;
+ "box"+L*{}**@{.}?*{L},
+ "box"+R*{}**@{.}?*{R},
+ "box"+D*{}**@{.}?*{D},
+ "box"+U*{}**@{.}?*{U},
+ "box"+L+<-2pc,-.8pc>*!UR\hbox{\TeX\ reference point};
+ "box"+L*{\bullet}*{}**@{.},
+ \endxy
+$$
+ The object shown has a rectangle edge but others are available even
+ though the kernel only supports rectangle and circle edges. It is
+ also possible to use entire \Xy-pictures as objects with a rectangle
+ edge, |0| as the reference point, $L={-X_{\min}}$, $R={X_{\max}}$,
+ $D={-Y_{\min}}$, and $U={Y_{\max}}$. The commands for objects are
+ described in~\S??[object].
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Connections}
+??=[basics.connect]
+
+ Besides having the ability to be dropped at a position in a picture,
+ all objects may be used to "??w![connect]" the two current objects of
+ the state, \ie, $p$ and $c$. For most objects this is done by
+ `filling' the straight line between the centers with as many copies
+ as will fit between the objects:
+$$
+ \let\objectstyle=\scriptscriptstyle
+ \xy*=<12pt>[o]{p}="P"*\cir{} ; (60,15)*=<18pt,8pt>{c}="C"*\frm{-}**@{--}
+%
+ **\xybox{(0,0).(-3,-2).(2,3)*\frm{.}="box"*@{o}+0;
+ "box"+L**@{.}?*{L},
+ "box"+R**@{.}?*{R},
+ "box"+D**@{.}?*{D},
+ "box"+U**@{.}?*{U}},
+ \endxy
+$$
+ The ways the various objects connect are described along with the
+ objects.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Decorations}
+??=[basics.decor]
+
+ When the ??c![\xy] command reaches something that can not be
+ interpreted as a continuation of the position being read, then it is
+ expected to be a "??w![decoration]", \ie, in a restricted set of
+ \TeX\ commands which add to pictures. Most such commands are
+ provided by the various "user options" (\cf~\S??[option])---only a
+ few are provided within the kernel to facilitate programming of such
+ options (and user macros) as described in~\S??[decor].
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{The \Xy-pic state}
+??=[basics.state]
+
+ Finally we summarise the user-accessible parts of the
+ ??w![\Xy-picture state] of two positions together with the
+ last object associated with each: the "previous", ??w![$p$], is the
+ position |<|??w![$X_p$]|,| ??w![$Y_p$]|>| with the object
+ ??w![$L_p$], ??w![$R_p$], ??w![$D_p$], ??w![$U_p$], ??w!["Edge$_p$"],
+ and the "current", ??w![$c$], is the position |<|??w![$X_c$]|,|
+ ??w![$Y_c$]|>| with the object ??w![$L_c$], ??w![$R_c$], ??w![$D_c$],
+ ??w![$U_c$], ??w!["Edge$_c$"].
+
+ Furthermore, \Xy-pic has a configurable "??w![cartesian coordinate
+ system]" described by an "origin" position
+ |<|??w![$X_"origin"$]|,|??w![$Y_"origin"$]|>|
+ and two "base vectors" |<|??w![$X_"xbase"$]|,|??w![$Y_"xbase"$]|>|
+ and~|<|??w![$X_"ybase"$]|,|??w![$Y_"ybase"$]|>|
+ accessed by the usual notation using parentheses:
+$$
+\arraycolsep=.25em \begin{array}{rclll}
+ |(|x|,|y|)| & = & |<| & X_"origin" + x*X_"xbase" + y*X_"ybase" & |,| \\
+ & & & Y_"origin" + x*Y_"xbase" + y*Y_"ybase" & |>| \\
+\end{array}
+$$
+ This is explained in full when we show how to set the base in
+ note~??[base] of \S??[pos].
+
+ Finally typesetting a connection will setup a ``??w![placement
+ state]'' for referring to positions on the connection that is
+ accessed through a special |?| position construction; this is also
+ discussed in detail in \S??[pos].
+
+ The \Xy-pic "??w![state]" consists of all these parameters
+ together. They are initialised to zero except for
+ $X_"xbase"=Y_"ybase"=|1mm|$.
+
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ The edges are not directly available but points on the edges may be
+ found using the different <corner> forms described in \S??[pos].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ The edges are are available to the programmer as token lists; see
+ \S??[algo.edge] for details.
+
+\subparagraph*{Procedure:}
+
+ ??c![\xy]\ \dots\ ??c![\endxy] builds an object from an \Xy-pic <pos>
+ <decor> sequence as follows: (??_[xy1])~|\xy| starts the |\hbox| to
+ contain the \Xy-picture, (??_[xy2])~starts an inner box to be resized
+ appropriately later, sets |\xy@| to just execute immediately, and
+ makes a fresh scope for global internal names, and
+ (??_[xy3])~initialises the \Xy-pic state (setting the size to a
+ ridiculously large negative value), and finally passes control to
+ the <pos> parser.
+
+ Some care is taken to `lift' the diagram a bit to `vcenter' it when
+ in math mode, and ??c![\mathsurround] is set to zero to make changes
+ into math mode safe.
+
+\DOCMODE(
+\message{pictures: \string\xy,}
+
+\xydef@\xy{\ifmmode\expandafter\xymath@\else\expandafter\xynomath@\fi}
+\xydef@\xymath@{\hbox\bgroup \dimen@=\the\fontdimen22\textfont\tw@ \xyinside@}
+\xydef@\xynomath@{\hbox\bgroup \dimen@=\z@ \xyinside@}
+
+\xydef@\xyinside@{%
+ \saveXyStyle@ \aftergroup\xycheck@end %?*[xy1]
+ \setboxz@h\bgroup %?*[xy2]
+ \plainxy@
+ \X@c=\z@ \Y@c=\z@ \czeroEdge@ %?*[xy3]
+ \X@p=\z@ \Y@p=\z@ \U@p=\z@ \D@p=\z@ \L@p=\z@ \R@p=\z@ \Edge@p={\zeroEdge}%
+ \X@min=\hsize \X@max=-\hsize \Y@min=\hsize \Y@max=-\hsize
+ \mathsurround=\z@
+ \expandafter\POS\everyxy@@}
+
+\xydef@\czeroEdge@{\U@c=\z@ \D@c=\U@c \L@c=\U@c \R@c=\U@c \Edge@c={\zeroEdge}}
+
+\xydef@\xyxy@#1#2{#2}
+
+\xywarnifdefined\everyxy
+\expandafter\def\addEQ@\everyxy#1{\def\everyxy@@{#1}\ignorespaces}
+
+\xylet@\everyxy@@=\empty
+\DOCMODE)
+
+ When finished |\endxy| does a |\relax| to disable any parser still
+ active and (??_[endxy1])~resets the size of the generated box to zero
+ if no (unhidden) objects were inserted, and (??_[endxy2])~defines a
+ command to end both the temporary and the `proper' box and set its
+ size correctly---this uses ??c![\edef] to expand the required
+ dimensions used within the temporary box before leaving the two
+ groups (namely the temporary box and the `proper' box).
+
+\DOCMODE(
+\xydef@\endxy{\if\inxy@\else\xyerror@{Unexpected \string\endxy}{}\fi
+ \relax
+ \dimen@=\Y@max \advance\dimen@-\Y@min %?*[endxy1]
+ \ifdim\dimen@<\z@ \dimen@=\z@ \Y@min=\z@ \Y@max=\z@ \fi
+ \dimen@=\X@max \advance\dimen@-\X@min
+ \ifdim\dimen@<\z@ \dimen@=\z@ \X@min=\z@ \X@max=\z@ \fi
+ \edef\tmp@{\egroup %?*[endxy2]
+ \setboxz@h{\kern-\the\X@min\boxz@}%
+ \ht\z@=\the\Y@max \dp\z@=-\the\Y@min \wdz@=\the\dimen@
+ \noexpand\maybeunraise@ \raise\dimen@\boxz@
+ \noexpand\recoverXyStyle@ \egroup \noexpand\xy@end
+ \U@c=\the\Y@max \D@c=-\the\Y@min \L@c=-\the\X@min \R@c=\the\X@max}\tmp@}
+
+\xydef@\maybeunraise@{\if\inxy@\else \dimen@ii=\dp\z@
+ \ifdim\dimen@ii<\z@ \advance\dimen@\dimen@ii \fi\fi}
+\DOCMODE)
+
+ If an |\xy| is not properly closed by an |\endxy| then the error
+ message is produced. This happens if (a)~too many |\xy|s or (b)~too
+ many |\endxy|s or (c)~if there is the correct number of each but the
+ grouping becomes unbalanced due to a misplaced |}| or |\egroup|.
+
+\DOCMODE(
+\xydef@\xycheck@end{\xyFN@\xycheck@end@}
+\xydef@\xycheck@end@{\ifx\next\xy@end\DN@\xy@end{}\else\DN@{\xy@end}\fi\next@}
+\xydef@\xy@end{%
+ \xyerror@{An \string\xy\space environment is not closed correctly.}%
+ {I expected \string\endxy. You probably have an umatched {} grouping.}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ It is possible to insert an `initial' piece of <pos> <decor> at the
+ start of every \Xy-picture with the declaration
+%
+\begin{defs1}
+|\everyxy={| <text> |}|
+\end{defs1}
+\noindent\unskip
+%
+ This will act as if the <text> was typed literally right after each
+ ??c![\xy] command, parsing the actual contents as if it follows this
+ -- thus it is recommended that <text> has the form <pos>|,| such that
+ users can continue with <pos> <decor>.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section{Positions}
+??=[pos]
+
+\DOCMODE(
+\message{positions,}
+\DOCMODE)
+
+ A <pos>ition is a way of specifying locations as well as dropping
+ objects at them and decorating them---in fact any aspect of the
+ \Xy-pic state can be changed by a <pos> but most will just change the
+ coordinates and/or shape of~$c$.
+
+\begin{figure*}[tp]\SQUEEZE
+\vss
+\begin{syntax}
+ ??w![<pos>]
+ &\iss & <coord>
+ & $c\from<coord>$
+\cr
+ &\orr & <pos> ??c![+] <coord>
+ & $c \from <pos> + <coord>$??^[arithmetic]
+\cr
+ &\orr & <pos> ??c![-] <coord>
+ & $c \from <pos> - <coord>$??^[arithmetic]
+\cr
+ &\orr & <pos> ??c![!] <coord>
+ & $c\from<pos>$ then ??!^[skew] $c$ by <coord>
+\cr
+ &\orr & <pos> ??c![.] <coord>
+ & $c\from<pos>$ but also ??!^[covering] $<coord>$
+\cr
+ &\orr & <pos> ??c![,] <coord>
+ & $c\from<pos>$ then $c\from<coord>$
+\cr
+ &\orr & <pos> ??c![;] <coord>
+ & $c\from<pos>$, swap $p$ and $c$, $c\from<coord>$
+\cr
+ &\orr & <pos> ??c![:] <coord>
+ & $c\from<pos>$, set ??!^[base], $c\from<coord>$
+\cr
+ &\orr & <pos> ??c![::] <coord>
+ & $c\from<pos>$, $"ybase"\from c-"origin"$, $c\from<coord>$
+\cr
+ &\orr & <pos> ??c![*] <object>
+ & $c\from<pos>$, ??!^[drop] <object>
+\cr
+ &\orr & <pos> ??c![**] <object>
+ & $c\from<pos>$, ??!^[connect] using <object>
+\cr
+ &\orr & <pos> ??c![?] <place>
+ & $c\from<pos>$, $c\from\hbox{??!^[<place>]}$
+\cr
+ &\orr & <pos> ??c![@] <stacking>
+ & $c\from<pos>$, do <stacking>??^[stack]
+\cr
+ &\orr & <pos> ??c![=] <saving>
+ & $c\from<pos>$, do <saving>??^[save]
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<coord>]
+ &\iss & <vector>
+ & <pos> is <vector> with zero size
+\cr
+ &\orr & <empty> \orr\ ??c![c]
+ & reuse last $c$ (do nothing)
+\cr
+ &\orr & ??c![p]
+ & $p$
+\cr
+ &\orr & ??c![x] \orr\ ??c![y]
+ & ??!^[axis intersection] with $\overline{pc}$
+\cr
+ &\orr & ??c![s]<digit> \orr\ |s{|<number>|}|
+ & ??!^[stack] position <digit> or <number> below the top
+\cr
+ &\orr & |"|<id>|"|
+ & restore what was ??!^[saved] as <id> earlier
+\cr
+ &\orr & |{| <pos> <decor> |}|
+ & the $c$ resulting from interpreting the ??!^[group]
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<vector>]
+ &\iss & ??c![0]
+ & zero
+\cr
+ &\orr & |<| <dimen> |,| <dimen> |>|
+ & absolute??c[<>]
+\cr
+ &\orr & |<| <dimen> |>|
+ & absolute with equal dimensions
+\cr
+ &\orr & |(| <factor> |,| <factor> |)|
+ & in current ??!^[base]??c[()]
+\cr
+ &\orr & ??c![a] |(| <number> |)|
+ & ??!^[angle in current base]
+\cr
+ &\orr & <corner>
+ & from reference point to <corner> of $c$
+\cr
+ &\orr & <corner> |(| <factor> |)|
+ & The <corner> multiplied with <factor>
+\cr
+ &\orr & |/| <direction> <dimen> |/|
+ & vector <dimen> ??!^[in <direction>]??c[//]
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<corner>]
+ &\iss & ??c![L]\orr??c![R]\orr??c![D]\orr??c![U]
+ & ??!^[offset] to left, right, down, up side
+\cr
+ &\orr & ??c![CL]\orr??c![CR]\orr??c![CD]\orr??c![CU]\orr??c![C]
+ & ??!^[offset] to center of side, true center
+\cr
+ &\orr & ??c![LD]\orr??c![RD]\orr??c![LU]\orr??c![RU]
+ & ??!^[offset] to actual left/down, \dots\ corner
+\cr
+ &\orr & ??c![E]\orr??c![P]
+ & ??!^[offset] to nearest/proportional edge point to $p$
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<place>]
+ &\iss & ??c![<] <place> \orr\ ??c![>] <place>
+ & ??!^[shave] ??c![(0)]/??c![(1)] to edge of $p$/$c$, $f \from |0|/|1|$
+\cr
+ &\orr & |(| <factor> |)| <place>
+ & $f \from <factor>$
+\cr
+ &\orr & <slide>
+ & ??!^[pick place] and apply <slide>
+\cr
+ &\orr & ??c![!] |{|<pos>|}| <slide>
+ & ??!^[intercept] with line setup by <pos> and apply <slide>
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<slide>]
+ &\iss & |/| <dimen> |/|
+ & ??!^[slide] <dimen> further along connection
+\cr
+ &\orr & <empty>
+ & no slide
+\cr
+\end{syntax}
+\unskip\vskip-1em
+\caption{\protect<pos>itions.}??=[f.pos]
+\vfill
+\end{figure*}
+
+ All possible positions are shown in figure~??[f.pos] with explanatory
+ notes below.
+
+\begin{exercise}
+ Which of the positions |0|, |<0pt,0pt>|, |<0pt>|, |(0,0)|, and
+ |/0pt/| is different from the others?
+\answertext{In the default setup they are all denote the reference point of
+ the \Xy-picture but the cartesian coordinate <pos> ??c![(0,0)]
+ denotes the point "origo" that may be changed to something else using
+ the |:| operator.}
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Parsing:}
+
+ First the ??c![\POS] and ??c![\afterPOS] <decor>ations, and similar
+ ??c![\afterCOORD] and ??c![\afterVECTORorEMPTY] ones. They handle
+ parsing of <pos>, <coord>, and <vector>; parsing of <corner> and
+ <place> is presented along with note~??[corner] and~??[<place>]
+ explaining them.
+
+\DOCMODE(
+\xydef@\POS{\afterPOS{}}
+
+\xydef@\afterPOS#1{%
+ \DN@##1{\def\afterPOS@{\def\afterPOS@{##1}#1}}%
+ \expandafter\next@\expandafter{\afterPOS@}%
+ \afterCOORD{\xyFN@\POS@}}
+
+\xylet@\afterPOS@=\empty
+
+\xydef@\afterCOORD#1{%
+ \DN@##1{\def\afterCOORD@{\def\afterCOORD@{##1}#1}}%
+ \expandafter\next@\expandafter{\afterCOORD@}%
+ \afterVECTORorEMPTY{\xy@@\czeroEdge@ \afterCOORD@}{\xyFN@\COORD@}}
+
+\xylet@\afterCOORD@=\empty
+
+\xydef@\afterVECTORorEMPTY#1#2{%
+ \DN@##1{\def\afterVECTOR@{\def\afterVECTOR@{##1}%
+ \ifVECTORempty@\DN@{#2}\else\DN@{#1}\fi \next@}}%
+ \expandafter\next@\expandafter{\afterVECTOR@}%
+ \xyFN@\VECTOR@}
+
+\xynew@{if}\ifVECTORempty@
+\xylet@\afterVECTOR@=\empty
+\DOCMODE)
+
+ The ??c![\afterVECTORorEMPTY] command is special in that it takes two
+ arguments: the `continuation' if a <vector> was found and the
+ continuation if <empty> was found (this is not applicable to the
+ other two since <empty> is a legal <coord> and thus also a legal
+ <pos>).
+
+ Next we proceed with the actual parsing primitives: |\COORD@|,
+ |\POS@|, and |\VECTOR@|. These are bound to |\xyCOORD@|, |\xyPOS@|,
+ and |\xyVECTOR@| in order to be extendable, \eg, the |matrix| option
+ extends <coord> to support the |[|"row"|,| "column"|]| format by
+ redefining |\COORD@| to first test for this new format and then call
+ |\xyCOORD@|.
+
+ The parsing commands above are set up such that they all first call
+ the |\VECTOR@| command. <coord> and <pos> parsing then proceeds with
+ calling the |\COORD@| if there was no <vector>. <pos> parsing then
+ calls |\POS@| to continue the <pos> (in both cases).
+
+ First <vector>s:
+
+\DOCMODE(
+\xydef@\xyVECTOR@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\VECTOR@}%gobble spaces
+ \else \ifcat A\noexpand\next \let\next@=\VECTOR@letter
+ \else \let\next@=\VECTOR@other \fi\fi \next@}
+
+\xylet@\VECTOR@=\xyVECTOR@
+\DOCMODE)
+
+ All letters used for <vector>s are uppercase <corner>s except for |a|
+ used for angles (where the main code is in note~??[angle in current
+ base]); this is also where we introduce the auxiliary
+ |\notrelaxorelse@| that takes two control sequences and expands the
+ first unless it is relax in which case it expands the second:
+
+\DOCMODE(
+\def\notrelaxorelse@#1#2{\ifx#1\relax \expandafter#2\else\expandafter#1\fi}
+
+\xydef@\VECTOR@letter{%
+ \ifx a\next \expandafter\VECTOR@a \else \expandafter\CORNER@ \fi}
+
+\xydef@\VECTOR@a a(#1){\xy@{a(#1)}{\vfromcartesianangle@{#1}}%
+ \VECTORempty@false \afterVECTOR@}
+\DOCMODE)
+
+ The <corner> trick is to do nothing when there is nothing and
+ initialise both $X$ and $Y$ in all other cases.
+
+\DOCMODE(
+\xydef@\CORNER@{%
+ \xy@{}{\A@=-.5\L@c \advance\A@.5\R@c \B@=-.5\D@c \advance\B@.5\U@c
+ \let\nextii@=\zeroit@}%
+ \VECTORempty@true\CORNER@i}
+
+\xydef@\zeroit@#1{#1=\z@}
+
+\xydef@\CORNER@i{%
+ \ifx D\next \DN@ D{\xy@{D}{\Y@c=-\D@c \nextii@\X@c \B@=\Y@c}\CORNER@ii}%
+ \else\ifx U\next \DN@ U{\xy@{U}{\Y@c= \U@c \nextii@\X@c \B@=\Y@c}\CORNER@ii}%
+ \else\ifx L\next \DN@ L{\xy@{L}{\X@c=-\L@c \nextii@\Y@c \A@=\X@c}\CORNER@ii}%
+ \else\ifx R\next \DN@ R{\xy@{R}{\X@c= \R@c \nextii@\Y@c \A@=\X@c}\CORNER@ii}%
+ \else\ifx C\next \DN@ C{\xy@{C}{\X@c= \A@ \Y@c= \B@}\CORNER@ii}%
+ \else\ifx E\next \DN@ E{\xy@{E}{%
+ \A@=\X@c \B@=\Y@c \the\Edge@c\z@ \advance\X@c-\A@ \advance\Y@c-\B@}%
+ \CORNER@ii}%
+ \else\ifx P\next \DN@ P{\xy@{P}{%
+ \A@=\X@c \B@=\Y@c \the\Edge@c\thr@@ \advance\X@c-\A@ \advance\Y@c-\B@}%
+ \CORNER@ii}%
+ \else\ifx (\next %)
+ \DN@(##1){\xy@{(##1)}{\X@c=##1\X@c \Y@c=##1\Y@c}\afterVECTOR@}%
+ \else \let\next@=\afterVECTOR@
+ \fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\CORNER@ii{\xy@@{\let\nextii@=\eat@}%
+ \VECTORempty@false \xyFN@\CORNER@i}
+\DOCMODE)
+
+ |\CORNER@i| recognises the |(|<factor>|)| also; this does no harm as
+ it was never called if the first character was a |(|.
+
+ The remaining <vector> forms just set $X$ and $Y$.
+
+\DOCMODE(
+\xydef@\VECTOR@other{%
+ \addLT@\ifx \next
+ \addGT@{\addLT@\DN@##1}{\xy@{<##1>}{\vfromabsolute@{##1}}%
+ \VECTORempty@false\afterVECTOR@}%
+ \else\ifx (\next %)
+ \DN@({\xyFN@\VECTOR@other@open}%)
+ \else\ifx /\next %/
+ \DN@/##1/{\xy@@ix@{{##1}}%
+ \xy@{/##1/}{\expandafter\vfromslide@\the\toks9 }%
+ \VECTORempty@false\afterVECTOR@}%
+ \else\ifx 0\next
+ \DN@ 0{\xy@{0}{\X@c=\z@ \Y@c=\z@}\VECTORempty@false\afterVECTOR@}%
+ \else
+ \DN@{\VECTORempty@true\afterVECTOR@}%
+ \fi\fi\fi\fi \next@}
+\DOCMODE)
+
+ \HACK: escape out in case of the special |(*| introducer\dots picked
+ up by the <coord> parser, then.
+
+\DOCMODE(
+\xydef@\VECTOR@other@open{%
+ \ifx *\next \DN@{\VECTORempty@true \xyFN@\afterVECTOR@(}%)
+ \else
+ \DN@##1){\xy@{(##1)}{\vfromcartesian@{##1}}\VECTORempty@false\afterVECTOR@}%
+ \fi \next@}
+\DOCMODE)
+
+ Next <coord>inates that are not <vector>s:
+
+\DOCMODE(
+\xydef@\xyCOORD@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\COORD@}%gobble spaces
+ \else \ifcat A\noexpand\next \let\next@=\xyCOORD@letter
+ \else \let\next@=\xyCOORD@other \fi\fi \next@}
+
+\xylet@\COORD@=\xyCOORD@
+
+\xydef@\xyCOORD@letter{%
+ \ifx c\next
+ \DN@ c{\xy@{c}{}\afterCOORD@}%
+ \else\ifx p\next
+ \DN@ p{\xy@{p}\cfromp@ \afterCOORD@}%
+ \else\ifx x\next
+ \DN@ x{\xy@{x}{\R@c=\X@xbase \U@c=\Y@xbase \intersect@}\afterCOORD@}%
+ \else\ifx y\next
+ \DN@ y{\xy@{y}{\R@c=\X@ybase \U@c=\Y@ybase \intersect@}\afterCOORD@}%
+ \else\ifx s\next
+ \DN@ s##1{\xy@{s{##1}}{\cfroms@{##1}}\afterCOORD@}%
+ \else \let\next@=\afterCOORD@ \fi\fi\fi\fi\fi \next@}
+
+\xydef@\xyCOORD@other{%
+ \ifx "\next %"
+ \DN@"##1"{\xy@{"##1"}{\cfromid@{##1}}\afterCOORD@}%
+ \else\ifx \bgroup\next
+ \DN@##1{\xy@{{##1}}{\enter@{\pfromthep@\basefromthebase@}}%
+ \silencexy@ \POS##1\relax \unsilencexy@ \xy@@\leave@ \afterCOORD@}%
+ \else\ifx (\next %)
+ \DN@({\xyFN@\xyCOORD@other@open}%)
+ \else \let\next@=\afterCOORD@ \fi\fi\fi \next@}
+
+\xynew@{if}\ifsilentxy@
+
+\xydef@\silencexy@{%
+ \ifsilentxy@ \nter@{}%
+ \else \nter@{\silentxy@false \let\xy@=\unsilent@@xy@}
+ \silentxy@true \let\unsilent@@xy@=\xy@ \def\xy@##1##2{\unsilent@@xy@{}{##2}}%
+ \fi}
+
+\xydef@\unsilencexy@{\leave@}
+
+\xydef@\xyCOORD@other@open{%
+ \ifx *\next
+ \DN@*##1*){\xy@{(*}{\enter@{\pfromthep@\basefromthebase@}}%
+ \POS##1\relax \xy@{*)}\leave@ \afterCOORD@}%
+ \else \DN@{\xyFN@\afterCOORD@(}%)
+ \fi \next@}
+\DOCMODE)
+
+ Finally <pos> parsing after <coord> (possibly <vector>) is
+ interpreted:
+
+\DOCMODE(
+\xydef@\xyPOS@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\POS@}%gobble spaces
+ \else\addPLUS@\ifx \next
+ \addPLUS@\DN@{\xy@+{\enter@\cplusthec@}%
+ \afterCOORD{\xy@@\leave@ \xyFN@\POS@}}%
+ \else\addDASH@\ifx \next
+ \addDASH@\DN@{\xy@-{\enter@\cplusthec@}%
+ \afterCOORD{\xy@@{\X@c=-\X@c \Y@c=-\Y@c\leave@}\xyFN@\POS@}}%
+ \else\ifx !\next
+ \DN@ !{\xy@!{\enter@\cskewthec@}\afterCOORD{\xy@@\leave@ \xyFN@\POS@}}%
+ \else\addDOT@\ifx \next
+ \addDOT@\DN@{\xy@.{\enter@\cmergethec@}%
+ \afterCOORD{\xy@@\leave@ \xyFN@\POS@}}%
+ \else\ifx ,\next
+ \DN@ ,{\xy@,{\comma@@}\afterCOORD{\xyFN@\POS@}}%
+ \else\ifx ;\next
+ \DN@ ;{\xy@;{\swap@}\afterCOORD{\xyFN@\POS@}}%
+ \else\ifx :\next
+ \DN@ :{\xyFN@\POS@colon}%
+ \else\addEQ@\ifx \next
+ \addEQ@\DN@{\xyFN@\saveid@}%
+ \else\ifx *\next
+ \DN@ *{\xyFN@\POS@star}%
+ \else \ifx ?\next
+ \DN@?{\xy@?{}\afterPLACE{\xyFN@\POS@}}%
+ \else \addAT@\ifx \next
+ \addAT@\DN@{\xyFN@\STACK@}%
+ \else
+ \let\next@=\afterPOS@
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xylet@\comma@@=\relax
+
+\xylet@\POS@=\xyPOS@
+\DOCMODE)
+
+ |\comma@@| is a hook used to change the operation of |,|, \eg, when
+ reading a stack setup where it means `push'.
+
+ The final functions serve only to distinguish between the single
+ character |:|/|*| and dual character |::|/|**| operators:
+
+\DOCMODE(
+\xydef@\POS@colon{\DNii@{\afterCOORD{\xyFN@\POS@}}%
+ \ifx :\next \xy@{::}{\setbase@@\X@c\Y@c}\DN@:{\nextii@}%
+ \else \xy@:{\setbase@\X@p\Y@p\X@c\Y@c}\let\next@=\nextii@ \fi
+ \next@}
+
+\xydef@\POS@star{%
+ \ifx *\next
+ \DN@*##1##{\nextii@{##1}}%
+ \DNii@##1##2{\xy@@ix@{{##1}{##2}}%
+ \xy@{**##1{##2}}{\expandafter\connect@\the\toks9 }\xyFN@\POS@}%
+ \else
+ \DN@##1##{\nextii@{##1}}%
+ \DNii@##1##2{\xy@@ix@{{##1}{##2}}%
+ \xy@{*##1{##2}}{\expandafter\drop@\the\toks9 }\xyFN@\POS@}%
+ \fi
+ \next@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Simple actions:}
+
+ Next follow the simplest actions; the complicated ones are explained
+ along with their notes below.
+
+\DOCMODE(
+\xydef@\cfromp@{\X@c=\X@p \Y@c=\Y@p \U@c=\U@p \D@c=\D@p \L@c=\L@p \R@c=\R@p
+ \Edge@c=\expandafter{\the\Edge@p}}
+
+\xydef@\pfromc@{\X@p=\X@c \Y@p=\Y@c \U@p=\U@c \D@p=\D@c \L@p=\L@c \R@p=\R@c
+ \Edge@p=\expandafter{\the\Edge@c}}
+
+\xydef@\swapdimen@#1#2{\dimen@=#1\relax #1=#2\relax #2=\dimen@}
+
+\xynew@{toks}\swaptoks@@
+
+\xydef@\swap@{\swapdimen@\X@c\X@p \swapdimen@\Y@c\Y@p
+ \swapdimen@\U@c\U@p\swapdimen@\D@c\D@p \swapdimen@\L@c\L@p\swapdimen@\R@c\R@p
+ \swaptoks@@=\Edge@c \Edge@c=\Edge@p \Edge@p=\swaptoks@@}
+\DOCMODE)
+
+ Next the parsing of coordinate pairs in |<>|:
+
+\DOCMODE(
+\xydef@\vfromabsolute@#1{\vfromabsolute@@#1,@}
+
+\xydef@\vfromabsolute@@#1,#2@{\X@c=#1\relax
+ \DN@{#2}\ifx\next@\empty \Y@c=\X@c
+ \else \DN@##1,{\Y@c=##1}\next@#2\relax \fi
+% \advance\X@c 1sp \advance\Y@c 1sp %HACK
+}
+\DOCMODE)
+
+ The next group of commands are used to store on the control stack
+ with the |\enter@| command, so they "expand" to something useful:
+
+\DOCMODE(
+\xydef@\cfromthec@{\X@c=\the\X@c \Y@c=\the\Y@c
+ \U@c=\the\U@c \D@c=\the\D@c \L@c=\the\L@c \R@c=\the\R@c
+ \Edge@c={\expandafter\noexpand\the\Edge@c}}
+
+\xydef@\cfromthep@{\X@c=\the\X@p \Y@c=\the\Y@p
+ \U@c=\the\U@p \D@c=\the\D@p \L@c=\the\L@p \R@c=\the\R@p
+ \Edge@c={\expandafter\noexpand\the\Edge@p}}
+
+\xydef@\pfromthep@{\X@p=\the\X@p \Y@p=\the\Y@p
+ \U@p=\the\U@p \D@p=\the\D@p \L@p=\the\L@p \R@p=\the\R@p
+ \Edge@p={\expandafter\noexpand\the\Edge@p}}
+
+\xydef@\pfromthec@{\X@p=\the\X@c \Y@p=\the\Y@c
+ \U@p=\the\U@c \D@p=\the\D@c \L@p=\the\L@c \R@p=\the\R@c
+ \Edge@p={\expandafter\noexpand\the\Edge@c}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notes}
+
+\note??=[arithmetic]
+%
+ When doing arithmetic with |+| and |-| then the resulting current
+ object inherits the size of the <coord>, \ie, the right
+ argument---this will be zero if the <coord> is a <vector>.
+
+\begin{exercise}
+ How do you set $c$ to an object the same size as the saved object
+ |"ob"| but moved |<|$X$|,|$Y$|>|?
+\answertext{Use the <pos>ition |<|$X$|,|$Y$|>+"ob"|.}
+\end{exercise}
+
+\DOCMODE(
+\xydef@\cplusthec@{\advance\X@c\the\X@c \advance\Y@c\the\Y@c}
+\DOCMODE)
+
+\note??=[skew]
+%
+ "Skewing" using |!| just means that the reference point of $c$ is
+ moved with as little change to the shape of the object as possible,
+ \ie, the edge of~$c$ will remain in the same location except that it
+ will grow larger to avoid moving the reference point outside~$c$.
+%
+\begin{exercise}
+ What does the <pos> \dots|!R-L| do?
+\answertext{It first sets $c$ according to ``\dots''. Then it changes $c$ to
+ the point right of $c$ at the same distance from the right edge of
+ $c$ as its width, $w$, \ie,
+$$
+\xy
+ *+\hbox{The \dots}="it" *\frm{_\}}!D-U*{w}
+ ,{"it"+RD}.{"it"+RU}.{"it"!R-L*{\times}+0}!C *\frm{_\}}!D-U*{w}
+\endxy
+$$}
+\end{exercise}
+%
+ \BUG: The result of |!| is always a rectangle currently.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Procedure:}
+
+ |!| moves the center of $c$ by a temporarily read $c'$ and then
+ readjusts the extents:
+$$
+\begin{array}{rclcl}
+ D_c &:=& Y'+Y_c - \min(Y'-D', Y'+Y_c) &=& \max(Y_c+D',0)\\
+ U_c &:=& \max(Y'+U', Y'+Y_c) - (Y'+Y_c) &=& \max(U'-Y_c,0)\\
+ Y_c &:=& Y'+Y_c\\
+ L_c &:=& X'+X_c - \min(X'-L', X'+X_c) &=& \max(X_c+L',0)\\
+ R_c &:=& \max(X'+R', X'+X_c) - (X'+X_c) &=& \max(R'-X_c,0)\\
+ X_c &:=& X'+X_c\\
+\end{array}
+$$
+
+\DOCMODE(
+\xydef@\cskewthec@{%
+ \noexpand\cskew@{\the\Y@c}{\the\X@c}{\the\D@c}{\the\U@c}{\the\L@c}{\the\R@c}}
+
+\xydef@\cskew@#1#2#3#4#5#6{%
+ \D@c=#3\advance\D@c \Y@c \ifdim\D@c<\z@ \D@c=\z@ \fi
+ \U@c=#4\advance\U@c-\Y@c \ifdim\U@c<\z@ \U@c=\z@ \fi
+ \advance\Y@c#1%
+ \L@c=#5\advance\L@c \X@c \ifdim\L@c<\z@ \L@c=\z@ \fi
+ \R@c=#6\advance\R@c-\X@c \ifdim\R@c<\z@ \R@c=\z@ \fi
+ \advance\X@c#2%
+ \Edge@c={\rectangleEdge}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[covering]
+%
+ A <pos> "covers" another if it is a rectangle with size sufficiently
+ large that the other is ``underneath''. The |.| operation
+ ``extends'' a <pos> to cover an additional one---the reference point
+ of $c$ is not moved but the shape is changed to a rectangle such that
+ the entire $p$ object is covered.
+
+ \BUG: non-rectangular objects are first ``translated'' into a
+ rectangle by using a diagonal through the object as the diagonal of
+ the rectangle.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Procedure:}
+
+ |.| takes a temporary object $c'$ and adjusts the extents of $c$ such
+ that it is covered.
+$$
+\begin{array}{rclcl}
+ L_c &:=& X' - \min(X'-L_c, X-L) &=& \max(L_c, A+L)\\
+ R_c &:=& \max(X'+R_c, X+R) - X' &=& \max(R_c, -A+R)\\
+ D_c &:=& Y' - \min(Y'-D_c, Y-D) &=& \max(D_c, B+D)\\
+ U_c &:=& \max(Y'+U_c, Y+U) - Y' &=& \max(U_c, -B+U)\\
+\end{array}
+$$
+ with $|<|A|,|B|>| = |<|X'-X|,|Y'-Y|>|$. First method~2 of the object
+ is used to convert it into a rectangle.
+
+\DOCMODE(
+\xydef@\cmergethec@{%
+ \noexpand\cmerge@{\the\Y@c}{\the\X@c}{\the\D@c}{\the\U@c}{\the\L@c}{\the\R@c}}
+
+\xydef@\cmerge@#1#2#3#4#5#6{\the\Edge@c4%
+ \A@=#2\advance\A@-\X@c \B@=#1\advance\B@-\Y@c
+ \dimen@=#5\advance\L@c \A@ \ifdim\L@c<\dimen@ \L@c=\dimen@ \fi
+ \dimen@=#6\advance\R@c-\A@ \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
+ \dimen@=#3\advance\D@c \B@ \ifdim\D@c<\dimen@ \D@c=\dimen@ \fi
+ \dimen@=#4\advance\U@c-\B@ \ifdim\U@c<\dimen@ \U@c=\dimen@ \fi
+ \advance\X@c\A@ \advance\Y@c\B@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[base]
+%
+ The operations |:| and |::| set the "base" used for <coord>inates
+ having the form $|(|x|,|y|)|$. The |:| operation will set
+ |<|$X_"origin"$|,| $Y_"origin"$|>| to~$p$, |<|$X_"xbase"$|,|
+ $Y_"xbase"$|>| to $c-"origin"$, and~|<|$X_"ybase"$|,| $Y_"ybase"$|>|
+ to |<|${-}Y_"xbase"$|,| $X_"xbase"$|>| (this ensures that it is a
+ usual square coordinate system). The |::| operation may then be used
+ afterwards to make nonsqare bases by just setting "ybase" to
+ $c-"origin"$. Here are two examples: firstly |0;<1cm,0cm>:| sets the
+ coordinate system
+$$
+\xy
+ <0cm,0cm>*@{o};<1cm,0cm>:
+ (0,0);{(1,0)**@{-}?>*@{>}},{(0,1)**@{-}?>*@{>}},
+ (0,0)*+!UR\hbox{\small"origin"},
+ (1,0)*+!LC\hbox{\small"xbase"},
+ (0,1)*!D\hbox{\small"ybase"},
+ (1,1)*{*}*++!CL{|(1,1)|}+0;(0,1)**@{.},(1,0)**@{.}
+\endxy
+$$
+ while~|<1cm,.5cm>;<2cm,1.5cm>:<1cm,1cm>::|\hfil defines
+$$
+\xy
+ <0cm,0cm>*@{o}, <1cm,.5cm>;<2cm,1.5cm>:
+%
+ (0,0);{(0,1)**@{--}?(1)*@{>}},
+ (0,1)*+!R\txt\small{"ybase"\\before\\{\tt::}},
+%
+ <1cm,1cm>::
+ (0,0);{(1,0)**@{-}?(1)*@{>}},{(0,1)**@{-}?(1)*@{>}},
+ (0,0)*+!LU\txt\small{"origin"},
+ (1,0)*+!LC\txt\small{"xbase"},
+ (0,1)*!D\txt\small{"ybase"},
+ (1,1)*{*}*++!CL{|(1,1)|}+0;(0,1)**@{.},(1,0)**@{.}
+\endxy
+$$
+ where in each case the $\circ$ is at |0|, the base vectors have been
+ drawn and the $\times$ is at |(1,1)|.
+
+ When working with cartesian coordinates these three special <factor>s
+ are particularly useful:
+%
+\begin{defs}
+ ??c![\halfroottwo] & $0.70710678\approx{1\over2}\sqrt2$ \cr
+ ??c![\partroottwo] & $0.29289322\approx 1-{1\over2}\sqrt2$ \cr
+ ??c![\halfrootthree] & $0.86602540\approx{1\over2}\sqrt3$ \cr
+\end{defs}
+\noindent\unskip
+%
+ More can be defined using |\def| (or |\newcommand| in \LaTeX).
+
+\DOCMODE(
+\xydef@\halfroottwo{.70710678}
+\xydef@\partroottwo{.29289322}
+\xydef@\halfrootthree{.8660254}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Procedure:}
+
+ The code chosen by the parsing is very simple; the only tricky bit is
+ to ensure that |\basefromthebase@| always expands to set the current
+ base.
+
+\DOCMODE(
+\xydef@\vfromcartesian@#1{\vfromcartesian@@#1@}
+
+\xydef@\vfromcartesian@@#1,#2@{%
+ \X@c=\X@origin \advance\X@c#1\X@xbase \advance\X@c#2\X@ybase
+ \Y@c=\Y@origin \advance\Y@c#1\Y@xbase \advance\Y@c#2\Y@ybase}
+
+\xydef@\setbase@#1#2#3#4{%
+ \X@origin=#1\relax \Y@origin=#2\relax
+ \X@xbase=#3\relax \advance\X@xbase-\X@origin
+ \Y@xbase=#4\relax \advance\Y@xbase-\Y@origin
+ \X@ybase=-\Y@xbase \Y@ybase=\X@xbase}
+
+\xydef@\setbase@@#1#2{%
+ \X@ybase=#1\relax \advance\X@ybase-\X@origin
+ \Y@ybase=#2\relax \advance\Y@ybase-\Y@origin}
+
+\xydef@\basefromthebase@{\X@origin=\the\X@origin \Y@origin=\the\Y@origin
+ \X@xbase=\the\X@xbase \Y@xbase=\the\Y@xbase
+ \X@ybase=\the\X@ybase \Y@ybase=\the\Y@ybase}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[angle in current base]
+%
+ An "angle" $\alpha$ in \Xy-pic is the same as the coordinate pair
+ $|(|\cos\alpha|,|\sin\alpha|)|$ where $\alpha$ must be an integer
+ interpreted as a number of degrees. Thus the <vector> |a(0)| is the
+ same as |(1,0)| and |a(90)| as |(0,1)|, etc.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The translation involves several steps: (??_[ang1])~Normalise the
+ argument to be within $[0^\circ:360^\circ[$. (??_[ang2])~Flip angle
+ around $x$-axis and then $y$-axis to ensure it is in the first
+ quadrant, \ie, within $[0^\circ:90^\circ[$. (??_[ang3])~Flip around
+ diagonal to ensure angle within $[0^\circ:45^\circ[$.
+ (??_[ang4])~Find values $\phi\le\alpha\lt\psi$ from the table in
+ figure~??[f.angles] (using recursive table lookup -- at most 3 tests
+ needed). (??_[ang5])~build vector $(x,y)$ interpolated between the
+ sin/cos values for $\phi$ and $\psi$ using the formula
+$$
+ \left(\cos\phi + k(\cos\psi-\cos\phi) ,
+ \sin\phi + k(\sin\psi-\sin\phi) \right) ~,
+ \quad\hbox{where}~k = \frac{\alpha-\phi}{\psi-\phi}
+$$
+ (??_[angx])~build the chosen vector.
+
+\begin{figure*}[tp]
+ \noindent Vectors for angles in $[0^\circ:45^\circ]$: contains all
+ angles required to typeset fractions up to $\frac{n}{12}\times2\pi$,
+ $\frac1{16}\times2\pi$, and $\frac1{24}\times2\pi$ exactly, and two
+ extra low ones to ensure that all gaps are less than $5^\circ$ and
+ the precision of all sine/cosines better than $\frac1{1000}$.
+ $$
+ \small
+ \def"{\vphantom{\frac()}\frac}
+ \begin{array}{\otherbar l\otherbar r@{~}l\otherbar c\otherbar c\otherbar}
+ \hline
+ ~\alpha & (\cos\alpha, & \sin\alpha) & \hbox{fractions of $2\pi$} &
+ \hbox{flipped fractions of $2\pi$} \\
+ \hline
+ ~0&(1,&0) & "0{n}
+ & "12,"14,"24,"28,"34,"36,"3{12},"48,"5{10},"68,"6{12},"9{12} \\
+ ~4.090909 & (.99677570, & .08023846) & - & - \\
+ ~6 & (.99452190, & .10452846) & - & - \\
+ ~8.181818 & (.98982144, & .14231484) & "3{11} & "8{11} \\
+ 10 & (.98480775, & .17364818) & "79 & "29 \\
+ 12.857143 & (.97492791, & .22252093) & "27 & "57 \\
+ 15 & (.96592583, & .25881905) & "1{24} & \\
+ 16.363636 & (.95949297, & .28173256) & "6{11} & "5{11} \\
+ 18 & (.95105652, & .30901699) & "3{10},"45,"8{10} & "15,"2{10},"7{10} \\
+ 20 & (.93969262, & .34202014) & "59 & "49 \\
+ 22.5 & (.92387953, & .38268343) & "1{16} & \\
+ 24.545455 & (.90963200, & .41541501) & "9{11} & "2{11} \\
+ 25.714286 & (.90096887, & .43388374) & "47 & "37 \\
+ 30 & (.86602540, & .5) & "13,"1{12},"26,"39,"4{12},"56,"7{12},"{10}{12}
+ & "16,"23,"2{12},"46,"5{12},"69,"8{12},"{11}{12} \\
+ 32.727273 & (.84125353, & .54064082) & "1{11} & "{10}{11} \\
+ 36 & (.80901699, & .58778525) & "1{10},"35,"6{10} & "25,"4{10},"9{10} \\
+ 38.571429 & (.78183148, & .62348980) & "67 & "17 \\
+ 40 & (.76604444, & .64278761) & "19 & "89 \\
+ 40.909091 & (.75574957, & .65486073) & "4{11} & "7{11} \\
+ 45 & (.70710678, & .70710678) & "18,"38,"58,"78 & - \\
+ \hline
+ \end{array}
+ $$
+ \caption{Computing angle vectors}
+ ??=[f.angles]
+\end{figure*}
+
+\DOCMODE(
+\xydef@\vfromcartesianangle@#1{\enter@\basefromthebase@ \R@=#1\p@
+ \B@=360\p@ %?*[ang1]
+ \loop@ \ifdim\R@<\z@ \advance\R@\B@ \repeat@
+ \loop@ \ifdim\R@>\B@ \advance\R@-\B@ \repeat@
+ \ifdim\R@<.5\B@\else \R@=-\R@ \advance\R@\B@ %?*[ang2]
+ \X@ybase=-\X@ybase \Y@ybase=-\Y@ybase \fi
+ \B@=180\p@
+ \ifdim\R@<.5\B@\else \R@=-\R@ \advance\R@\B@
+ \X@xbase=-\X@xbase \Y@xbase=-\Y@xbase \fi
+ \B@=90\p@ %?*[ang3]
+ \ifdim\R@<.5\B@ \let\nextiii@=\literal@
+ \else \R@=-\R@ \advance\R@\B@ \def\nextiii@##1,##2@{##2,##1@}\fi
+ \dimen@=\z@ \DN@{1,0@}% %?*[ang4]
+ \dimen@ii=45\p@ \DNii@{.70710678,.70710678@}%
+ \chooseangleinterval@
+ {\chooseangleinterval@
+ {\chooseangleinterval@
+ {\chooseangleinterval@
+ {\chooseangleinterval@
+ {}%
+ {4.090909}{.99677570,.08023846@}%
+ {}}%
+ {6}{.99452190,.10452846@}%
+ {\chooseangleinterval@
+ {}%
+ {8.181818}{.98982144,.14231484@}%
+ {}}}%
+ {10}{.98480775,.17364818@}%
+ {\chooseangleinterval@
+ {}%
+ {12.857143}{.97492791,.22252093@}%
+ {}}}%
+ {15}{.96592583,.25881905@}%
+ {\chooseangleinterval@
+ {\chooseangleinterval@
+ {}%
+ {16.363636}{.95949297,.28173256@}%
+ {}}%
+ {18}{.95105652,.30901699@}%
+ {\chooseangleinterval@
+ {}%
+ {20}{.93969262,.34202014@}%
+ {}}}}%
+ {22.5}{.92387953,.38268343@}%
+ {\chooseangleinterval@
+ {\chooseangleinterval@
+ {\chooseangleinterval@
+ {}%
+ {24.545455}{.90963200,.41541501@}%
+ {}}%
+ {25.714286}{.90096887,.43388374@}%
+ {}}%
+ {30}{.86602540,.5@}%
+ {\chooseangleinterval@
+ {\chooseangleinterval@
+ {}%
+ {32.727273}{.84125353,.54064082@}%
+ {}}%
+ {36}{.80901699,.58778525@}%
+ {\chooseangleinterval@
+ {\chooseangleinterval@
+ {}%
+ {38.571429}{.78183148,.62348980@}%
+ {}}%
+ {40.909091}{.75574957,.65486073@}%
+ {\chooseangleinterval@
+ {}%
+ {40}{.76604444,.64278761@}%
+ {}}}}}%
+ \A@=\R@ \advance\A@-\dimen@ %?*[ang5]
+ \ifdim\ifdim\A@<\z@-\fi\A@<.01\p@ \edef\next@{\expandafter\nextiii@\next@}%
+ \else \B@=\dimen@ii \advance\B@-\R@
+ \ifdim\A@<\B@ \dimen@=\toradians@\A@
+ \edef\next@{\next@ \expandafter\removePT@\the\dimen@ @}%
+ \else \dimen@=-\toradians@\B@
+ \edef\next@{\nextii@ \expandafter\removePT@\the\dimen@ @}%
+ \fi
+ \expandafter\interpolatepoint@\next@
+ \edef\next@{\expandafter\nextiii@\next@}%
+ \fi
+ \expandafter\vfromcartesian@@\next@ %?*[angx]
+ \leave@}
+
+\xydef@\chooseangleinterval@#1#2#3#4{%
+ \B@=#2\p@ \def\next{#3}%
+ \ifdim\R@<\B@ \dimen@ii=\B@ \let\nextii@=\next #1%
+ \else \dimen@=\B@ \let\next@=\next \ifdim\B@<\R@ #4\fi\fi}
+
+\xydef@\interpolateinterval@#1,#2@#3,#4@{%
+ \A@=#1\p@ \dimen@=#3\p@ \advance\dimen@-\A@ \advance\A@\next\dimen@
+ \B@=#2\p@ \dimen@=#4\p@ \advance\dimen@-\B@ \advance\B@\next\dimen@
+ \edef\next@{\expandafter\removePT@\the\A@,\expandafter\removePT@\the\B@ @}}
+
+\xydef@\toradians@{0.01745329}
+
+\xydef@\interpolatepoint@#1,#2@#3@{%
+ \A@=#1\p@ \dimen@ii=#3\A@ \dimen@ii=-.5\dimen@ii \advance\A@#3\dimen@ii
+ \dimen@=-#2\p@ \advance\A@#3\dimen@
+ \B@=#2\p@ \dimen@ii=#3\B@ \dimen@ii=-.5\dimen@ii \advance\B@#3\dimen@ii
+ \dimen@=#1\p@ \advance\B@#3\dimen@
+ \edef\next@{\expandafter\removePT@\the\A@,\expandafter\removePT@\the\B@ @}}
+\DOCMODE)
+
+ Figure~\ref{f.alldirections} shows all directions.
+
+\begin{figure}[ht]
+\begin{center}\leavevmode
+\def\a#1(#2){\save"o";a(#2)**@{-}*+__!P{\scriptscriptstyle#1#2}\restore}
+\def\ad(#1){\save"o",a(#1)*{\cdot}\restore}
+%
+\newcount\n \newcount\m
+\xy (50,0):0*{\kern.7pt\scriptstyle\ddot\smile}*[o]\cir<4pt>{}="o"\relax
+\n=0 %
+\loop
+ \expandafter\a\expandafter(\the\n)%
+ \advance\n1 \expandafter\ad\expandafter(\the\n)%
+ \advance\n1 \expandafter\ad\expandafter(\the\n)%
+ \advance\n1 \expandafter\ad\expandafter(\the\n)%
+ \advance\n1 \expandafter\ad\expandafter(\the\n)%
+ \advance\n1 \ifnum360>\n\relax \repeat
+\a~, (360)%
+\endxy
+\end{center}
+\caption{All directions.}\label{f.alldirections}
+\end{figure}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[drop]
+%
+ To "drop" an <object> at $c$ with |*| means to actually physically
+ typeset it in the picture with reference position at $c$---how this
+ is done depends on the <object> in question and is described in
+ detail in~\S??[object]. The intuition with a drop is that it
+ typesets something at $|<|X_c|,|Y_c|>|$ and sets the edge of $c$
+ accordingly.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subparagraph*{Procedure:}
+
+ (??_[drop1])~sets up the direction to allow for directionals and
+ builds the requested <object> in the (global) |\lastobjectbox@| box,
+ (??_[drop2])~adjust the picture size unless it is a hidden object,
+ setting $|\dimen@| = X_c-L_c$, and (??_[drop3])~drop the object in
+ the picture at the right point by setting |box0| and using the
+ |\Drop@@| method.
+
+\DOCMODE(
+\xydef@\drop@#1#2{%*[drop1]
+ \global\setbox\lastobjectbox@=\object#1{#2}%
+ \ifHidden@ \dimen@=\X@c \advance\dimen@-\L@c \else %?*[drop2]
+ \dimen@=\Y@c \advance\dimen@ \U@c \ifdim\Y@max<\dimen@ \Y@max=\dimen@ \fi
+ \dimen@=\Y@c \advance\dimen@-\D@c \ifdim\dimen@<\Y@min \Y@min=\dimen@ \fi
+ \dimen@=\X@c \advance\dimen@ \R@c \ifdim\X@max<\dimen@ \X@max=\dimen@ \fi
+ \dimen@=\X@c \advance\dimen@-\L@c \ifdim\dimen@<\X@min \X@min=\dimen@ \fi
+ \fi
+ \ifInvisible@\else %?*[drop3]
+ \setboxz@h{\kern\dimen@ \raise\Y@c\box\lastobjectbox@}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ {\Drop@@}\fi}
+\DOCMODE)
+
+ \NOTE: All typesetting into a picture should use or emulate |\drop@|!
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[connect]
+%
+ The "connect" operation |**| will first compute a number of internal
+ parameters describing the direction from~$p$ to~$c$ and then typesets
+ a connection filled with copies of the <object> as illustrated
+ in~\S??[basics.connect]. The exact details of the connection depend
+ on the actual <object> and are described in general in~\S??[object].
+ The intuition with a connection is that it typesets something
+ connecting $p$ and $c$ and sets the |?| <pos> operator up accordingly.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subparagraph*{Procedure:}
+
+ Set up the direction to allow for directional objects, then save
+ $c$, build the <object> in |\lastobjectbox@|, restore $c$, and perform
+ the |\Connect@@| method to connect using |\lastobjectbox@|.
+
+\DOCMODE(
+\xydef@\connect@#1#2{\setupDirection@ \enter@{\cfromthec@}%
+ \global\setbox\lastobjectbox@=\object#1{#2}\leave@
+ \Connect@@}
+
+\xydef@\preconnect@#1#2{\setupDirection@ \enter@{\cfromthec@}%
+ \global\setbox\lastobjectbox@=\object#1{#2}\leave@ \connectStore@
+ \ifInvisible@ \Connect@@ \else \Invisible@true\Connect@@\Invisible@false \fi}
+\DOCMODE)
+
+ The |\preconnect| command is for internal use by arrow \dots\ it
+ makes use of the following:
+
+\DOCMODE(
+\xynew@{box}\connectobjectbox@@
+\xylet@\connectDrop@@=\empty
+\xylet@\connectpreXY@style@=\empty
+\xylet@\connectpostXY@style@=\empty
+
+\xylet@\connectRest@@=\empty
+
+\xydef@\connectStore@{%
+ \global\setbox\connectobjectbox@@=\copy\lastobjectbox@
+ \let\connectDrop@@=\Drop@@
+ \let\connectpreXY@style@ =\preXY@style@
+ \let\connectpostXY@style@=\postXY@style@
+ \xdef\connectRest@@{%
+ \def\noexpand\Upness@{\Upness@}%
+ \def\noexpand\Leftness@{\Leftness@}%
+ \ifInvisible@ \noexpand\Invisible@true \else \noexpand\Invisible@false \fi
+ \ifHidden@ \noexpand\Hidden@true \else \noexpand\Hidden@false \fi}}
+
+\xydef@\connectRestore@{%
+ \ifvbox\connectobjectbox@@
+ \setbox\lastobjectbox@=\copy\voidb@x
+ \else
+ \global\setbox\lastobjectbox@=\copy\connectobjectbox@@
+ \fi
+ \let\Drop@@=\connectDrop@@
+ \global\let\preXY@style@ =\connectpreXY@style@
+ \global\let\postXY@style@=\connectpostXY@style@
+ \connectRest@@}
+\DOCMODE)
+
+ See note `??w![define <shape>]' for the use of |\preXY@style@| and
+ |\postXY@style@| to apply special <style>s, specified via
+ <object-modifier>s; being saved here by |\connectStore@| as
+ |\connectpreXY@style@| and |\connectpostXY@style@| to be reset by
+ |\connectRestore@|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[shave]??=[pick place]??=[<place>]
+%
+ Using |?| will ``pick a place'' along the most recent connection
+ typeset with |**|. What exactly this means is determined by the
+ object that was used for the connection and by the modifiers
+ described in general terms here.
+
+ The ``shave'' modifiers in a <place>, |<| and |>|, change the default
+ <factor>, $f$, and how it is used, by `moving' the positions that
+ correspond to |(0)| and |(1)| (respectively): These are initially set
+ equal to~$p$ and~$c$, but shaving will move them to the point on the
+ edge of $p$ and $c$ where the connection ``leaves/enters'' them, and
+ change the default $f$ as indicated. When one end has already been
+ shaved thus then subsequent shaves will correspond to sliding the
+ appropriate position(s) a \TeX\ ??c![\jot] (usually equal to |3pt|)
+ further towards the other end of the connection (and past it).
+ Finally the "pick" action will pick the position located the fraction
+ $f$ of the way from |(0)| to |(1)| where $f=|0.5|$ if it was not set
+ (by |<|, |>|, or explicitly).
+
+ All this is probably best illustrated with some examples: each
+ $\otimes$ in figure~??[f.places] is typeset by a sequence of the form
+ $p$|;| $c$ |**@{.}| |?|<place> |*{\oplus}| where we indicate the
+ |?|<place> in each case. (We also give examples of <slide>s.)
+
+\begin{figure*}[tb]
+$$
+ \def\[#1]#2{\def\2{#2}%
+ \POS "p";"c"**{}
+ #2*+=[o]{\oplus}="x"*=<5em,3em>{}-#1*!#1\hbox{{\tt\codeof\2}};
+ "x"**@{-}?>*@{>}\ignorespaces}%
+ %
+\xy
+ <0pt,110pt>*[o]=<20pt>{}="p"*\frm{oo}+L*!RC\hbox{$p$ is circular:~},
+ <270pt,0pt>*=<4em>\txt<4em>{$c$ is a square text!}="c"*\frm{-,},
+ "p";"c"**@{--}\relax
+ %
+ \[UR]{?(0)}
+ \[UR]{?(1)}
+ \[UR]{?}
+ \[UR]{?(.7)}
+ %
+ \[D]{?<>(.5)}
+ \[DL]{?<>(.2)(.5)}
+ \[DL]{?<}
+ \[UR]{?<<<}
+ \[UR]{?<<</1cm/}
+ \[D]{?<(0)}
+ \[DL]{?>}
+ \[D]{?>>>>}
+ %
+ \[DL]{?<>(.7)}
+ \[D]{?>(.7)}
+\endxy
+$$
+\caption{Example \protect<place>s}??=[f.places]
+\end{figure*}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Procedure:}
+
+ The code for parsing <place> is the following. To get first |<>| to
+ move to edge and the remaining to move a ??c![\jot] we have both
+ initial and continuing versions for each, the idea being that the
+ second and following go to the edge of a small temporary object with
+ radius |\jot|.
+
+ \NOTE: This parser tests the "new parsing principle" that |\xy@|
+ should always be called as |\xy@{| "source" |}{| "target" |}|!
+
+% \HACK: `Helps' the `arrow' feature: in the procedure for path
+% sub-segments, it is necessary to know the value of |\PLACEf@| both at
+% the (possibly delayed) time when the sub-segments are being typeset
+% and also at the time when the subsegments are being processed (and
+% packaged to be delayed by the |\xy@@|). Thus it is necessary for any
+% changes to the value of |\PLACEf@| to be both immediate and
+% delayed. The reason is that |\bstartPLACE@| and |\bendPLACE@| read
+% values from |\PLACEf@| and are themselves delayed by calls to |\xy@@|
+% -- these delayed calls need to know what |\PLACEf@| will be when they
+% are used.
+
+\DOCMODE(
+\xydef@\afterPLACE#1{%
+ \DN@##1{\def\afterPLACE@{\xy@@\leave@ \def\afterPLACE@{##1}#1}}%
+ \expandafter\next@\expandafter{\afterPLACE@}%
+ \def\PLACEf@{{.5}}%
+ \xy@@{\enter@{\pfromthep@}%
+ \Creset@@ \def\PLACEf@{{.5}}%
+ \let\PLACEedgep@@=\PLACEedgep@ \let\PLACEedgec@@=\PLACEedgec@}%
+ \xyFN@\PLACE@}
+
+\xydef@\PLACEf@{}
+
+\xydef@\PLACEedgep@@{}
+\xydef@\PLACEedgec@@{}
+
+\xydef@\PLACEedgep@{\Cshavep@@ \def\PLACEedgep@@{\Cslidep@@\jot}}
+\xydef@\PLACEedgec@{\Cshavec@@ \def\PLACEedgec@@{\Cslidec@@{-\jot}}}
+
+\xylet@\afterPLACE@=\empty
+
+\xydef@\PLACE@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PLACE@}%gobble spaces
+ \else\addLT@\ifx \next
+ \addLT@\DN@{\addLT@\xy@{\def\PLACEf@{{0}}\PLACEedgep@@}\xyFN@\PLACE@}%
+ \else\addGT@\ifx \next
+ \addGT@\DN@{\addGT@\xy@{\def\PLACEf@{{1}}\PLACEedgec@@}\xyFN@\PLACE@}%
+ \else\ifx (\next %)
+ \DN@(##1){\def\PLACEf@{{##1}}\xy@{(##1)}{\def\PLACEf@{{##1}}}\xyFN@\PLACE@}%
+ \else\ifx !\next
+ \DN@!{\xyFN@\PLACE@intercept}%
+ \else
+ \DN@{\xy@@{\expandafter\Calong@@\PLACEf@ \czeroEdge@}\PLACE@@}%
+ \fi\fi\fi\fi\fi \next@}
+
+\xydef@\PLACE@intercept{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PLACE@intercept}%gobble spaces
+ \else\ifx \bgroup\next
+ \DN@##1{\xy@{!{##1}}{}\PLACE@intercept@{##1}}%
+ \else\ifx (\next %)
+ \DN@(*##1*){\xy@{!(*##1*)}{}\PLACE@intercept@{##1}}%
+ \else \DN@{\xyerror@{{<pos>} expected after ! in <place>}{}}%
+ \fi\fi\fi \next@}
+
+\xydef@\PLACE@intercept@#1{%
+ \xy@@{\enter@{\pfromthep@\basefromthebase@}\begingroup}%
+ \xy@@ix@{#1}\xy@@{\plainxy@ \expandafter\POS\the\toks9\relax
+ \edef\next@{\endgroup
+ \X@c =\the\X@c \Y@c=\the\Y@c \X@p=\the\X@p \Y@p=\the\Y@p}%
+ \next@ \Cintercept@@ \leave@}%
+ \PLACE@@}
+
+\xydef@\PLACE@@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PLACE@@}%gobble spaces
+ \else\ifx /\next \DN@/##1/{\xy@{/##1/}{\Cslidec@@{##1}}\afterPLACE@}%
+ \else \let\next@=\afterPLACE@
+ \fi\fi \next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[slide]
+%
+ A <slide> will move the position a dimension further along the
+ connection at the picked position. For straight connections (the
+ only ones kernel \Xy-pic provides) this is the same as adding a
+ vector in the tangent direction, \ie, $|?|\dots|/|A|/|$ is the same
+ as $|?|\dots|+/|A|/|$.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[intercept]
+%
+ This special <place> finds the point where the last connection
+ intercepts with the line from $p$ to $c$ as setup by the <pos>, thus
+ usually this will have the form |!{|<coord>|;|<coord>|}|\footnote{The
+ braces can be replaced by |(*|\dots|*)| "once", \ie, there can be no
+ other braces nested inside it.}, for example,
+ \BUG: Only works for straight arrows at present.
+%
+\begin{code}
+\xy <1cm,0cm>:
+ (0,0)*=0{+}="+" ;
+ (2,1)*=0{\times}="*" **@{.} ,
+ (1,0)*+{A} ; (2,2)*+{B} **@{-}
+ ?!{"+";"*"} *{\bullet}
+\endxy
+\end{code}
+\displaycode\noindent
+%
+ will typeset
+%
+$$\docode$$
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[axis intersection]
+%
+ The positions denoted by the "axis intersection"
+ <coord>inates~??c![x] and~??c![y] are the points where the line
+ through $p$ and $c$ intersects with each axis. The following figure
+ illustrates this:
+$$
+ \xy;<1cm,.5cm>:<-.5cm,.5cm>::
+ (0,0)*+!UR{"origin"};
+ (1,0)*+!DR{"xbase"}**@{-}?>*@{>},
+ (0,0);(0,1)*+!DR{"ybase"}**@{-}?>*@{>},
+ (0.5,-1)="p"*@{o}*!LU\hbox{~$p$};
+ p+<.25cm,.5cm>="c"*@{o}*!LU\hbox{~$c$}*{}?(1),
+ %
+ "p";"c",x*+!LD{|x|}*@{*}*{}**@{.};(1,0)**@{.},
+ "p";"c",y*!U{\strut|y|}*@{*}*{}**@{.};(0,0)**@{.},
+ \endxy
+$$
+
+\begin{exercise}
+%
+ Given predefined points $A$, $B$, $C$, and $D$ (stored as objects
+ |"A"|, |"B"|, |"C"|, and |"D"|), write a <coord> specification that
+ will return the point where the lines $\overline{AB}$ and
+ $\overline{CD}$ cross (the point marked with a large circle here):
+%
+\begin{code}
+\xy
+ %
+ % set up and mark A, B, C, and D:
+ (0,0)="A" *\cir<1pt>{}*+!DR{A},
+ (7,10)="B" *\cir<1pt>{}*+!DR{B},
+ (13,8)="C" *\cir<1pt>{}*+!DL{C},
+ (15,4)="D" *\cir<1pt>{}*+!DL{D},
+ %
+ % goto intersection and name+circle it:
+ {"A";"B":"C";"D",x} ="I" *\cir<3pt>{},
+ %
+ % make dotted lines:
+ "I";"A"**{} +/1pc/;-/1pc/ **@{..},
+ "I";"D"**{} +/1pc/;-/1pc/ **@{..}
+ %
+\endxy
+\end{code}
+$$\docode$$
+%
+\answertext{The <coord> ``|{"A";"B":| |"C";"D",| |x}|'' returns the cross
+ point. Here is how the author typeset the diagram in the exercise:}
+\answercode
+\answertext{\displaycode\noindent A |?!|\dots\ <place> could also have been
+ used.}
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Procedure:}
+
+ We solve the following equation in $a,b$:
+$$
+ "origin" + a*|<|R_c|,|U_c|>| = c - b*(c-p)
+$$
+ and then set
+$$
+ |<|X_c|,|Y_c|>| := |<|X_c|,|Y_c|>| - b*(c-p)
+ \quad\textrm{with zero size}\quad
+ D_c,U_c,L_c,R_c := 0,0,0,0.
+$$
+ The code uses $c=(X_c,Y_c,D_c,U_c,L_c,R_c)$ and $A,B$ as temporaries
+ and computes:
+$$
+\begin{array}{rcl}
+ |<|dX|,|dY|>| &:=& |<|X_c|,|Y_c|>| - |<|X_p,Y_p|>| \\[1pt]
+ |<|A|,|B|>| &:=& |<|X_c|,|Y_c|>| - |<|X_"origin"|,|Y_"origin"|>| \\[1pt]
+ |<|D_c|,|L_c|>| &:=& |<| \Det{R& dX\\U&dY} |,|
+ \Det{R&A\\U&B} |>| \\[1pt]
+ |<|X_c|,|Y_c|>| &:=& |<|X_c|,|Y_c|>| - (L_c/D_c)*|<|dX|,|dY|>|
+\end{array}
+$$
+ where we really do $D := (R/|pt|)dY - (U/|pt|)dX$ and similarly for
+ $L$.
+
+\DOCMODE(
+\xydef@\intersect@{%?*[intersect@]
+ \d@X=\X@c \advance\d@X-\X@p \d@Y=\Y@c \advance\d@Y-\Y@p
+ \A@=\X@c \advance\A@-\X@origin \B@=\Y@c \advance\B@-\Y@origin
+ \edef\next@{\expandafter\removePT@\the\R@c}%
+ \edef\nextii@{\expandafter\removePT@\the\U@c}%
+ \D@c=\next@\d@Y \advance\D@c-\nextii@\d@X \divide\D@c\KK@
+ \L@c=\next@\B@ \advance\L@c-\nextii@\A@ \divide\L@c\KK@
+ \ifdim\D@c=\z@\zeroDivide@\else \quotient@\next@\L@c\D@c \fi
+ \advance\X@c-\next@\d@X \advance\Y@c-\next@\d@Y
+ \czeroEdge@}
+\DOCMODE)
+
+ When there is no intersection point a wrong answer is returned,
+ accompanied by a warning message. This behaviour can be altered by
+ assigning a different value to the hook: |\zeroDivide@|. This macro
+ must store a number in |\next@|.
+
+\DOCMODE(
+\xydef@\zeroDivide@@{\zeroDivide@message{\intersect@}{treated as 0}\DN@{0}}
+\xydef@\zeroDivide@message#1#2{\xywarning@{division by 0 in \string#1, #2}}
+\xylet@\zeroDivide@=\zeroDivide@@
+
+\xydef@\zeroDivideLimit@@{\ifdim\L@c=\z@ \DN@{0}%
+ \else\ifdim\L@c<\z@\DN@{-\zeroDivide@Limit}%
+ \else\DN@{\zeroDivide@Limit}\fi\fi
+ \zeroDivide@message{\intersect@}{replaced by \zeroDivide@Limit}}
+\xydef@\zeroDivideLimit@#1{\edef\zeroDivide@Limit{#1}%
+ \let\zeroDivide@=\zeroDivideLimit@@}
+\xylet@\zeroDivideLimit=\zeroDivideLimit@
+\DOCMODE)
+
+ By specifying |\zeroDivideLimit{|<num>|}| the user can locally
+ establish that ${x\over0} = \sgn(x)$<num>, whenever such a division
+ by zero would otherwise occur in an intersection calculation.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[group]
+%
+ A <pos> <decor> "grouped" in |{}|-braces\footnote{One can use
+ |(*|\dots|*)| instead also here.} is interpreted in a local scope in
+ the sense that any $p$ and "base" built within it are forgotten
+ afterwards, leaving only the $c$ as the result of the <coord>.
+ \NOTE: Only $p$ and "base" are restored -- it is not a \TeX\ group.
+
+\begin{exercise}
+ What effect is achieved by using the <coord>inate ``|{;}|''?
+\answertext{To copy the $p$ value to $c$, \ie, equivalent to ``|p|''.}
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The code is inside |\POS@|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[in <direction>]
+%
+ The vector $|/|Z|/|$, where $Z$ is a <dimen>sion, is the same as the
+ vector $|<|Z\cos\alpha|,|Z\sin\alpha|>|$ where $\alpha$ is the angle
+ of the last direction set by a connection (\ie, with |**|) or
+ subsequent placement (|?|) position.
+
+\DOCMODE(
+\xydef@\vfromslide@#1{\enter@\DirectionfromtheDirection@ \begingroup
+ \plainxy@\afterDIRECTIONorEMPTY\vfromslide@i\vfromslide@i#1@}
+
+\xydef@\vfromslide@i#1@{\DN@{#1}%
+ \edef\next{\endgroup
+ \ifx\next@\empty \dimen@=.5pc \else \dimen@=#1\relax \fi
+ \X@c=\cosDirection\dimen@ \Y@c=\sinDirection\dimen@}\next
+ \leave@}
+\DOCMODE)
+
+ It is possible to give a <direction> as described in the next section
+ (figure~??[f.object], note~??[direction] in particular) that will
+ then be used to set the value of $\alpha$. It is also possible to
+ omit the <dimen> in which case it is set to a default value of
+ |.5pc|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[offset]??=[corner]
+%
+ A <corner> is an offset from the current $|<|X_c|,|Y_c|>|$ position
+ to a specific position on the edge of the $c$ object (the two-letter
+ ones may be given in any combination):
+$$
+\def\[#1]{\POS"box"+#1="x";"box"
+ **{} ?</-2em/*+\hbox{\tt#1};"x",**@{-}?>*@{>}}
+%
+\xy.(-5,-4).(15,9)*\frm{-}="box"*{c}="c";
+ "box"+L**@{.}, "box"+R**@{.}, "box"+D**@{.}, "box"+U**@{.}
+%
+ \[L] \[R] \[D] \[U]
+ \[LD]\[RD]\[LU]\[RU]
+ \[CL]\[CR]\[DC]\[UC] \[C] \[P]
+ \POS"box"+(-20,-8)*{p}="p";"c"**@{.},"box"**{}\[E]
+\endxy
+$$
+ The `edge point' |E| lies on the edge along the line from $p$ to the
+ centre of the object, in contrast to the `proportional' point |P|
+ which is also a point on the edge but computed in such a way that the
+ object looks as much `away from $p$' as possible.
+
+ Finally, a following $|(|f|)|$ suffix will multiply the offset vector
+ by the <factor> $f$.
+
+\begin{exercise}
+ What is the difference between the <pos>itions |c?<| and |c+E|?
+\answertext{When using the kernel connections that are all straight there is
+ no difference, \eg, |**{}?<| and |**{}+E| denote exactly the same
+ position. However, for other connections it is not necessarily the
+ case that the point where the connection enters the current object,
+ denoted by |?<|, and the point where the straight line from $p$
+ enters the object, denoted by |+E|, coincide.}
+\end{exercise}
+
+\begin{exercise}
+\begin{code}
+\xy *=<3cm,1cm>\txt{Box}*\frm{-}
+ !U!R(.5) *\frm{..}*{\bullet} \endxy
+\end{code}
+%
+ What does this typeset?
+%
+\displaycode
+\noindent
+ "Hint": ??c![\frm] is defined by the frame extension and just
+ typesets a frame of the kind indicated by the argument.
+%
+\answercode
+\answertext{The code typesets the picture $$\docode$$}
+\end{exercise}
+
+ \BUG: Currently only the single-letter corners (??c![L], ??c![R],
+ ??c![D], ??c![U], ??c![C], ??c![E], and ??c![P]) will work for any
+ shape---the others silently assume that the shape is rectangular.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[stack]??=[<stack op>eration]
+%
+ The "stack" is a special construction useful for storing a sequence
+ of <pos>itions that are accessible using the special
+ <coord>inates~|s|$n$, where $n$~is either a single digit or a
+ positive integer in |{}|s: |s0| is always the `top' element of the
+ stack and if the stack has depth $d$ then the `bottom' element of the
+ stack has number |s{|$d-1$|}|. The stack is said to be `empty' when
+ the depth is~$0$ and then it is an error to access any of the |s|$n$
+ or `pop' which means remove the top element, shifting what is in |s1|
+ to |s0|, |s2| to |s1|, etc. Similarly, `push~$c$' means to shift
+ |s0| to |s1|, etc., and then insert the $c$ as the new |s0|.
+
+ The stack is manipulated as follows:
+%
+\begin{defs}
+ |@|<stacking> & Action \cr
+\noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}%
+ ??c![@+]<coord> & push $<coord>$ \cr
+ ??c![@-]<coord> & $c\from<coord>$ then pop \cr
+ ??c![@=]<coord> & load stack with <coord> \cr
+ ??c![@@]<coord> & do $<coord>$ for $c\from$ stack \cr
+ ??c![@i] & initialise \cr
+ ??c![@(] & enter new frame \cr
+ ??c![@)] & leave current frame \cr
+\end{defs}
+\noindent\unskip
+%
+ To `load stack', means to load the entire stack with the positions
+ set by <coord> within which |,| means `push $c$'.
+
+ To `do <coord> for all stack elements' means to set $c$ to each
+ element of the stack in turn, from the bottom and up, and for each
+ interpret the <coord>. Thus the first interpretation has $c$ set to
+ the bottom element of the stack and the last has $c$ set to~|s0|. If
+ the stack is empty, the <coord> is not interpreted at all.
+
+ These two operations can be combined to repeat a particular <coord>
+ for several points, like this:
+%
+\begin{code}
+\xy
+ @={(0,-10),(10,3),(20,-5)} @@{*{P}}
+\endxy
+\end{code}
+\displaycode\noindent
+%
+ will typeset
+%
+$$\docode$$
+
+ Finally, the stack can be forcibly cleared using |@i|, however, this
+ is rarely needed because of |@(|, which saves the stack as it is, and
+ then clears it, such when it has been used (and is empty), and |@)|
+ is issued, then it is restored as it was at the time of the~|@(|.
+
+\begin{exercise}
+ How would you change the example above to connect the points as shown
+ below?
+%
+\begin{code}
+\xy
+ @={(0,-10),(10,3),(20,-5)},
+ s0="prev" @@{;"prev";**@{-}="prev"}
+\endxy
+\end{code}
+%
+$$\docode$$
+%
+\answercode
+\answertext{This does the job, saving each point to make the previous point
+ available for the next piece:\displaycode\noindent Notice how we
+ close the line by first saving |s0|, the last point visited, such
+ that the first point will be connected to it.}
+%
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ First the stack top and bottom, both initially~$-1$:
+
+\DOCMODE(
+\xydef@\s@bot{-1}
+\xydef@\s@top{-1}
+\DOCMODE)
+
+ Next the function to set $c\from|s|n$, \ie, test that $"bot"\lt
+ n+"bot"\lt "top"$ and then run the associated stack element.
+
+\DOCMODE(
+\xydef@\cfroms@#1{\tests@{#1}\runs@\outofranges@}
+
+\xydef@\tests@#1#2#3{\DN@{#3}%
+ \count@=\s@top \advance\count@-#1\relax
+ \ifnum\count@>\s@bot\relax \ifnum\count@>\s@top\else\DN@{#2}\fi\fi
+ \next@}
+
+\xydef@\runs@{\csname S@\the\count@\endcsname}
+
+\xydef@\outofranges@{\count@=\s@top \advance\count@-\s@bot
+ \xyerror@{stack index out of range (should be 0..\the\count@)}{}}
+\DOCMODE)
+
+ Finally the actual code to do the stack operations: it depends on the
+ `code' passed after |@|; spaces are not allowed:
+
+\DOCMODE(
+\xydef@\STACK@{%
+ \addPLUS@\ifx\next
+ \addPLUS@\DN@{\xy@{@+}{}\afterCOORD{\xy@@\spushc@ \xyFN@\POS@}}%
+ \else\addDASH@\ifx\next
+ \addDASH@\DN@{\xy@{@-}{}\afterCOORD{\xy@@\spop@ \xyFN@\POS@}}%
+ \else \ifx i\next \DN@ i{\xy@{@i}\sinit@ \xyFN@\POS@}%
+ \else \ifx (\next \DN@ ({\xy@{@(}\senter@ \xyFN@\POS@}%
+ \else \ifx )\next \DN@ ){\xy@{@)}\sleave@ \xyFN@\POS@}%
+ \else\addEQ@\ifx\next \addEQ@\DN@{\STACK@load}%
+ \else\addAT@\ifx\next \addAT@\DN@{\xy@{@@}{}\smap@}%
+ \else \DN@##1{\xyerror@{illegal stack command ##1}{}\afterCOORD{\xyFN@\POS@}}%
+ \fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\STACK@load{\xy@{@=}{%
+ \if\sempty@\else \xywarning@{loading on top of non-empty stack}\sinit@ \fi
+ \let\comma@@=\spushc@}%
+ \afterCOORD{\xy@@{\spushc@ \let\comma@@=\relax}\xyFN@\POS@}}
+
+\xydef@\spushc@{%
+ \count@=\s@top \advance\count@\@ne \edef\s@top{\the\count@}%
+ \expandafter\edef\csname S@\s@top\endcsname{\cfromthec@}}
+
+\xydef@\spushid@#1{\DNii@{#1}\edef\nextii@{\codeof\nextii@}%
+ \expandafter\let\expandafter\next@\csname Q@\nextii@\endcsname
+ \ifx\next@\relax \xyerror@{<pos> \string"\nextii@\string" not defined}{}%
+ \else
+ \count@=\s@top \advance\count@\@ne \edef\s@top{\the\count@}%
+ \DNii@##1{\expandafter\def\csname S@\s@top\endcsname{##1}}%
+ \expandafter\nextii@\expandafter{\next@}%
+ \fi}
+
+\xydef@\idfroms@#1#2{%
+ \tests@{#2}{\DN@{\idfromxy@{#1}}%
+ \expandafter\expandafter\expandafter\next@
+ \expandafter\expandafter\expandafter{\csname S@\the\count@\endcsname}%
+ }\outofranges@}
+
+\xydef@\spop@{\count@=\s@top
+ \ifnum\count@>\s@bot \advance\count@\m@ne \edef\s@top{\the\count@}%
+ \else \xyerror@{nothing to pop from stack}{}\fi}
+
+\xydef@\sinit@{\edef\s@top{\s@bot}}
+
+\xydef@\senter@{%
+ \count@=\s@top \advance\count@\@ne
+ \expandafter\edef\csname S@\the\count@\endcsname{\s@bot}%
+ \edef\s@bot{\the\count@}\edef\s@top{\the\count@}}
+
+\xydef@\sleave@{%
+ \ifnum\s@bot=\s@top\else \xywarning@{leaving non-empty stack}\sinit@ \fi
+ \ifnum\s@bot>\m@ne \edef\s@bot{\csname S@\s@top\endcsname}%
+ \count@=\s@top \advance\count@\m@ne \edef\s@top{\the\count@}%
+ \edef\sbot{\the\count@}\fi}
+
+\xydef@\sempty@{\ifnum\s@top=\s@bot TT\else TF\fi}
+\DOCMODE)
+
+ |\smap@| maps a <coord> over a stack:
+
+\DOCMODE(
+\xydef@\xytotoks@#1#2{\addtotoks@{#2}}
+\xydef@\xytotoks@@toksix@#1{\addtotoks@{\toks9={#1}}}
+
+\xydef@\smap@{%
+ \begingroup \toks@={}\let\xy@=\xytotoks@ \change@oxy@\xy@
+ \let\xy@@ix@=\xytotoks@@toksix@
+ \afterCOORD{\expandafter\endgroup
+ \expandafter\smapxy@@\expandafter{\the\toks@}\xyFN@\POS@}}
+
+\xydef@\smapxy@@#1{\xy@@{\edef\smapp@@{\s@bot}\smapxy@i{#1}}}
+
+\xylet@\smapp@@=\empty
+
+\xydef@\smapxy@i#1{%
+ \ifnum\smapp@@<\s@top
+ \count@=\smapp@@ \advance\count@\@ne \edef\smapp@@{\the\count@}%
+ \DN@{\csname S@\smapp@@\endcsname #1\relax \smapxy@i{#1}}%
+ \else \let\next@=\relax
+ \fi \next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[save]??=[saved]
+%
+ It is possible to define new <coord>inates on the form |"|<id>|"| by
+ "saving" the current $c$ using the \dots|="|<id>|"| <pos>ition form.
+ Subsequent uses of |"|<id>|"| will then reestablish the $c$ at the
+ time of the saving.
+
+ Using a |"|<id>|"| that was never defined is an error, however,
+ saving into a name that was previously defined just replaces the
+ definition without warning, \ie, |"|<id>|"| always refers to the last
+ thing saved with that <id>.
+
+ However, many other things can be `saved': in general |@|<saving> has
+ either of the forms
+%
+\begin{defs}
+ |@:"|<id>|"| & |"|<id>|"| restores current "base" \cr
+ |@|<coord>|"|<id>|"| & |"|<id>|"| reinterprets <coord> \cr
+ |@@"|<id>|"| & |@="|<id>|"| reloads this stack \cr
+\end{defs}
+\noindent\unskip
+%
+ The first form defines |"|<id>|"| to be a macro that restores the
+ current "base".
+
+ The second does not depend on the state at the time of definition at
+ all; it is a macro definition. You can pass parameters to such a
+ macro by letting it use coordinates named |"1"|, |"2"|, etc., and
+ then use |="1"|, |="2"|, etc., just before every use of it to set the
+ actual values of these. \NOTE: it is not possible to use a <coord>
+ of the form |"|<id>|"| directly: write it as |{"|<id>|"}|.
+%
+\begin{exercise}
+ Write a macro |"dbl"| to double the size of the current~$c$ object,
+ \eg, changing it from the dotted to the dashed outline in this
+ figure:
+%
+\begin{code}
+\xy ={.{+DL(2)}.{+UR(2)}}"dbl",
+ *+<3pc,2pc>{+}*\frm{.}, "dbl"*\frm{--}
+\endxy
+\end{code}
+$$
+\docode
+$$
+\answercode
+\answertext{The author used \displaycode\noindent to typeset the figure in
+ the exercise.}
+\end{exercise}
+
+ The final form defines a special kind of macro that should only be
+ used after the |@=| stack operation: the entire current stack is
+ saved such that the stack operation |@="|<id>|"| will reload it.
+
+ \NOTE: There is no distinction between the `name spaces' of <id>s
+ used for saved coordinates and other things.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This parser distinguishes between the cases:
+
+\DOCMODE(
+\xydef@\saveid@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\saveid@}%gobble spaces
+ \else \ifx "\next\DN@"##1"{\xy@{="##1"}{\idfromc@{##1}}\xyFN@\POS@}%
+ \else \ifx :\next\DN@:##1"##2"{\xy@{=:"##2"}{\idfrombase@{##2}}\xyFN@\POS@}%
+ \else\addAT@\ifx\next
+ \addAT@\DN@"##1"{\xy@{=@"##1"}{\idfromstack@{##1}}\xyFN@\POS@}%
+ \else \ifx s\next
+ \DN@ s##1"##2"{\xy@{=s##1"##2"}{\idfroms@{##2}{##1}}\xyFN@\POS@}%
+ \else\addEQ@\ifx\next \let\saveid@COORD@@=\saveid@COORDii
+ \addEQ@\DN@{\xyFN@\saveid@COORD}%
+ \else \let\saveid@COORD@@=\saveid@COORDi \let\next@=\saveid@COORD
+ \fi\fi\fi\fi\fi\fi \next@}
+
+\xylet@\saveid@COORD@@=\relax
+\DOCMODE)
+
+ Here is the code for saving/restoring a position and a base.
+
+\DOCMODE(
+\xydef@\idfromc@#1{\DN@{#1}%
+ \expandafter\edef\csname Q@\codeof\next@\endcsname{\cfromthec@}}
+
+\xydef@\idfrombase@#1{\DN@{#1}%
+ \expandafter\edef\csname Q@\codeof\next@\endcsname{\basefromthebase@}}
+
+\xydef@\idfromstack@#1{%
+ \toks@={\if\sempty@\else
+ \xywarning@{loading on top of non-empty stack}\sinit@ \fi}%
+ \count@=\s@bot \advance\count@\@ne
+ \ifnum\count@>\s@top\else
+ \loop@
+ \expandafter\let\expandafter\next@\csname S@\the\count@\endcsname
+ \expandafter\addtotoks@\expandafter{\next@}%
+ \ifnum\count@<\s@top \advance\count@\@ne \addtotoks@{\spushc@}\repeat@
+ \fi
+ \DN@{#1}\edef\next@##1{%
+ \def\expandafter\noexpand\csname Q@\codeof\next@\endcsname{##1}}%
+ \expandafter\next@\expandafter{\the\toks@}}
+
+\xydef@\saveid@COORD{%
+ \begingroup \toks@={}\let\xy@=\xytotoks@ \change@oxy@\xy@
+ \let\xy@@ix@=\xytotoks@@toksix@
+ \afterCOORD{\expandafter\saveid@COORDi\expandafter{\the\toks@}}}
+
+\xydef@\saveid@COORDi#1#2"#3"{\endgroup \xy@@{\idfromxy@{#3}{#1}}\xyFN@\POS@}
+\xydef@\saveid@COORDii#1#2"#3"{\endgroup \xy@@{\idfromcxy@{#3}{#1}}\xyFN@\POS@}
+
+\xydef@\idfromxy@#1#2{\DN@{#1}%
+ \expandafter\def\csname Q@\codeof\next@\endcsname{#2}}
+
+\xydef@\idfromcxy@#1#2{\DN@{#1}%
+ \expandafter\edef\csname Q@\codeof\next@\endcsname{\cfromthec@#2}}
+
+\xydef@\cfromid@#1{\DNii@{#1}\edef\nextii@{\codeof\nextii@}%
+ \expandafter\let\expandafter\next@\csname Q@\nextii@\endcsname
+ \ifx\next@\relax \xyerror@{<pos> \string"\nextii@\string" not defined}{}%
+ \else \expandafter\next@\fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section{Objects}
+??=[object]
+
+\DOCMODE(
+\message{objects,}
+\DOCMODE)
+
+ Objects are the entities that are manipulated with the |*| and |**|
+ <pos> operations above to actually get some output in \Xy-pictures.
+ As for <pos>itions the operations are interpreted strictly from left
+ to right, however, the actual object is built "before" all the
+ <modifier>s take effect. The syntax of objects is given in
+ figure~??[f.object] with references to the notes below. \REMARK: It
+ is "never" allowed to include braces |{}| inside <modifier>s! In
+ case you wish to do something that requires |{|\dots|}| then check in
+ this manual whether you can use |(*|\dots|*)| instead. If not then
+ you will have to use a different construction!
+
+\begin{figure*}[tp]
+\begin{syntax}
+%
+ ??w![<object>]
+ &\iss & <modifier> <object>
+ & apply <modifier> to <object>
+\cr
+ &\orr & <objectbox>
+ & build <objectbox> then apply its <modifier>s
+\cr
+\noalign{\smallbreak}
+%
+\cr
+ ??w![<objectbox>]
+ &\iss & |{| <text> |}|
+ & ??!^[build default] object
+\cr
+ &\orr & <library object> \orr\ |@|<dir>
+ & use <library object> or <dir>ectional (see~\S??[objectlib])
+\cr
+ &\orr & <\TeX\ box> |{| <text> |}|
+ & ??!^[build box] object with <text> using the given <\TeX\ box>
+ command, \eg, ??c![\hbox]
+\cr
+ &\orr & ??c![\object] <object>
+ & wrap up the <object> as a ??!^[finished object box]
+\cr
+ &\orr & ??c![\composite] |{| <composite> |}|
+ & build ??!^[composite object box]
+\cr
+ &\orr & ??c![\xybox] |{| <pos> <decor> |}|
+ & package ??!^[entire \Xy-picture as object]
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<modifier>]
+ &\iss & |!| <vector>
+ & <object> has its reference point ??!^[shifted] by <vector>
+\cr
+ &\orr & |!|
+ & <object> has the original reference point reinstated
+\cr
+ &\orr & <add op> <size>
+ & change ??!^[<object> size]
+\cr
+ &\orr & ??c![h] \orr\ ??c![i]
+ & <object> is ??!^[hidden], ??!^[invisible]
+\cr
+ &\orr & |[| <shape> |]|
+ & <object> is given the specified ??!^[<shape>]
+\cr
+ &\orr & ??c![[=] <shape> |]|
+ & ??!^[define <shape>] to reestablish ??w![current object style]
+\cr
+ &\orr & <direction>
+ & set current direction for this <object>
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<add op>]
+ &\iss & |+| \orr\ |-| \orr\ |=| \orr\ |+=| \orr\ |-=|
+ & grow, shrink, set, grow to, shrink to
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<size>]
+ &\iss & <empty>
+ & ??!^[default size]
+\cr
+ &\orr & <vector>
+ & size as sides of rectangle covering the <vector>
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<direction>]
+ &\iss & <diag>
+ & <diag>onal ??!^[direction]
+\cr
+ &\orr & ??c![v] <vector>
+ & ??!^[direction] of <vector>
+\cr
+ &\orr & ??c![q]|{| <pos> <decor> |}|
+ & ??!^[direction] from $p$ to $c$ after <pos> <decor>
+\cr
+ &\orr & <direction> ??c![:] <vector>
+ & vector relative ??!^[to <direction>]
+\cr
+ &\orr & <direction> |_| \orr\ <direction> |^|
+ & $90^\circ$ clockwise/anticlockwise ??!^[to <direction>]
+\cr
+%
+ ??w![<diag>]
+ &\iss & <empty>
+ & last used direction (not necessarily ??!^[diagonal])
+\cr
+ &\orr & |l|\orr|r|\orr|d|\orr|u|
+ & left, right, down, up ??!^[diagonal]
+\cr
+ &\orr & |ld|\orr|rd|\orr|lu|\orr|ru|
+ & left/down, \dots\ ??!^[diagonal]
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<composite>]
+ &\iss & <object>
+ & first object is required
+\cr
+ &\orr & <composite> |*| <object>
+ & add <object> to ??!^[composite object box]
+%
+\end{syntax}
+\caption{\protect<object>s.}
+??=[f.object]
+\end{figure*}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ We first discuss the parser and then summarise the required methods.
+ The entry point to use of objects is ??c![\object] described in note
+ ??[finished object box]. This should always be used because it
+ initialises the token list and redefines |\xy@| to be |\addtotoks@|
+ such that we can use <pos> parser routines within the <object>!
+
+\paragraph*{Parsing:}
+
+ The <object> parser |\OBJECT@| will first parse the <modifier>s,
+ storing the action of each in sequence on the |\toks@| token list.
+ When there are no more modifiers we insert ??c![\objectbox] if we have
+ reached the |{| otherwise we just assume that the rest of the
+ <object> is some kind of box construction.
+
+ "Note": The <modifier> actions doing shifts are implemented by having
+ an independent vector for the shift: $|<|R_p|,|U_p|>|$ always
+ contains the vector from the current to the original \TeX\ reference
+ point; furthermore the initial $L_c$ is saved as $L_p$ such that we
+ can retrieve the original (\Xy-pic) reference point again. Modifying
+ the $p$ values is safe because all actual changes are done in a local
+ scope after the entire <object> is parsed and we have built the
+ object box (in |\OBJECT@@|).
+
+ The <modifier>s changing the direction are executed while parsing to
+ make sure that the direction used when building the <object> is
+ right, and restored in the right sequence while evaluating the
+ <modifier>s afterwards.
+
+\DOCMODE(
+\xydef@\OBJECT@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\OBJECT@}%gobble spaces
+ \else\ifcat A\noexpand\next \let\next@=\OBJECT@letter
+ \else \let\next@=\OBJECT@other \fi\fi \next@}
+
+\xydef@\OBJECT@letter{%
+ \ifx i\next \DN@ i{\addtotoks@\Invisible@true \xyFN@\OBJECT@}%
+ \else\ifx h\next\DN@ h{\addtotoks@\Hidden@true \xyFN@\OBJECT@}%
+ \else\ifx o\next\DN@ o{\xywarning@{Obsolete o modifier used}\OBJECT@shape{o}}%
+ \else\ifx x\next\DN@ x{\xywarning@{Obsolete x modifier used}\OBJECT@shape{}}%
+ \else\ifx @\next\DN@ @##1##{%
+%
+\xywarning@{Impossible @ (letter) should not be here!!}
+%
+ \OBJECT@@{\dir##1}}%
+ \else \let\next@=\OBJECT@direction
+ \fi\fi\fi\fi\fi \next@}
+
+\xydef@\OBJECT@other{%
+ \ifx !\next \DN@!{\OBJECT@shift}%
+ \else\addPLUS@\ifx \next \DN@{\OBJECT@change}%
+ \else\addDASH@\ifx \next \DN@{\OBJECT@change}%
+ \else\addEQ@\ifx \next \DN@{\OBJECT@set}%
+ \else\ifx [\next %]
+ \DN@[##1]{\xy@{[##1]}{\OBJECT@shape{##1}}}%
+ \else\ifx ^\next \let\next@=\OBJECT@direction
+ \else\ifx _\next \let\next@=\OBJECT@direction
+ \else\ifx :\next \let\next@=\OBJECT@direction
+ \else\ifx ?\next
+ \DN@ ?{\xywarning@{\string? modifier used}\xyFN@\OBJECT@direction}%
+ \else\ifx (\next %)
+ \let\next@=\OBJECT@direction
+ \else\addAT@\ifx\next \addAT@\DN@##1##{\OBJECT@@{\dir##1}}%
+ \else \DN@##1##{\OBJECT@@{##1}}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+\DOCMODE)
+
+ |\OBJECT@@| is where we actually build the box by first
+ ??_[OBJ0]~saving the previous edge in case it is needed, then
+ ??_[OBJ1]~setting the defaults (including temporarily resetting
+ |\xy@| to execute in case any |\xy@|s are used internally),
+ ??_[OBJ2]~building the object box (which might change them) using
+ ??c![\objectbox] if no other command specified and setting the
+ $D,U,L,R$ dimensions ad required using the |\Leftness@| and
+ |\Upness@| methods, and finally ??_[OBJ3]~setting up the $R_p,U_p$
+ dimensions (as discussed above) and applying the <modifier>s stored
+ in |\toks@| and dumping the modified box.
+
+\DOCMODE(
+\xydef@\prevEdge@@{\zeroEdge}
+
+\xydef@\OBJECT@@#1#2{%
+ \expandafter\def\expandafter\prevEdge@@\expandafter{\the\Edge@c}%?*[OBJ0]
+ \expandafter\Edge@c\expandafter{\objectEdge}%?*[OBJ1]
+ \Invisible@false\Hidden@false
+ \def\Leftness@{.5}\def\Upness@{.5}%
+ \gdef\preXY@style@{}\gdef\postXY@style@{}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@\relax}%
+ \DN@{#1}\ifx\next@\empty \DNii@{#2}%?*[OBJ2]
+ \ifx\nextii@\empty \DN@{\hbox\bgroup\no@}\else \let\next@=\objectbox \fi\fi
+ \setbox\z@=\next@{#2}\L@c=\Leftness@\wdz@ \R@c=\wdz@ \advance\R@c-\L@c
+ \D@c=\dp\z@ \advance\D@c\ht\z@ \U@c=\Upness@\D@c \advance\D@c-\U@c
+ \R@p=\z@ \L@p=\L@c \U@p=\U@c \advance\U@p-\ht\z@ \D@p=-\U@p %?*[OBJ3]
+ \the\toks@\toks@={}\setboxz@h{\kern\R@p \raise\U@p\boxz@}%
+ \checkZeroEdge@
+ \dimen@=\L@c \advance\dimen@\R@c \wdz@=\dimen@ \ht\z@=\U@c \dp\z@=\D@c \boxz@
+ \OBJECT@x}
+
+\xydef@\adjustLR@{%
+ \ifdim\zz@\wdz@ \L@c=\z@ \R@c=\z@ \dimen@=\Leftness@\p@
+ \ifdim\dimen@<\z@ \L@c=\dimen@ \R@c=-\L@c
+ \else\ifdim\dimen@>\p@ \L@c=\dimen@ \advance\L@c-\p@ \R@c=-\L@c \fi\fi
+ \else \L@c=\Leftness@\wdz@ \R@c=\wdz@ \advance\R@c-\L@c \fi}
+
+\xydef@\adjustUD@{\dimen@=\ht\z@ \advance\dimen@\dp\z@
+ \ifdim\zz@\dimen@ \U@c=\z@ \D@c=\z@ \dimen@=\Upness@\p@
+ \ifdim\dimen@<\z@ \U@c=\dimen@ \D@c=-\L@c
+ \else\ifdim\dimen@>\p@ \U@c=\dimen@ \advance\U@c-\p@ \D@c=-\L@c \fi\fi
+ \else \D@c=\dimen@ \U@c=\Upness@\dimen@ \advance\D@c-\U@c \fi}
+
+\def\checkZeroEdge@{%
+ \DN@{}%
+ \ifdim\zz@\L@c \ifdim\zz@\R@c \ifdim\zz@\U@c \ifdim\zz@\D@c
+ \DN@{\Edge@c={\zeroEdge}}\fi\fi\fi\fi
+ \next@}
+\DOCMODE)
+
+ As an optimisation |\OBJECT@@| sets the edge type of all zero-sized
+ objects to ??c![\zeroEdge].
+
+ |\OBJECT@x| cleans up the object by ensuring that it defines all the
+ required methods: Essentially it terminates the box with the sequence
+ ``|}| |\def\Drop@@{|\dots|}| |\def\Connect@@{|\dots|}| |\D@c=|\dots\
+ |\U@c=|\dots\ |\L@c=|\dots\ |\R@c=|\dots\ | \Invisible@|\dots
+ |\Hidden@|\dots\ |\def\Leftness@{|\dots|}| |\def\Upness@{|\dots|}|''
+ where each \dots\ is set to the method defined within the object
+ creation environment (started with |\hbox{| in |\OBJECT@@| or
+ possibly elsewhere). We use rather heavy expansion hacking with
+ |\toks@| to create the sequence so please look the other
+ way\dots\smiley
+
+\DOCMODE(
+\xydef@\OBJECT@x{\toks@={\egroup\def\Drop@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\Drop@@}\def\Connect@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\Connect@@}}%
+ \edef\tmp@{\D@c=\the\D@c \U@c=\the\U@c \L@c=\the\L@c \R@c=\the\R@c
+ \Edge@c={\expandafter\noexpand\the\Edge@c}%
+ \ifInvisible@\noexpand\Invisible@true\else\noexpand\Invisible@false\fi
+ \ifHidden@\noexpand\Hidden@true\else\noexpand\Hidden@false\fi
+ \def\noexpand\Leftness@{\Leftness@}\def\noexpand\Upness@{\Upness@}}%
+ \expandafter\addtotoks@\expandafter{\tmp@}\the\toks@}
+\DOCMODE)
+
+\paragraph*{Methods:}
+??w[object methods]
+
+ In addition to the ``current object properties'' for $c$
+ (\cf~??[basics.state]) the following methods are set up by all
+ objects:
+
+\begin{defs}
+ |\Invisible@true| or |\Invisible@false| & whether object is ??!^[invisible]\cr
+ |\Hidden@true| or |\Hidden@false| & whether object is ??!^[hidden]\cr
+ |\def\Leftness@{|<factor>|}| & the desired $L/(L+R)$\cr
+ |\def\Upness@{|<factor>|}| & the desired $U/(D+U)$\cr
+ |\def\Drop@@{|\dots|}| & code that outputs the object, assuming |\boxz@| is
+ of zero size and has the object displaced $|<|X|,|Y|>|$
+ inside---usually just |\def|'d to |\styledboxz@|\cr
+ |\def\Connect@@{|\dots|}| & code that builds a connection from $p$ to $c$,
+ assuming |\last|\-|object|\-|box@| contains the object\cr
+\end{defs}
+
+ It is important to |\def| and not |\let| the last four methods since
+ the \TeX\-nique used in |\OBJECT@x| (and elsewhere) of passing them
+ to surrounding scopes depends on it. The |\Connect@@| method should
+ in turn setup several submethods as described in detail in
+ ??[algo.connection].
+
+ Suitable defaults are set up by |\OBJECT@@| above which is why any
+ box generating command can be used to construct objects as explained
+ in note ??[build default] below.
+
+ Here are the declarations:
+
+\DOCMODE(
+\xynew@{if}\ifInvisible@
+\xynew@{if}\ifHidden@
+
+\xydef@\Leftness@{}
+\xydef@\Upness@{}
+
+\xydef@\Drop@@{\styledboxz@}
+\xydef@\Connect@@{}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notes}
+%
+\note??=[build default]
+%
+ An <object> is built using |\object|\-|box|??c[\objectbox]
+ |{|<text>|}|. |\object|\-|box| is initially defined as
+%
+\begin{code}
+\def\objectbox#1{%
+ \hbox{$\objectstyle{#1}$}}
+\let\objectstyle=\displaystyle
+\end{code}
+\displaycode
+%
+ but may be redefined by options or the user. The <text> should thus
+ be in the mode required by the ??c![\objectbox] command---with the
+ default |\objectbox| shown above it should be in math mode.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Actually it is
+
+\DOCMODE(
+\xydef@\objectbox#1{\hbox{$\m@th\objectstyle{#1}$}}
+
+\xylet@\objectstyle=\textstyle
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[build box]
+%
+ An <object> built from a \TeX\ box with dimensions $w*(h+d)$ will
+ have $L_c=R_c=w/2$, $U_c=D_c=(h+d)/2$, thus initially be equipped
+ with the adjustment |!C| (see note~??[shifted]). In particular: in
+ order to get the reference point on the (center of) the base line of
+ the original <\TeX~box> then you should use the <modifier> |!|; to
+ get the reference point identical to the \TeX\ reference point use
+ the modifier |!!L|.
+
+ \TeX\-nical remark: Any macro that expands to something that starts
+ with a <box> may be used as a <\TeX~box> here.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ This is done by the parsing above.
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[finished object box]
+%
+ Takes an object and constructs it, building a box; it is then
+ processed according to the preceeding modifiers. This form makes it
+ possible to use any <object> as a \TeX\ box (even outside of
+ \Xy-pictures) because a finished object is always also a box.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This macro is the main entry point to the <object> parser. It
+ furthermore initialises the modifier list and the previous object
+ edge.
+
+\DOCMODE(
+%\xydef@\object{\hbox\bgroup\object@}
+\xydef@\object{\hbox\bgroup\resetStyle@\object@}
+
+\xydef@\object@{%
+ \edef\next@{={\DirectionfromtheDirection@}}\expandafter\toks@\next@
+% \resetStyle@\plainxy@ \xyFN@\OBJECT@}
+ \plainxy@ \xyFN@\OBJECT@}
+\DOCMODE)
+
+ The initial value of |\toks@| <modifier> list is explained in
+ note~??[direction] below.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[composite object box]
+%
+ Several <object>s can be combined into a single object using the
+ special command ??c![\composite] with a list of the desired objects
+ separated with |*|s as the argument. The resulting box (and object)
+ is the least rectangle enclosing all the included objects.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ First we collect all the objects smash on top of each other in box0
+ while we maintain the maximal extents in $(DULR)_p$. Then we reset
+ box0 to contain the same but with the right spacing around.
+
+\DOCMODE(
+\xydef@\composite#1#{\hbox\bgroup\composite@{#1}}
+
+\xydef@\composite@#1#2{%
+ \DN@{#1}\ifx\next@\empty\else\xywarning@{no variants of
+ \string\composite\space allowed}\fi
+ \global\setbox9=\hbox\bgroup
+ \D@p=-\maxdimen \U@p=-\maxdimen \L@p=-\maxdimen \R@p=-\maxdimen
+ \xyFN@\composite@i#2@}
+
+\xydef@\composite@i{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\composite@i}%gobble spaces
+ \else\ifx *\next \DN@ *{\xyFN@\composite@i}%
+ \else\ifx @\next \DN@ @{\composite@x}%
+ \xyerror@{<composite> object expected}{}\czeroEdge@
+ \else \DN@{\composite@ii}\fi\fi\fi \next@}
+
+\xydef@\composite@ii#1#{\composite@iii{#1}}
+
+\xydef@\composite@iii#1#2{%
+ \setbox\z@=\object#1{#2}%
+ \ifInvisible@ \setboxz@h{}\else
+ \setboxz@h{\kern-\L@c \boxz@}\ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ {\Drop@@}\fi
+ \ifHidden@\else
+ \ifdim\U@p<\U@c \U@p=\U@c \fi \ifdim\D@p<\D@c \D@p=\D@c \fi
+ \ifdim\R@p<\R@c \R@p=\R@c \fi \ifdim\L@p<\L@c \L@p=\L@c \fi
+ \fi
+ \xyFN@\composite@iv}
+
+\xydef@\composite@iv{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\composite@iv}%gobble spaces
+ \else \ifx @\next \DN@ @{\composite@x}%
+ \else \let\next@=\composite@i \fi\fi \next@}
+
+\xydef@\composite@x{%
+ \edef\tmp@{\egroup
+ \D@c=\the\D@p \U@c=\the\U@p \L@c=\the\L@p \R@c=\the\R@p}\tmp@
+ \setboxz@h{\kern\L@c\box9}\ht\z@=\U@c \dp\z@=\D@c
+ \dimen@=\L@c \advance\dimen@\R@c \wdz@=\dimen@
+ \Edge@c={\rectangleEdge}\computeLeftUpness@ \boxz@
+ \OBJECT@x}
+
+\xydef@\computeLeftUpness@{%
+ \dimen@=\L@c \advance\dimen@\R@c
+ \ifdim\zz@\dimen@ \def\Connect@@{\straight@{\dottedSpread@\jot}}%
+ \ifdim\zz@\L@c\else
+ \DN@{\zeroEdge}\expandafter\DNii@\expandafter{\the\Edge@c}%
+ \ifx\next@\nextii@\Edge@c={\rectangleEdge}\fi\fi
+ \else \quotient@\Leftness@\L@c\dimen@ \fi
+ \dimen@=\U@c \advance\dimen@\D@c
+ \ifdim\zz@\dimen@ \def\Connect@@{\straight@{\dottedSpread@\jot}}%
+ \ifdim\zz@\U@c\else
+ \DN@{\zeroEdge}\expandafter\DNii@\expandafter{\the\Edge@c}%
+ \ifx\next@\nextii@\Edge@c={\rectangleEdge}\fi\fi
+ \else \quotient@\Upness@\U@c\dimen@ \fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note ??=[entire \Xy-picture as object]
+%
+ Take an entire \Xy-picture and wrap it up as a box as described
+ in~\S??[basics.pos]. Makes nesting of \Xy-pictures possible: the
+ inner picture will have its own zero point which will be its
+ reference point "in" the outer picture when it is placed there.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This is simple exploiting the fact that |\endxy| actually sets up the
+ extents of the `object':
+
+\DOCMODE(
+\xydef@\xybox#1{\xy#1\endxy \Edge@c={\rectangleEdge}\computeLeftUpness@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[shifted]
+%
+ An object is "shifted" a <vector> by moving the point inside it which
+ will be used as the reference point. This effectively pushes the
+ object the same amount in the opposite direction.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Shifting uses the special value of $R_p$ and $U_p$ used while
+ evalutaing the <modifier>s. The fact that shifts like |!C| refer to
+ the initial object's size means that we should parse the <vector>
+ such that its actions happen at modification time\dots hence
+ |\xytotoks@| is used to delay execution.
+
+\DOCMODE(
+\xydef@\OBJECT@shift{%
+ \let\xy@=\xytotoks@ \afterVECTORorEMPTY
+ {\OBJECT@shift@}%
+ {\addtotoks@{\X@c=-\L@c \advance\X@c\R@p \advance\X@c\L@p \Y@c=\U@p}%
+ \OBJECT@shift@}}
+
+\xydef@\OBJECT@shift@{%
+ \addtotoks@{\advance\U@p-\Y@c
+ \advance\L@c\X@c \advance\R@c-\X@c \advance\D@c\Y@c \advance\U@c-\Y@c
+ \computeLeftUpness@}%
+ \let\xy@=\oxy@ \xyFN@\OBJECT@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{exercise}
+ What is the difference between the <pos>itions |0*{a}!DR| and
+ |0*!DR{a}|?
+\answertext{The first typesets ``$a$'' centered around |0| and then moves $c$
+ to the lower right corner, the second typesets ``$a$'' above the |0|
+ point and does not change $c$. With a ``$+$'' at |0| they look like
+ this: $\vcenter{\xy*{+}*{a}!DR\endxy}$ and
+ $\vcenter{\xy*{+}*!DR{a}\endxy}$.}%
+\end{exercise}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[<object> size]??=[change size]??=[<size>]??=[default size]
+%
+ A <size> is a pair $|<|W|,|H|>|$ of the width and height of a
+ rectangle. When given as a <vector> these are just the vector
+ coordinates, \ie, the <vector> starts in the lower left corner and
+ ends in the upper right corner. The possible <add op>erations that
+ can be performed are described in the following table.
+$$
+\begin{array}{\otherbar c\otherbar l\otherbar}
+\hline
+ \hbox{<add op>} & \hbox{description} \\
+\hline
+ |+| & \hbox{grow} \\
+ |-| & \hbox{shrink} \\
+ |=| & \hbox{set to} \\
+ |+=| & \hbox{grow to at least} \\
+ |-=| & \hbox{shrink to at most} \\
+\hline
+\end{array}
+$$
+ In each case the <vector> may be omitted which invokes the ``default
+ size'' for the particular <add op>:
+$$
+\begin{array}{\otherbar c\otherbar l\otherbar}
+\hline
+ \hbox{<add op>} & \hbox{default}\\
+\hline
+ |+| & |+<|2*"objectmargin"|>| \\
+ |-| & |-<|2*"objectmargin"|>| \\
+ |=| & |=<|"objectwidth"|,|"objectheight"|>| \\
+ |+=| & |+=<|\max(L_c+R_c,D_c+U_c)|>| \\
+ |-=| & |-=<|\min(L_c+R_c,D_c+U_c)|>| \\
+\hline
+\end{array}
+$$
+ The defaults for the first three are set with the commands
+%
+\begin{defs1}
+ ??c![\objectmargin] <add op> |{|<dimen>|}| \cr
+ ??c![\objectwidth] <add op> |{|<dimen>|}| \cr
+ ??c![\objectheight] <add op> |{|<dimen>|}| \cr
+\end{defs1}
+\noindent\unskip
+%
+ where <add op> is interpreted in the same way as above.
+
+\DOCMODE(
+\xylet@\objectmargin@=\jot
+\xylet@\objectwidth@=\z@
+\xylet@\objectheight@=\z@
+
+\xydef@\objectmargin{\afterADDOP{\Addop@@\objectmargin@}}
+\xydef@\objectwidth{\afterADDOP{\Addop@@\objectwidth@}}
+\xydef@\objectheight{\afterADDOP{\Addop@@\objectheight@}}
+\DOCMODE)
+
+ The defaults for |+=|/|-=| are such that the resulting object will be
+ the smallest containing/largest contained square.
+
+\begin{exercise}
+ How are the objects typeset by the <pos>itions ``|*+UR{\sum}|'' and
+ ``|*+DL{\sum}|'' enlarged?
+\answertext{They have the outlines
+ $$\xy*+UR{\sum}*\frm{-}*{+}\endxy
+ \quad\textrm{and}\quad
+ \xy*+DL{\sum}*\frm{-}*{+}\endxy$$
+ because the first is enlarged by the positive offset to the upper
+ right corner and the second by the negative offset to the lower left
+ corner.}
+\end{exercise}
+
+ \BUG: Currently changing the size of a circular object is buggy---it
+ is changed as if it is a rectangle and then the change to the $R$
+ parameter affects the circle. This should be fixed probably by a
+ generalisation of the |o| shape to be ovals or ellipses with
+ horizontal/vertical axes.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The three cases distinguished by the parsing above are handled
+ similarly: they insert the parsed/default vector into $X,Y$ in the
+ modifications and then perform the operation at that time using the
+ |\xytotoks@| trick described in note~??[shifted]:
+
+\DOCMODE(
+\xydef@\OBJECT@change{%
+ \afterADDOP{%
+ \addEQ@\ifx \next
+ \addtotoks@{\X@c=\D@c \advance\X@c\U@c \Y@c=\L@c \advance\Y@c\R@c}%
+ \else
+ \addtotoks@{\X@c=\objectmargin@ \advance\X@c\X@c \Y@c=\X@c}%
+ \fi
+ \let\xy@=\xytotoks@
+ \afterVECTORorEMPTY\OBJECT@change@\OBJECT@change@}}
+
+\xydef@\OBJECT@set{%
+ \afterADDOP{%
+ \let\xy@=\xytotoks@ \afterVECTORorEMPTY\OBJECT@change@
+ {\addtotoks@{\X@c=\objectwidth@ \Y@c=\objectheight@}\OBJECT@change@}}}
+\DOCMODE)
+
+ The real work is done by the following command: a hack using
+ expansion tricks to make use of the |\Addop@@| known now on the
+ values in $X,Y$ at modification time.
+
+\DOCMODE(
+\xydef@\OBJECT@change@{%
+ \addtotoks@{\advance\R@c\L@c \advance\R@p-\L@c \let\tmp@=\R@c}%
+ \expandafter\addtotoks@\expandafter{\Addop@@\tmp@\X@c\R@c=\tmp@
+ \L@c=\Leftness@\R@c \advance\R@p\L@c \advance\R@c-\L@c}%
+ \addtotoks@{\advance\D@c\U@c \let\tmp@=\D@c}%
+ \expandafter\addtotoks@\expandafter{\Addop@@\tmp@\Y@c\D@c=\tmp@
+ \U@c=\Upness@\D@c \advance\D@c-\U@c}%
+ \let\xy@=\oxy@ \xyFN@\OBJECT@}
+\DOCMODE)
+
+ It is clearly crucial that |\Addop@@| expands to its action
+ immediately! Also note that enlarging changes the initial box offset
+ in the horizontal direction only, \ie, $R_p$.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Finally the code to interpret an <add op> used above: This
+ simply parses it and creates a macro |\Addop@@| that takes a
+ control sequence and a parameter <dimen> as arguments, and
+ expands directly to commands that perform the <add op> of the
+ <dimen> on the control sequence:
+$$
+\begin{array}{\otherbar c\otherbar l\otherbar}
+\hline
+ \hbox{<add op>} & \hbox{effect of |\Addop@@| "cs" $D$} \\
+\hline
+ |+| & "cs" \from "cs"+D \\
+ |-| & "cs" \from "cs"-D \\
+ |=| & "cs" \from D \\
+ |+=| & "cs" \from \left\{
+ \begin{array}{cc} D & \hbox{if $D\le"cs"$} \\
+ "cs" & \hbox{if $D\gt"cs"$} \end{array}\right.
+ \\[1pt]
+ |-=| & "cs" \from \left\{
+ \begin{array}{cc} D & \hbox{if $D\ge"cs"$} \\
+ "cs" & \hbox{if $D\lt"cs"$} \end{array}\right.
+ \\[1pt]
+\hline
+\end{array}
+$$
+ Furthermore ??c![\afterADDOP] leaves the |\next| token set to |=| in
+ the last three cases only (this is used to determine the right
+ default value in the size changes above).
+
+ The ??c![\afterADDOP] macro is relatively simple because <add op>s
+ don't nest:
+
+\DOCMODE(
+\xydef@\afterADDOP#1{\def\afterADDOP@{#1}\xyFN@\ADDOP@}
+
+\xylet@\afterADDOP@=\empty
+
+\xydef@\ADDOP@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\ADDOP@}%gobble spaces
+ \else\addPLUS@\ifx \next \addPLUS@\DN@{\xyFN@\ADDOP@plus}%
+ \else\addDASH@\ifx \next \addDASH@\DN@{\xyFN@\ADDOP@minus}%
+ \else\addEQ@\ifx \next
+ \addEQ@\DN@{\def\Addop@@{\Addop@0+=}\afterADDOP@}%
+ \else
+ \DN@{\def\Addop@@{\Addop@0+=}\afterADDOP@}%
+ \fi\fi\fi\fi \next@}
+
+\xydef@\ADDOP@plus{%
+ \addEQ@\ifx \next
+ \addEQ@\DN@{\def\Addop@@{\Addop@0+<}\afterADDOP@}%
+ \else
+ \DN@{\def\Addop@@{\Addop@1+=}\afterADDOP@}%
+ \fi \next@}
+
+\xydef@\ADDOP@minus{%
+ \addEQ@\ifx \next
+ \addEQ@\DN@{\def\Addop@@{\Addop@0+>}\afterADDOP@}%
+ \else
+ \DN@{\def\Addop@@{\Addop@1-=}\afterADDOP@}%
+ \fi \next@}
+\DOCMODE)
+
+ The work is done by the general |\Addop@| |{|$f$|}| |{|$\pm$|}|
+ |{|$\bowtie$|}| |{|"cs"|}| $D$ that defines
+$$
+"cs" \equiv \left\{
+ \begin{array}{ll}
+ f*"cs"~{\pm}~D & \hbox{if $\lnot ((f*"cs"~{\pm}~D)~{\bowtie}~D)$} \\
+ "cs" & \hbox{otherwise} \end{array}\right.
+$$
+ and also leaves the dimension in |\dimen@|.
+
+\DOCMODE(
+\xydef@\Addop@#1#2#3#4#5{%
+ \dimen@=#4\relax \edef#4{\the\dimen@}%
+ \dimen@=#1\dimen@ \advance\dimen@#2#5\relax %\advance\dimen@ 1sp %HACK
+ \ifdim\dimen@#3#4\else \edef#4{\the\dimen@}\fi
+ \ifx\xy@\xyinitial@\else \DN@##1{\xy@@{\edef#4{##1}\checkZeroEdge@}}%
+ \expandafter\next@\expandafter{#4}\fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[hidden]
+%
+ A "hidden" object will be typeset but hidden from \Xy-pic in that it
+ won't affect the size of the entire picture as discussed
+ in~\S??[basics.pos].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ This is handled by the |\ifHidden@| conditional allocated with the
+ methods.
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[invisible]
+%
+ An "invisible" object will be treated completely normal except that
+ it won't be typeset, \ie, \Xy-pic will behave as if it was.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ This is handled by the |\ifInvisible@| conditional allocated with the
+ methods.
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[<shape>]
+%
+ Setting the "shape" of an object forces the shape of its edge to be
+ as indicated. The kernel provides three shapes that change the edge,
+ namely ??C![.], ??C![], and ??C![o], corresponding to the outlines
+$$
+\let\objectstyle=\scriptstyle
+\xy*{*}\endxy
+\quad
+\textrm{,}
+\quad
+\xy(0,0).(-10,-4).(15,7)*\frm{-}="box"*{*}+0;
+ "box"+L*{}**@{.}?*{L},
+ "box"+R*{}**@{.}?*{R},
+ "box"+D*{}**@{.}?*{D},
+ "box"+U*{}**@{.}?*{U}
+\endxy
+\quad
+\textrm{, and}
+\quad
+\xy*[o]=<40pt>{*}="box"*\cir{}+0;
+ "box"+L*{}**@{.}?*{L},
+ "box"+R*{}**@{.}?*{R},
+ "box"+D*{}**@{.}?*{D},
+ "box"+U*{}**@{.}?*{U}
+\endxy
+$$
+ where the $*$ denotes the point of the reference position in the
+ object (the first is a point). Extensions can provide more shapes,
+ however, all shapes set the extent dimensions $L$, $R$, $D$,
+ and $U$.
+
+ The default shape for objects is ??C![] and for plain coordinates it
+ is ??C![.].
+
+\DOCMODE(
+\xydef@\objectEdge{\rectangleEdge}
+\DOCMODE)
+
+ Furthermore the <shape>s ??C![r], ??C![l], ??C![u], and ??C![d], are
+ defined for convenience to adjust the object to the indicated side by
+ setting the reference point such that the reference point is the same
+ distance from the opposite of the indicated edge and the two
+ neighbour edges but never closer to the indicated side than the
+ opposite edge, \eg, the object |[r]\hbox{Wide text}| has reference
+ point at the $*$ in $\xy*[r]\hbox{Wide text}*\frm{-}*{*}\endxy$ but
+ the object |[d]\hbox{Wide text}| has reference
+ point at the $*$ in $\xy*[d]\hbox{Wide text}*\frm{-}*{*}\endxy$.
+ Finally, ??C![c] puts the reference point at the center.
+
+\DOCMODE(
+\xydefcsname@{shape [r]}{\advance\U@p\D@c \centerobject@
+ \ifdim\L@c>\D@c
+ \advance\R@c\L@c \L@c=.5\U@c \advance\L@c.5\D@c \advance\R@c-\L@c \fi
+ \advance\U@p-\D@c}
+\xydefcsname@{shape [l]}{\advance\U@p\D@c \centerobject@
+ \ifdim\L@c>\D@c
+ \advance\L@c\R@c \R@c=.5\U@c \advance\R@c.5\D@c \advance\L@c-\R@c \fi
+ \advance\U@p-\D@c}
+\xydefcsname@{shape [u]}{\advance\U@p\D@c \centerobject@
+ \ifdim\D@c>\L@c
+ \advance\U@c\D@c \D@c=.5\L@c \advance\D@c.5\R@c \advance\U@c-\D@c \fi
+ \advance\U@p-\D@c}
+\xydefcsname@{shape [d]}{\advance\U@p\D@c \centerobject@
+ \ifdim\D@c>\L@c
+ \advance\D@c\U@c \U@c=.5\L@c \advance\U@c.5\R@c \advance\D@c-\U@c \fi
+ \advance\U@p-\D@c}
+\xydefcsname@{shape [c]}{\advance\U@p\D@c \centerobject@ \advance\U@p-\D@c}
+
+\xydef@\centerobject@{%
+ \advance\D@c\U@c \D@c=.5\D@c \U@c=\D@c \advance\L@c\R@c \L@c=.5\L@c \R@c=\L@c}
+\DOCMODE)
+
+ \NOTE: Extensions can add new <shape> object <modifier>s which are
+ then called <style>s. These will always be either of the form
+ |[|<keyword>|]| or |[|<character> <argument>|]|. Some of these
+ <style>s do other things than set the edge of the object.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ A ``simple shape'' is just a control sequence |\shape [|<shape>|]|
+ setting the appropriate edge. When such a |[|<shape>|]| modifier is
+ encountered then we expand this control sequence onto the modifier
+ queue, unless a control sequence |\style [|<shape>|]| exists: then
+ that is expected to do it (and whatever else is required).
+
+\DOCMODE(
+\xydef@\OBJECT@shape#1{\DN@{shape [#1]}%
+ \expandafter\let\expandafter\nextii@\csname\codeof\next@\endcsname
+ \ifx\nextii@\relax\DN@{style [#1]}%
+ \expandafter\let\expandafter\nextii@\csname\codeof\next@\endcsname
+ \ifx\nextii@\relax \DN@{\OBJECT@shapei[#1]}%
+ \else\DN@{\nextii@\xyFN@\OBJECT@}\fi
+ \else \expandafter\addtotoks@\expandafter{\nextii@}%
+ \DN@{\xyFN@\OBJECT@}%
+ \fi \next@}
+
+\xydefcsname@{shape []}{\the\Edge@c5\relax}%
+\xydefcsname@{shape [Outer]}{\the\Edge@c5\relax}%
+\xydefcsname@{shape [Inner]}{\the\Edge@c4\relax}%
+\xydefcsname@{shape [o]}{\Edge@c={\circleEdge}\the\Edge@c5\relax
+ \Edge@c={\circleEdge}\def\prevEdge@@{\circleEdge}}
+\xydefcsname@{shape [.]}{\czeroEdge@}
+\DOCMODE)
+
+ Add more simple shapes by defining more commands like these and
+ proceed with coding the |\|\dots|Edge| command as described
+ in~\S??[algo.edge].
+
+ Alternatively it is a ``complex shape'' of which none are defined in
+ the kernel but some options like more variation\dots It is
+ characterised by its first token and the rest of the contents of the
+ ??C![]s is the argument (remember: no |{}[]| characters!); it is
+ searched for as control sequence |\[|<shape>|...]| overridden
+ in the same way by |\*stylechar@|<shape>|@|.
+
+\DOCMODE(
+\def\OBJECT@shapei[#1#2]{\DN@{shape [#1...]}%
+ \expandafter\let\expandafter\next\csname\codeof\next@\endcsname
+ \ifx\next\relax\DN@{*stylechar@#1@}%
+ \expandafter\let\expandafter\next\csname\codeof\next@\endcsname
+ \ifx\next\relax\DNii@{shape [#1#2]}%
+ \xywarning@{illegal [<shape>] ignored: \codeof\nextii@\space not defined}%
+ \DN@{\xyFN@\OBJECT@}%
+ \else% Delete this: \expandafter\addtotoks@\expandafter{\next{#2}}%
+ \DN@{\next{#2}\xyFN@\OBJECT@}%
+ \fi
+ \else
+
+\expandafter\addtotoks@\expandafter{\next{#2}}\DN@{\next{#2}\xyFN@\OBJECT@}%
+ \fi \next@}
+\DOCMODE)
+
+ \BUG: The above is messy!
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[define <shape>]
+%
+ While typesetting an object, some of the properties are considered
+ part of the `??w![current object style]??w[style]'. Initially this
+ means nothing but some of the <style>s defined by extensions have
+ this status, \eg, colours |[red]|, |[blue]| say, using the |xycolor|
+ extension, or varying the width of lines using |xyline|. Such styles
+ are processed "left-to-right"; for example,
+$$
+|*[red][green][=NEW][blue]{A}|
+$$
+ will typeset a blue |A| and define |[NEW]| to set the colour to green
+ (all provided that |xycolor| has been loaded, of course).
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The method of requesting a special effect is via the <shape>
+ modifiers. However the code required for implementation is quite
+ different. In particular it must allow for the different ways in
+ which the <driver> may implement the |\special|s required to
+ activate, and turn off, the effect. Another difficulty is that the
+ <style> applies also to nested sub-parts of any <object>. This means
+ that the code cannot be wholly delayed until after the <object> has
+ been constructed.
+
+ Usually some value has to be stored, so as to be accessible to
+ sub-parts, though the |\special| commands cannot be fully constructed
+ until the <object> is completely known and ready to be |\Drop@@| or
+ |\Connect@@|'ed.
+
+ Finally, the overhead in using |\special| commands can be quite high
+ with some |dvi|-drivers. Thus it is not best that every <style>
+ request generate a |\special| command; indeed {\it two} |\special|
+ commands, since each style-change also requires a command to revert
+ to the previous style, after the change is no longer applicable.
+
+ Thus, as with <shape>s, all the style-change requests are stored
+ until the <object> is ready to be |\Drop@@|'ed. This also helps with
+ getting the sequencing correct when later requests compound on, or
+ override, earlier requests.
+
+ When the <style> requests are processed, after the <object> has been
+ constructed, information of the form <control-word>|{|<data>|}| is
+ added to a global list called |\preXY@style@|. Similar information is
+ added to another global list |\postXY@style@|, for the purpose of
+ reverting the style parameters, within the <driver>-file, to their
+ previous values prior to the current <object>.
+
+ Both lists are initially <empty> at the start of an <object>. The
+ contents of these lists are processed when the macros
+ |\xypre@Style@@| and |\xypost@Style@@| are encountered in the
+ expansion of |\styledboxz@|.
+
+\DOCMODE(
+\xydef@\preXY@style@{}
+\xydef@\postXY@style@{}
+
+\xydef@\resetStyle@{\gdef\preXY@style@{}\gdef\postXY@style@{}}
+\DOCMODE)
+
+ The <data> contains the code needed to implement the requested
+ style-change, with the particular <driver> being used.
+
+ The <control-word> is a macro whose expansion could be fixed, or
+ could depend upon what other style-change requests are made for this
+ <object>. Its purpose is to decide whether or not the <data> is
+ actually required. If so, it is added to the token-list
+ |\styletoks@| for later use.
+
+ Whether the <control-word>|{|<data>|}| tokens are prepended or
+ appended to the global lists depends upon the nature of the
+ style-change requested. For example, with |*[red][green]|<object>
+ the information |\|<set-color>|{|<green>|}| could be appended to
+ |\preXY@style@|, with |\|<revert-to-color>|{|<red>|}| prepended to
+ |\postXY@style@|. Then the dvi-output would set the color to <red>
+ then <green> and restore it first to <red> then <black>.
+
+ \TODO: A more sophisticated implementation could instead prepend
+ |\|<set-color>|{|<green>|}| to |\preXY@style@| and append
+ |\|<revert-to-color>|{|<red>|}| to |\postXY@style@|. Now the first
+ |\|<set-color> encountered adds its <data> to |\styletoks@| then
+ rebinds |\|<set-color> to |\eat@|, to ignore subsequent occurrences.
+ Similarly |\|<revert-to-color> is rebound so that only the is
+ restoration to <black> is retained.
+
+ This latter strategy is preferred when the overhead for a |\special|
+ command is high, within the <driver>'s output. Indeed the \PS\
+ back-end is even more efficient. Since \PS\ is itself a programming
+ language, the <data> can be just the \PS\ code. A single |\special|
+ command is sufficient to accommodate {\it all\/} the style-changes
+ for an individual <object>. This is achieved by rebinding
+ |\xydoprestyles@@| and |\xydopoststyles@@| to include the <data>
+ within an appropriately prepared |\special| command.
+
+\DOCMODE(
+\xynew@{toks}{\styletoks@}
+\xydef@\addtostyletoks@#1{%
+ \expandafter\styletoks@\expandafter{\the\styletoks@#1}}
+\DOCMODE)
+
+ The <data> to be used is collected in the token-list |\styletoks@|.
+ If this is <empty> for an <object> then the style processing is
+ skipped completely. For safety, in case multiple occurences of
+ |\xypre@Style@| have somehow slipped into the token stream, these and
+ |\xypost@Style@@| are bound to |\relax| until the <object> is
+ finished. Indeed |\xypost@Style@@| is always bound to |\relax| unless
+ |\styletoks@| is non-empty.
+
+\DOCMODE(
+\xydef@\styledboxz@{%
+%
+%\W@{STYLED BOX:}%
+%\W@{: PRE={\meaning\xypre@Style@@}}%
+%
+ \xypre@Style@@
+%
+%{\expandafter\DN@\expandafter{\the\styletoks@}\W@{: STYLTOKS={\codeof\next@}}}%
+%
+ \boxz@
+%
+%\W@{: POST={\meaning\xypost@Style@@}}%
+%
+ \xypost@Style@@}
+
+\xydef@\xypre@Style@{\styletoks@={}\saveXyStyle@\preXY@style@
+ \expandafter\DN@\expandafter{\the\styletoks@}%
+ \ifx\next@\empty \DN@{\let\xypre@Style@@=\relax
+ \let\xypost@Style@@=\relax \xypre@skipStyle@}%
+ \else
+ \let\xypre@Style@@=\relax \let\xypost@Style@@=\xypost@Style@
+ \DN@{\expandafter\xydoprestyles@\expandafter{\the\styletoks@}}%
+ \fi \next@ }
+
+\xydef@\xypost@Style@{\styletoks@={}\postXY@style@
+ \expandafter\xydopoststyles@\expandafter{\the\styletoks@}%
+ \let\xypost@Style@@=\relax \let\xypre@Style@@=\xypre@Style@ }
+
+\xydef@\xypre@skipStyle@#1\xypost@Style@@{#1\relax
+ \let\xypre@Style@@=\xypre@Style@ }
+
+\xydef@\xydoprestyles@@{\literal@}
+\xydef@\xydopoststyles@@{\literal@}
+\xylet@\xydoprestyles@=\xydoprestyles@@
+\xylet@\xydopoststyles@=\xydopoststyles@@
+\DOCMODE)
+
+ Some extensions use the following macros to add style <data> to the
+ global macros. Here code is added sequentially to |\preXY@style@| so
+ that it is acted upon in the order of occurrence (FIFO) of the
+ <shape> modifiers. Code is added to |\postXY@style@| in reverse order
+ (LIFO), so that each addition to |\preXY@style@| can be closed off,
+ if necessary, in correctly nested sequence.
+
+\DOCMODE(
+\xydef@\modXYstyle@{%
+ \ifx\xy@style@\empty\resetStyle@\fi \checkXyStyle@
+ \expandafter\expandafter\expandafter\DN@
+ \expandafter\expandafter\expandafter{\preXYstyle@@}%
+ \ifx\next@\empty\else\DN@{\modXYstyle@@}\fi \next@ }
+
+\xydef@\modXYstyle@@{%
+ \DN@##1{\expandafter\def\expandafter\tmp@\expandafter{##1}}%
+ \expandafter\next@\expandafter{\preStyle@@}%
+ \DN@##1{\expandafter\gdef\expandafter\preXY@style@\expandafter{%
+ \preXY@style@ ##1}}\expandafter\next@\expandafter{\tmp@}%
+ \DN@##1{\expandafter\def\expandafter\tmp@\expandafter{##1}}%
+ \expandafter\next@\expandafter{\postStyle@@}%
+ \DN@##1{\expandafter\gdef\expandafter\postXY@style@\expandafter{%
+ \tmp@ ##1}}\expandafter\next@\expandafter{\postXY@style@}}
+
+\xydef@\xy@style@{}
+\xydef@\checkXyStyle@{\ifx\xy@style@\empty\resetStyle@\fi
+ \let\xy@style@=\relax}
+\DOCMODE)
+
+ The |\preStyle@| and |\postStyle@| temporarily hold style <data>.
+ The macro |\preXYstyle@@| is used to check whether there is any
+ <data> to process. Normally this is just an alias for |\preStyle@@|,
+ but some back-ends may use the two control-names differently.
+
+\DOCMODE(
+\xydef@\preStyle@@{}
+\xydef@\postStyle@@{}
+\xydef@\preXYstyle@@{\relax}
+
+\xydef@\loadxystyle@{%
+ \let\xypre@Style@@=\xypre@Style@ \def\preXYstyle@@{\preStyle@@}}
+
+\loadxystyle@
+\DOCMODE)
+
+ Initially styles are activated but can be suppressed using
+ |\Unloadstyle@|.
+
+\DOCMODE(
+\xydef@\Unloadstyle@{%
+ \let\xypre@Style@@=\relax \let\xypost@Style@@=\relax
+ \def\preXYstyle@@{\relax}}
+\DOCMODE)
+
+ Global macros are used, so that the same styles can be reused by
+ successive objects without having to re-interpret <shape> modifiers,
+ as described next.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Saving styles:\ }
+
+ Once specified for an <object>, the collection of <style>s can be
+ assigned a name, using ??c![[=]<word>|]|. Then |[|<word>|]| becomes a
+ new <style>, suitable for use with the same or other <objects>s. Use
+ a single <word> built from ordinary letters. If |[|<word>|]| already
+ had meaning the new definition will still be imposed, but the
+ following type of warning will be issued:
+$$
+|Xy-pic Warning: Redefining style [|<word>|]|
+$$
+ The latter warning will appear if the definition occurs within an
+ ??c![\xymatrix]. This is perfectly normal, being a consequence of the
+ way that the matrix code is handled. Similarly the message may appear
+ several times if the style definition is made within an ??c![\ar].
+
+\begin{code}
+ \setbox0=\hbox{%
+ \xy\drop[OrangeRed][=A]{}\endxy}
+\end{code}
+
+\noindent
+ The following illustrates how to avoid these messages by defining the
+ style without typesetting anything.
+
+\displaycode
+
+ \NOTE{~1:} The current colour is regarded as part of the style for
+ this purpose.
+
+ \NOTE{~2:} Such namings are global in scope. They are intended to
+ allow a consistent style to be easily maintained between various
+ pictures and diagrams within the same document.
+
+\DOCMODE(
+\xydefcsname@{shape [=...]}#1{\checkXyStyle@ \addtotoks@{\xynamestyle@{#1}}}
+
+\xydef@\xynamestyle@#1{\checkXyStyle@
+ \expandafter\DNii@\expandafter{\csname shape [#1]\endcsname}%
+ \expandafter\ifx\nextii@\relax %%\xywarning@{Defining new style [#1]}%
+ \else\xywarning@{Redefining style [#1]}\fi
+ \expandafter\xynamestyle@@\csname shape [#1]\endcsname }
+
+\xydef@\xynamestyle@@#1{%
+ \expandafter\def\expandafter\tmp@\expandafter{\preXY@style@}%
+ \DN@##1{\def\tmp@{\checkXyStyle@\gdef\preXY@style@{##1}}}%
+ \expandafter\next@\expandafter{\preXY@style@}%
+ \DN@##1{\expandafter\gdef\expandafter#1\expandafter{\tmp@
+ \gdef\postXY@style@{##1}}}%
+ \expandafter\next@\expandafter{\postXY@style@}\DN@{}}
+\DOCMODE)
+
+ If the same <style> is intended for several <object>s occurring
+ in succession, the |[||*]| <modifier> can be used on the later
+ <object>s. This only works when |[||*]| precedes any other <style>
+ modifiers; it is local in scope, recovering the last <style>s used
+ at the same level of \TeX\ grouping.
+
+\DOCMODE(
+\xydef@\prevXypreStyle@@{}
+\xydef@\prevXypostStyle@@{}
+
+\xydef@\saveXyStyle@{\expandafter
+ \def\expandafter\prevXypreStyle@@\expandafter{\preXY@style@}%
+ \expandafter\def\expandafter\prevXypostStyle@@\expandafter{%
+ \postXY@style@}}
+
+\xydef@\recoverXyStyle@{\expandafter
+ \gdef\expandafter\preXY@style@\expandafter{\prevXypreStyle@@}%
+ \expandafter\gdef\expandafter\postXY@style@\expandafter{%
+ \prevXypostStyle@@}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Defining new effects}
+
+ Allow new effects to be declared and a default action provided. The
+ name is constructed from |#1| and the action to be taken is passed as
+ |#2|. If |#3| is non-empty then overwrite any existing definition for
+ a control sequence of the same name.
+
+\DOCMODE(
+\xydef@\newxystyle#1#2#3{%
+ \DN@{#3}\ifx\next@\empty
+ \xydefcsname@{shape [#1]}{\csname xyshape@#1@\endcsname}%
+ \else \expandafter\def\csname shape [#1]\endcsname{%
+ \csname xyshape@#1@\endcsname}\fi
+ \DN@{#2}\ifx\next@\empty
+ \expandafter\def\csname xyshape@#1@\endcsname{%
+ \xyundefinedStyle@{#1}{}@@}%
+ \else \expandafter\def\csname xyshape@#1@\endcsname{#2}\fi}
+
+\xydef@\xyundefinedStyle@#1#2@@{%
+ \xywarning@{style #1 not defined, nothing to apply}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Support for a new <style> takes the following form, in which
+ |\thestyle@| expands to the current value of the <style> information
+ to be maintained. If this is kept in a <count> or <dimen> register,
+ named |\xystyle@| say, then replace |\thestyle@| by
+ |\the\style@|. (However due to the large number of <dimen>s already
+ allocated, it is preferable to keep a text form of the value in
+ |\thestyle@|.)
+
+\begin{code}
+\xyshape@stylechange@{\modifystyle@{<how>}}
+\xydef@\modifystyle@#1{\checkXyStyle@
+ \edef\prevstyle@{\thestyle@}\modifystyle@@{#1}%
+ \let\prestyle@=\prestyle@@ \let\poststyle@=\poststyle@@
+ \applystyle@\prestyle@{\thestyle@}\poststyle@{\prevstyle@}}
+\xydef@\resetstyle@@#1{\def\thestyle@{#1}\outputstyle@{#1}}
+\xydef@\outputstyle@#1{\transformstyle@{#1}%
+ \expandafter\stylespecial@\expandafter{\next@}}
+\xylet@\transformstyle@@=\DN@
+\xylet@\transformstyle@=\transformstyle@@
+\end{code}
+\displaycode
+
+ In the above the macros |\modifystyle@@| and |\stylespecial@| are
+ adapted to the particular <style> information, see below. Typically
+ <how> is actual \TeX\ code and |\modifystyle@@| is simply |\literal@|
+ to execute this code. Typesetting is done by |\stylespecial@#1|
+ which is typically of the form |\special{|<key> |#1}|.
+
+ The |\transformstyle@| is required in case a dvi-<driver> needs
+ information in a form that is different to how \Xy-pic maintains it
+ in |\thestyle@|. A <driver> file should define |\|<driver>|@style@@|
+ to perform the transformation and place its result in |\next@|.
+ Install this macro using |\let\transformstyle@=\|<driver>|@style@@|
+ within the <driver> installation macro.
+
+\medskip
+
+ Next we discuss |\applystyle@|; which uses |\prestyle@|,
+ |\prestyle@@|, |\poststyle@| and |\poststyle@@|. There are two
+ strategies here, affecting how much information is placed into the
+ dvi-file, indicated by the alternative expansions given above. The
+ appropriateness for a given style must be decided by the author of
+ the style-option.
+
+ Suppose several modifications are made to a particular style
+ parameter. We must build a list of commands |\prestyle@{|<value>|}|,
+ to be executed later, which will recover the required value. Also we
+ build a list of commands |\poststyle@{|<value>|}| to reset to the
+ previous value.
+
+ In most cases it is only the result of the modifications that need be
+ placed into the dvi-file. Since we do not know how many, if any, more
+ modifications follow we could store each new result {\em after} the
+ previous, so that its effect will override the previous value. This
+ is building a FIFO list for the |\prestyle@| commands, with a FILO
+ list for the |\poststyle@| commands:
+
+\DOCMODE(
+\xydef@\applyFIFOstyle@#1#2#3#4{\bgroup
+ \styletoks@={\egroup\gdef\preXY@style@}%
+ \expandafter\toks@\expandafter{\preXY@style@}%
+ \expandafter\addtotoks@\expandafter{\expandafter#1\expandafter{#2}}%
+ \expandafter\addtostyletoks@\expandafter{\expandafter{\the\toks@}%
+ \gdef\postXY@style@}%
+ \expandafter\toks@\expandafter{\expandafter#3\expandafter{#4}}%
+ \expandafter\addtotoks@\expandafter{\postXY@style@}%
+ \expandafter\addtostyletoks@\expandafter{\expandafter{\the\toks@}}%
+ \the\styletoks@ }
+\DOCMODE)
+%
+\noindent
+ Use this via:
+ |\applyLIFOstyle@\prestyle@{\thestyle@}\poststyle@{\prevstyle@}|.
+ \newline With this method each modification places two entries into
+ the dvi-file; there is no need for separate |\prestyle@| and
+ |\prestyle@@| macros.
+
+ Perhaps a more efficient strategy is to build a LIFO list for the
+ |\prestyle@| commands. This way the required value is encountered
+ first. This first instance should then cancel all subsequent
+ instances of |\prestyle@|. This is where the need comes for a
+ |\prestyle@@|. Accompanying this is a FIFO list for the
+ |\poststyle@| commands, with a corresponding |\poststyle@@| to kill
+ subsequent instances:
+
+\DOCMODE(
+\xydef@\applyLIFOstyle@#1#2#3#4{\bgroup
+ \styletoks@={\egroup\gdef\preXY@style@}%
+ \expandafter\toks@\expandafter{\expandafter#1\expandafter{#2}}%
+ \expandafter\addtotoks@\expandafter{\preXY@style@}%
+ \expandafter\addtostyletoks@\expandafter{\expandafter{\the\toks@}%
+ \gdef\postXY@style@}%
+ \expandafter\toks@\expandafter{\postXY@style@}%
+ \expandafter\addtotoks@\expandafter{\expandafter#3\expandafter{#4}}%
+ \expandafter\addtostyletoks@\expandafter{\expandafter{\the\toks@}}%
+ \the\styletoks@ }
+\DOCMODE)
+
+\noindent
+ Use this via:
+ |\applyLIFOstyle@\prestyle@{\thestyle@}\poststyle@{\prevstyle@}|.
+ \newline The advantage here is that only two pieces of data need be
+ output to the dvi-file, no matter how many modifications are
+ requested.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[diagonal]??=[direction]??=[<direction>]
+%
+ Setting the current direction is simply pretending for the
+ typesetting of the object (and the following <modifier>s) that some
+ connection set it -- the <empty> case just inherits the previous
+ direction.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The code just calls the general <direction> parser below:
+
+\DOCMODE(
+\xydef@\OBJECT@direction{\afterDIRECTIONorEMPTY{%
+ \edef\next@{{\DirectionfromtheDirection@}}\expandafter\addtotoks@\next@
+ \xyFN@\OBJECT@}%
+ {\xyFN@\OBJECT@}}
+\DOCMODE)
+
+ Here is the <direction> parser: first the parts parsing the <diag>
+ part then the parts parsing the <trailer> part:
+
+\DOCMODE(
+\xydef@\afterDIRECTIONorEMPTY#1#2{%
+ \DN@##1{\def\afterDIRECTION@{\def\afterDIRECTION@{##1}%
+ \ifDIRECTIONempty@\DN@{#2}\else\DN@{#1}\fi \next@}}%
+ \expandafter\next@\expandafter{\afterDIRECTION@}%
+ \xyFN@\DIRECTION@}
+
+\xylet@\afterDIRECTION@=\empty
+\xynew@{if}\ifDIRECTIONempty@
+
+\xydef@\DIRECTION@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\DIRECTION@}%gobble spaces
+ \else\ifx v\next \DN@ v{\DIRECTION@v}%
+ \else\ifx \bgroup\next \let\next@=\DIRECTION@group
+ \else\ifx (\next \DN@({\xyFN@\DIRECTION@open}%))
+ \else
+ \DN@{\count@=8 %
+ \afterDIAG{\ifnum\count@=8 \DN@{\DIRECTIONempty@true \xyFN@\DIRECTION@i}%
+ \else \DN@{\xy@@{\dimen@=\xydashl@}\Directionfromdiag@}\fi \next@}}%
+ \fi\fi\fi\fi \next@}
+
+\xydef@\DIRECTION@open{%
+ \ifx *\next \DN@*##1*){\DIRECTION@group{##1}}%
+ \else \DN@{\xyerror@{(* <pos> *) expected}{} \xyFN@\DIRECTION@i}%
+ \fi \next@}
+\DOCMODE)
+
+\paragraph*{Diagonal directions.}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ It is particularly easy to set <diag>onal directions:
+$$
+\xy *[o]\cir<1pc>{}="c",
+ "c"; (-1,-1)**{},p+/4pc/ *+{|dl|=|ld|} **@{-}?>*@{>},
+ "c"; ( 0,-1)**{},p+/4pc/ *+{|d|} **@{-}?>*@{>},
+ "c"; ( 1,-1)**{},p+/4pc/ *+{|dr|=|rd|} **@{-}?>*@{>},
+ "c"; ( 1, 0)**{},p+/4pc/ *+{|r|} **@{-}?>*@{>},
+ "c"; ( 1, 1)**{},p+/4pc/ *+{|ur|=|ru|} **@{-}?>*@{>},
+ "c"; ( 0, 1)**{},p+/4pc/ *+{|u|} **@{-}?>*@{>},
+ "c"; (-1, 1)**{},p+/4pc/ *+{|ul|=|lu|} **@{-}?>*@{>},
+ "c"; (-1, 0)**{},p+/4pc/ *+{|l|} **@{-}?>*@{>},
+\endxy
+$$
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ More to the point, <diag>onals are stored internally as
+$$
+\xy *\cir<1pc>{}="c",
+ "c"; (-1,-1)**{},p+/3pc/ *+{|0|} **@{-}?>*@{>},
+ "c"; ( 0,-1)**{},p+/3pc/ *+{|1|} **@{-}?>*@{>},
+ "c"; ( 1,-1)**{},p+/3pc/ *+{|2|} **@{-}?>*@{>},
+ "c"; ( 1, 0)**{},p+/3pc/ *+{|3|} **@{-}?>*@{>},
+ "c"; ( 1, 1)**{},p+/3pc/ *+{|4|} **@{-}?>*@{>},
+ "c"; ( 0, 1)**{},p+/3pc/ *+{|5|} **@{-}?>*@{>},
+ "c"; (-1, 1)**{},p+/3pc/ *+{|6|} **@{-}?>*@{>},
+ "c"; (-1, 0)**{},p+/3pc/ *+{|7|} **@{-}?>*@{>},
+\endxy
+$$
+ Expanding |\afterDIAG{|<stuff>|}|<diag> will result in |\count@|
+ being set to the <diag> code (not changed in case the <diag> is
+ <empty>) before expanding <stuff>.
+
+\DOCMODE(
+\def\afterDIAG#1{\def\afterDIAG@{#1}\xyFN@\DIAG@}
+
+\xydef@\DIAG@{%
+ \ifx d\next \DN@ d{\count@=1 \xyFN@\DIAG@@}%
+ \else\ifx r\next \DN@ r{\count@=3 \xyFN@\DIAG@@}%
+ \else\ifx u\next \DN@ u{\count@=5 \xyFN@\DIAG@@}%
+ \else\ifx l\next \DN@ l{\count@=7 \xyFN@\DIAG@@}%
+ \else \let\next@=\afterDIAG@
+ \fi\fi\fi\fi \next@}
+
+\xydef@\DIAG@@{\ifcase\count@ \or
+%\count@=1 3 5 7
+ \DIAG@@@ l0r2\or\or \DIAG@@@ d2u4\or\or \DIAG@@@ r4l6\or\or \DIAG@@@ u6d0%
+ \else\xybug@{impossible <diag> number}\fi
+ \next@}
+
+\xydef@\DIAG@@@#1#2#3#4{%
+ \ifx #1\next \count@=#2\DN@#1{\afterDIAG@}%
+ \else \ifx #3\next \count@=#4\DN@#3{\afterDIAG@}%
+ \else \let\next@=\afterDIAG@ \fi\fi}
+\DOCMODE)
+
+ The action in case of a <diag> is simply to pick the right direction
+ setup routine according to the encoding, getting the <diag> from
+ |\count@| and the length of the $d$ vector from |\dimen@|:
+
+\DOCMODE(
+\xydef@\Directionfromdiag@{\ifcase\count@
+ \xy@@{\dlDirection@\dimen@}%
+ \or \xy@@{\dDirection@\dimen@}%
+ \or \xy@@{\drDirection@\dimen@}%
+ \or \xy@@{\rDirection@\dimen@}%
+ \or \xy@@{\urDirection@\dimen@}%
+ \or \xy@@{\uDirection@\dimen@}%
+ \or \xy@@{\ulDirection@\dimen@}%
+ \or \xy@@{\lDirection@\dimen@}%
+ \or % 8 is legal and means change nothing
+ \else\xybug@{impossible <diag>}\fi
+ \DIRECTIONempty@false \xyFN@\DIRECTION@i}
+\DOCMODE)
+
+\paragraph*{Vector directions.}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Alternatively |v|<vector> sets the direction as if the connection
+ from |0| to the <vector> had been typeset except that the "origin" is
+ assumed zero such that directions $|v(|x|,|y|)|$ mean the natural
+ thing, \ie, is the direction of the connection from |(0,0)| to
+ $|(|x|,|y|)|$.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The action for a |v| reads a <vector> and sets the direction
+ accordingly using some expansion hackery to propagate it out. The
+ "origin" is cleared locally to make |v(|$x$|,|$y$|)| behave as it
+ should.
+
+\DOCMODE(
+\xydef@\DIRECTION@v{%
+ \xy@{v}{\enter@{\cfromthec@ \X@origin=\the\X@origin \Y@origin=\the\Y@origin
+ \X@p=\the\X@p \Y@p=\the\Y@p}%
+ \X@origin=\z@ \Y@origin=\z@}%
+ \afterVECTORorEMPTY
+ {\xy@@{\X@p=\z@ \Y@p=\z@ \setupDirection@ \leave@}%
+ \DIRECTIONempty@false \xyFN@\DIRECTION@i}%
+ {\xy@@\leave@ \xyerror@{<vector> expected after v}{}%
+ \DIRECTIONempty@false \xyFN@\DIRECTION@i}}
+\DOCMODE)
+
+\paragraph*{Complex direction.}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ In case the direction is not as simple, you can construct
+ |{| <pos> <decor> |}| that sets up $p$ and $c$ such that
+ $\overline{pc}$ has the desired direction. \NOTE: that you must use
+ the |(*|\dots|*)| form if this is to appear in an object <modifier>!
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The code for this is rather like the one for <vector>s.
+
+\DOCMODE(
+\xydef@\DIRECTION@group#1{%
+ \xy@@{\begingroup}\xy@@ix@{#1}\xy@@{\plainxy@\expandafter\POS\the\toks9\relax
+ \setupDirection@\edef\next@{\endgroup \DirectionfromtheDirection@}\next@}%
+ \DIRECTIONempty@false \xyFN@\DIRECTION@i}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{exercise}
+ What effect is achieved by using <modifier>s |v/1pc/| and |v/-1pc/|?
+\answertext{The first has no effect since the direction is set to be that of
+ a vector in the current direction, however, the second reverses the
+ current direction.}
+\end{exercise}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[to <direction>]
+%
+ Once the initial direction is established as either the last one or
+ an absolute one then the remainder of the <direction> is interpreted.
+
+ Adding a single |^| or |_| denotes the result of rotating the default
+ direction a right angle in the positive and negative direction, \ie,
+ anti-/clockwise, respectively. \NOTE: Do \emph{not} use |^|\relax|^|
+ but only |__| to reverse the direction!
+
+ A trailing |:|<vector> is like |v|<vector> but uses the
+ <direction> to set up a standard square base such that |:(0,1)| and
+ |:(0,-1)| mean the same as |:a(90)| and |:a(-90)| and as |^| and |_|,
+ respectively.
+
+\DOCMODE(
+\xydef@\DIRECTION@i{%
+ \ifx ^\next \DN@ ^{\xy@^{\aboveDirection@\xydashl@}%
+ \DIRECTIONempty@false \xyFN@\DIRECTION@i}%
+ \else\ifx _\next \DN@ _{\xy@_{\belowDirection@\xydashl@}%
+ \DIRECTIONempty@false \xyFN@\DIRECTION@i}%
+ \else\ifx :\next \DN@ :{%
+ \xy@{:}{\enter@{\cfromthec@ \basefromthebase@ \X@p=\the\X@p \Y@p=\the\Y@p}%
+ \X@origin=\z@ \Y@origin=\z@
+ \X@xbase=\cosDirection\xydashl@ \Y@xbase=\sinDirection\xydashl@
+ \X@ybase=-\Y@xbase \Y@ybase=\X@xbase}%
+ \afterVECTORorEMPTY
+ {\xy@@{\X@p=\z@ \Y@p=\z@ \setupDirection@ \leave@}%
+ \DIRECTIONempty@false \xyFN@\DIRECTION@i}%
+ {\xy@@\leave@ \xyerror@{<vector> expected after :}{}%
+ \DIRECTIONempty@false \xyFN@\DIRECTION@i}}%
+ \else
+ \let\next@=\afterDIRECTION@
+ \fi\fi\fi \next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{exercise}
+ What effect is achieved by using <modifier>s |v/1pc/:(1,0)| and
+ |v/-1pc/__|?
+\answertext{None in both cases.}
+\end{exercise}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section{Decorations}
+??=[decor]
+
+\DOCMODE(
+\message{decorations;}
+\DOCMODE)
+
+ <Decor>ations are actual \TeX\ macros that decorate the current
+ picture in manners that depend on the state. They are allowed "after"
+ the <pos>ition either of the outer ??c![\xy]\dots??c![\endxy] or inside
+ |{|\dots|}|. The possibilities are given in figure~??[f.decor] with
+ notes below.
+
+\begin{figure*}[tp]
+\vss
+\begin{syntax}
+ ??w![<decor>]
+ &\iss & <command> <decor>
+ & either there is a command\dots
+\cr
+ &\orr & <empty>
+ & \dots or there isn't.
+\cr
+ ??w![<command>]
+ &\iss & ??c![\save] <pos>
+ & save ??!^[state], then do <pos>
+\cr
+ &\orr & ??c![\restore]
+ & restore ??!^[state] saved by matcing |\save|
+\cr
+ &\orr & ??c![\POS] <pos>
+ & interpret <pos>
+\cr
+ &\orr & ??c![\afterPOS] |{| <decor> |}| <pos>
+ & interpret <pos> and then perform <decor>
+\cr
+ &\orr & ??c![\drop] <object>
+ & drop <object> as the <pos> |*| operation
+\cr
+ &\orr & ??c![\connect] <object>
+ & connect with <object> as the <pos> |**| operation
+\cr
+ &\orr & ??c![\relax]
+ & do nothing
+\cr
+ &\orr & <\TeX\ commands>
+ & any ??!^[\TeX\ commands] and user-defined macros \hfil\break
+ that neither generates output (watch out for stray
+ \hfil\break spaces!), nor changes the grouping, may be used
+\cr
+ &\orr & ??c![\xyverbose]\orr??c![\xytracing]\orr??c![\xyquiet]\kern-1pc
+ &\kern1pc ??!^[tracing] commands
+\cr
+ &\orr & ??c![\xyignore] |{|<pos> <decor>|}|
+ & ??!^[ignore] \Xy-code
+\cr
+ &\orr & ??c![\xycompile] |{|<pos> <decor>|}|
+ & ??!^[compile] to file <prefix><no>|.xyc|
+\cr
+ &\orr & ??c![\xycompileto]|{|<name>|}{|<pos><decor>|}|\kern-1pc
+ &\kern1pc ??!^[compile] to file <name>|.xyc|
+\cr
+\end{syntax}
+\caption{\protect<decor>ations.}
+??=[f.decor]
+\vfill
+\end{figure*}
+
+ Most options add to the available <decor>, in particular the |v2|
+ option loads many more since \Xy-pic versions prior to 2.7 provided
+ most features as <decor>.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Simple decorations:}
+
+ ??c![\POS] and ??c![\afterPOS] have already been defined; the
+ following are just simple applications of previously defined
+ commands:
+
+\DOCMODE(
+\xydef@\drop#1#{\DN@##1{\xy@@ix@{{#1}{##1}}%
+ \xy@{\drop#1{##1}}{\expandafter\drop@\the\toks9 }\ignorespaces}\next@}
+
+\xydef@\connect#1#{\DN@##1{\xy@@ix@{{#1}{##1}}%
+ \xy@{\connect#1{##1}}{\expandafter\connect@\the\toks9 }\ignorespaces}\next@}
+
+\xydef@\preconnect#1#{\DN@##1{\xy@@ix@{{#1}{##1}}%
+ \xy@{\connect#1{##1}}{\expandafter\preconnect@\the\toks9 }\ignorespaces}\next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notes}
+%
+\note??=[state]
+%
+ Saving and restoring allows `excursions' where lots of things are
+ added to the picture without affecting the resulting \Xy-pic state,
+ \ie, $c$, $p$, and "base", and without requiring matching |{}|s. The
+ independence of |{}| is particularly useful in conjunction with the
+ ??c![\afterPOS] command, for example, the definition
+
+\begin{code}
+\def\ToPOS{\save\afterPOS{%
+ \POS**{}?>*@2{>}**@{-}\restore};p,}
+\end{code}
+\gdocode
+\displaycode
+
+ will cause the code |\ToPOS|<pos> to construct a double-shafted arrow
+ from the current object to the <pos> (computed relative to it) such
+ that
+%
+\begin{code}
+\xy *{A} \ToPOS +<10mm,2mm> \endxy
+\end{code}
+%
+ \thecode\ will typeset the picture \docode.
+
+\paragraph*{Note:}
+ Saving this way in fact uses the same state as the |{}| `grouping',
+ so the code $p_1$|,| |{|$p_2$|\save},| \dots\ |{\restore}| will have
+ $c=p_1$ both at the \dots\ and at the end!
+
+\DOCMODE(
+\xydef@\save{\relax\saveC}
+\xydef@\saveC{\xy@\save\save@ \POS}
+
+\xydef@\save@{\enter@{\cfromthec@ \pfromthep@ \basefromthebase@}}
+
+\xydef@\restore{\xy@\restore\leave@ \ignorespaces}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[\TeX\ commands]
+%
+ One very tempting kind of \TeX\ commands to perform as <decor> is
+ arithmetic operations on the \Xy-pic state. This will work in simple
+ \Xy-pictures as described here but be warned: "it is not portable"
+ because all \Xy-pic execution is indirect, and this is used by
+ several options in nontrivial ways. Check the \TeX-nical
+ documentation~\cite{RM95:Xy-picCSTC} for details about this!
+
+ Macros that expand to <decor> will always do the same, though.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ \TeX\ hackers like the author may enjoy changing the \Xy-pic state
+ directly using <decor> of the form |\xy@{|<id>|}{|<code>|}|\dots
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[tracing]
+%
+ ??c![\xyecho] will turn on echoing of all interpreted \Xy-pic <pos>
+ characters. \BUG: Not completely implemented yet. ??c![\xyverbose]
+ will switch on a tracing of all \Xy-pic commands executed, with line
+ numbers. ??c![\xytracing] traces even more: the entire \Xy-pic state
+ is printed after each modification. ??c![\xyquiet] restores default
+ quiet operation.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The trick is to replace the |\xy@| command such that it calls the
+ `normal' one between writing out a trace message and the state.
+
+\DOCMODE(
+\xydef@\xyecho{%
+ \xy@\xyecho{\let\xy@=\xyecho@ \message{\string\xyecho}}\POS}
+
+\xydef@\xyecho@#1#2{{\def\1{#1}\ifx\1\empty\else\message{\codeof\1}\fi}%
+ \oxy@{#1}{#2}}
+
+\xydef@\xyverbose{%
+ \xy@\xyverbose{\let\xy@=\xyverbose@
+ \W@{Xy: \string\xyverbose\xytracelineno@}}\POS}
+
+\xydef@\xyverbose@#1#2{%
+ {\def\1{#1}\ifx\1\empty\else\W@{Xy: \codeof\1\xytracelineno@}\fi}%
+ \oxy@{#1}{#2}}
+
+\xydef@\xytracing{%
+ \xy@\xytracing{\let\xy@=\xytracing@
+ \W@{Xy TRACE: \string\xytracing\xytracelineno@}\xystatus@:}\POS}
+
+\xydef@\xytracing@#1#2{{\def\1{#1}\def\2{#2}%
+ \W@{Xy TRACE: \codeof\1 {\codeof\2}\xytracelineno@}}\oxy@{#1}{#2}\xystatus@:}
+
+\xydef@\xystatus@#1{\xystatus@cp{#1}%
+ \W@{#1 d=<\the\d@X,\the\d@Y>
+ Direction=\the\Direction=\string(\cosDirection,\sinDirection\string)}%
+ \W@{#1 base=<\the\X@origin,\the\Y@origin>+%
+ <\the\X@xbase,\the\Y@xbase>x+<\the\X@ybase,\the\Y@ybase>y}%
+ \W@{#1 min/max=<\the\X@min,\the\Y@min>/<\the\X@max,\the\Y@max>
+ S=\the\csp@}}
+
+\xydef@\xystatus@cp#1{%
+ \W@{#1 c=<\the\X@c,\the\Y@c> \expandafter\string\the\Edge@c
+ \string[\the\L@c+\the\R@c,\the\D@c+\the\U@c\string]
+ \ifInvisible@ I\fi\ifHidden@ H\fi}%
+ \W@{#1 p=<\the\X@p,\the\Y@p> \expandafter\string\the\Edge@p
+ \string[\the\L@p+\the\R@p,\the\D@p+\the\U@p\string]}}
+
+\xydef@\xystatus@c#1{%
+ \W@{#1<\the\X@c,\the\Y@c> \expandafter\string\the\Edge@c
+ \string[\the\L@c+\the\R@c,\the\D@c+\the\U@c\string]}}
+
+\xydef@\xyquiet{\xy@\xyquiet{\let\xy@=\oxy@}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[ignore]
+%
+ Ignoring means that the <pos> <decor> is still parsed the usual way
+ but nothing is typeset and the \Xy-pic state is not changed.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ We ignore in a group to ensure that nothing done inside `leaks' to
+ the outside.
+
+\DOCMODE(
+\xydef@\xyignore#1{\xy@\xyignore{\xyignore@{#1}}\ignorespaces}
+
+\xydef@\xyignore@#1{{\let\xy@=\xyeat@ \change@oxy@\xy@ \POS#1\relax}}
+
+\xydef@\xyeat@#1#2{}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[compile]
+%
+ It is possible to save an intermediate form of commands that generate
+ parts of an \Xy-picture to a file such that subsequent typesetting of
+ those parts is significantly faster: this is called
+ "??w![compiling]". The produced file contains code to check that the
+ compiled code still corresponds to the same <pos><decor> as well as
+ efficient \Xy-code to redo it; if the <pos><decor> has changed then
+ the compilation is redone.
+
+ There are two ways to use this. The direct is to invent a <name> for
+ each diagram and then embrace it in
+ |\xycompileto{|<name>|}||{|\dots|}| -- this dumps the compiled code
+ into the file <name>|.xyc|.
+
+ When many diagrams are compiled then it is easier to add
+ ??c![\xycompile]|{|\dots|}| around the <pos><decor> to be compiled.
+ This will assign file names numbered consecutively with a <prefix>
+ which is initially the expansion of |\jobname-| but may be set with
+%
+\begin{defs1}
+??c![\CompilePrefix]|{|<prefix>|}|
+\end{defs1}
+\noindent\unskip
+%
+ This has the disadvantage, however, that if additional compiled
+ \Xy-pictures are inserted then all subsequent pictures will have to
+ be recompiled. One particular situation is provided, though: when
+ used within constructions that typeset their contents more than once
+ (such as most ??w![\AMS-\LaTeX] equation constructs) then the
+ declaration
+%
+\begin{defs1}
+??c![\CompileFixPoint]|{|<id>|}|
+\end{defs1}
+\noindent\unskip
+%
+ can be used inside the environment to fix the counter to have the
+ same value at every passage.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ It is done by just writing all |\xy@|-commands to the file. The file
+ establishes the correct input mode through use of the appropriate
+ commands itself.
+
+\DOCMODE(
+\xydef@\xycompile@@{\jobname-}
+\xydef@\xycompileno@@{0}
+
+\xydef@\CompilePrefix#1{%
+ \def\xycompile@@{#1}\xdef\xycompile@@{\codeof\xycompile@@}%
+ \xdef\xycompileno@@{0}}
+
+\xydef@\xycompile{%
+ \count@=\xycompileno@@ \advance\count@\@ne
+ \xdef\xycompileno@@{\ifnum10>\count@ 0\fi \the\count@}%
+ \edef\next{\noexpand\xycompileto{\xycompile@@\xycompileno@@}}\next}
+
+\xylet@\compilename@@=\empty
+\xylet@\xyrecompile@@=\relax
+
+\xydef@\xycompileto#1#2{%
+ \if\inxy@ \DN@{\xy@@{\nter@{}}}%
+ \else \DN@{\xy \xy@@{\nter@{\endxy}}}\fi \next@
+ \ifxysaving@ \xyerror@{Compilations can not be nested}{}\fi
+ \DN@{#1}\edef\compilename@@{\codeof\next@}\DNii@{#2}%
+ \def\xyrecompile@@{recompiling TRUNCATED}%
+ \expandafter\xyinputorelse@@\expandafter{\compilename@@.xyc}%
+ {\def\xyrecompile@@{compiling to}}%
+ \ifx\xyrecompile@@\relax \else \expandafter\xyrecompile@ \fi
+ \xy@@\leave@ \ignorespaces}
+\DOCMODE)
+
+ Recompilation is done by just writing all |\xy@|-commands to the
+ file. The file establishes the correct input mode and terminates
+ itself; after it has been finished it is simply reread to actually
+ get the drawing done in the document.
+
+\DOCMODE(
+\xydef@\xyrecompile@{%
+ \message{(\xyrecompile@@\space\string`\compilename@@.xyc\string'}%
+ \DN@{\immediate\openout\xywrite@=}\expandafter\next@\compilename@@.xyc
+ \immediate\write\xywrite@{%
+ \string\xycompiled{\compilename@@}%
+ {\the\year/\the\month/\the\day\string:\the\time\xytracelineno@}%
+ {Xy-pic \xyversion}\xycomment@}%
+ \immediate\write\xywrite@{{\codeof\nextii@}\relax}%
+ {\xysaving@ \expandafter\POS\nextii@ \relax}%
+ \immediate\write\xywrite@{\string\xyendcompiled}%
+ \immediate\closeout\xywrite@ \message{done)}%
+ \expandafter\input\compilename@@.xyc
+ \outlines@@\writeoutline@\writeoutline@}
+
+\xydef@\xysaving@{\let\xy@=\xysave@ \change@oxy@\xy@
+ \let\xy@@ix@=\xysave@@toksix@ \xysaving@true}
+
+\xynew@{if}\ifxysaving@ \xysaving@false
+
+\xydef@\xysave@#1#2{{\DN@{{#1}{#2}}%
+ \immediate\write\xywrite@{\string\xy@\codeof\next@\xycomment@}}}
+
+\xydef@\xysave@@toksix@#1{{\DN@{{#1}}%
+ \immediate\write\xywrite@{\string\xy@@ix@\codeof\next@\relax}}}
+
+\xywarnifdefined\xycomment@
+{\catcode`\%=12 \catcode`\(=1 \catcode`\)=2 \gdef\xycomment@(%)}
+\DOCMODE)
+
+ \HACK{1:} The |\ifxysaving@| can never be locally switched off!
+ Anyway it is used to allow a gross hack avoiding building a queue in
+ the matrix option that will generate too long lines!!
+
+ \HACK{2:} |\xysave@@toksix@| is not doing the catcode jive because it
+ can never be invoked while loading a file (knock, knock~\smiley~).
+
+ The initial command in all |.xyc| files check that this is the right
+ file and that neither the version of \Xy-pic nor the user's code has
+ changed:
+
+\DOCMODE(
+\xydef@\xycompiled#1#2#3#4{\DN@{#1}\edef\next@{\codeof\next@}%
+ \ifx\next@\compilename@@\else
+ \xywarning@{This file does not contain the result of
+ \string\xycompileto{\compilename@@}{...}^^J%
+ but of \string\xycompileto{\next@}}\fi
+ \edef\next{Xy-pic \xyversion}\DN@{#3}\ifx\next\next@
+ \DN@{#4}\ifx\next@\nextii@ \xycatcodes \outlines@@\relax\readoutline@
+ \else \def\xyrecompile@@{recompiling to}\endinput \fi
+ \else \def\xyrecompile@@{Xy-pic version change - recompiling}\endinput \fi}
+
+\xydef@\xyendcompiled{\let\xyrecompile@@=\relax \xyuncatcodes\endinput}
+\DOCMODE)
+
+ Finally the fix-point thing.
+
+\DOCMODE(
+\xydef@\CompileFixPoint#1{%
+ \expandafter\ifx\csname#1FIX@@\endcsname\relax
+ \expandafter\xdef\csname#1FIX@@\endcsname{\xycompileno@@}%
+ \else
+ \xdef\xycompileno@@{\csname#1FIX@@\endcsname}\fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Finally, when many `administrative typesetting runs' are needed, \eg,
+ readjusting \LaTeX\ cross references and such, then it may be an
+ advantage to not typeset any \Xy-pictures at all during the
+ intermediate runs. This is supported by the following declarations
+ which for each compilation creates a special file with the extension
+ ??c![.xyd] containing just the size of the picture:
+%
+\begin{defs1}
+??c![\MakeOutlines]\cr
+??c![\OnlyOutlines]\cr
+??c![\ShowOutlines]\cr
+??c![\NoOutlines]\cr
+\end{defs1}
+\noindent\unskip
+%
+ The first does no more. The second uses the file to typesets a
+ dotted frame of the appropriate size instead of the picture (unless
+ the picture has changed and is recompiled, then it is typeset as
+ always and the |.xyd| file is recreated for subsequent runs). The
+ third shows the outlines as dotted rectangles. The last switches
+ outline processing completely off.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The implementation is all handled by |\outlines@@| which is called at
+ strategic places in the compilation macros above. It just expands to
+ nothing when the state is `No', the first argument when it is `Make',
+ and the second when it is `Only'.
+
+\DOCMODE(
+
+\xydef@\outlines@no#1#2{}
+\xydef@\outlines@make#1#2{#1}
+\xydef@\outlines@only#1#2{#2}
+
+\xylet@\outlines@@=\outlines@no
+\xylet@\writeoutline@@=\relax
+\xylet@\readoutline@@=\relax
+
+\xydef@\MakeOutlines{\let\outlines@@=\outlines@make}
+
+\xydef@\OnlyOutlines{\xywarning@{Compiled pictures only shown as outlines}%
+ \let\outlines@@=\outlines@only}
+
+\xydef@\ShowOutlines{\let\readoutline@@=\typesetoutline@}
+
+\xydef@\NoOutlines{\let\outlines@@=\outlines@no}
+
+\xydef@\writeoutline@{%
+ \DN@{\immediate\openout\xywrite@=}\expandafter\next@\compilename@@.xyd
+ \immediate\write\xywrite@{\xycomment@\space\compilename@@.xyd}
+ \immediate\write\xywrite@{%
+ \string\X@min=\the\X@min \string\X@max=\the\X@max
+ \string\Y@min=\the\Y@min \string\Y@max=\the\Y@max \string\relax}%
+ \writeoutline@@
+ \immediate\closeout\xywrite@}
+
+\xynew@{if}\ifoutlineread@
+
+\xydef@\readoutline@{\outlineread@true
+ \expandafter\xyinputorelse@@\expandafter{\compilename@@.xyd}%
+ {\def\xyrecompile@@{outline missing - recompiling to}\outlineread@false}%
+ \ifoutlineread@ \readoutline@@
+ \writeoutline@\expandafter\xyendcompiled\fi}
+
+\xydef@\typesetoutline@{%
+ \xy@@{\czeroEdge@ \U@p=\z@ \D@p=\z@ \L@p=\z@ \R@p=\z@ \Edge@p={\zeroEdge}%
+ \X@p=\X@min \Y@p=\Y@min \X@c=\X@min \Y@c=\Y@max \connect@\dir{.}%
+ \X@p=\X@c \Y@p=\Y@c \X@c=\X@max \Y@c=\Y@max \connect@\dir{.}%
+ \X@p=\X@c \Y@p=\Y@c \X@c=\X@max \Y@c=\Y@min \connect@\dir{.}%
+ \X@p=\X@c \Y@p=\Y@c \X@c=\X@min \Y@c=\Y@min \connect@\dir{.}}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section{Kernel object library}
+??=[objectlib]
+
+\DOCMODE(
+\message{kernel objects:}
+\DOCMODE)
+
+ In this section we present the "library objects" provided with the
+ kernel language---several options add more library objects. They fall
+ into three types: Most of the kernel objects (including all those
+ usually used with |**| to build connections) are "directionals",
+ described in \S??[objectlib.directionals]. The remaining kernel
+ library objects are "circles" of \S??[objectlib.circles] and "text"
+ of \S??[objectlib.text].
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Directionals}
+??=[objectlib.directionals]
+
+\DOCMODE(
+\message{directionals,}
+\DOCMODE)
+
+ The kernel provides a selection of "directionals": objects that
+ depend on the current direction. They all take the form
+%
+\begin{defs1}
+%
+ ??c![\dir]<dir> \cr
+%
+\end{defs1}
+\noindent\unskip
+%
+ to typeset a particular <dir>ectional object. All have the structure
+%
+\begin{defs1}
+%
+ <dir> \iss\ <variant>|{|<main>|}| \cr
+%
+\end{defs1}
+\noindent\unskip
+%
+ with <variant> being <empty> or one of the characters |^_23| and
+ <main> some mnemonic code.
+
+ We will classify the directionals primarily intended for building
+ connections as "connectors" and those primarily intended for
+ placement at connection ends or as markers as "tips".
+
+\begin{figure*}[tp]
+ %
+ \def\Dx#1#2{\hbox{\def\1{#1{#2}}\enspace\tt\string\dir\codeof\1}}
+ %
+ \def\DC#1#{\DCx{#1}}
+ \def\DCx#1#2{ \Dx{#1}{#2} & \vcenter{\xy
+ 0*\cir<5pt>{} ; (16,5)*=<10.1pt>{}*\frm{-} **\dir#1{.} **h\dir#1{#2}
+ \endxy}}
+ %
+ \def\DT#1#{\DTx{#1}}
+ \def\DTx#1#2{\Dx{#1}{#2} & \vcenter{\xy
+ -(4,2.5)*{} ; (4,0)*{} **{} ?>*\dir#1{#2} **\dir#1{.}
+ \endxy}}
+ %
+ \def\Darray#1#2{{\let\\=\cr \tabskip=0pt plus 1fil %
+ \halign to\hsize{&\hfil$##$&$##$\hfil\\
+ \noalign{\hbox to\hsize{\hss#1\hss}\smallskip}#2\crcr}\bigskip}}
+%
+\Darray{??!^[Dummy]}{\hbox{\tt\string\dir\string{\string}}}
+%
+\Darray{??!^[Plain connectors]}{%
+ \DC{-} &\DC2{-} &\DC3{-} \\
+ \DC{.} &\DC2{.} &\DC3{.} \\
+ \DC{~} &\DC2{~} &\DC3{~} \\
+ \DC{--} &\DC2{--} &\DC3{--} \\
+ \DC{~~} &\DC2{~~} &\DC3{~~} \\
+}
+\bigskip
+\Darray{??!^[Plain tips]}{%
+ \DT{>} &\DT^{>} &\DT_{>} &\DT2{>} &\DT3{>} \\
+ \DT{<} &\DT^{<} &\DT_{<} &\DT2{<} &\DT3{<} \\
+ \DT{|} &\DT^{|} &\DT_{|} &\DT2{|} &\DT3{|} \\
+ \DT{(} &\DT^{(} &\DT_{(} \\
+ \DT{)} &\DT^{)} &\DT_{)} \\
+ & &\DT^{`} &\DT_{`} \\
+ & &\DT^{'} &\DT_{'}
+}
+\bigskip
+\Darray{??!^[Constructed tips]}{%
+ \DT{>>} &\DT^{>>} &\DT_{>>} &\DT2{>>} &\DT3{>>} \\
+ \DT{<<} &\DT^{<<} &\DT_{<<} &\DT2{<<} &\DT3{<<} \\
+ \DT{||} &\DT^{||} &\DT_{||} &\DT2{||} &\DT3{||} \\
+ \DT{|-} &\DT^{|-} &\DT_{|-} &\DT2{|-} &\DT3{|-} \\
+ \DT{>|} &\DT{>>|} &\DT{|<} &\DT{|<<} &\DT{*} \\
+ \DT{+} &\DT{x} &\DT{/} &\DT{//} &\DT{o}
+}
+\caption{Kernel library \protect<dir>ectionals}??=[f.dir]
+\end{figure*}
+
+ Figure~??[f.dir] shows all the <dir>ectionals defined by the kernel
+ with notes below; each <main> type has a line showing the available
+ <variant>s. Notice that only some variants exist for each
+ <dir>---when a nonexisting variant of a <dir> is requested then the
+ <empty> variant is used silently. Each is shown in either of the two
+ forms available in each direction as applicable: connecting a
+ $\bigcirc$ to a $\Box$ (typeset by |**\dir|<dir>) and as a tip at the
+ end of a dotted connection of the same variant (\ie, typeset by the
+ <pos> |**\dir|<variant>|{.}| |?>| |*\dir|<dir>).
+
+ As a special case an entire <object> is allowed as a <dir> by
+ starting it with a |*|: |\dir*| is equivalent to ??c![\object].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Setup:}
+
+ ??c![\dir] starts an <object> and passes control to a `finisher' named
+ |\dir|<variant>|{|<main>|}| otherwise to the one corresponding to an
+ <empty> <variant>. The kernel ones described here have in common
+ that they make use of the generic |\straight@| defined
+ in~\S??[algo.connection].
+
+\DOCMODE(
+\xydef@\dir{\hbox\bgroup\xyFN@\dir@i}
+
+\xydef@\dir@i{\ifx *\next \DN@*{\resetStyle@\object@}%
+ \else \let\next@=\dir@ii \fi \next@}
+
+\xydef@\dir@ii#1#{\dir@{#1}}
+
+\xydef@\dir@#1#2{\DN@{dir#1{#2}}%
+ \expandafter\let\expandafter\next\csname\codeof\next@\endcsname
+ \ifx\next\relax \DN@{dir{#2}}%
+ \expandafter\let\expandafter\next\csname\codeof\next@\endcsname
+ \ifx\next\relax \DN@{\dir#1{#2}}%
+ \xyerror@{illegal <dir>: \codeof\next@\space not defined}{}%
+ \let\next=\no@ \fi\fi \next}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notes}
+
+\note??=[Dummy]
+
+ You may use |\dir{}| for a ``dummy'' directional object (in fact this
+ is used automatically by |**{}|). This is useful for a uniform
+ treatment of connections, \eg, making the |?| <pos> able to find a
+ point on the straight line from $p$ to $c$ without actually
+ typesetting anything.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Uses an empty droppping, the |\no@@| connection. All the variants
+ are defined for optimisation reasons and it is also named |\dir{ }|
+ to allow spurious spaces:
+
+\DOCMODE(
+\xydefcsname@{dir{}}{\no@}
+
+\xyletcsnamecsname@{dir0{}}{dir{}}
+\xyletcsnamecsname@{dir1{}}{dir{}}
+\xyletcsnamecsname@{dir^{}}{dir{}}
+\xyletcsnamecsname@{dir_{}}{dir{}}
+\xyletcsnamecsname@{dir2{}}{dir{}}
+\xyletcsnamecsname@{dir3{}}{dir{}}
+
+\xyletcsnamecsname@{dir{ }}{dir{}}
+
+\xydef@\no@{\egroup \czeroEdge@ %\Invisible@false \Hidden@false %%%%HACK?
+ \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\setbox\z@=\copy\voidb@x}\def\Connect@@{\no@@}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[Plain connectors]
+
+ The "plain connectors" group contains basic directionals that lend
+ themself to simple connections.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The bulk of the code is in fact in the description of these. First
+ each of the three types---lines, dots, and squiggles---then the code
+ for doubling and tripling.
+
+\paragraph*{Lines:}
+
+ A single |\dir{-}| object is a dash in the current direction: build
+ box with character $C$ of the semidirectional ??c![\xydashfont]; use
+ the characters natural width $w$ and construct a height/depth from $d
+ = \abs{\sin(|\Direction|)}|em|$ (where |1em| is the dash length,
+ \cf~|xydash10.mf|) as follows:
+$$
+\begin{array}{cccccc}
+ C & L & R & D & U & "flip if" \\
+ 0\ldots30 & 0 & w & 0 & d & dY \lt 0 \\
+ 31\ldots63 & 0 & w & d & 0 & dY \gt 0 \\
+ 64\ldots95 & 0 & w & d & 0 & dX \lt 0 \\
+ 96\ldots127 & 0 & w & 0 & d & dX \lt 0 \\
+\end{array}
+$$
+ where "flip" means shift the box opposite vertically and
+ horizontally, \ie, $(L,R,D,U) := (R,L,U,D)$, and then lower the box
+ $D-U$.
+
+ "Procedure": (??_[line1])~Compute $d$, (??_[line2])~set $D,U$, and
+ flip condition, (??_[line3])~build box to get $w,L,R$,
+ (??_[line4])~dump box that is flipped if condition holds, and
+ (??_[line5])~finally setup the required parameters properly.
+
+\DOCMODE(
+\xydefcsname@{dir1{-}}{\line@}
+\xydefcsname@{dir2{-}}{\line@ \double@\xydashh@}
+\xydefcsname@{dir3{-}}{\line@ \triple@\xydashh@}
+\xyletcsnamecsname@{dir0{-}}{dir{}}
+\xyletcsnamecsname@{dir{-}}{dir1{-}}
+\xyletcsnamecsname@{dir{=}}{dir2{-}}
+
+\xydef@\line@{\dimen@=\sd@Y\sinDirection\xydashl@ %?*[line1]
+ \ifnum\SemiDirectionChar<31 \D@c=\z@ \U@c=\dimen@ \DN@{\d@Y<\z@}% %?*[line2]
+ \else\ifnum\SemiDirectionChar<64 \D@c=\dimen@ \U@c=\z@ \DN@{\z@<\d@Y}%
+ \else\ifnum\SemiDirectionChar<96 \D@c=\dimen@ \U@c=\z@ \DN@{\d@X<\z@}%
+ \else \D@c=\z@ \U@c=\dimen@ \DN@{\d@X<\z@}\fi\fi\fi
+ \setboxz@h{\line@@}\ht\z@=\U@c \dp\z@=\D@c %?*[line3]
+ \L@c=\z@ \R@c=\wdz@
+ \ifdim\next@ \dimen@=\R@c \R@c=\L@c \L@c=\dimen@ %?*[line4]
+ \dimen@=\U@c \U@c=\D@c \D@c=\dimen@ \advance\dimen@-\U@c
+ \lower\dimen@\boxz@
+ \else \boxz@ \fi
+%
+%\ifnum\SemiDirectionChar=31\relax
+% \W@{LINE@(\the\SemiDirectionChar): WH=<\the\L@c+\the\R@c,\the\D@c+\the\U@c>;
+% d=<\the\d@X,\the\d@Y>}\fi
+%
+ \edef\tmp@{\egroup \U@c=\the\U@c \D@c=\the\D@c \L@c=\the\L@c \R@c=\the\R@c}% %?*[line5]
+ \tmp@
+ \Edge@c={\rectangleEdge}%%%%%\Invisible@false\Hidden@false
+ \ifdim\z@<\U@c \def\Upness@{1}\else \def\Upness@{0}\fi
+ \ifdim\z@<\L@c \def\Leftness@{1}\else \def\Leftness@{0}\fi
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\solid@}}
+
+\xydef@\line@@{{\xydashfont\SemiDirectionChar\/}}
+\DOCMODE)
+
+ \BUG: |\line@| should allow the size of the object to be changed
+ after typesetting---this should make |\Connect@@| do dashing. Hm.
+
+ As mentioned above a dash will `Connect' to make lines by using rules
+ when strictly horizontal or vertical. This is controlled by enabling
+ or disabling the test |\ifjusthvtest@| discussed below.
+
+\DOCMODE(
+\xydef@\solid@{%
+%
+%\W@{SOLID}\xystatus@:%
+%
+ \checkXy@rules@\solidhrule@\solidvrule@{\straight@\solidSpread@}}
+
+\xydef@\checkXy@rules@#1#2#3{%
+ \dimen@=\Y@c \advance\dimen@-\Y@p
+ \ifjusthvtest@.05pt>\ifdim\dimen@<\z@-\fi\dimen@ \DN@{#1}%
+ \else \dimen@=\X@c \advance\dimen@-\X@p
+ \ifjusthvtest@.05pt>\ifdim\dimen@<\z@-\fi\dimen@ \DN@{#2}%
+ \else \DN@{#3}\fi\fi \next@}
+\DOCMODE)
+
+ Finally, we give the algorithm for `spreading' the dashes along a
+ solid line: just add an extra dash so they always overlap
+ (see~\S??[algo.connection] for a proper defintion of the requirements
+ to spreading).
+
+\DOCMODE(
+\xydef@\solidSpread@{\ifnum\z@<\count@@ \advance\count@@\@ne \fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ By default \Xy-pic will typeset horizontal and vertical |\dir{-}|
+ connections using \TeX\ rules. Unfortunately rules is the feature of
+ the DVI format most commonly handled wrong by DVI drivers. Therefore
+ \Xy-pic provides the <decor>ations
+%
+\begin{defs1}
+%
+ ??c![\NoRules] \cr
+ ??c![\UseRules] \cr
+%
+\end{defs1}
+\noindent\unskip
+%
+ that will switch the use of such off and on.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ They simply redefine the conditional used to select typesetting
+ with rules in |\solid@| above:
+
+\DOCMODE(
+\xylet@\ifjusthvtest@=\ifdim
+
+\xydef@\NoRules{\let\ifjusthvtest@=\iffalse}
+\xydef@\UseRules{\let\ifjusthvtest@=\ifdim}
+\DOCMODE)
+
+ The actual typesetting essentially means calling |\drop@| to box with
+ a rule of the appropriate length and with line width set to that of
+ ??c![\xydashfont] (as stored in |\xydashw@|).
+
+\DOCMODE(
+\xydef@\solidvrule@{\no@@ \solidvrule@typeset \ifHidden@\else\noinsert@\fi
+ \solidvrule@pre}
+
+\xydef@\solidvrule@pre{%
+%
+%\W@{VRULE SETUP}%
+%
+ \def\Cbreak@@{%
+%
+%\W@{VRULE Cbreak}%
+%
+ \connectRestore@ \swap@\lastbreak@@\swap@
+ \solidvrule@typeset \edef\lastbreak@@{\cfromthec@}\Creset@@}%
+ \def\Clast@@{%
+%
+%\W@{VRULE Clast}%
+%\let\Clast@@=\undefined
+%
+ \connectRestore@ \Creset@@\swap@\lastbreak@@\swap@
+ \solidvrule@typeset \Creset@@ \edef\lastbreak@@{\cfromthep@}}%
+}
+
+\xydef@\solidvrule@typeset{%
+%
+%\W@{VRULE TYPESET}\xystatus@cp:%
+%
+ \ifInvisible@ \let\next@=\relax \else \let\next@=\solidvrule@typeset@ \fi
+ \checkoverlap@@ \next@}
+
+\xydef@\solidvrule@typeset@{{%
+%
+ \advance\X@c\X@p \X@c=.5\X@c \X@p=\X@c
+ \advance\X@c-.5\xydashw@ \advance\X@p.5\xydashw@
+%
+ \ifdim\Y@c<\Y@p \advance\Y@c\U@c \advance\Y@p-\D@p
+ \else \swapdimen@\Y@c\Y@p \advance\Y@c\U@p \advance\Y@p-\D@c \fi
+%
+ \Droprule@}}
+
+\xydef@\solidhrule@{\no@@ \solidhrule@typeset \ifHidden@\else\noinsert@\fi
+ \solidhrule@pre}
+
+\xydef@\solidhrule@pre{%
+%
+%\W@{HRULE SETUP}%
+%
+ \def\Cbreak@@{%
+%
+%\W@{HRULE Cbreak}%
+%
+ \connectRestore@ \swap@\lastbreak@@\swap@
+ \solidhrule@typeset \edef\lastbreak@@{\cfromthec@}\Creset@@}%
+ \def\Clast@@{%
+%
+%\W@{HRULE Clast}%
+%\let\Clast@@=\undefined
+%
+ \connectRestore@ \Creset@@\swap@\lastbreak@@\swap@
+ \solidhrule@typeset \Creset@@ \edef\lastbreak@@{\cfromthep@}}%
+}
+
+\xydef@\solidhrule@typeset{%
+%
+%\W@{HRULE TYPESET}\xystatus@cp:%
+%
+ \ifInvisible@ \let\next@=\relax \else \let\next@=\solidhrule@typeset@ \fi
+ \checkoverlap@@ \next@}
+
+\xydef@\solidhrule@typeset@{{%
+ \ifdim\X@c<\X@p \advance\X@c\R@c \advance\X@p-\L@p
+ \else \swapdimen@\X@c\X@p \advance\X@c\R@p \advance\X@p-\L@c \fi
+ \advance\Y@c\Y@p \Y@c=.5\Y@c \Y@p=\Y@c
+ \advance\Y@c-.5\xydashw@ \advance\Y@p.5\xydashw@
+ \Droprule@}}
+\DOCMODE)
+
+ |\Droprule@| puts the actual ink on the page: with lower left corner
+ at $c$ and upper right corner at~$p$.
+
+\DOCMODE(
+\xydef@\Droprule@{\advance\X@p-\X@c
+%
+%\W@{: kern\the\X@c\space width\the\X@p\space depth-\the\Y@c\space
+% height\the\Y@p}%
+%
+ \setboxz@h{\kern\X@c \vrule width\X@p depth-\Y@c height\Y@p}%
+ \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ \Drop@@}
+\DOCMODE)
+
+\paragraph*{Dots:}
+
+ |\dir{.}| creates a very boring dot when used as an <object>, but
+ interesting dotted lines when used to connect. ??c![\zerodot] should
+ expand to a zero-sized box with a dot (initialised to use
+ |\zero|\-|dotbox@|); the <object> is built using |\pointlike@| <text>
+ <spread-dimen> that we will use again later.
+
+\DOCMODE(
+\xydef@\zerodot{\copy\zerodotbox@}
+
+\xydefcsname@{dir1{.}}{\point@}
+\xydefcsname@{dir2{.}}{\point@ \double@\xydashh@}
+\xydefcsname@{dir3{.}}{\point@ \triple@\xydashh@}
+\xyletcsnamecsname@{dir0{.}}{dir{}}
+\xyletcsnamecsname@{dir{.}}{dir1{.}}
+\xyletcsnamecsname@{dir{:}}{dir2{.}}
+
+\xydef@\point@{\pointlike@\zerodot\p@}
+
+\xydef@\pointlike@#1#2{%
+ \setboxz@h{#1}\wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@\egroup
+% \Invisible@false \Hidden@false
+ \def\Leftness@{.5}\def\Upness@{.5}\ctipEdge@
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@{\dottedSpread@{#2}}}}
+\DOCMODE)
+
+ This is reflected by the rather complicated spreading routine:
+ `Dotting' is the art of putting zero-sized objects together with
+ equal distance independent of the chosen direction. So we must
+ recompute the number of segments $N$ (likely to be very big or
+ ${-}1$) with trigonometry; using "radius" for the individual dots
+ this becomes
+$$
+\begin{array}{lc}
+ ??_[dottedspread]
+ & A := \abs{\cos{|\Direction|}}*"radius"\\
+ & B := \abs{\sin{|\Direction|}}*"radius"\\
+ ??_[dottedspread1]
+ & "if"~A+B \gt \abs{|\d@X|}+\abs{|\d@Y|}~"then"~N=0~"and exit" \\
+ ??_[dottedspread2]
+ & |<|A|,|B|>| := 2*|<|A|,|B|>|\\
+ & "Filler" := <box with the original filler centered...>\\
+ ??_[dottedspread3]
+ & |<\d@X,\d@Y>| := |<\d@X,\d@Y>| + |<\sd@X|*A|,\sd@Y|*B|>|\\
+ & |<|X|,|Y|>| := |<|X|,|Y|>| + |<\sd@X|*A/2|,\sd@Y|*B/2|>|\\
+ ??_[dottedspread4]
+ & N := \floor{"if"~\abs{|\d@X|}\gt\abs{|\d@Y|}
+ ~"then" \abs{|\d@X|}/A else \abs{|\d@Y|}/B} + 1
+\end{array}
+$$
+ as realised below:
+
+\DOCMODE(
+\xydef@\dottedSpread@#1{%\setupDirection@ %?*[dottedspread]
+ \dimen@=#1\relax \DN@{\A@=2\A@ \B@=2\B@ \dottedSpread@i}%
+ \A@=\sd@X\cosDirection\dimen@ \B@=\sd@Y\sinDirection\dimen@
+ \dimen@=\A@ \advance\dimen@\B@ %?*[dottedspread1]
+ \dimen@ii=\sd@X\d@X \advance\dimen@ii\sd@Y\d@Y
+ \ifdim\dimen@>\dimen@ii \DN@{\count@@=\z@}\fi
+ \next@}
+
+\xydef@\dottedSpread@i{%\setupDirection@ %?*[dottedspread2]
+ \global\setbox8=\hbox to\A@{\hss
+ \kern.5\A@\box\lastobjectbox@\kern.5\A@\hss}\dp8=.5\B@ \ht8=.5\B@
+ \advance\d@X\sd@X\A@ \advance\d@Y\sd@Y\B@ %?*[dottedspread3]
+ \advance\X@c\sd@X.5\A@ \advance\Y@c\sd@Y.5\B@
+ \ifdim\sd@Y\d@Y<\sd@X\d@X \dimen@=\sd@X\d@X %?*[dottedspread4]
+ \ifdim\zz@\A@\else \divide\dimen@\A@ \fi \count@@=\dimen@
+ \else \dimen@=\sd@Y\d@Y
+ \ifdim\zz@\B@\else \divide\dimen@\B@ \fi \count@@=\dimen@
+ \fi \advance\count@@\@ne}
+\DOCMODE)
+%
+\noindent
+ A particular aspect of this is that we have to enlarge and recenter
+ the actual box used for the typesetting (|\lastobjectbox@|).
+
+\paragraph*{Squiggles:}
+
+ These are just a lot of box maneuvering using the directional
+ characters of ??c![\xybsqlfont] (see~|xybsql10.mf| for details):
+
+\DOCMODE(
+\xydefcsname@{dir1{~}}{\squiggle@}
+\xydefcsname@{dir2{~}}{\squiggle@ \double@\xybsqlh@}
+\xydefcsname@{dir3{~}}{\squiggle@ \triple@\xybsqlh@}
+\xyletcsnamecsname@{dir0{~}}{dir{}}
+\xyletcsnamecsname@{dir{~}}{dir1{~}}
+
+\xydef@\squiggle@{\xybsqlfont
+ \dimen@=\sd@X\cosDirection\xybsqll@ \advance\dimen@.1\p@
+ \dimen@ii=\sd@Y\sinDirection\xybsqll@
+ \kern\dimen@\squiggle@@
+ \edef\tmp@{\egroup \U@c=\the\dimen@ii \L@c=\the\dimen@}\tmp@
+ \wdz@=2\L@c \R@c=\L@c \ht\z@=\U@c \D@c=\U@c \dp\z@=\U@c
+ \Edge@c={\rectangleEdge}%
+% \Invisible@false \Hidden@false
+ \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@\squiggledSpread@}}
+
+\xydef@\squiggle@@{\DirectionChar \count@=\DirectionChar
+ \advance\count@-64 \ifnum\count@<\z@ \advance\count@128 \fi \char\count@}
+\DOCMODE)
+
+ The interesting bit is that they spread by not spreading, \ie, by
+ centering between the endpoints---this means
+$$
+\begin{array}{ll}
+ X := X - d/2, dX := dX - d
+ &\hbox{where}~ d = |\sd@X|(\abs{dX} - N*A + |.1pt|)\\
+ Y := Y - d/2, dY := dY - d
+ &\hbox{where}~ d = |\sd@Y|(\abs{dY} - N*B + |.1pt|)\\
+\end{array}
+$$
+
+\DOCMODE(
+\xydef@\squiggledSpread@{%
+ \dimen@=\d@X \advance\dimen@-\sd@X\count@@\A@ \advance\dimen@\sd@X.3\p@
+ \advance\X@c-.5\dimen@ \advance\d@X-\dimen@
+ \dimen@=\d@Y \advance\dimen@-\sd@Y\count@@\B@ \advance\dimen@\sd@Y.3\p@
+ \advance\Y@c-.5\dimen@ \advance\d@Y-\dimen@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Double and triple directionals:}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ As can be seen by the last two columns, these (and most of the other
+ connectors) also exist in double and triple versions with a |2| or a
+ |3| prepended to the name. For convenience |\dir{=}| and |\dir{:}|
+ are synonyms for |\dir2{-}| and |\dir2{.}|, respectively; similarly
+ |\dir{==}| is a synonym for |\dir2{--}|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This is very simple, really: |\double@| and |\triple@| do the work by
+ redefining the |\Drop@@| method to do its job twice and thrice.
+ \TODO: should probably extend any already defined |\Drop@@| method?
+
+\DOCMODE(
+%\xydef@\double@#1{\edef\Drop@@{\dimen@=#1\relax
+% \dimen@=.5\dimen@ \A@=-\sinDirection\dimen@ \B@=\cosDirection\dimen@
+% \setbox2=\hbox{\kern\A@\raise\B@\copy\z@}\dp2=\z@ \ht2=\z@ \wd2=\z@ \box2 %
+% \setbox2=\hbox{\kern-\A@\raise-\B@\boxz@}\dp2=\z@ \ht2=\z@ \wd2=\z@ \box2 }}
+
+%\xydef@\triple@#1{\edef\Drop@@{\dimen@=#1\relax
+% \A@=-\sinDirection\dimen@ \B@=\cosDirection\dimen@
+% \setbox2=\hbox{\kern\A@\raise\B@\copy\z@}\dp2=\z@ \ht2=\z@ \wd2=\z@ \box2 %
+% \setbox2=\hbox{\kern-\A@\raise-\B@\copy\z@}\dp2=\z@ \ht2=\z@ \wd2=\z@ \box2
+% \dp\z@=\z@ \ht\z@=\z@ \wdz@=\z@ \boxz@}}
+
+\xydef@\double@#1{\edef\Drop@@{\dimen@=#1\relax
+ \dimen@=.5\dimen@ \A@=-\sinDirection\dimen@ \B@=\cosDirection\dimen@
+ \setboxz@h{\setbox2=\hbox{\kern\A@\raise\B@\copy\z@}%
+ \dp2=\z@ \ht2=\z@ \wd2=\z@ \box2 %
+ \setbox2=\hbox{\kern-\A@\raise-\B@ \noexpand\boxz@}%
+ \dp2=\z@ \ht2=\z@ \wd2=\z@ \box2 }%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \noexpand\styledboxz@}}
+
+\xydef@\triple@#1{\edef\Drop@@{\dimen@=#1\relax
+ \A@=-\sinDirection\dimen@ \B@=\cosDirection\dimen@
+ \setboxz@h{\setbox2=\hbox{\kern\A@\raise\B@\copy\z@}%
+ \dp2=\z@ \ht2=\z@ \wd2=\z@ \box2 %
+ \setbox2=\hbox{\kern-\A@\raise-\B@\copy\z@}%
+ \dp2=\z@ \ht2=\z@ \wd2=\z@ \box2 %
+ \dp\z@=\z@ \ht\z@=\z@ \wdz@=\z@ \noexpand\boxz@}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \noexpand\styledboxz@}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Dashing directionals:}
+
+ First traditional dashing:
+
+\DOCMODE(
+\xydefcsname@{dir1{--}}{\dash@}
+\xydefcsname@{dir2{--}}{\dash@ \double@\xydashh@}
+\xydefcsname@{dir3{--}}{\dash@ \triple@\xydashh@}
+\xyletcsnamecsname@{dir0{--}}{dir{}}
+\xyletcsnamecsname@{dir{--}}{dir1{--}}
+\xyletcsnamecsname@{dir{==}}{dir2{--}}
+
+\xydef@\dash@{\line@ \wdz@=2\wdz@ \ht\z@=2\ht\z@ \dp\z@=2\dp\z@
+ \multiply\D@c\tw@ \multiply\U@c\tw@ \multiply\L@c\tw@ \multiply\R@c\tw@
+ \def\Connect@@{\straight@\dashedSpread@}}
+\DOCMODE)
+
+ Since the dashes should reach the endpoints we do this:
+$$
+\begin{array}{l}
+ "if"~ N\gt 0 ~"then"~ N := N+1\\
+ dX := dX + d/2 ~"where"~ d = |\sd@X|A\\
+ dY := dY + d/2 ~"where"~ d = |\sd@Y|B\\
+ "if"~ dX\gt 0 ~"then"~ X := X + A/2\\
+ Y := Y + |\sd@Y|A/2\\
+\end{array}
+$$
+\DOCMODE(
+\xydef@\dashedSpread@{\ifnum\z@<\count@@ \advance\count@@\@ne \fi
+ \advance\d@X\sd@X.5\A@ \advance\d@Y\sd@Y.5\B@
+ \ifdim\z@<\d@X \advance\X@c.5\A@ \fi \advance\Y@c\sd@Y.5\B@}
+\DOCMODE)
+
+ Dashed dashing of squiggled lines are simpler since squiggles are
+ symmetric:
+
+\DOCMODE(
+\xydefcsname@{dir1{~~}}{\dashsquiggle@}
+\xydefcsname@{dir2{~~}}{\dashsquiggle@ \double@\xybsqlh@}
+\xydefcsname@{dir3{~~}}{\dashsquiggle@ \triple@\xybsqlh@}
+\xyletcsnamecsname@{dir0{~~}}{dir{}}
+\xyletcsnamecsname@{dir{~~}}{dir1{~~}}
+
+\xydef@\dashsquiggle@{\squiggle@
+ \multiply\D@c\tw@ \multiply\U@c\tw@ \multiply\L@c\tw@ \multiply\R@c\tw@
+ \dimen@=\L@c \advance\dimen@\R@c \wdz@=\dimen@ \ht\z@=\U@c \dp\z@=\D@c
+ \def\Connect@@{\straight@\dashsquiggledSpread@}}
+\DOCMODE)
+
+ The spreading of squiggles is similarly simpler: we just shave $1/4$
+ squiggle size of each end of the conection in order to eliminate the
+ blank space at both ends:
+
+\DOCMODE(
+\xydef@\dashsquiggledSpread@{\ifnum\z@<\count@@ \advance\count@@\@ne \fi
+ \advance\X@c.5\A@ \advance\d@X.5\A@ \advance\Y@c.25\B@ \advance\d@Y.5\B@}
+\DOCMODE)
+
+ Finally ``dashed dotting'' synonyms:
+
+\DOCMODE(
+\xyletcsnamecsname@{dir1{..}}{dir{.}}
+\xyletcsnamecsname@{dir2{..}}{dir2{.}}
+\xyletcsnamecsname@{dir3{..}}{dir3{.}}
+\xyletcsnamecsname@{dir{..}}{dir1{.}}
+\xyletcsnamecsname@{dir{::}}{dir2{.}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[Plain tips]
+
+ The group of "plain tips" contains basic objects that are useful as
+ markers and arrowheads making connections, so each is shown at the
+ end of a dotted connection of the appropriate kind.
+
+ They may also be used as connectors and will build dotted
+ connections. \eg, |**@{>}| typesets
+$$
+ \xy 0*++{}; (10,3)*++{} **@{>} \endxy
+$$
+
+\begin{exercise}
+ Typeset the following two $+$s and a tilted square:
+\begin{code}
+$$\xy
+ *{+}; p+(6,3)*{+} **{} ?(1)
+ *@{-} *!/-5pt/^\dir{-}
+ *^\dir{-} *!/^-5pt/\dir{-}
+\endxy$$
+\end{code}
+\docode
+%
+ "Hint": the dash created by |\dir{-}| has the length |5pt| (here).
+%
+\answercode
+\answertext{One way is}
+\answertext\displaycode
+\answertext{Thus we first create the two $+$s as $p$ and $c$ and connect them
+ with the dummy connection |**{}| to setup the direction parameters.
+ Then we move `on top of $c$' with |?(1)| and position the four sides
+ of the square using |^| and |_| for local direction changes and
+ |/|<dimen>|/| for skewing the resulting object by moving its
+ reference point in the opposite direction.}%
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xylet@\ctipEdge@=\czeroEdge@
+\DOCMODE)
+
+ \TODO: Change tips to have a tiny size of 2sp which may be taken as
+ an indication that it is a tip (this can be used by some features,
+ \eg, `arrow').
+
+\paragraph*{Arrow heads:}
+
+ The ones intended for single connections are just characters from
+ ??c![\xyatipfont] and ??c![\xybtipfont].
+
+\DOCMODE(
+\xydefcsname@{dir1{>}}{\tip@}
+\xydefcsname@{dir^{>}}{\atip@}
+\xydefcsname@{dir_{>}}{\btip@}
+\xyletcsnamecsname@{dir0{>}}{dir{}}
+\xyletcsnamecsname@{dir{>}}{dir1{>}}
+
+\xydefcsname@{dir1{<}}{\reverseDirection@\tip@}
+\xydefcsname@{dir^{<}}{\reverseDirection@\btip@}
+\xydefcsname@{dir_{<}}{\reverseDirection@\atip@}
+\xyletcsnamecsname@{dir0{<}}{dir{}}
+\xyletcsnamecsname@{dir{<}}{dir1{<}}
+
+\xydef@\tip@{\tip@x\tip@@}
+\xydef@\atip@{\tip@x\atip@@}
+\xydef@\btip@{\tip@x\btip@@}
+
+\xydef@\tip@x#1{#1\egroup
+ \ctipEdge@ %\Invisible@false \Hidden@false
+ \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@{\dottedSpread@\jot}}}
+
+\xydef@\tip@@{\atip@@\btip@@}
+\xydef@\atip@@{\xyatipfont\DirectionChar}
+\xydef@\btip@@{\xybtipfont\DirectionChar}
+\DOCMODE)
+
+ Double and triple tips are realised by taking the two halfs and
+ `wringing them apart'; as the naming indicates they are meant to be
+ put at the end of |2|- and |3|-connections. This is currently done
+ the slightly hacky (but efficient) way of adding directly to
+ ??c![\DirectionChar]; maybe this should be using |\vDirection@|?
+
+\DOCMODE(
+\xydefcsname@{dir2{>}}{\Tip@}
+\xydefcsname@{dir2{<}}{\reverseDirection@\Tip@}
+
+\xydef@\Tip@{\kern2.5pt \vrule height2.5pt depth2.5pt width\z@
+ \Tip@@ \kern2.5pt \egroup
+ \U@c=2.5pt \D@c=2.5pt \L@c=2.5pt \R@c=2.5pt \Edge@c={\circleEdge}%
+% \Invisible@false \Hidden@false
+ \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@{\dottedSpread@\jot}}}
+
+\xydef@\Tip@@{\count@=\DirectionChar
+ \advance\count@-4 \ifnum\count@<\z@ \advance\count@128 \fi
+ \xyatipfont\char\count@
+ \advance\count@ 8 \ifnum127<\count@ \advance\count@-128 \fi
+ \xybtipfont\char\count@}
+
+\xydefcsname@{dir3{>}}{\Ttip@}
+\xydefcsname@{dir3{<}}{\composite@{}{:(-1,0)\dir3{>}}}
+
+\xydef@\Ttip@{\kern3.2pt \vrule height3.2pt depth3.2pt width\z@
+ \Ttip@@ \kern3.2pt \egroup
+ \U@c=3.2pt \D@c=3.2pt \L@c=3.2pt \R@c=3.2pt \Edge@c={\circleEdge}%
+% \Invisible@false \Hidden@false
+ \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@{\dottedSpread@\jot}}}
+
+\xydef@\Ttip@@{%
+ \setboxz@h\bgroup\reverseDirection@\line@ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@
+ \kern-\L@c \boxz@ \kern\L@c
+ {\vDirection@(1,-.31)\xydashl@ \xyatipfont\char\DirectionChar}%
+ {\vDirection@(1,+.31)\xydashl@ \xybtipfont\char\DirectionChar}}
+\DOCMODE)
+
+\paragraph*{Stopper:}
+
+ |\dir{||}| makes a `stopper' using just the appropriate
+ ??c![\xydashfont] character rotated $90^\circ$ and centered; the |^|
+ and |_| variants are just shifted appropriately and two are used to
+ make the |2| and |3| variants longer.
+
+\DOCMODE(
+\xydefcsname@{dir1{|}}{\stopper@}
+\xydefcsname@{dir^{|}}{\aboveDirection@\xydashl@
+ \shiftdir@\line@\z@ \pointlike@{}\xydashh@}
+\xydefcsname@{dir_{|}}{\belowDirection@\xydashl@
+ \shiftdir@\line@\z@ \pointlike@{}\xydashh@}
+\xydefcsname@{dir2{|}}{\stopper@ \double@\xydashh@}
+\xydefcsname@{dir3{|}}{\stopper@ \double@{2\xydashh@}}
+
+\xyletcsnamecsname@{dir0{|}}{dir{}}
+\xyletcsnamecsname@{dir{|}}{dir1{|}}
+
+\xydef@\stopper@{\tip@x\stopper@@}
+
+\xydef@\stopper@@{\setboxz@h{\count@=\SemiDirectionChar \advance\count@64 %
+ \ifnum127<\count@ \advance\count@-128 \fi \xydashfont\char\count@\/}%
+ \setboxz@h{\kern-.5\wdz@ \dimen@=\sd@Y\cosDirection\xydashl@
+ \ifnum\SemiDirectionChar=95 \dimen@=\sd@X\sd@Y\dimen@ \fi
+ \raise.5\dimen@\boxz@}%
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
+\DOCMODE)
+
+\paragraph*{Hooks:}
+
+ These are halfcircles opening towards or opposite ??c![\Direction] and
+ fastened by their center or either endpoint. Build by lots of box
+ manipulation with the ??c![\xybsqlfont] quarter circles\dots\smiley
+
+\DOCMODE(
+\xydefcsname@{dir1{(}}{\hook@}
+\xydefcsname@{dir^{(}}{\ahook@}
+\xydefcsname@{dir_{(}}{\bhook@}
+\xyletcsnamecsname@{dir0{(}}{dir{}}
+\xyletcsnamecsname@{dir{(}}{dir1{(}}
+
+\xydefcsname@{dir1{)}}{\reverseDirection@\hook@}
+\xydefcsname@{dir^{)}}{\reverseDirection@\bhook@}
+\xydefcsname@{dir_{)}}{\reverseDirection@\ahook@}
+\xyletcsnamecsname@{dir0{)}}{dir{}}
+\xyletcsnamecsname@{dir{)}}{dir1{)}}
+
+\xydef@\hook@{\tip@x\hook@@}
+\xydef@\hook@@{\setboxz@h{\xybsqlfont
+ \vDirection@(1,-1){.707107\xybsqll@}%
+ \hbox{\DirectionChar
+ \kern-\d@Y\raise\d@X\hbox{\count@=\DirectionChar \advance\count@-32 %
+ \ifnum\count@<\z@ \advance\count@128 \fi \char\count@}}}%
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
+
+\xydef@\ahook@{\tip@x\ahook@@}
+\xydef@\ahook@@{\setboxz@h{\xybsqlfont
+ \vDirection@(1,-1){.707107\xybsqll@}\kern-\d@X
+ \lower\d@Y\hbox{\DirectionChar
+ \kern-\d@Y\raise\d@X\hbox{\count@=\DirectionChar \advance\count@-32 %
+ \ifnum\count@<\z@ \advance\count@128 \fi \char\count@}}}%
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
+
+\xydef@\bhook@{\tip@x\bhook@@}
+\xydef@\bhook@@{\setboxz@h{\xybsqlfont
+ \vDirection@(-1,-1){.707107\xybsqll@}\DirectionChar
+ \kern\d@X\raise\d@Y\hbox{\count@=\DirectionChar \advance\count@-96 %
+ \ifnum\count@<\z@ \advance\count@128 \fi \char\count@}}%
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
+\DOCMODE)
+
+\paragraph*{Quarter turns:}
+
+ These are quarter circles fastened by their start or end point in
+ ??c![\Direction]. Build by box manipulation of the ??c![\xybsqlfont]
+ quarter circles. The intention is that the |`'| directionals are
+ half the corresponding |()| directional.
+
+\DOCMODE(
+\xydefcsname@{dir^{'}}{\reverseDirection@\bturn@}
+\xydefcsname@{dir_{'}}{\reverseDirection@\aturn@}
+
+\xydefcsname@{dir^{`}}{\aturn@}
+\xydefcsname@{dir_{`}}{\bturn@}
+
+\xydef@\aturn@{\tip@x\aturn@@}
+\xydef@\aturn@@{\setboxz@h{\xybsqlfont
+ \vDirection@(1,-1){.707107\xybsqll@}\kern-\d@X
+ \lower\d@Y\hbox{\DirectionChar}}%
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
+
+\xydef@\bturn@{\tip@x\bturn@@}
+\xydef@\bturn@@{\setboxz@h{\xybsqlfont
+ \vDirection@(-1,-1){.707107\xybsqll@}\DirectionChar}%
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[Constructed tips]
+
+ These tips are combinations of the plain tips provided for
+ convenience (and optimised for efficiency). New ones can be
+ constructed using ??c![\composite] and by declarations of the form
+%
+\begin{defs1}
+%
+ ??c![\newdir] <dir> |{|<composite>|}|\cr
+%
+\end{defs1}
+\noindent\unskip
+%
+ which defines ??c![\dir]<dir> as the <composite> (see note~??[composite
+ object box] for the details).
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ ??c![\newdir] is simple:
+
+\DOCMODE(
+\xydef@\newdir#1#{\newdir@{#1}}
+
+\xydef@\newdir@#1#2#3{\xydefcsname@{dir#1{#2}}{\composite@{}{#3}}}
+\DOCMODE)
+
+ Then the somewhat more efficient |\shiftdir@| used internally for
+ moving a tip in the current direction---it does so by making a local
+ hbox within which the argument tip is constructed and subsequently
+ shifted and made of zero size. Use as
+$$
+ |\shiftdir@|<tip@><dimen><tip@>
+$$
+ where <tip@> means a tip command without the leading |\hbox{|.
+
+\DOCMODE(
+\xydef@\shiftdir@#1#2{%
+ \setbox\z@=\hbox\bgroup#1\relax
+ \setboxz@h{\dimen@ii=#2\relax
+ \dimen@=-\cosDirection\dimen@ii \advance\dimen@-\L@c
+ \kern\dimen@ \lower\sinDirection\dimen@ii\boxz@}%
+ \wdz@\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
+\DOCMODE)
+
+ Then the tips, with the |\tipjot@| hook allowing changing the spacing
+ of tips used for single lines.
+
+\DOCMODE(
+\xylet@\tipjot@=\jot
+
+\xydefcsname@{dir1{>>}}{\shiftdir@\tip@\tipjot@ \tip@}
+\xydefcsname@{dir^{>>}}{\shiftdir@\atip@\tipjot@ \atip@}
+\xydefcsname@{dir_{>>}}{\shiftdir@\btip@\tipjot@ \btip@}
+\xydefcsname@{dir2{>>}}{\composite@{}{h!/\tipjot@/\dir2{>}*\dir2{>}}}
+\xydefcsname@{dir3{>>}}{\composite@{}{h!/\tipjot@/\dir3{>}*\dir3{>}}}
+\xyletcsnamecsname@{dir0{>>}}{dir{}}
+\xyletcsnamecsname@{dir{>>}}{dir1{>>}}
+
+\xydefcsname@{dir1{<<}}{\reverseDirection@ \shiftdir@\tip@\tipjot@ \tip@}
+\xydefcsname@{dir^{<<}}{\reverseDirection@ \shiftdir@\btip@\tipjot@ \btip@}
+\xydefcsname@{dir_{<<}}{\reverseDirection@ \shiftdir@\atip@\tipjot@ \atip@}
+\xydefcsname@{dir2{<<}}{\composite@{}{h!/-\tipjot@/\dir2{<}*\dir2{<}}}
+\xydefcsname@{dir3{<<}}{\composite@{}{h!/-\tipjot@/\dir3{<}*\dir3{<}}}
+\xyletcsnamecsname@{dir0{<<}}{dir{}}
+\xyletcsnamecsname@{dir{<<}}{dir1{<<}}
+
+\xydefcsname@{dir1{||}}{\shiftdir@\stopper@\xydashh@ \shiftdir@\stopper@\z@
+ \pointlike@{}\jot}
+\xydefcsname@{dir^{||}}{\shiftdir@{\aboveDirection@\xydashl@\line@}\xydashh@
+ \shiftdir@{\aboveDirection@\xydashl@\line@}\z@ \pointlike@{}\jot}
+\xydefcsname@{dir_{||}}{\shiftdir@{\belowDirection@\xydashl@\line@}\xydashh@
+ \shiftdir@{\belowDirection@\xydashl@\line@}\z@ \pointlike@{}\jot}
+\xydefcsname@{dir2{||}}{\shiftdir@\stopper@\xydashh@ \shiftdir@\stopper@\z@
+ \pointlike@{}\jot \double@\xydashh@}
+\xydefcsname@{dir3{||}}{\shiftdir@\stopper@\xydashh@ \shiftdir@\stopper@\z@
+ \pointlike@{}\jot \double@{2\xydashh@}}
+\xyletcsnamecsname@{dir0{||}}{dir{}}
+\xyletcsnamecsname@{dir{||}}{dir1{||}}
+
+\xydefcsname@{dir1{>|}}{\shiftdir@\stopper@\z@ \tip@}
+\xydefcsname@{dir2{>|}}{\composite@{}{\dir2{>}*\dir2{|}}}
+\xydefcsname@{dir3{>|}}{\composite@{}{\dir3{>}*\dir3{|}}}
+\xyletcsnamecsname@{dir0{>|}}{dir{}}
+\xyletcsnamecsname@{dir{>|}}{dir1{>|}}
+
+\xydefcsname@{dir1{>>|}}{\shiftdir@\stopper@\z@ \shiftdir@\tip@\tipjot@ \tip@}
+\xydefcsname@{dir2{>>|}}{\composite@{}{h!/\tipjot@/\dir2{>}*\dir2{>}*\dir2{|}}}
+\xydefcsname@{dir3{>>|}}{\composite@{}{h!/\tipjot@/\dir3{>}*\dir3{>}*\dir3{|}}}
+\xyletcsnamecsname@{dir0{>>|}}{dir{}}
+\xyletcsnamecsname@{dir{>>|}}{dir1{>>|}}
+
+\xydefcsname@{dir1{|<}}{\reverseDirection@ \shiftdir@\stopper@\z@ \tip@}
+\xydefcsname@{dir2{|<}}{\reverseDirection@ \shiftdir@\stopper@\z@ \Tip@}
+\xydefcsname@{dir3{|<}}{\reverseDirection@ \shiftdir@\stopper@\z@ \Ttip@}
+\xyletcsnamecsname@{dir0{|<}}{dir{}}
+\xyletcsnamecsname@{dir{|<}}{dir1{|<}}
+
+\xydefcsname@{dir1{|<<}}{\reverseDirection@
+ \shiftdir@\stopper@\z@ \shiftdir@\tip@\tipjot@ \tip@}
+\xydefcsname@{dir2{|<<}}{%
+ \composite@{}{h!/-\tipjot@/\dir2{<}*\dir2{<}*\dir2{|}}}
+\xydefcsname@{dir3{|<<}}{%
+ \composite@{}{h!/-\tipjot@/\dir3{<}*\dir3{<}*\dir3{|}}}
+\xyletcsnamecsname@{dir0{|<<}}{dir{}}
+\xyletcsnamecsname@{dir{|<<}}{dir1{|<<}}
+
+\xydefcsname@{dir1{|-}}{\shiftdir@\stopper@\z@
+ \shiftdir@\line@\z@ \pointlike@{}\jot}
+\xydefcsname@{dir^{|-}}{\shiftdir@{\aboveDirection@\xydashl@ \line@}\z@
+ \shiftdir@\line@\z@ \pointlike@{}\jot}
+\xydefcsname@{dir_{|-}}{\shiftdir@{\belowDirection@\xydashl@ \line@}\z@
+ \shiftdir@\line@\z@ \pointlike@{}\jot}
+\xydefcsname@{dir2{|-}}{\shiftdir@\stopper@\z@
+ \shiftdir@\line@\z@ \pointlike@{}\jot \double@\xydashh@}
+\xydefcsname@{dir3{|-}}{\shiftdir@\stopper@\z@
+ \shiftdir@\line@\z@ \pointlike@{}\jot \triple@\xydashh@}
+\xyletcsnamecsname@{dir0{|-}}{dir{}}
+\xyletcsnamecsname@{dir{|-}}{dir1{|-}}
+\xyletcsnamecsname@{dir{|=}}{dir2{|-}}
+
+\xydefcsname@{dir{+}}{%
+ \DN@##1{\composite@{}{##10\dir{|}*!C##10\dir{-}}}\addEQ@\next@}
+\xyletcsnamecsname@{dir0{+}}{dir{}}
+
+\xydefcsname@{dir{x}}{\vDirection@(1,1)\jot
+ \DN@##1{\composite@{}{##10\dir{|}*!C##10\dir{-}}}\addEQ@\next@}
+\xyletcsnamecsname@{dir0{x}}{dir{}}
+
+\xydefcsname@{dir{/}}{\vDirection@(1,-.3)\jot \stopper@}
+\xyletcsnamecsname@{dir0{/}}{dir{}}
+
+\xydefcsname@{dir{//}}{\vDirection@(1,-.3)\jot
+ \shiftdir@\stopper@\xydashh@ \stopper@}
+\xyletcsnamecsname@{dir0{//}}{dir{}}
+
+\xydefcsname@{dir{*}}{\solidpoint@}
+\xydef@\solidpoint@{%
+ \pointlike@{\kern-1.8pt\lower1.8pt\hbox{$\scriptstyle\bullet$}}\jot}
+\xyletcsnamecsname@{dir0{*}}{dir{}}
+
+\xydefcsname@{dir{o}}{\hollowpoint@}
+\xydef@\hollowpoint@{%
+ \pointlike@{\kern-1.8pt\lower1.8pt\hbox{$\scriptstyle\circ$}}\jot}
+\xyletcsnamecsname@{dir0{o}}{dir{}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{figure*}[ht]
+\vss
+\begin{syntax}
+%
+ \multispan3|\cir| <radius> |{| <cir> |}|\hfil
+ & <cir>cle segment with <radius>
+\cr
+\noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+%
+ ??w![<radius>]
+ &\iss & <empty>
+ & use $R_c$ as the radius
+\cr
+ &\orr & <vector>
+ & use $X$ of the <vector> as radius
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<cir>]
+ &\iss & <empty>
+ & full circle of <radius>
+\cr
+ &\orr & <diag> <orient> <diag>
+ & partial circle from first <diag>onal through to the
+ second <diag>onal in the <orient>ation
+\cr
+\noalign{\smallbreak}
+%
+ ??w![<orient>]
+ &\iss & |^|
+ & anticlockwise
+\cr
+ &\orr & |_|
+ & clockwise
+\cr
+\end{syntax}
+\caption{\protect<cir>cles.}
+??=[f.cir]
+\vfill
+\end{figure*}
+
+
+\subsection{Circle segments}
+??=[objectlib.circles]
+
+\DOCMODE(
+\message{circles,}
+\DOCMODE)
+
+ Circle <object>s are round and typeset a segment of the circle
+ centered at the reference point. The syntax of circles is described
+ in figure~??[f.cir] with explanations below.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The |\cir| command is the hub: it parses the optional <radius> (to
+ |\R@|, default from $R_c$) and |{|<cir>|}|, bailing out with a
+ |\zerodot| if the radius is to small:
+
+\DOCMODE(
+\xydef@\cir#1#{\hbox\bgroup
+ \afterVECTORorEMPTY{\xy@@{\R@=\X@c}\cir@}{\xy@@{\R@=\R@c}\cir@}#1@}
+
+\xydef@\cir@#1@#2{%
+ \DN@{#1}\ifx\next@\empty\else \xyerror@{illegal circle <radius>: must be
+ <vector> or <empty>}{}\fi
+ \afterCIRorDIAG{\xyFN@\cir@cir}{\xyFN@\cir@diag}#2@}
+\DOCMODE)
+
+ The code to actually typeset the <cir> just parsed starts by checking
+ that the <cir> was immediately followed by the |@| we put there in
+ |\cir|:
+
+\DOCMODE(
+\xydef@\cir@cir{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\cir@cir}%gobble spaces
+ \else \ifx @\next \DN@ @{\cir@i}%
+ \else \xyerror@{illegal <cir>: must have form <diag><orient><diag> or
+ <empty>}{}%
+ \fi\fi \next@}
+\DOCMODE)
+
+ Similarly when an <empty> one was given---the parser will recognise
+ this as a <diag> but we hack that here:
+
+\DOCMODE(
+\xydef@\cir@diag{%
+ \DN@{\xyerror@{illegal <cir>: must have form <diag><orient><diag> or
+ <empty>}{}}%
+ \ifx @\next \ifnum\count@=8 %
+ \DN@ @{\def\CIRin@@{0}\def\CIRorient@@{\CIRfull@}\def\CIRout@@{7}\cir@i}%
+ \fi\fi \next@}
+\DOCMODE)
+
+ \dots and then use the constructed methods to build it:
+
+\DOCMODE(
+\xydef@\cir@i{%
+ \ifnum\CIRin@@=8 \xyerror@{incomplete <cir> specification}{%
+The <cir> you specified as <diag><orient><diag> is not sufficiently specific.}%
+ \def\CIRin@@{0}\fi
+ \ifdim\R@<.5\p@ \R@=\z@ \zerodot
+ \else \CIRorient@@ \cirbuild@ \fi
+ \L@c=\R@ \R@c=\R@ \D@c=\R@ \U@c=\R@ \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@\relax}%
+ \Edge@c={\circleEdge}\OBJECT@x}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Parsing:}
+
+ The |\afterCIRorDIAG| parser handles the parsing: it either
+%
+\begin{itemize}
+
+\item
+ parses the <cir> and sets "in", "orient", and "out", and passes
+ control to the first argument continuation, or
+
+\item
+ parses the single <diag> specified, store it in |\count@| (as |8| if
+ an <empty> one given), and pass control to the second continuation
+ argument,
+
+\end{itemize}
+%
+ where the <diag> internal representation number of note~??[diagonal]
+ of is used. An <empty> circle is treated as an <empty> diagonal;
+ specifying an <empty> first <diag> of a <cir> is equivalent to using
+ the value of the "in" method at call time.
+
+ The parser is very simple, setting methods stored in the usual
+ |@@|-terminated control sequences (\TODO: Rename all non-method
+ control sequences that end in |@@|\dots to use |@|<romannumeral>
+ suffixes\dots):
+
+\DOCMODE(
+\xydef@\CIRin@@{3}
+\xydef@\CIRout@@{3}
+\xylet@\CIRorient@@=\empty
+
+\xydef@\afterCIRorDIAG#1#2{\def\afterCIR@{#1}\def\afterCIRDIAG@{#2}\xyFN@\CIR@}
+
+\xylet@\afterCIR@=\empty
+\xylet@\afterCIRDIAG@=\empty
+
+\xydef@\CIR@{\count@=8 \afterDIAG{\edef\CIRin@@{\the\count@}\xyFN@\CIR@@}}
+
+\xydef@\CIR@@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\CIR@@}%gobble spaces
+ \else\ifx ^\next
+ \DN@ ^{\def\CIRorient@@{\CIRacw@}%
+ \afterDIAG{\edef\CIRout@@{\the\count@}\afterCIR@}}%
+ \else\ifx _\next
+ \DN@_{\def\CIRorient@@{\CIRcw@}%
+ \afterDIAG{\edef\CIRout@@{\the\count@}\afterCIR@}}%
+ \else
+ \DN@{\def\CIRorient@@{\relax}\afterCIRDIAG@}%
+ \fi\fi\fi \next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The default is to generate a "full circle" with the specified radius,
+ \eg,
+$$
+\def\quotesmash#1{\setbox0=\hbox{``$\vcenter{#1}$''}\ht0=8pt \dp0=3pt \box0}
+\begin{array}{ccc}
+ |\xy*\cir<4pt>{}\endxy|
+ &\hbox{typesets}& \quotesmash{\xy*\cir<4pt>{}\endxy}
+\cr
+ |\xy*{M}*\cir{}\endxy|
+ &\hbox{---}& \quotesmash{\xy*{M}*\cir{}\endxy}
+\end{array}
+$$
+ All the other circle segments are subsets of this and have the shape
+ that the full circle outlines.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Finally we present the "orient" methods. They use these `internal
+ methods' to actually draw the circles
+
+\DOCMODE(
+\xylet@\CIRtest@@=\relax
+\xydef@\CIRlo@@{0}
+\xydef@\CIRhi@@{0}
+\DOCMODE)
+
+ Below we call them "lo", "hi", and "test"; the first two are coded as
+ described in note ??[diagonal] and the last takes two arguments: a
+ dimension and something to do if the test succeeds. |\count@@| and
+ |\count@| should be set to "in" and "out" internally as well in case
+ |\cirbuild@| and friends below should be used.
+
+ The dummy "orient" used for simple circles is the simplest:
+
+\DOCMODE(
+\xydef@\CIRfull@{\def\CIRtest@@##1##2{##2}}
+\DOCMODE)
+
+ The kernel |\cirbuild@| builds the actual <object> using characters
+ from the ??c![\xycircfont] assumed coded like |xycirc10.mf|:
+ |\cirrestrict@@| choses a group and adjusts the radius |\R@| to fit it
+ exactly. The group is multiplied by 8 to get the group character
+ offset [|\count@|].
+
+\DOCMODE(
+\xydef@\cirbuild@{\cirrestrict@@ \multiply\count@8 %
+ \circhar@0\circhar@7\kern\dimen@
+ \circhar@1\circhar@6\kern\dimen@
+ \circhar@2\circhar@5\kern\dimen@
+ \circhar@3\circhar@4\kern\dimen@}
+
+\xydef@\circhar@#1{%
+ \setboxz@h{\circhar@@{#1}}\dimen@=\wdz@ \wdz@=\z@ \ht\z@=\R@ \dp\z@=\R@
+ \CIRtest@@#1{\styledboxz@}\setbox\z@=\copy\voidb@x}
+
+\xydef@\circhar@@#1{{\xycircfont \advance\count@#1\relax \char\count@}}
+\DOCMODE)
+
+ |\cirrestrict@@| computes the group $g$ [|\count@|] of circle segments
+ to use from the radius $r$ [|\R@|] using the formula (the reverse of
+ the one in |xycirc10.mf|)
+$$
+\def\arraystretch{1}
+g = \left\{ \begin{array}{ll}
+ \floor{r\over1|pt|}-1 &\textrm{if}~ 1|pt|\le r\lt 8|pt|\\
+ \floor{r\over2|pt|}+3 &\textrm{if}~ 8|pt|\le r\lt 16|pt|\\
+ \floor{r\over4|pt|}+7 &\textrm{if}~16|pt|\le r\lt 32|pt|\\
+ 15 &\textrm{if}~32|pt|\le r \end{array}
+\right.
+$$
+ (where we know from |\cir@i| that $r\ge\frac12|pt|$), and then
+ adjusts the radius to be exactly the one chosen through the use of
+ group $g$ using the formula in |xycirc10.mf|\dots this is necessary
+ because of the restriction on |tfm| files that they can only have 15
+ different nonzero heights and depths. Subsequent calls to
+ |\cirrestrict@@| should compute the same values.
+
+\DOCMODE(
+\xydef@\cirrestrict@@{\begingroup \dimen@=\R@
+ \setboxz@h{\xycircfont\char\z@\char\@ne}\A@=\wdz@
+ \ifdim\R@<8\A@ \count@=\dimen@ \divide\count@\A@ \advance\count@\m@ne
+ \else\ifdim\R@<16\A@ \count@=\dimen@
+ \dimen@=2\A@ \divide\count@\dimen@ \advance\count@3 %
+ \else\ifdim\R@<32\A@ \count@=\dimen@
+ \dimen@=4\A@ \divide\count@\dimen@ \advance\count@7 %
+ \else \count@=15 \fi\fi\fi
+ \R@=\A@
+ \ifnum\count@<8 \multiply\R@\count@ \advance\R@\A@
+ \else\ifnum\count@<12 \multiply\R@\count@ \multiply\R@\tw@ \advance\R@-6\A@
+ \else\ifnum\count@<16 \multiply\R@\count@ \multiply\R@ 4 \advance\R@-28\A@
+ \else \multiply\R@ 32 \fi\fi\fi
+ \edef\@tmp{\endgroup \R@=\the\R@ \count@=\the\count@}\@tmp}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ "Partial circle segments" with <orient>ation are the part of the full
+ circle that starts with a tangent vector in the direction of the
+ first <diag>onal (see note~??[diagonal]) and ends with a tangent
+ vector in the direction of the other <diag>onal after a clockwise
+ (for |_|) or anticlockwise (for |^|) turn, \eg,
+$$
+\def\quotesmash#1{\setbox0=\hbox{``$\vcenter{#1}$''}\ht0=8pt \dp0=3pt \box0}
+\begin{array}{ccc}
+ |\xy*\cir<4pt>{l^r}\endxy|
+ &\hbox{typesets}& \quotesmash{\xy*\cir<4pt>{l^r}\endxy}
+\\
+ |\xy*\cir<4pt>{l_r}\endxy|
+ &\hbox{---}& \quotesmash{\xy*\cir<4pt>{l_r}\endxy}
+\\
+ |\xy*\cir<4pt>{dl^u}\endxy|
+ &\hbox{---}& \quotesmash{\xy*\cir<4pt>{dl^u}\endxy}
+\\
+ |\xy*\cir<4pt>{dl_u}\endxy|
+ &\hbox{---}& \quotesmash{\xy*\cir<4pt>{dl_u}\endxy}
+\\
+ |\xy*+{M}*\cir{dr_ur}\endxy|
+ &\hbox{---}& \quotesmash{\xy*+{M}*\cir{dr_ur}\endxy}
+\end{array}
+$$
+ If the same <diag> is given twice then nothing is typeset, \eg,
+$$
+\def\quotesmash#1{\setbox0=\hbox{``$\vcenter{#1}$''}\ht0=8pt \dp0=3pt \box0}
+\begin{array}{ccc}
+ |\xy*\cir<4pt>{u^u}\endxy|
+ &\hbox{typesets}& \quotesmash{\xy*\cir<4pt>{u^u}\endxy}
+\end{array}
+$$
+ Special care is taken to setup the <diag>onal defaults:
+%
+\begin{itemize}
+
+\item
+ After |^| the default is the diagonal $90^\circ$ anticlockwise from
+ the one before the |^|.
+
+\item
+ After |_| the default is the diagonal $90^\circ$ clockwise from the
+ one before the |_|.
+
+\end{itemize}
+%
+ The <diag> before |^| or |_| is required for ??c![\cir] <objects>.
+
+\begin{exercise}
+ Typeset the following shaded circle with radius |5pt|:
+%
+\begin{code}
+$$\xy
+ *\cir<5pt>{}
+ *!<-.2pt,.2pt>\cir<5pt>{dr^ul}
+ *!<-.4pt,.4pt>\cir<5pt>{dr^ul}
+ *!<-.6pt,.6pt>\cir<5pt>{dr^ul}
+\endxy$$
+\end{code}
+\docode
+%
+\answertext{One way is to add extra half circles skewed such that they create
+ the illusion of a shade:}
+\answercode
+\answertext\displaycode
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ These two macros implement the defaults and setup of "lo" and "hi"
+ for anticlockwise and clockwise segments. Here is what they set:
+$$
+\begin{array}{\otherbar c\otherbar cc\otherbar l\otherbar}
+\hline
+ ??w![<cir>] & "lo" & "hi" & "test"(s) \\
+\hline
+ d_1|^|d_2, d_1\le d_2 & d_1 -_8 1 & d_2 -_8 1 & {"lo"\le s}\wedge{s\lt "hi"}\\
+ d_1|^|d_2, d_1\gt d_2 & d_2 -_8 1 & d_1 -_8 1 & {s \lt"lo"} \vee {"hi"\le s}\\
+ d_1|_|d_2, d_1\lt d_2 & d_1 +_8 3 & d_2 +_8 3 & {s \lt"lo"} \vee {"hi"\le s}\\
+ d_1|_|d_2, d_1\ge d_2 & d_2 +_8 3 & d_1 +_8 3 & {"lo"\le s}\wedge{s\lt "hi"}\\
+\hline
+\end{array}
+$$
+ where $+_8$ and $-_8$ are $+$ and $-$ modulo 8; $d_1$ and $d_2$ are
+ in |\count@@| and |\count@|, respectively.
+
+\DOCMODE(
+\xydef@\CIRacw@{\count@@=\CIRin@@ \count@=\CIRout@@
+ \ifnum\count@=8 \count@=\count@@
+ \ifnum\count@<6 \advance\count@\tw@ \else \advance\count@-6 \fi \fi
+ \ifnum\count@@<\@ne \advance\count@@7 \else \advance\count@@\m@ne \fi
+ \ifnum\count@<\@ne \advance\count@7 \else \advance\count@\m@ne \fi
+ \ifnum\count@@>\count@ \let\CIRtest@@=\CIRtest@outside
+ \edef\CIRlo@@{\the\count@}\edef\CIRhi@@{\the\count@@}%
+ \else \let\CIRtest@@=\CIRtest@inside
+ \edef\CIRlo@@{\the\count@@}\edef\CIRhi@@{\the\count@}%
+ \fi}
+
+\xydef@\CIRcw@{\count@@=\CIRin@@ \count@=\CIRout@@
+ \ifnum\count@=8 \count@=\count@@
+ \ifnum\count@>\@ne \advance\count@-\tw@ \else \advance\count@6 \fi \fi
+ \ifnum\count@@<5 \advance\count@@\thr@@ \else \advance\count@@-5 \fi
+ \ifnum\count@<5 \advance\count@\thr@@ \else \advance\count@-5 \fi
+ \ifnum\count@@<\count@ \let\CIRtest@@=\CIRtest@outside
+ \edef\CIRlo@@{\the\count@@}\edef\CIRhi@@{\the\count@}%
+ \else \let\CIRtest@@=\CIRtest@inside
+ \edef\CIRlo@@{\the\count@}\edef\CIRhi@@{\the\count@@}%
+ \fi}
+
+\xydef@\CIRtest@inside#1#2{\let\next@=\relax
+ \ifnum\CIRlo@@>#1\else \ifnum#1<\CIRhi@@\DN@{#2}\fi\fi \next@}
+
+\xydef@\CIRtest@outside#1#2{\let\next@=\relax
+ \ifnum\CIRlo@@>#1\DN@{#2}\else \ifnum#1<\CIRhi@@\else\DN@{#2}\fi\fi \next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Text}
+??=[objectlib.text]
+
+\DOCMODE(
+\message{text;}
+\DOCMODE)
+
+ Text in pictures is supported through the <object> construction
+%
+\begin{defs1}
+??c![\txt] <width> <style> |{|<text>|}|\cr
+\end{defs1}
+\noindent\unskip
+%
+ that builds an object containing <text> typeset to <width> using
+ <style>; in <text> |\\| can be used as an explicit line break; all
+ lines will be centered. <style> should either be a font command or
+ some other stuff to do for each line of the <text> and <width> should
+ be either |<|<dimen>|>| or <empty>.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The code just parses the <width> defaulting it to |<\maxdimen>| which
+ is recognised as `free form'.
+
+\DOCMODE(
+\xydef@\txt{\hbox\bgroup \xyFN@\txt@}
+
+\xydef@\txt@{%
+ \addLT@\ifx\next \addGT@{\addLT@\DN@##1}{\A@=##1\txt@i}%
+ \else \DN@{\A@=\maxdimen \txt@i}\fi \next@}
+
+\xydef@\txt@i#1#{%
+ \setboxz@h{#1\mathstrut}\dimen@=\ht\z@ \advance\dimen@\dp\z@
+ \baselineskip=1.1\dimen@ \lineskip=.2\dimen@ \lineskiplimit=\lineskip
+ \def\txtline@@##1{\txtline@{#1}{##1}}\object@\txt@ii}
+
+\xylet@\txtline@@=\eat@
+\xydef@\txtline@#1#2{\relax\setboxz@h{#1{\ignorespaces #2\unskip}}%
+ \ifdim\A@<\wdz@ \setboxz@h{\hsize=\A@
+ \leftskip=0pt plus4em \rightskip=\leftskip
+ \parfillskip=0pt \parindent=0pt %
+ \spaceskip=.3333em \xspaceskip=.5em %
+ \pretolerance=9999 \tolerance=9999 %
+ \hyphenpenalty=9999 \exhyphenpenalty=9999 %
+ \vbox{#1\noindent\ignorespaces #2\unskip}}%
+ \else\ifdim\A@<\maxdimen\setboxz@h to\A@{\hfil\boxz@\hfil}\fi\fi
+ \boxz@}
+
+\xydef@\txt@ii#1{\vbox{%
+ \let\\=\cr
+ \tabskip=\z@skip \halign{\relax\hfil\txtline@@{##}\hfil\cr\leavevmode#1\crcr}}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section{\Xy-pic options}
+??=[option]
+%
+ \NOTE: \LaTeXe\ users should also consult the paragraph on ``xy.sty''
+ in~\S??[env.loading].
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Loading}
+??=[option.loading]
+%
+ \Xy-pic is provided with a growing number of options supporting
+ specialised drawing tasks as well as exotic output devices with
+ special graphic features. These should all be loaded using this
+ uniform interface in order to ensure that the \Xy-pic environment is
+ properly set up while reading the option.
+%
+\begin{defs1}
+%
+ ??c![\xyoption] |{| <option> |}| \cr
+ ??c![\xyrequire] |{| <option> |}|
+%
+\end{defs1}
+\noindent\unskip
+%
+ ??c![\xyoption] will cause the loading of an \Xy-pic option file
+ which can have one of several names. These are tried in sequence:
+ |xy|<option>|.tex|, |xy|<option>|.doc|, |xy|<short>|.tex|, and
+ |xy|<short>|.doc|, where <short> is <option> truncated to 6 (six)
+ characters to conform with the TWG-TDS~\cite{TWG-TDS}.
+
+ ??c![\xyrequire] is the same except it is ignored if an option with
+ the same name is already present (thus does not check the version
+ etc.).
+
+\DOCMODE(
+\message{options;}
+
+\xylet@\xyoption@@=\relax
+
+\xydef@\xyoption#1{\DN@{#1}\edef\next@{\codeof\next@}%
+ \csname xyeveryrequest@\next@ @\endcsname
+ \xyinputorelse@{xy#1}{\xyoption@truncated#1@@@@@@@@@,#1@}%
+ \def\xyoption@@{#1}\edef\xyoption@@{\codeof\xyoption@@}
+ \expandafter\let\expandafter\next@\csname xy\xyoption@@ version\endcsname
+ \expandafter\let\csname xy\xyoption@@ loaded\endcsname=\next@
+ \runxywith@ \ignorespaces}
+
+\xydef@\xyoption@truncated#1#2#3#4#5#6#7@#8,#9@{%
+ \DN@{#7}\ifx\next@\empty \DN@##1##2{##2}\else\let\next@=\xyinputorelse@ \fi
+ \next@{xy#1#2#3#4#5#6}%
+ {\DN@{#1#2#3#4#5#6}\edef\next@{\codeof\next@}%
+ \xyerror@{No `\next@' option}{%
+Your \xyoption{#9} request could not be granted: the required^^J%
+file `xy#9.tex' could not be located. Please make sure that it is^^J%
+properly installed before continuing.}}}
+
+\xydef@\xyrequire#1{\DN@{#1}\edef\next@{\codeof\next@}%
+ \csname xyeveryrequest@\next@ @\endcsname
+ \expandafter\let\expandafter\next@\csname xy\codeof\next@ loaded\endcsname
+ \ifx \next@\relax \DN@{\xyoption{#1}}\else \DN@{\ignorespaces}\fi \next@}
+\DOCMODE)
+
+ Sometimes some declarations of an option or header file or whatever
+ only makes sense after some particular other option is loaded. In
+ that case the code should be wrapped in the special command
+%
+\begin{defs1}
+ ??c![\xywithoption] |{| <option> |}| |{| <code> |}| \cr
+\end{defs1}
+\noindent\unskip
+%
+ which indicates that if the <option> is already loaded then <code>
+ should be executed now, otherwise it should be saved and if <option>
+ ever gets loaded then <code> should be executed afterwards. \NOTE:
+ The <code> should allow more than one execution; it is saved with the
+ catcodes at the time of the ??c![\xywithoption] command.
+
+\DOCMODE(
+\xylet@\xywith@@=\empty
+
+\xydef@\runxywith@{\let\xywithdo@@=\xywithtest@ \xywith@@}
+
+\xydef@\xywithoption#1#2{\DN@{#1}\edef\next@{\codeof\next@}%
+ \expandafter\let\expandafter\nextii@\csname xy\next@ loaded\endcsname
+ \ifx \nextii@\relax
+ \expandafter\def\expandafter\xywith@@\expandafter{\xywith@@
+ \xywithdo@@{#1}{#2}}%
+ \else \expandafter\xywithrun@\expandafter{\next@}{#2}\fi}
+
+\xydef@\xywithtest@#1#2{\DN@{#1}\edef\next@{\codeof\next@}%
+ \ifx\next@\xyoption@@ \expandafter\xywithrun@\expandafter{\next@}{#2}\fi}
+
+\xydef@\xywithrun@#1#2{\csname xyeverywithoption@#1@\endcsname #2}
+\DOCMODE)
+
+ Finally, it is possible to declare <code> as some commands to be
+ executed before every actual execution of
+ ??c![\xywithoption]\-|{|<option>|}|\-|{|\dots|}|, and similarly
+ <code> to be executed before every |\xyoption{|<option>|}| and
+ |\xyrequire{|<option>|}| (collectively called `requests')::
+%
+\begin{defs1}
+ ??c![\xyeverywithoption] |{| <option> |}| |{| <code> |}| \cr
+ ??c![\xyeveryrequest] |{| <option> |}| |{| <code> |}| \cr
+\end{defs1}
+\noindent\unskip
+%
+ This is most often used by an option to activate some hook every time
+ it is requested itself.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ These last two use the usual expansion trickery to define or append
+ to the control sequences named |\xyevery|\-|request@|\-<option>|@|
+ and |\xyevery|\-|withoption@|\-<option>|@| used in the definitions
+ above.
+
+\DOCMODE(
+\xydef@\xyevery@#1#2#3{\DN@{#2}\edef\next@{\codeof\next@}%
+ \expandafter\ifx\csname xyevery#1@\next@ @\endcsname\relax
+ \expandafter\let\csname xyevery#1@\next@ @\endcsname=\empty \fi
+ \DNii@##1{\expandafter\def\expandafter##1\expandafter{##1#3}}%
+ \expandafter\nextii@\csname xyevery#1@\next@ @\endcsname}
+
+\xydef@\xyeveryrequest{\xyevery@{request}}
+\xydef@\xyeverywithoption{\xyevery@{withoption}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Option file format}
+??=[option.fileformat]
+%
+ Option files must have the following structure:
+
+\begin{quote}
+ |%%| <identification> \\
+ |%%| <copyright, \etc>
+
+ |\ifx\xyloaded\undefined \input xy \fi|
+
+ |\xyprovide{|<option>|}{|<name>|}{|<version>|}%| \\
+ \null\qquad\qquad |{|<author>|}{|<email>|}{|<address>|}|
+
+ ??w![<body of the option>]
+
+ ??c![\xyendinput]
+\end{quote}
+%
+ The 6 arguments to ??c![\xyprovide] should contain the following:
+%
+\begin{description}
+
+\item[<option>]
+ Option load name as used in the ??c![\xyoption] command. This should
+ be safe and distinguishable for any operating system and is thus
+ limited to characters chosen among the lowercase letters (|a|--|z|),
+ digits (|0|--|9|), and dash (|-|), and all options should be uniquely
+ identifiable by the first 6 (six) characters only.
+
+\item[<name>]
+ Descriptive name for the option.
+
+\item[<version>]
+ Identification of the version of the option.
+
+\item[<author>]
+ The name(s) of the author(s).
+
+\item[<email>]
+ The electronic mail address(es) of the author(s) "or" the affiliation
+ if no email is available.
+
+\item[<address>]
+ The postal address(es) of the author(s).
+
+\end{description}
+%
+ This information is used not only to print a nice banner but also to
+ (1)~silently skip loading if the same version was preloaded and
+ (2)~print an error message if a different version was preloaded.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The ??c![\xyprovide] command checks that the option is not already
+ loaded and that the loaded version is the same as the preloaded one
+ by checking the existence and contents of the macro
+ |\xy|<option>|loaded|. Finally it calls ??c![\xycatcodes] such that
+ the option internals are loaded in `\TeX\ programming mode'.
+ ??c![\xyendinput] undoes this.
+
+\DOCMODE(
+\xydef@\xyprovide#1#2#3#4#5#6{%
+ \def\xyoption@@{#1}\edef\xyoption@@{\codeof\xyoption@@}\edef\next@{#3}%
+ \message{ Xy-pic option: #2 v.\next@}%
+ \expandafter\let\expandafter\nextii@\csname xy\xyoption@@ loaded\endcsname
+ \ifx \next@\nextii@ \message{not reloaded}\endinput
+ \else
+ \ifx \nextii@\relax\else \xyerror@{Option `\xyoption@@' version mismatch}{%
+You previously loaded, or the format has preloaded, a different version^^J%
+of this option. Just continue to try to load this version instead (and^^J%
+be prepared for a lot of warnings about redefinitions).}%
+ \fi
+ \expandafter\let\csname xy\xyoption@@ version\endcsname=\next@
+ \expandafter\let\expandafter\xyenddocmode@\csname DOCMODE\endcsname
+ \expandafter\let\csname DOCMODE\endcsname\xyprovidedocmode@
+ \xycatcodes
+ \fi \ignorespaces}
+
+\xydef@\xyendinput{\expandafter\let\csname DOCMODE\endcsname=\xyenddocmode@
+ \message{loaded}\xyuncatcodes\endinput}
+\DOCMODE)
+
+ The above is futher complicated because an option may loaded in its
+ |DOCMODE| form (ending in |.doc|). So we make sure that the mode
+ that skips documentation, defined in the |xy.tex| file header, is
+ active now.
+
+\DOCMODE(
+\expandafter\xylet@\expandafter\xyprovidedocmode@\csname DOCMODE\endcsname
+\xylet@\xyenddocmode@=\relax
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The `dummy' option described in~\S??g[:dummy] is a minimal option
+ using the above features. It uses the special |DOCMODE| format to
+ include its own documentation for this document (like all official
+ \Xy-pic options) but this is not a requirement.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Driver options}
+??=[option.drivers]
+%
+ The ??w![<driver>] options described in \GROUP~??g[:drivers] require
+ special attention because each driver can support several
+ ??w![extension] options, and it is sometimes desirable to change
+ <driver> or even mix the support provided by several.\footnote{The
+ kernel support described here is based on the (now defunct)
+ |xydriver| include file by Ross Moore.}
+
+ A <driver> option is loaded as other options with
+ |\xyoption{|<driver>|}| (or through \LaTeXe\ class or package options
+ as described in~\S??[env.loading]). The special thing about a
+ <driver> is that loading it simply declares the name of it,
+ establishes what extensions it will support, and selects it
+ temporarily. Thus the special capabilities of the driver will only
+ be exploited in the produced DVI file if some of these extensions are
+ also loaded and if the driver is still selected when output is
+ produced. Generally, the order in which the options are loaded is
+ immaterial. (Known exceptions affect only internal processing and
+ are not visible to the user in terms of language and expected output.)
+ In particular one driver can be preloaded in a format and a different
+ one used for a particular document.
+
+ The following declarations control this:
+%
+\begin{defs}
+??c![\UseSingleDriver] & forces one driver only \cr
+??c![\MultipleDrivers] & allows multiple drivers \cr
+??c![\xyReloadDrivers] & resets driver information \cr
+\end{defs}
+\noindent\unskip
+%
+ The first command restores the default behaviour: that ony one
+ <driver> is allowed, \ie, each loading of a <driver> option cancels
+ the previous. The second allows consecutive loading of drivers such
+ that when loading a <driver> only the extensions actually supported
+ are selected, leaving other extensions supported by previously
+ selected drivers untouched. Beware that this can be used to create
+ DVI files that cannot be processed by any actual DVI driver program!
+
+ The last command is sometimes required to reset the \Xy-pic <driver>
+ information to a sane state, for example, after having applied one of
+ the other two in the middle of a document, or when using simple
+ formats like plain \TeX\ that do not have a clearly distinguished
+ preamble.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Driver database.}
+
+ The main structure, the list of `loaded' and `selected' <driver>s
+ (ordered by age), is implemented as traditional \TeX\ `|\do|-lists'
+ (applications of |\do{|<driver>|}| to each element).
+
+\DOCMODE(
+\xydef@\xydriversloaded@@{\do{unload}}
+\xylet@\xydriversselected@@=\empty
+\DOCMODE)
+%
+ This is used to provide entry points into a secondary structure that
+ lists for each <driver> the extensions supported by that driver. As
+ should be apparent from the above, only the |unload| <driver> is
+ present initially: it represents the implementation technique used
+ for the extension when no <driver> is selected. Every extension must
+ add an entry which reestablishes the default implementation of the
+ extension:
+
+\DOCMODE(
+\xylet@\xydriver@unload@support@@=\empty
+\DOCMODE)
+%
+ All <driver>s will have a similar structure named
+ |\xydriver@|\-<driver>\-|@support@@| which contains the extensions
+ supported by that particular <driver>: the `signature' of each driver
+ as |\doii|-list with two arguments (hence the |ii|~\smiley~): the
+ extension and the command to install the <driver>-extension
+ combination.
+
+ The two selection principles differ significantly. When only a
+ single <driver> is selectable then all extensions need to be unloaded
+ "before" the selection. When multiple <driver>s are allowed then
+ only the added support needs to be executed.
+
+\DOCMODE(
+\xydef@\selectdriver@#1{\DN@{#1}\edef\next@{\codeof\next@}%
+ \expandafter\selectdriver@@\expandafter{\next@}}
+
+\xydef@\selectdriver@single#1{\xysetup@@{\def\xydriversselected@@{\do{#1}}%
+ \xyLoadDrivers@}\let\selectdriver@@=\changedriver@single}
+
+\xydef@\changedriver@single#1{\xysetup@@{\def\xydriversselected@@{\do{#1}}%
+ \xyReloadDrivers@}}
+
+\xydef@\selectdriver@multiple#1{\expandafter\xysetup@@\expandafter{%
+ \expandafter\def\expandafter\xydriversselected@@\expandafter{%
+ \xydriversselected@@ \do{#1}}%
+ \let\do=\activatedriver@ \xydriversselected@@}}
+
+\xydef@\UseSingleDriver{\let\selectdriver@@=\selectdriver@single}
+\xydef@\MultipleDrivers{\let\selectdriver@@=\selectdriver@multiple}
+
+\xydef@\xyLoadDrivers@{\let\do=\activatedriver@ \xydriversselected@@}
+\xydef@\xyReloadDrivers@{\activatedriver@{unload}\xyLoadDrivers@}
+\xylet@\xyReloadDrivers=\xyReloadDrivers@
+
+\xydef@\activatedriver@#1{%
+ \let\doii=\activatedriversupport@ \csname xydriver@#1@support@@\endcsname}
+
+\xydef@\activatedriversupport@#1#2{%
+ \expandafter\ifx\csname xy#1loaded\endcsname\relax\DN@{}%
+ \else\DN@{#2}\fi \next@}
+
+\UseSingleDriver
+\DOCMODE)
+
+ Finally we define the following to get complete independence of load
+ sequence: at every loading of an extension option known to be
+ supported, we run through the list of presently selected drivers to
+ activate any support for it, using the following:
+
+\DOCMODE(
+\xydef@\xyselectoptionsupport@{\let\do=\activatedriver@ \xydriversselected@@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ As the above suggests it sometimes makes sense to load <driver>s in
+ the actual textual part of a document, however, it is recommended
+ that only drivers "also" loaded in the preamble are reloaded later,
+ and that ??c![\xyReloadDrivers] is used when there is doubt about the
+ state of affairs. In case of confusion the special command
+ ??c![\xyShowDrivers] will list all the presently supported and
+ selected driver-extension pairs to the \TeX\ log.
+
+\DOCMODE(
+\xydef@\xyShowDrivers{{\W@{Loaded:}\let\do=\doShow \xydriversloaded@@
+ \let\next@=\empty
+ \def\do##1{\ifx\next@\empty \DN@{##1}%
+ \else \expandafter\DN@\expandafter{\next@, ##1}\fi}%
+ \xydriversselected@@\W@{Selected: \next@.}}}
+
+\def\doShow#1{\let\next@=\empty
+ \def\doii##1##2{\ifx\next@\empty \DN@{##1}%
+ \else \expandafter\DN@\expandafter{\next@, ##1}\fi}%
+ \csname xydriver@#1@support@@\endcsname
+ \W@{ <driver> #1 supports \next@.}}
+\DOCMODE)
+
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ It is not difficult to add support for additional <driver>s; how is
+ described in the \TeX\-nical documentation.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Driver internals.}
+
+ A <driver> option files must have the following structure:
+
+\begin{quote}
+ |%%| <identification> \\
+ |%%| <copyright, \etc>
+
+ |\ifx\xyloaded\undefined \input xy \fi|
+
+ |\xyprovide{|<option>|}{|<name>|}{|<version>|}%| \\
+ \null\qquad\qquad |{|<author>|}{|<email>|}{|<address>|}|
+
+ |\newdriver{%|\\
+ |\xyaddsupport{|<extension>|}|<cs>\\
+ \vdots\\
+ |}|
+
+ <body of the {<driver>} option>
+
+ ??c![\xyendinput]
+\end{quote}
+%
+ There should be an ??c![\xyaddsupport] command for each supported
+ <extension> which specicifies the <cs> (control sequence) with which
+ the indicated support is "activated".
+
+ The ??c![\newdriver] command first establishes the `support' list for
+ the <driver> (running the argument), then adds the <driver> to the
+ `loaded' list, and finally selects it now and for every subsequent
+ request of this <driver> option.
+
+ It is important that the <cs> that "activates" each driver/extension
+ combination only does "rebinding of hooks". In order to see what
+ hooks are available for an extension, look for declarations of the
+ form
+%
+\begin{defs1}
+ ??c![\xyaddunsupport] |{|<extension>|}| <cs>
+\end{defs1}
+\noindent\unskip
+%
+ and see what rebindings that <cs> does: those are the
+ hokks. "because" they are the ones that will be safely reestablished!
+ This should be adherede to because both activation and deactivation
+ <cs>s may be executed many times.
+
+ The procedure is as follows: (??_[newdr1])~add the driver and clear
+ its support control sequence unless it is already defined,
+ (??_[newdr2])~execute the support commands, and (??_[newdr3])~setup
+ to select it after loading.
+
+\DOCMODE(
+\xydef@\newdriver#1{%
+ \def\nextiii@##1{%?*[newdr1]
+ \expandafter\def\expandafter\xydriversloaded@@
+ \expandafter{\xydriversloaded@@\do{##1}}%
+ \expandafter\let\csname xydriver@\xyoption@@ @support@@\endcsname=\empty}%
+ \def\do##1{\DNii@{##1}\ifx\xyoption@@\nextii@ \let\nextiii@=\eat@ \fi}%
+ \xydriversloaded@@ \expandafter\nextiii@\expandafter{\xyoption@@}%
+ #1\relax %?*[newdr2]
+ \DN@##1{\xywithoption{##1}{%?*[newdr3]
+ \selectdriver@{##1}\xyeveryrequest{##1}{\selectdriver@{##1}}}}%
+ \expandafter\next@\expandafter{\xyoption@@}\ignorespaces}
+\DOCMODE)
+
+ The support commands merely add to the support |\do|-lists which in
+ turn (??_[adddr1])~adds |\doii{|<extension>|}{|\dots|}| to the
+ |\xydriver@|<driver>|@support@@| control sequence and adds a check
+ for when to apply it every time that <extension> is requested!
+
+
+\DOCMODE(
+\xydef@\xyaddsupport{\expandafter\xyadddriversupport@\expandafter{\xyoption@@}}
+\xydef@\xyaddunsupport{\xyadddriversupport@{unload}}
+
+\xydef@\xyadddriversupport@#1#2#3{%
+ \DNii@{#1}\edef\nextii@{\codeof\nextii@}%
+ \def\nextiii@{#2}\edef\nextiii@{\codeof\nextiii@}%
+%
+% CHECK that the <driver> is loaded!
+\def\next{\xybug@{<driver> \nextii@\space not loaded}}%
+\def\do##1{\DN@{##1}\edef\next@{\codeof\next@}%
+ \ifx\next@\nextii@ \let\next=\relax \fi}\xydriversloaded@@ \next
+%
+% CHECK that the specified <extension> is not already supported!
+\def\next{\xybug@{<driver> \nextii@\space already supports \nextiii@}}%
+\def\doii##1##2{\DN@{##1}\edef\next@{\codeof\next@}%
+ \ifx\next@\nextiii@ \let\next=\relax \fi}\xydriversloaded@@ \next
+%
+ \DN@##1##2{\ifx##1\relax \let##1=\empty \fi %?*[adddr1]
+ \expandafter\def\expandafter##1\expandafter{##1\doii{##2}{#3}}}%
+ \expandafter\expandafter\expandafter\next@
+ \expandafter\expandafter\csname xydriver@\nextii@ @support@@\endcsname
+ \expandafter{\nextiii@}%
+ \DN@##1{\expandafter\xyeverywithoption\expandafter{\nextiii@}{%
+ \xytestforsupport@{##1}}}%
+ \expandafter\next@\expandafter{\nextii@}\xydriversloaded@@
+ \ignorespaces}
+
+\xydef@\xytestforsupport@#1{\def\do##1{\DN@{##1}\DNii@{#1}%
+ \ifx\next@\nextii@ \expandafter\xyselectoptionsupport@ \fi}}
+\DOCMODE)
+
+\paragraph*{Driver related messages.}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Most extensions will print a warning when a capability is used which
+ is not supported by the presently loaded <driver>. Such messages are
+ only printed once, however, (for some formats they are repeated at
+ the end). Similarly, when the support of an extension that exploits
+ a particular <driver> is used a warning message will be issued that
+ the DVI file is not portable.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This is implemented by defining a control sequence for each such
+ warning and repeat it at the end. Warnings should be issued using
+ one of
+%
+\begin{defs1}
+|\xyununsupportwarning@| |{|<extension>|}| |{|<message>|}|\cr
+|\xyunsupportwarning@| |{|<driver>|}| |{|<extension>|}| \cr
+\end{defs1}
+
+\DOCMODE(
+\xynew@{if}\ifunsupportwarnings@
+
+\xydef@\xyunsupportwarning@#1#2{{%
+ \DN@{#1}\edef\next@{\codeof\next@}
+ \expandafter\ifx\csname xywarn@unload@\next@ @\endcsname\relax
+ \expandafter\gdef\csname xywarn@unload@\next@ @\endcsname{}%
+ \ifunsupportwarnings@ \xyclosedown@@\xyunsupportwarnings@@ \fi
+ \global\unsupportwarnings@true
+ \expandafter\gdef\expandafter\xyunsupportwarnings@@\expandafter{%
+ \xyunsupportwarnings@@ \W@{ #2.}}%
+ \W@{}%
+ \W@{Xy-pic Warning: `\next@' reproduction is NOT EXACT\xytracelineno@:}%
+ \W@{ #2.}%
+ \W@{}%
+ \fi}}
+
+\xydef@\xyunsupportwarnings@@{\W@{}%
+ \W@{Xy-pic Warning: The produced DVI file is NOT EXACT:}}
+
+\xynew@{if}\ifsupportwarnings@
+
+\xydef@\xysupportwarning@#1#2{{%
+ \DN@{#1}\edef\next@{\codeof\next@}\DNii@{#2}\edef\nextii@{\codeof\nextii@}%
+ \expandafter\ifx\csname xywarn@\next@ @\nextii@ @\endcsname\relax
+ \expandafter\gdef\csname xywarn@\next@ @\nextii@ @\endcsname{}%
+ \ifsupportwarnings@ \xyclosedown@@\xysupportwarnings@@ \fi
+ \global\supportwarnings@true
+ \expandafter\gdef\expandafter\xysupportwarnings@@\expandafter{%
+ \xysupportwarnings@@ \driverextensioncomplain@{#1}{#2}}%
+ \W@{}%
+ \W@{Xy-pic Warning: The produced DVI file is NOT PORTABLE\xytracelineno@:}%
+ \driverextensioncomplain@{#1}{#2}%
+ \W@{}%
+ \fi}}
+
+\xydef@\xysupportwarnings@@{%
+ \W@{Xy-pic Warning: The produced DVI file is NOT PORTABLE:}}
+
+\xydef@\driverextensioncomplain@#1#2{%
+ \DN@{#1}\edef\next@{\codeof\next@}\DNii@{#2}\edef\nextii@{\codeof\nextii@}%
+ \W@{ It contains <driver> `\next@' \string\special s for the `\nextii@'
+ extension.}}
+\DOCMODE)
+
+ Backwards compatibility\dots
+
+\DOCMODE(
+\xydef@\dvimessage@#1#2{\xysupportwarning@{#1}{#2}}
+
+\xynew@{if}\ifxydrivernoloads@
+\xydef@\xydrivernoload@#1{\xyerror@{Could not load xy#1.tex}{}%
+ \xydrivernoloads@true}
+
+\xydef@\xydriverfail@#1{\xyerror@{Sorry, #1 not supported.}{}}
+
+\xydef@\xyunload@#1{\xywarning@{Unloading #1.}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section{Algorithms}
+??=[algo]
+
+ This section presents the more complicated algorithms used in
+ \Xy-pic.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Directions}
+??=[algo.direction]
+
+\DOCMODE(
+\message{algorithms: directions,}
+\DOCMODE)
+
+ The "direction state" is described by the following parameters:
+%
+\begin{defs}
+"Direction" & `angle' of the direction on $]-4K\dots4K]$ unit square \cr
+"dX","dY" & the vector $c-p$ \cr
+"sdX","sdY" & sign of "dX" and "dY" \cr
+|\K@dXdY|,|\K@dYdX| & quotients $K\frac{"dX"}{"dY"}$ and
+ $K\frac{"dY"}{"dX"}$ (as dimensions in sp) \cr
+"DirectionChar","SemiDirectionChar" & |\chardefs| for directional
+ and semidirectional fonts \cr
+"cosDirection","sinDirection" & factors in the range $]-1\dots1]$
+ corresponding to cos and sin of Direction \cr
+\end{defs}
+%
+ where the ``$]-4K\dots4K]$ unit square'' has the following angles:
+$$
+\xy *[]=<3pc>{}="c"*\frm{-},
+ "c"; (-1,-1)**{},p+/4pc/ *+{0} **@{-}?>*@{>},
+ "c"; ( 0,-1)**{},p+/4pc/ *+{K} **@{-}?>*@{>},
+ "c"; ( 1,-1)**{},p+/4pc/ *+{2K} **@{-}?>*@{>},
+ "c"; ( 1, 0)**{},p+/4pc/ *+{3K} **@{-}?>*@{>},
+ "c"; ( 1, 1)**{},p+/4pc/ *+{4K} **@{-}?>*@{>},
+ "c"; ( 0, 1)**{},p+/4pc/ *+{{-}3K} **@{-}?>*@{>},
+ "c"; (-1, 1)**{},p+/4pc/ *+{{-}2K} **@{-}?>*@{>},
+ "c"; (-1, 0)**{},p+/4pc/ *+{{-}K} **@{-}?>*@{>},
+\endxy
+$$
+ where the intermediate $K$ angle in each interval correspond to
+ equidistant points on the unit square. Thus only for
+ $n\in\{-3,2,1,0,1,2,3,4\}$ the angle of direction $n*K$ is exactly
+ $n*45^\circ - 135^\circ$ ($0^\circ$ being the direction straight
+ right).
+
+ As usual |\DirectionfromtheDirection@| expands to code setting the
+ current direction.
+
+\DOCMODE(
+\xydef@\DirectionfromtheDirection@{\noexpand\Direction=\the\Direction
+ \noexpand\d@X=\the\d@X \noexpand\d@Y=\the\d@Y
+ \def\noexpand\sd@X{\sd@X}\def\noexpand\sd@Y{\sd@Y}%
+ \noexpand\K@dXdY=\the\K@dXdY \noexpand\K@dYdX=\the\K@dYdX
+ \chardef\noexpand\DirectionChar=\the\DirectionChar
+ \chardef\noexpand\SemiDirectionChar=\the\SemiDirectionChar
+ \def\noexpand\cosDirection{\cosDirection}%
+ \def\noexpand\sinDirection{\sinDirection}%
+ \noexpand\resetupDirection@}
+\DOCMODE)
+
+ The actual direction computation is done using
+ |\setupDirection@|.
+
+\paragraph*{Procedure:}
+%
+ Is really not so complicated. [??_[Dir1]]~"dX" and "dY" are computed
+ from $c-p$ and we skip if the current setting is based on these (this
+ is stored in the internal |\Directiontest@@| method);
+ [??_[Diri1]]~if the direction is one of the principal ones then
+ proceed with an optimised special case for those; otherwise proceed
+ with the generic code.
+
+\DOCMODE(
+\xydef@\Directiontest@@#1#2{#2}
+
+\xydef@\setupDirection@{%
+ \d@X=\X@c\advance\d@X-\X@p \d@Y=\Y@c\advance\d@Y-\Y@p %?*[Dir1]
+ \Directiontest@@\relax\setupDirection@i}
+
+\xydef@\setupDirection@i{\DN@{\setupDirection@ii}%?*[Diri1]
+ \ifdim\d@X=\d@Y
+ \ifdim\zz@\d@Y \DN@{}%
+ \else\ifdim\d@X<\z@ \DN@{\dlDirection@{-1.4142\d@X}}%
+ \else \DN@{\urDirection@{1.4142\d@X}}\fi\fi
+ \else\ifdim\d@X<\d@Y
+ \ifdim\zz@\d@X \DN@{\uDirection@\d@Y}%
+ \else\ifdim\zz@\d@Y \DN@{\lDirection@{-\d@X}}%
+ \else\ifdim-\d@X=\d@Y \DN@{\ulDirection@{-1.4142\d@X}}\fi\fi\fi
+ \else
+ \ifdim\zz@\d@X \DN@{\dDirection@{-\d@Y}}%
+ \else\ifdim\zz@\d@Y \DN@{\rDirection@\d@X}%
+ \else\ifdim\d@X=-\d@Y \DN@{\drDirection@{1.4142\d@X}}\fi\fi\fi
+ \fi\fi \next@}
+\DOCMODE)
+
+ The procedures for the special <diag>onal cases are summarised in
+ this table:
+$$
+\let\|=\otherbar
+\begin{array}{\|c\|r\|rl\|c\|rl\|}
+\hline
+\mbox{<diag>onal} & "Direction" & \cos("Direction"),& \sin("Direction")
+ & "sign"("dX","dY") & "Char" & "Semi" \\
+\hline
+ |dl| & 0 & {-\sqrt{\frac12}},& {-\sqrt{\frac12}} & -,- & 127 & 127 \\
+ |d| & K & 0,& -1 & +,- & 15 & 31 \\
+ |dr| & 2K & {\sqrt{\frac12}},& {-\sqrt{\frac12}} & +,- & 31 & 63 \\
+ |r| & 3K & 1,& 0 & +,+ & 47 & 95 \\
+ |ur| & 4K & {\sqrt{\frac12}},& {\sqrt{\frac12}} & +,+ & 63 & 127 \\
+ |u| &-3K & 0,& 1 & +,+ & 79 & 31 \\
+ |ul| &-2K & {-\sqrt{\frac12}},& {\sqrt{\frac12}} & -,+ & 95 & 63 \\
+ |l| & -K & -1,& 0 & -,+ & 111 & 95 \\
+\hline
+\end{array}
+$$
+ In each case the argument is used as the unit circle, \ie, non-zero
+ of "dX" and "dY", and $|<|K\frac{"dX"}{"dY"}|,|K\frac{"dY"}{"dX"}|>|
+ := "KK"*|<|"dX"|,|"dY"|>|$\dots
+
+\DOCMODE(
+\xydef@\dlDirection@{\Direction=\z@
+ \def\cosDirection{-.7071}\def\sinDirection{-.7071}\def\sd@X{-}\def\sd@Y{-}%
+ \chardef\DirectionChar=127\relax\chardef\SemiDirectionChar=127\relax
+ \K@dXdY=1\K@ \K@dYdX=1\K@ \fixedDirection@}
+
+\xydef@\dDirection@{\Direction=\K@
+ \def\cosDirection{0}\def\sinDirection{-1}\def\sd@Y{-}%\def\sd@X{+}
+ \edef\sd@X{\ifdim\X@c<\X@p-\else+\fi}%
+ \chardef\DirectionChar=15\relax\chardef\SemiDirectionChar=31\relax
+ \K@dXdY=\z@ \K@dYdX=\KK@\K@ \fixedDirection@}
+
+\xydef@\drDirection@{\dimen@ii=2\K@ \Direction=\dimen@ii
+ \def\cosDirection{+.7071}\def\sinDirection{-.7071}\def\sd@X{+}\def\sd@Y{-}%
+ \chardef\DirectionChar=31\relax\chardef\SemiDirectionChar=63\relax
+ \K@dXdY=-1\K@ \K@dYdX=-1\K@ \fixedDirection@}
+
+\xydef@\rDirection@{\dimen@ii=3\K@ \Direction=\dimen@ii
+ \def\cosDirection{+1}\def\sinDirection{0}\def\sd@X{+}%\def\sd@Y{+}%
+ \edef\sd@Y{\ifdim\Y@c<\Y@p-\else+\fi}%
+ \chardef\DirectionChar=47\relax\chardef\SemiDirectionChar=95\relax
+ \K@dXdY=\KK@\K@ \K@dYdX=\z@ \fixedDirection@}
+
+\xydef@\urDirection@{\dimen@ii=4\K@ \Direction=\dimen@ii
+ \def\cosDirection{+.7071}\def\sinDirection{+.7071}\def\sd@X{+}\def\sd@Y{+}%
+ \chardef\DirectionChar=63\relax\chardef\SemiDirectionChar=127\relax
+ \K@dXdY=1\K@ \K@dYdX=1\K@ \fixedDirection@}
+
+\xydef@\uDirection@{\dimen@ii=-3\K@ \Direction=\dimen@ii
+ \def\cosDirection{0}\def\sinDirection{+1}\def\sd@Y{+}%\def\sd@X{+}
+ \edef\sd@X{\ifdim\X@c<\X@p-\else+\fi}%
+ \chardef\DirectionChar=79\relax\chardef\SemiDirectionChar=31\relax
+ \K@dXdY=\z@ \K@dYdX=\KK@\K@ \fixedDirection@}
+
+\xydef@\ulDirection@{\dimen@ii=-2\K@ \Direction=\dimen@ii
+ \def\cosDirection{-.7071}\def\sinDirection{+.7071}\def\sd@X{-}\def\sd@Y{+}%
+ \chardef\DirectionChar=95\relax\chardef\SemiDirectionChar=63\relax
+ \K@dXdY=-1\K@ \K@dYdX=-1\K@ \fixedDirection@}
+
+\xydef@\lDirection@{\Direction=-\K@
+ \def\cosDirection{-1}\def\sinDirection{0}\def\sd@X{-}%\def\sd@Y{+}%
+ \edef\sd@Y{\ifdim\Y@c<\Y@p-\else+\fi}%
+ \chardef\DirectionChar=111\relax\chardef\SemiDirectionChar=95\relax
+ \K@dXdY=\KK@\K@ \K@dYdX=\z@ \fixedDirection@}
+
+\xydef@\fixedDirection@#1{\dimen@ii=#1\relax
+ \d@X=\cosDirection\dimen@ii \d@Y=\sinDirection\dimen@ii
+ \resetupDirection@}
+\DOCMODE)
+
+ Here is the procedure for the generic code.
+%
+\begin{itemize}
+
+\item[{??_[Dirii1]}]
+ Make sign variables and slopes: $"sdX" := "sign"("dX")$, $"sdY" :=
+ "sign"("dY")$, $K\frac{"dX"}{"dY"} :=
+ "sdX"*"sdY"*\floor{\abs{"KK"*"dX"} / \abs{"dY"/"KK"}}$, and
+ $K\frac{"dY"}{"dX"} := "sdX"*"sdY"*\floor{\abs{"KK"*"dY"} /
+ \abs{"dX"/"KK"}}$, where the somewhat exotic computation method is
+ used to ensure that the `native' floor function provided by \TeX\
+ |\divide| can be used (it only acts predictably for positive
+ numbers), that overflow is avoided even for large $"dX","dY"$, and
+ that it is reasonable to use the convention of |\quotient@| that
+ division by zero is like multiplying with one\dots Also takes care
+ not to multiply too big dimensions with each other.
+
+\item[{??_[Dirii2]}]
+ If ${-K} \le K\frac{"dX"}{"dY"} \le K$ then the direction is mostly
+ up or down: if $"dY"\lt0$ [down, ??_[Dirii2a]]: $"Direction" := -
+ K\frac{"dX"}{"dY"} + 1K$; else [up, ??_[Dirii2b]]: $"Direction" := -
+ K\frac{"dX"}{"dY"} - 3K$.
+
+\item[{??_[Dirii3]}]
+ If ${-K} \lt K\frac{"dY"}{"dX"} \lt K$ then direction is mostly left
+ or right: if $"dX"\lt0$ [left, ??_[Dirii3a]]: $"Direction" :=
+ K\frac{"dY"}{"dX"} - K$; else [right, ??_[Dirii3b]]: $"Direction" :=
+ K\frac{"dY"}{"dX"} + 3K$.
+
+\item[{??_[Dirii4]}]
+ Compute character codes for direction and semidirection fonts.
+ [??_[Dirii4a]]: $"DirectionChar" := (8K+"Direction"+K/32)
+ \hbox{~div~} (K/16) - 1$; while $"DirectionChar" \gt 127:
+ "DirectionChar" -:= 128$. [??_[Dirii4b]]: $"SemiDirectionChar" :=
+ (8K+"Direction"+K/64) \hbox{~div~} (K/32) - 1$; while
+ $"SemiDirectionChar" \gt 127: "SemiDirectionChar" -:= 128$. In both
+ cases the $8K$ are added to ensure that \TeX\ will round down.
+ \HACK: The |16|, |\KK@|, and |64| in these lines are really $K/64$,
+ $K/32$, and $K/16$\dots
+
+\item[{??_[Dirii5]}]
+ Build "cosDirection" and "sinDirection" from appropriate characters
+ in the |\xydashfont|. [??_[Dirii5]]: $"cosDirection" :=
+ "wd"(|\xydashfont| "SemiDirectionChar")$. [??_[Dirii5b]] $C :=
+ "SemiDirectionChar"-64$, if $C\lt0$: $C := C+128$, $"sinDirection" :=
+ "wd"(|\xydashfont| C)$.
+
+\item[{??_[Dirii6]}]
+ Register this "dX","dY" for next time.
+
+\end{itemize}
+
+\DOCMODE(
+\xydef@\setupDirection@ii{%
+ \ifdim\d@X<\z@ \def\sd@X{-}\else \def\sd@X{+}\fi %?*[Dirii1]
+ \ifdim\d@Y<\z@ \def\sd@Y{-}\else \def\sd@Y{+}\fi
+ \K@dXdY=\sd@X\d@X \ifdim\K@dXdY<500pt \multiply\K@dXdY\KK@ \fi
+ \dimen@=\sd@Y\d@Y
+% \advance\dimen@.5\KK@ \divide\dimen@\KK@
+ \advance\dimen@\ifdim\dimen@<\z@-\fi.5\KK@ \divide\dimen@\KK@
+ \ifdim\dimen@=\z@\else %\count@=\dimen@ \divide\count@\tw@
+ \advance\K@dXdY by.5\dimen@\relax \divide\K@dXdY\dimen@
+ \fi \K@dXdY=\sd@X\sd@Y\K@dXdY
+ \K@dYdX=\sd@Y\d@Y \ifdim\K@dYdX<500pt \multiply\K@dYdX\KK@ \fi
+ \dimen@=\sd@X\d@X
+% \advance\dimen@.5\KK@ \divide\dimen@\KK@
+ \advance\dimen@\ifdim\dimen@<\z@-\fi.5\KK@ \divide\dimen@\KK@
+ \ifdim\dimen@=\z@\else %\count@=\dimen@ \divide\count@\tw@
+ \advance\K@dYdX by.5\dimen@\relax \divide\K@dYdX\dimen@
+ \fi \K@dYdX=\sd@X\sd@Y\K@dYdX
+ \Direction=\maxdimen
+ \ifnum\K@dXdY<-\K@ \else \ifnum\K@<\K@dXdY \else %?*[Dirii2]
+ \ifdim \d@Y<\z@ %?*[Dirii2a]
+ \Direction=\K@ \advance\Direction-\K@dXdY
+ \else %?*[Dirii2b]
+ \Direction=\K@ \multiply\Direction-\thr@@ \advance\Direction-\K@dXdY
+ \fi\fi\fi
+ \ifnum-\K@<\K@dYdX \ifnum\K@dYdX<\K@ %?*[Dirii3]
+ \ifdim \d@X<\z@ %?*[Dirii3a]
+ \Direction=-\K@ \advance\Direction\K@dYdX
+ \else %?*[Dirii3b]
+ \Direction=\K@ \multiply\Direction\thr@@ \advance\Direction\K@dYdX
+ \fi\fi\fi
+ \ifnum\Direction=\maxdimen
+ \Direction=\K@dYdX \advance\Direction-\K@dXdY
+ \advance\Direction\ifnum\Direction<\z@-\fi\@ne \divide\Direction\tw@
+ \ifnum\K@dXdY<\z@ \advance\Direction\K@ \advance\Direction\K@
+ \else \advance\Direction-\K@ \advance\Direction-\K@ \fi
+ \fi
+ \imposeDirection@i
+ \resetupDirection@ %?*[Dirii6]
+ }
+
+\xydef@\imposeDirection@{\count@@=\Direction
+ \loop@\ifnum\count@@>4096 \advance\count@@-8192 \repeat@
+ \loop@\ifnum\count@@<-4096 \advance\count@@8192 \repeat@
+ \def\sd@X{+}\ifnum\count@@<\K@ \relax
+ \ifnum\count@@>-3072 \def\sd@X{-}\fi\fi
+ \def\sd@Y{+}\ifnum\count@@<3072 \relax
+ \ifnum\count@@>-\K@ \relax\def\sd@Y{-}\fi\fi
+ \imposeDirection@i
+ \d@X=\cosDirection\xydashl@ \d@Y=\sinDirection\xydashl@
+ \resetupDirection@}
+
+\xydef@\imposeDirection@i{%
+ \count@@=\K@ \multiply\count@@ by8 \advance\count@@\Direction %?*[Dirii4]
+ \count@=\count@@ \advance\count@\KK@ \divide\count@64 \advance\count@\m@ne %?*[Dirii4a]
+ \loop@\ifnum127<\count@ \advance\count@-128 \repeat@
+ \chardef\DirectionChar\count@
+ \advance\count@@16 \divide\count@@\KK@ \advance\count@@\m@ne %?*[Dirii4b]
+ \loop@\ifnum127<\count@@ \advance\count@@-128 \repeat@
+ \chardef\SemiDirectionChar\count@@
+ \setbox8=\hbox{\xydashfont\SemiDirectionChar\/}% %?*[Dirii5]
+ \quotient@@\cosDirection{\sd@X\wd8}\xydashl@
+ \setbox8=\hbox{\xydashfont\count@=\SemiDirectionChar\advance\count@-64 %?*[Dirii5b]
+ \ifnum\count@<\z@ \advance\count@128 \fi \char\count@\/}%
+ \quotient@@\sinDirection{\sd@Y\wd8}\xydashl@}
+
+\xydef@\getxyDirection@#1{\xy@@\bgroup\xy@@ix@{#1}%
+ \xy@@{\expandafter\POS\the\toks9\relax\setupDirection@
+ \edef\next@{\egroup \Direction=\the\Direction}\next@ \imposeDirection@ }}
+\DOCMODE)
+
+ Finally some special cases used by the <direction>s and directional
+ library objects. All manipulate the Direction dependent parameters
+ and then call |\resetupDirection@|: |\reverseDirection| reverses it;
+ |\above|- and |\belowDirection@| are for |^| and |_|, and
+ $|\vDirection@(|x|,|y|){|L|}|$ is for $|:(|x|,|y|)|$, \ie, computes
+ a new direction as the vector
+$$
+ |<| X - x*\cos\alpha*L - y*({-}\sin\alpha)*L |,|
+ Y - x*\sin\alpha*L - y*\cos\alpha*L |>|
+$$
+ where $\alpha$ is the previous direction angle.
+
+\DOCMODE(
+\xydef@\reverseDirection@{%
+ \d@X=-\d@X \d@Y=-\d@Y
+ \ifdim\d@X<\z@ \def\sd@X{-}\else \def\sd@X{+}\fi
+ \ifdim\d@Y<\z@ \def\sd@Y{-}\else \def\sd@Y{+}\fi
+ \dimen@=4\K@ \ifnum\Direction<\z@ \advance\Direction\dimen@
+ \else \advance\Direction-\dimen@ \fi
+ \count@=\DirectionChar \ifnum\count@<64 \advance\count@64 %
+ \else \advance\count@-64 \fi \chardef\DirectionChar=\count@
+ \edef\cosDirection{\if-\cosDirection\else-\cosDirection\fi}%
+ \edef\sinDirection{\if-\sinDirection\else-\sinDirection\fi}%
+ \resetupDirection@}
+
+\xydef@\aboveDirection@#1{%
+ \dimen@=\d@X \d@X=-\d@Y \d@Y=\dimen@
+ \dimen@=\K@dXdY \K@dXdY=-\K@dYdX \K@dYdX=-\dimen@
+ \ifdim\d@X<\z@ \def\sd@X{-}\else \def\sd@X{+}\fi
+ \ifdim\d@Y<\z@ \def\sd@Y{-}\else \def\sd@Y{+}\fi
+ \dimen@=2\K@ \ifdim 1\Direction<\dimen@\else \dimen@=-6\K@ \fi
+ \advance\Direction\dimen@
+ \count@=\DirectionChar \ifnum\count@<96 \advance\count@32 %
+ \else \advance\count@-96 \fi \chardef\DirectionChar=\count@
+ \count@=\SemiDirectionChar \ifnum\count@<64 \advance\count@64 %
+ \else \advance\count@-64 \fi \chardef\SemiDirectionChar=\count@
+ \let\tmp@=\cosDirection
+ \edef\cosDirection{\if-\sinDirection\else-\sinDirection\fi}%
+ \let\sinDirection=\tmp@
+ \dimen@=#1\relax \d@X=\cosDirection\dimen@ \d@Y=\sinDirection\dimen@
+ \resetupDirection@}
+
+\xydef@\belowDirection@#1{%
+ \dimen@=\d@X \d@X=\d@Y \d@Y=-\dimen@
+ \dimen@=\K@dXdY \K@dXdY=-\K@dYdX \K@dYdX=-\dimen@
+ \ifdim\d@X<\z@ \def\sd@X{-}\else \def\sd@X{+}\fi
+ \ifdim\d@Y<\z@ \def\sd@Y{-}\else \def\sd@Y{+}\fi
+ \dimen@=-2\K@\ifdim 1\Direction<\dimen@\dimen@=6\K@\fi
+ \advance\Direction\dimen@
+ \count@=\DirectionChar \ifnum\count@<32 \advance\count@96 %
+ \else \advance\count@-32 \fi \chardef\DirectionChar=\count@
+ \count@=\SemiDirectionChar \ifnum\count@<64 \advance\count@64 %
+ \else \advance\count@-64 \fi \chardef\SemiDirectionChar=\count@
+ \let\tmp@=\sinDirection
+ \edef\sinDirection{\if-\cosDirection\else-\cosDirection\fi}%
+ \let\cosDirection=\tmp@
+ \dimen@=#1\relax \d@X=\cosDirection\dimen@ \d@Y=\sinDirection\dimen@
+ \resetupDirection@}
+
+\xydef@\vDirection@(#1,#2)#3{\dimen@ii=#3\relax
+ \dimen@=#1\dimen@ii \dimen@ii=#2\dimen@ii
+ \d@X=\cosDirection\dimen@ \advance\d@X-\sinDirection\dimen@ii
+ \d@Y=\sinDirection\dimen@ \advance\d@Y \cosDirection\dimen@ii
+ \X@p=\X@c \advance\X@p-\d@X \Y@p=\Y@c \advance\Y@p-\d@Y
+ \setupDirection@\ignorespaces}
+\DOCMODE)
+
+ The above all make use of the following; use them also when the
+ direction state is known to be correct: |\resetDirection@| should be
+ called when $p$ and/or $c$ are moved along the line $\vec{pc}$,
+ |\resetupDirerection| when the entire direction state is changed in a
+ consistent manner.
+
+\DOCMODE(
+\xydef@\resetDirection@{%
+ \d@X=\X@c\advance\d@X-\X@p \d@Y=\Y@c\advance\d@Y-\Y@p
+ \let\next@=\resetupDirection@
+ \ifdim\sd@X\d@X<\z@ \let\next@=\setupDirection@i \fi
+ \ifdim\sd@Y\d@Y<\z@ \let\next@=\setupDirection@i \fi
+ \next@}
+
+\xydef@\resetupDirection@{%
+ \edef\Directiontest@@##1##2{\noexpand\DN@{##2}%
+ \noexpand\ifdim\noexpand\d@X=\the\d@X\relax
+ \noexpand\ifdim\noexpand\d@Y=\the\d@Y\relax \noexpand\DN@{##1}%
+ \noexpand\fi\noexpand\fi \noexpand\next@}}
+
+\xydef@\unsetupDirection@{\def\Directiontest@@##1##2{##2}}
+\DOCMODE)
+
+ Finally the initial direction: up!
+
+\DOCMODE(
+\uDirection@\xydashl@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Edges}
+??=[algo.edge]
+
+ An "Edge" is a token list describing the edge of an object. It must
+ have the form |{|<expandable token> <unexpandable tokens>|}|.
+ To find the edge of an object then first make it the current object
+ and then do
+$$
+ |\the\Edge@c|<code>
+$$
+ where <code> determines what should be done:
+%
+\begin{itemize}
+
+\item[0]
+ $c$ is changed to be equal to the point on the edge intersecting with
+ the line segment from $p$ (for ??c![E] <corner>, also this was the
+ v2.6 behaviour).
+
+ \NOTE: This should not change any of $A$, $B$, or any component of
+ the state except $X_c$ and $Y_c$!
+
+\item[1]
+ Test whether the center of $p$, \ie, $|<|X_p|,|Y_p|>|$, is `inside'
+ the $c$ object (or on the edge). Sets the test |\ifInside@|
+ accordingly.
+
+\item[2]
+ Set |\dimen@| to the distance from the center to the edge towards~$p$
+ (as set with code~0).
+
+ \NOTE: This is only positive in the direction towards $p$
+ (thus negative-sized circles and rectangles make it negative).
+
+\item[3]
+ $c$ is changed to be equal to the point on the edge furthest in the
+ direction towards $p$ (for ??c![P] <corner>).
+
+ \NOTE: This should not change any of $A$, $B$, or any component of
+ the state except $X_c$ and $Y_c$!
+
+\item[4]
+ Replace $c$ with rectangle with corners where the line from $p$
+ intersects with the edge of $c$ (thus this is the inner rectangle
+ with corners as the current direction dictates).
+
+\item[5]
+ Replace $c$ with smallest rectangle that encloses the current object
+ completely.
+
+\end{itemize}
+%
+ (if this reminds the reader of a `dictionary' as used by
+ object-oriented programming languages then they probably share this
+ author's regret that \TeX\ is not object-oriented :-)
+
+\DOCMODE(
+\message{edges,}
+
+\xynew@{if}\ifInside@
+\DOCMODE)
+
+\paragraph*{Points:}
+
+ The simplest shape is none at all -- a point.
+
+\DOCMODE(
+\xydef@\zeroEdge#1{%
+ \ifcase#1\relax \or \Inside@false \or \dimen@=\z@
+ \or \else \Edge@c={\rectangleEdge}\fi}
+\DOCMODE)
+
+\paragraph*{Circles and Ellipses:}
+
+ Next we define round things, with several special cases for the
+ individual variants described below: centered circular, centered
+ elliptical, and general elliptical. The only `intelligent' choice
+ is for the `Under' method where the object is forced to be a centered
+ variant before applying either the circular or elliptical version.
+
+\DOCMODE(
+\xydef@\circleEdge#1{\ifcase#1\expandafter\circleEdge@
+ \or \expandafter\circleUnder@ \or \dimen@=\R@c
+ \or \expandafter\circleProp@ \or \expandafter\circleInner@
+ \else \expandafter\circleOuter@ \fi}
+
+\xydef@\circleEdge@{\DN@{\ellipseEdge@}%
+ \ifdim\R@c=\L@c\relax \ifdim\U@c=\D@c\relax
+ \ifdim\R@c=\U@c\DN@{\circlecentredEdge@}%
+ \else\DN@{\ellipsecentredEdge@}\fi
+ \fi\fi \next@}
+
+\xydef@\circleProp@{\DN@{\reverseDirection@\ellipseEdge@}%
+ \ifdim\R@c=\L@c\relax \ifdim\U@c=\D@c\relax
+ \ifdim\R@c=\U@c\DN@{\reverseDirection@\circlecentredEdge@}%
+ \else\DN@{\reverseDirection@\ellipsecentredEdge@}\fi
+ \fi\fi \next@}
+
+\xydef@\circleUnder@{\Inside@false
+ \ifdim\X@p=\X@c \relax \ifdim\Y@p=\Y@c \Inside@true \fi \fi
+ \ifInside@ \else \expandafter \circleCentre@ \fi}
+
+\xydef@\circleCentre@{{%
+ \ifdim\L@c=\R@c \relax\else
+ \dimen@=\R@c\advance\dimen@-\L@c \divide\dimen@\tw@
+ \advance\X@c\dimen@ \advance\R@c-\dimen@ \fi
+ \d@X=\X@c \advance\d@X-\X@p \d@X=\ifdim\d@X<\z@-\fi\d@X
+ \ifdim\U@c=\D@c\relax \else
+ \dimen@=\U@c\advance\dimen@-\D@c \divide\dimen@\tw@
+ \advance\Y@c\dimen@ \advance\U@c-\dimen@ \fi
+ \d@Y=\Y@c \advance\d@Y-\Y@p \d@Y=\ifdim\d@Y<\z@-\fi\d@Y
+ \DN@{}\ifdim\d@X>\R@c \relax \else \ifdim\d@Y>\U@c \relax
+ \else \ifdim\U@c=\R@c \DN@{\circlecentredUnder@}%
+ \else \DN@{\ellipsecentredUnder@}\fi
+ \fi\fi \next@}}
+
+\xydef@\circleInner@{\DN@{\ellipseInner@}%
+ \ifdim\R@c=\L@c\relax \ifdim\U@c=\D@c\relax
+ \ifdim\R@c=\U@c\DN@{\circlecentredInner@}%
+ \else\DN@{\ellipsecentredInner@}\fi
+ \fi\fi \next@}
+
+\xydef@\circleOuter@{\DN@{\ellipseOuter@}%
+ \ifdim\R@c=\L@c\relax \ifdim\U@c=\D@c\relax
+ \ifdim\R@c=\U@c\DN@{\circlecentredOuter@}%
+ \else\DN@{\ellipsecentredOuter@}\fi
+ \fi\fi \next@}
+\DOCMODE)
+
+\subparagraph*{True circles, centered:} Code~0 moves $|<|X_c|,|Y_c|>|$ to the
+ point $|<|X_c - R_c*\cos\alpha|,| Y_c - R_c*\sin\alpha|>|$ where
+ $\alpha$ is the current direction angle, code~1 tests whether the
+ $p$ center is located between those two points., code~2 just returns
+ the radius, code~3 is as code~0 and code~4 is the only nontrivial
+ one, replacing with the inner symmetric rectangle with corner at the
+ point of code~0.
+
+\DOCMODE(
+\xydef@\circlecentredEdge@{%
+ \dimen@=-\cosDirection\R@c \advance\X@c\dimen@
+ \dimen@=-\sinDirection\R@c \advance\Y@c\dimen@}
+
+\xydef@\circlecentredUnder@{%
+ \loop\ifdim\R@c>100\p@ \circlescale@ \repeat
+ \edef\tmp@{\expandafter\removePT@\the\R@c}\dimen@=\tmp@\R@c
+ \edef\tmp@{\expandafter\removePT@\the\d@X}\advance\dimen@-\tmp@\d@X
+ \edef\tmp@{\expandafter\removePT@\the\d@Y}\advance\dimen@-\tmp@\d@Y
+ \ifdim\dimen@>\z@ \aftergroup\Inside@true \fi}
+
+%%\xydef@\circlescale@{\divide\R@c\KK@ \divide\d@X\KK@ \divide\d@Y\KK@ }
+\xydef@\circlescale@{\divide\R@c\KK@ \divide\d@X\KK@ \divide\d@Y\KK@ }
+
+\xydef@\circlecentredInner@{%
+ \L@c=\sd@X\cosDirection\R@c \D@c=\sd@Y\sinDirection\R@c
+ \R@c=\L@c \U@c=\D@c \Edge@c={\rectangleEdge}}
+
+\xydef@\circlecentredOuter@{%
+ \L@c=\R@c \D@c=\R@c \U@c=\D@c \Edge@c={\rectangleEdge}}
+\DOCMODE)
+
+\subparagraph*{Ellipsis, centered:} When $c$ is at the centre of an
+ elliptical object, first rescale the axes to make the object
+ circular. Rescale $dX$ and $dY$ appropriately, reset the direction
+ and move to the edge as previously. Then scale back to
+ the original shape, adjusting $X_c$ and $Y_c$ appropriately.
+
+\DOCMODE(
+\xydef@\ellipsecentredEdge@{\bgroup \X@p=\X@c \Y@p=\Y@c
+ \ifdim\U@c>\R@c
+ \X@c=\cosDirection\U@c \Y@c=\sinDirection\U@c
+ \quotient@\tmp@\U@c\R@c \X@c=\tmp@\X@c \R@c=\U@c
+ \else
+ \X@c=\cosDirection\R@c \Y@c=\sinDirection\R@c
+ \quotient@\tmp@\R@c\U@c \Y@c=\tmp@\Y@c
+ \fi
+ \advance\X@c\X@p \advance\Y@c\Y@p
+ \setupDirection@ \X@c=\X@p \Y@c=\Y@p \circlecentredEdge@
+ \d@X=\X@c \advance\d@X-\X@p \d@Y=\Y@c \advance\d@Y-\Y@p
+ \ifdim\U@c>\L@c \quotient@\tmp@\L@c\U@c \d@X=\tmp@\d@X
+ \else \quotient@\tmp@\U@c\R@c \d@Y =\tmp@\d@Y \fi
+ \X@c=\X@p \advance\X@c\d@X \Y@c=\Y@p \advance\Y@c\d@Y
+ \edef\next@{\egroup \X@c=\the\X@c \Y@c=\the\Y@c}\next@ }%
+
+\xydef@\ellipsecentredUnder@{%
+ \ifdim\R@c>64\p@ \circlescale@ \divide\U@c\KK@
+ \else \ifdim\U@c>64\p@ \circlescale@ \divide\U@c\KK@ \fi\fi
+ \edef\tmp@{\expandafter\removePT@\the\R@c}\d@Y=\tmp@\d@Y
+ \edef\tmp@{\expandafter\removePT@\the\U@c}\d@X=\tmp@\d@X
+ \R@c=\tmp@\R@c \circlecentredUnder@ }
+\DOCMODE)
+
+ For elliptical objects the Outer-rectangle retains all the
+ extents, so just change the edge-type.
+
+\DOCMODE(
+\xydef@\ellipsecentredOuter@{\Edge@c={\rectangleEdge}}
+\DOCMODE)
+
+ For elliptical objects the Inner-rectangle needs to
+ be calculated for each direction. This is done by
+ first finding the edge, using |\ellipseEdge@| or
+ |\ellipsecentredEdge@| when appropriate.
+
+\DOCMODE(
+\xydef@\ellipsecentredInner@{%
+ \bgroup \X@p=\X@c \Y@p=\Y@c \ellipsecentredEdge@
+% \advance\X@c-\X@p \L@c=\ifdim\X@c<\z@-\fi\L@c
+ \advance\X@c-\X@p \L@c=\ifdim\X@c<\z@-\fi\X@c
+% \advance\Y@c-\Y@p \D@c=\ifdim\Y@c<\z@-\fi\D@c
+ \advance\Y@c-\Y@p \D@c=\ifdim\Y@c<\z@-\fi\Y@c
+ \edef\next@{\egroup \L@c=\the\L@c \D@c=\the\D@c}\next@
+ \R@c=\L@c \U@c=\D@c \Edge@c={\rectangleEdge}}
+\DOCMODE)
+
+\subparagraph*{Non-centered variants:} The code for the more general
+ |\ellipseEdge@| uses a Newton iteration to solve a quadratic
+ equation.
+
+ First locate the actual centre of the ellipse and
+ the lengths of the major axis $a$ and minor axis $b$.
+ Let $(x,y)$ denote the displacement of the required
+ edge point from the centre of the ellipse,
+ so that ${x^2\over a^2}+{y^2\over b^2}=1$.
+ Now let $(dx,dy)$ be the displacement from the centre
+ to the reference point; then $x=dx+s \cos\theta$ and
+ $y=dy+s\sin\theta$ where $s$ is the distance to $(x,y)$
+ in the required direction $\theta$.
+ We must find the value of $s$, presumed to satisfy $s\ge0$.
+
+ If $a\lt b$ we search for a root of
+\begin{eqnarray*}
+f\left({s\over a}\right) &= \;\;
+\left(\tilde{dx}+{s\over a}\cos\theta\right)^2
++\left(\tilde{dy}+{s\over a}{a\over b}\sin\theta\right)^2 & \cr
+f'\left({s\over a}\right) &= \;\;
+2\left(\tilde{dx}+{s\over a}\cos\theta\right)\cos\theta
++ 2\left(\tilde{dy}+{s\over a}{a\over b}\sin\theta\right)
+{a\over b}\sin\theta
+\end{eqnarray*}
+ where $\tilde{dx} = dx/a$ and $\tilde{dy} = dy/b$.
+ By choosing a starting value $s_0=2a+2b$ the Newton-iteration
+ converges rapidly to the correct root, provided $b\gt0$.
+\smallskip
+\noindent
+ If $a\gt b$ then we solve a similar quadratic in ${s\over b}$.
+
+ \TODO:
+ The case of $a=0$ or $b=0$, so that the ellipse degenerates
+ to a line segment, should be trapped earlier.
+ Such an object would be more easily handled as a degenerate
+ case of a rectangle.
+
+ \TODO:
+ In the case when the reference point lies outside the ellipse
+ the Newton iteration is not guaranteed to converge.
+ A simple test --- $s$ growing rather than decreasing in size ---
+ detects possible converge problems and exits the iteration.
+ The following message is issued \dots
+ $$|Xy-pic warning: poor convergence.|$$
+ Often, particularly when the reference point is on or near
+ the edge of the ellipse,
+ an acceptable approximation to the edge has been found anyway.
+
+\DOCMODE(
+\xydef@\ellipseEdge@{\bgroup
+ \A@=\R@c \B@=\U@c
+ \ifdim\R@c=\L@c \d@X=\z@
+ \else \d@X=.5\R@c \advance\d@X-.5\L@c
+ \advance\A@\L@c \divide\A@\tw@ \fi
+ \ifdim\U@c=\D@c \d@Y=\z@
+ \else \d@Y=.5\U@c \advance\d@Y-.5\D@c
+ \advance\B@\D@c \divide\B@\tw@ \fi
+ \bgroup
+ \L@c=\A@ \U@c=\B@
+ \R@p=\U@c \advance\R@p\L@c \multiply\R@p\tw@
+ \ifdim\B@<\A@ \quotient@\tmp@\U@c\L@c \R@c=\tmp@\p@ \D@c=\p@
+ \quotient@\tmp@\R@p\L@c \R@p=\tmp@\p@
+ \else
+ \ifdim\A@<\B@ \quotient@\tmp@\L@c\U@c \D@c=\tmp@\p@ \R@c=\p@
+ \quotient@\tmp@\R@p\U@c \R@p=\tmp@\p@
+ \else
+ \R@c=\p@ \D@c=\p@ \quotient@\tmp@\R@p\U@c \R@p=\tmp@\p@
+ \fi\fi
+ \quotient@\sd@X\d@X\L@c \d@X=\sd@X\p@
+ \quotient@\sd@Y\d@Y\U@c \d@Y=\sd@Y\p@
+ \loop
+ \bgroup \U@p=-\p@ \D@p=\z@
+ \ifdim\R@c<\p@
+ \edef\tmp@{\expandafter\removePT@\the\R@c}\dimen@=\tmp@\R@p
+ \advance\d@X\cosDirection\dimen@
+ \else \advance\d@X\cosDirection\R@p \fi
+ \edef\sd@X{\expandafter\removePT@\the\d@X}%
+ \advance\U@p\sd@X\d@X
+ \ifdim\R@c<\p@
+ \edef\tmp@{\expandafter\removePT@\the\R@c}\dimen@=\tmp@\d@X
+ \advance\D@p\cosDirection\dimen@
+ \else \advance\D@p\cosDirection\d@X \fi
+%
+ \ifdim\D@c<\p@
+ \edef\tmp@{\expandafter\removePT@\the\D@c}\dimen@=\tmp@\R@p
+ \advance\d@Y\sinDirection\dimen@
+ \else \advance\d@Y\sinDirection\R@p \fi
+ \edef\sd@Y{\expandafter\removePT@\the\d@Y}%
+ \advance\U@p\sd@Y\d@Y
+ \ifdim\D@c<\p@
+ \edef\tmp@{\expandafter\removePT@\the\D@c}\dimen@=\tmp@\d@Y
+ \advance\D@p\sinDirection\dimen@
+ \else \advance\D@p\sinDirection\d@Y \fi
+ \multiply\D@p\tw@
+ \dimen@=\ifdim\U@p<\z@-\fi\U@p
+ \ifdim\dimen@<.01\p@ \U@p=\z@
+ \else
+ \quotient@\tmp@\U@p\D@p \U@p=\tmp@\p@
+ \ifdim\U@p<\z@\xywarning@{poor convergence}\U@p=\z@
+ \else \advance\R@p-\U@p \U@p=\ifdim\U@p<\z@-\fi\U@p
+ \fi \fi
+ \edef\next@{\egroup \R@p=\the\R@p \U@p=\the\U@p \D@p=\the\D@p}\next@
+ \ifdim\U@p>\z@ \repeat
+ \edef\next@{\egroup \dimen@=\the\R@p}\next@
+ \edef\tmp@{\expandafter\removePT@\the\dimen@}%
+ \ifdim\B@<\A@ \dimen@=\tmp@\B@ \else \dimen@=\tmp@\A@ \fi
+ \dimen@=-\dimen@
+ \advance\X@c\cosDirection\dimen@
+ \advance\Y@c\sinDirection\dimen@
+ \edef\next@{\egroup \X@c=\the\X@c \Y@c=\the\Y@c}\next@ }%
+\DOCMODE)
+
+ The `Under' procedure is identical to the centered version.
+
+\DOCMODE(
+\xydef@\ellipseOuter@{\Edge@c={\rectangleEdge}}
+
+\xydef@\ellipseInner@{%
+ \bgroup \X@p=\X@c \Y@p=\Y@c \ellipseEdge@
+ \d@X=\X@c\advance\d@X-\X@p
+ \ifdim\d@X>\z@ \R@p=\d@X \L@p=\R@p
+ \ifdim\L@c=\R@c\else\advance\L@p\L@c \advance\L@p-\R@c \fi
+ \else \L@p=-\d@X \R@p=\L@p
+ \ifdim\L@c=\R@c \else\advance\R@p\R@c \advance\R@p-\L@c \fi
+ \fi
+ \d@Y=\Y@c\advance\d@Y-\Y@p
+ \ifdim\d@Y>\z@ \U@p=\d@Y \D@p=\U@p
+ \ifdim\D@c=\U@c\else\advance\D@p\D@c \advance\D@p-\U@c \fi
+%\else \D@p=-\d@X \R@p=\D@p
+ \else \D@p=-\d@Y \U@p=\D@p % <<<<<<========
+ \ifdim\D@c=\U@c\else\advance\U@p\U@c \advance\U@p-\D@c \fi
+ \fi
+ \edef\next@{\egroup
+ \L@c=\the\L@p \D@c=\the\D@p \R@c=\the\R@p \U@c=\the\U@p}%
+ \next@ \Edge@c={\rectangleEdge}}
+\DOCMODE)
+
+\paragraph*{Rectangles:}\leavevmode
+
+ Rectangles intersection is slightly more complicated and handled
+ separately for the horizontal and vertical case.
+
+\DOCMODE(
+\xydef@\rectangleEdge#1{\ifcase#1\expandafter\rectangleEdge@
+ \or \expandafter\rectangleUnder@ \or \expandafter\rectangleDist@
+ \or \expandafter\rectangleProp@ %%%\or \expandafter\rectangleInner@ BUG!
+ \else \relax \fi}
+\DOCMODE)
+
+ \BUG: no `Inner' for rectangles!
+
+\DOCMODE(
+% \rectangleEdge@
+% Sets <X,Y> to the intersection of a line from <X-dX,Y-dY> to <X,Y>
+% and the rectangle from <X-L,Y-D> to <X+R,Y+U>:
+%
+% %1a dY<0, dX<0: X := X + min{R, U*|dX/dY|},
+% Y := Y + min{U, R*|dY/dX|};
+% b dY<0, dX=0: Y := Y + U;
+% c dY<0, dX>0: X := X - min{L, U*|dX/dY|},
+% Y := Y + min{U, L*|dY/dX|};
+%
+% %2a dY=0, dX<0: X := X + R;
+% b dY=0, dX=0: ;
+% c dY=0, dX>0: X := X - L;
+%
+% %3a dY>0, dX<0: X := X + min{R, D*|dX/dY|},
+% Y := Y - min{D, R*|dY/dX|};
+% b dY>0, dX=0: Y := Y - D;
+% c dY>0, dX>0: X := X - min{L, D*|dX/dY|},
+% Y := Y - min{D, L*|dY/dX|};
+%
+% %4 \resetupDirection@ to register that even though dX,dY changed all
+% Direction parameters are is still valid!
+%
+% NOTE: d=0 really means |d| < .05pt.
+%
+\xydef@\rectangleEdge@{%
+ \ifdim\d@Y<-.05\p@ \rectangleEdge@i %1
+ \else\ifdim\d@Y<.05\p@ \rectangleEdge@ii %2
+ \else \rectangleEdge@iii\fi\fi
+ \resetupDirection@}
+
+\xydef@\rectangleEdge@i{%
+ \ifdim\d@X<-.05\p@
+ \settomin@\X@c+\R@c\U@c\d@X\d@Y \settomin@\Y@c+\U@c\R@c\d@Y\d@X%1a
+ \else\ifdim\d@X<.05\p@ \advance\Y@c\U@c %1b
+ \else \settomin@\X@c-\L@c\U@c\d@X\d@Y \settomin@\Y@c+\U@c\L@c\d@Y\d@X %1c
+ \fi\fi}
+
+\xydef@\rectangleEdge@ii{%
+ \ifdim\d@X<-.05\p@ \advance\X@c\R@c %2a
+ \else\ifdim\d@X<.05\p@ %2b
+ \else \advance\X@c-\L@c %2c
+ \fi\fi}
+
+\xydef@\rectangleEdge@iii{%
+ \ifdim\d@X<-.05\p@
+ \settomin@\X@c+\R@c\D@c\d@X\d@Y \settomin@\Y@c-\D@c\R@c\d@Y\d@X%3a
+ \else\ifdim\d@X<.05\p@ \advance\Y@c-\D@c %3b
+ \else \settomin@\X@c-\L@c\D@c\d@X\d@Y \settomin@\Y@c-\D@c\L@c\d@Y\d@X %3c
+ \fi\fi}
+
+\xydef@\settomin@#1#2#3#4#5#6{%
+ % Perform d := #2 min{#3, #4*|#5/#6|}; #1 := #1+d ...
+ \edef\nextii@{\A@=\the\A@ \B@=\the\B@}\quotient@\next@{#5}{#6}\nextii@
+ \dimen@=\sd@X\sd@Y\next@#4\relax
+ \ifdim#3<\dimen@ \dimen@=#3\fi \advance#1#2\dimen@}
+\DOCMODE)
+
+ Checking that $p$ is under is simpler: Normally it is not but
+ if $c=p$ or ($-L_c \lt X_p-X_c \lt R_c$ and $-D_c \lt Y_p-Y_c \lt
+ U_c$) then it is.
+
+\DOCMODE(
+\xydef@\rectangleUnder@{\Inside@false
+ \ifdim\X@p=\X@c \ifdim\Y@p=\Y@c \Inside@true \fi\fi
+ \ifInside@ \else
+ \dimen@=\X@p \advance\dimen@-\X@c
+ \ifdim \dimen@>-\L@c \relax \ifdim\dimen@<\R@c
+ \dimen@=\Y@p \advance\dimen@-\Y@c
+ \ifdim \dimen@>-\D@c \relax \ifdim\dimen@<\U@c
+ \Inside@true
+ \fi\fi\fi\fi\fi }
+\DOCMODE)
+
+ Calculating the width is like computing the edge point, just simpler:
+ (??_[rDist])~Set $A$ to the horizontal and $B$ to the vertical
+ distance applicable; if either is zero (or close) use the other
+ unmodified . (??_[rDisti])~If both nonzero use
+ $\min(A/\cos\alpha,B/\sin\alpha)$ where $\alpha$ is the current angle.
+
+\DOCMODE(
+\xydef@\rectangleDist@{\let\next@=\rectangleDist@i %?*[rDist]
+ \ifdim\d@X<-.05\p@ \dimen@=\R@c
+ \else\ifdim\d@X<.05\p@ \dimen@=\z@ \DN@{\dimen@=\dimen@ii}%
+ \else \dimen@=\L@c \fi\fi
+ \ifdim\d@Y<-.05\p@ \dimen@ii=\U@c
+ \else\ifdim\d@Y<.05\p@ \DN@{}%
+ \else \dimen@ii=\D@c \fi\fi
+ \next@}
+
+\xydef@\rectangleDist@i{%?*[rDisti]
+ \begingroup \quotient@\next\p@{\sd@X\cosDirection\p@}%
+ \edef\next{\endgroup \dimen@=\next\dimen@}\next
+ \begingroup \quotient@\next\p@{\sd@Y\sinDirection\p@}%
+ \edef\next{\endgroup \dimen@ii=\the\dimen@ii}\next
+ \ifdim\dimen@ii<\dimen@ \dimen@=\dimen@ii \fi}
+\DOCMODE)
+
+ Setting $c$ to the `proportional edge point' is straight out of
+ v2.6's |\setlabel@@| macro\dots
+
+\DOCMODE(
+% First rotate to opposite direction.
+
+% Then compute Leftf,Upf [\next@,\nextii@]:
+% 0,(D-2K)/2K for 2K < D <= 4K [right]
+% (2K-D)/2K,0 for 0 < D <= 2K [down]
+% 1,-D/2K for -2K < D <= 0 [left]
+% (D+4K)/2K,1 for -4K < D <= -2K [up]
+
+% Finally set <X,Y> to
+% < X - L + Leftf*(R+L) , Y + U - Upf*(D+U) >
+
+\xydef@\rectangleProp@{%
+ \enter@{\A@=\the\A@ \B@=\the\B@ \DirectionfromtheDirection@}%
+ \reverseDirection@
+ \dimen@=1\Direction \count@=\K@ \multiply\count@\tw@
+ \ifnum \Direction>\count@
+ \DN@{0}%
+ \advance\dimen@-2\K@ \quotient@\nextii@{\dimen@}{2\K@}%
+ \else\ifnum \Direction>\z@
+ \dimen@=-\dimen@ \advance\dimen@2\K@ \quotient@\next@{\dimen@}{2\K@}%
+ \DNii@{0}%
+ \else\ifnum \Direction>-\count@
+ \DN@{1}%
+ \quotient@\nextii@{-\dimen@}{2\K@}%
+ \else
+ \advance\dimen@4\K@ \quotient@\next@{\dimen@}{2\K@}%
+ \DNii@{1}%
+ \fi\fi\fi
+ \advance\X@c-\L@c \dimen@=\L@c \advance\dimen@\R@c
+ \ifdim\dimen@=\z@ \advance\X@c 2\L@c \else \advance\X@c\next@\dimen@ \fi
+ \advance\Y@c+\U@c \dimen@=\D@c \advance\dimen@\U@c
+ \ifdim\dimen@=\z@ \advance\Y@c-2\U@c \advance\Y@c\Upness@\U@c
+ \else \advance\Y@c-\nextii@\dimen@ \fi
+ \leave@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Connections}
+??=[algo.connection]
+
+\DOCMODE(
+\message{connections;}
+\DOCMODE)
+
+ Connections describe how a particular <object> may be used to connect
+ $p$ to $c$. The following parameters and methods are defined by any
+ connection; they should be used in the indicated
+ sequence:??w[connection methods]
+%
+\begin{description}
+
+\item[|\Invisible@@|, |\Hidden@@|, and |\Drop@@|:] as for <object>.
+
+\item[|\Creset@@|:]
+ (Re)set the connection parameters to allow use of the following to
+ move to a point on the connection (this is what the interpretation of
+ <pos> |?| does first). All effects obtained by the following methods
+ are undone: |\Creset@@| reestablishes the state to what it was just
+ after the |\Connect@@| every time.
+
+\item[|\Cshavep@@| or |\Cshavec@@|:]
+ Change $p$ or $c$ to a zero-sized object at the start or finish of
+ the connection (the first |<| and |>| <place> components).
+
+\item[|\Calong@@{|<factor>|}|:]
+ Move $c$ to point the <factor> along the connection and set the
+ direction parameters as a tangent to it in this point (the
+ |(|<factor>|)| <place> component).
+
+\item[|\Cslidep@@{|<dimen>|}| or |\Cslidec@@{|<dimen>|}|:]
+ Move $p$ or $c$ the <dimen>sion further in the current direction.
+ Can be used both before and after the |\Calong@@| method (these
+ handle subsequent |<| and |>| as well as the |/|<slide>|/| <place>
+ component).
+
+\item[|\Cintercept@@|:]
+ Set $c$ to a zerosized object at the point where the connection
+ crosses the straight line from $p$ to $c$ (the |!{|\dots|}| <place>
+ component).
+
+\item[|\Cbreak@@| and |\Clast@@|:]
+ These support typesetting of the connection in several `subsegments'
+ as used by the arrow option. The idea is the following, using the
+ internal "lastbreak" and "nextbreak" positions:
+\begin{enumerate}
+
+\item |\Connect@@| sets $"lastbreak":=p$ and $"nextbreak":=c$
+
+\item The commands |\Cslidec@@|, |\Cslidep@@|, and |\Cintercept@@|, set
+ "nextbreak" logically to the position that is obtained by the
+ manipulation.
+
+\item |\Cbreak@@| retypesets the connection except only the piece
+ from "lastbreak" to the current $c$ object, which "must" be at on top
+ of "nextbreak", is typeset. Afterwords it sets
+ $"lastbreak":="nextbreak"$ and $"nextbreak":=c$ (where $c$ is the
+ original $c$ of the connection).
+
+\item The command |\Clast@@| typesets from "lastbreak" and the remainder of
+ the connection, and resets $"lastbreak":=p$ and $"nextbreak":=c$.
+
+\end{enumerate}
+\end{description}
+%
+ Notice that it is not necessary for "nextbreak" to actually exist, in
+ fact in the kernel it is just an alias for $c$ at the time
+ |\Cbreak@@| is called.
+
+ These are the defaults for basic \Xy-pictures that only has straight
+ connections hence the macros all starting with |\no|\dots are rather
+ simple -- in particular they just merge with zerosized objects at the
+ locations cutoff locations (this was inherited from the broken
+ |arrow| code~\smiley~).
+
+\DOCMODE(
+\xydef@\Creset@@{}
+\xydef@\Cshavep@@{\noCshavep@@}
+\xydef@\Cshavec@@{\noCshavec@@}
+\xydef@\Cslidep@@{\noCslidep@@}
+\xydef@\Cslidec@@{\noCslidec@@}
+\xydef@\Calong@@{\noCalong@@}
+\xydef@\Cintercept@@{\noCintercept@@}
+\xydef@\Cbreak@@{\noCbreak@@}
+\xydef@\Clast@@{\noClast@@}
+
+\xylet@\lastbreak@@=\empty
+
+\xydef@\noCshavep@@{\setupDirection@
+ \enter@{\cfromthec@ \DirectionfromtheDirection@}%
+ \reverseDirection@ \cfromp@ \the\Edge@c\z@
+ \pfromc@ \leave@ \resetDirection@}
+
+\xydef@\noCshavec@@{\setupDirection@ \the\Edge@c\z@ \resetDirection@}
+
+\xydef@\noCslidep@@#1{\dimen@=#1\relax
+ \advance\X@p\cosDirection\dimen@ \advance\Y@p\sinDirection\dimen@
+ \resetDirection@}
+
+\xydef@\noCslidec@@#1{\dimen@=#1\relax
+ \advance\X@c\cosDirection\dimen@ \advance\Y@c\sinDirection\dimen@
+ \resetDirection@}
+
+\xydef@\noCalong@@#1{%
+ \d@X=#1\d@X \d@Y=#1\d@Y \X@c=\X@p \Y@c=\Y@p \advance\X@c\d@X \advance\Y@c\d@Y
+ \resetupDirection@}
+\DOCMODE)
+
+ Next the intercept method that just uses |\intersect@|.
+
+\DOCMODE(
+\xydef@\noCintercept@@{\enter@{\pfromthep@}%
+ \begingroup\Creset@@ \edef\tmp@{\endgroup
+ \X@origin=\the\X@p \Y@origin=\the\Y@p \R@c=\the\d@X \U@c=\the\d@Y}\tmp@
+ \loop@\dimen@=\ifdim\R@c<\z@-\fi\R@c \advance\dimen@\ifdim\U@c<\z@-\fi\U@c
+ \ifdim\dimen@>10\p@ \advance\R@c \ifdim\R@c<\z@-\fi 16sp \divide\R@c\KK@
+ \advance\U@c \ifdim\U@c<\z@-\fi 16sp \divide\U@c\KK@ \repeat@
+ \intersect@ \leave@}
+\DOCMODE)
+
+ And finally the dummy `break' method which of course does nothing
+ except the required shifting.
+
+\DOCMODE(
+\xydef@\noCbreak@@{\edef\lastbreak@@{\cfromthec@}}
+\xydef@\noClast@@{\Creset@@ \edef\lastbreak@@{\cfromthep@}}
+\DOCMODE)
+
+ The kernel only defines one kind of connection which is used by
+ default: `filling' many copies of the connect object on the straight
+ line from $p$ to $c$.
+
+ First the `dummy' connection type |no| used for <object>s where it
+ doesn't really make sense to `connect', and used to provide defaults
+ for easy operations:
+
+\DOCMODE(
+\xydef@\no@@{\setupDirection@ \edef\lastbreak@@{\cfromthep@}%
+ \enter@{\cfromthec@\pfromthep@\DirectionfromtheDirection@}%
+ \edef\Creset@@{\cfromthec@ \pfromthep@ \DirectionfromtheDirection@}%
+ \edef\next@{{\sd@X}{\sd@Y}}\expandafter\straightcheckoverlap@\next@
+ \setupDirection@ \the\Edge@c\z@
+ \swap@\reverseDirection@\the\Edge@c\z@\swap@\reverseDirection@
+ \resetDirection@
+ \edef\Cshavep@@{\DirectionfromtheDirection@
+ \pfromthep@\noexpand\resetDirection@}%
+ \edef\Cshavec@@{\DirectionfromtheDirection@
+ \cfromthec@\noexpand\resetDirection@}%
+ \leave@
+ \def\Cslidep@@{\noCslidep@@}\def\Cslidec@@{\noCslidec@@}%
+ \def\Calong@@{\noCalong@@}\def\Cintercept@@{\noCintercept@@}%
+ \def\Cbreak@@{\noCbreak@@}\def\Clast@@{\noClast@@}\noinsert@}
+
+\xydef@\noinsert@{\ifHidden@\else
+ \ifdim\Y@c>\Y@max \Y@max=\Y@c \fi \ifdim\Y@p>\Y@max \Y@max=\Y@p \fi
+ \ifdim\Y@c<\Y@min \Y@min=\Y@c \fi \ifdim\Y@p<\Y@min \Y@min=\Y@p \fi
+ \ifdim\X@c>\X@max \X@max=\X@c \fi \ifdim\X@p>\X@max \X@max=\X@p \fi
+ \ifdim\X@c<\X@min \X@min=\X@c \fi \ifdim\X@p<\X@min \X@min=\X@p \fi
+ \fi}
+\DOCMODE)
+
+ Next `straight' connections that use the following special parameters
+ to customises how to repeat a `filler' object as many times as needed
+ to draw the connection:
+%
+\begin{description}
+
+\item[|\lastobjectbox@|:] box to fill with; assumed to be `trimmed' to have
+ only the size needed for the filler; size is $w*(h+d)$).
+
+\end{description}
+%
+ The method is called as |\straight@{|<spread>|}| where <spread> is a
+ macro to expand "after" the number of fillers $N$ (in |\count@@|) is
+ known and with $A=w$ and $B=d+h$ but "before" any filling is done.
+ May change $N$ as well as $"dX","dY",X,Y,w,d,h$ in order to affect
+ the filling.
+
+\subparagraph*{Procedure:}
+%
+ [??_[Strgt1]] setup direction parameters, clear the break state, and
+ define the |\Creset@@| macro to reestablish this initial state;
+ [??_[Strgt2]] build macro to discover if the edges of the objects
+ overlap (it edges were removed); [??_[Strgt3]] move both $p,c$ to the
+ edges of the objects\dots and define the |\Cshave*@@| macros
+ accordingly; [??_[Strgt4]] choose either to ignore the connection if
+ requested or there is overlap between the objects of choose either
+ vbox or hbox version (see below)\dots; and [??_[Strgt5]] build
+ |\Calong@@|, |\Cbreak@@|, and |\Clast@@| macros, and reset $pc$.
+
+ \NOTE: Assumes that the direction is not tampered with between Creset
+ is defined and used\dots
+
+\DOCMODE(
+\xydef@\Spread@@{}
+\xydef@\checkoverlap@@{}
+
+\xydef@\straight@#1{\setupDirection@ \def\Spread@@{#1}% %?*[Strgt1]
+ \edef\Creset@@{\cfromthec@ \pfromthep@ \DirectionfromtheDirection@}%
+ \edef\lastbreak@@{\cfromthep@}%
+ \edef\next@{{\sd@X}{\sd@Y}}\expandafter\straightcheckoverlap@\next@ %?*[Strgt2]
+ \setupDirection@ \the\Edge@c\z@
+ \swap@\reverseDirection@\the\Edge@c\z@\swap@\reverseDirection@
+ \resetDirection@
+ \edef\Cshavep@@{\DirectionfromtheDirection@
+ \pfromthep@\noexpand\resetDirection@}%
+ \edef\Cshavec@@{\DirectionfromtheDirection@
+ \cfromthec@\noexpand\resetDirection@}%
+ \noinsert@ %?*[Strgt3b]
+ \straight@typeset %?*[Strgt4]
+ \def\Cbreak@@{\straightCbreak@}\def\Clast@@{\straightClast@}%
+% \DN@{\solidSpread@}\ifx\next@\Spread@@
+% \checkXy@rules@\solidhrule@pre\solidvrule@pre\relax
+% \fi
+ \def\Cslidep@@{\noCslidep@@}\def\Cslidec@@{\noCslidec@@}%?*[Strgt5]
+ \def\Calong@@{\noCalong@@}\def\Cintercept@@{\noCintercept@@}%
+ \Creset@@}
+
+\xydef@\straightcheckoverlap@#1#2{\def\checkoverlap@@{%
+ \ifdim#1\X@p>#1\X@c \let\next@=\relax \fi
+ \ifdim#2\Y@p>#2\Y@c \let\next@=\relax \fi}}
+
+\xydef@\straight@typeset{%
+ \ifInvisible@ \let\next@=\relax
+ \else\ifdim 1\Direction<-2\K@ \DN@{\straightv@}%
+ \else\ifdim 1\Direction<\z@ \DN@{\straighth@}%
+ \else\ifdim 1\Direction<2\K@ \DN@{\straightv@}%
+ \else \DN@{\straighth@}%
+ \fi\fi\fi\fi \checkoverlap@@ \next@}
+\DOCMODE)
+
+ The methods |\straightCbreak@| and |\straightClast@| implement the
+ break method parametrised on the `typeset' primitive which is usually
+ |\straight@typeset| which is a simplified version of |\straight@|
+ that does not initialise. This relies on the connection being
+ straight: the |Cbreak@@| method executes $p,c :=
+ p|.|"lastbreak",c|.|"nextbreak"$ and |Clast@@| executes $p,c :=
+ p|.|"lastbreak",c$, where in both cases the |[Inner]| modifier is
+ applied just before the merging to make sure the edge is respected by
+ the merged object.
+
+\DOCMODE(
+\xylet@\nextbreak@@=\empty
+
+\xydef@\straightCbreak@{\connectRestore@
+ \edef\nextbreak@@{\cfromthec@}%
+ \Creset@@ \swap@ \the\Edge@c4\enter@{\cmergethec@}\lastbreak@@ \leave@
+ \swap@ \the\Edge@c4\enter@{\cmergethec@}\nextbreak@@ \leave@
+ \setupDirection@
+ \the\Edge@c\z@
+ \swap@ \reverseDirection@ \the\Edge@c\z@ \swap@ \reverseDirection@
+ \resetDirection@ \noinsert@ \straight@typeset
+ \Creset@@ \let\lastbreak@@=\nextbreak@@}
+
+\xydef@\straightClast@{\connectRestore@
+ \Creset@@ \swap@ \the\Edge@c4\enter@{\cmergethec@}\lastbreak@@ \leave@
+ \swap@
+ \setupDirection@
+ \the\Edge@c\z@
+ \swap@\reverseDirection@ \the\Edge@c\z@ \swap@\reverseDirection@
+ \resetDirection@ \noinsert@ \straight@typeset
+ \Creset@@ \edef\lastbreak@@{\cfromthep@}}
+\DOCMODE)
+
+ Now for the typesetting -- to summarise: these are parametrised on
+ direction parameters and use $X,Y$: endpoint of connection
+ (`Direction end'). $"dX","dY"$: connection distance (`Direction
+ vector'). |\Leftness@| of <object>. |\lastobjectbox@| to fill with;
+ assumed to be `trimmed'. |\Spread@@| to expand to modify the default
+ spreading used. |\Drop@@| to expand to actually typeset the finished
+ connection when it is in box0! \NOTE: Must make box0 void to avoid
+ `box leaks'.
+
+ Two variants exist: one for mostly horisontal and one for mostly
+ vertical filling. We detail the `mostly horisontal' one:
+
+ [??_[StrH0]] start box;
+%
+ [??_[StrH1]] compute initial adjustment ($X$ right and $Y$ up) and
+ $A := w$, $B := h+d$, $N = \floor(\abs{"dX"} / A)$,
+ and run user supplied Spread;
+%
+ [??_[StrH2]] adjust first filler position horizontally:
+ if $dX\gt0$ then $X := X-w$;
+%
+ [??_[StrH4]] adjust first filler vertically: $Y := Y -
+ "sdX"*L*("dY"/"dX")*w$ where $L = \textup{if} dX>0 \textup{then}
+ (1-Leftness) \textup{else} Leftness$;
+%
+ [??_[StrH3]] recompute the move dimensions ($A$ right and $B$ up):
+ $A := -"sdX"(\abs{dX} - w) / (N-1)$,
+ $B := "sdY"\abs{"sdX"(w)*"dY"/"dX" - dY} / (N-1)$,
+ and set the filler box to have $w := A$;
+%
+ [??_[StrH5]] output first filler adjusted $X,Y$ and the following $N-1$
+ each $A$ further right and raised $B$ more than the previous;
+%
+ and finally end object with usual bravour!
+
+\DOCMODE(
+\xydef@\straighth@{\setbox\z@=\hbox{%
+ \setbox8=\copy\lastobjectbox@
+ \A@=\wd8\relax \B@=\dp8\relax \advance\B@\ht8\relax %?*[StrH1]
+ \ifdim \A@=\z@ \count@@=\m@ne
+ \else \dimen@=\sd@X\d@X \divide\dimen@\A@ \count@@=\dimen@ \fi
+ \Spread@@
+ \ifdim\d@X>\z@ \advance\X@c-\wd8\relax\fi %?*[StrH2]
+ \dimen@=-\sd@X\wd8\relax %?*[StrH4]
+ \multiply\dimen@\K@dYdX \divide\dimen@\K@
+ \ifdim\d@X>\z@ \advance\Y@c\dimen@ \advance\Y@c-\Leftness@\dimen@
+ \else \advance\Y@c\Leftness@\dimen@ \fi
+ \dimen@=\wd8\relax \A@=\sd@X\d@X \advance\A@-\dimen@ %?*[StrH3]
+ \B@=\sd@X\dimen@ \multiply\B@\K@dYdX \divide\B@\K@
+ \advance\B@-\d@Y \B@=\sd@Y\B@
+ \count@=\count@@ \advance\count@\m@ne
+ \ifnum\z@<\count@ \divide\A@\count@ \divide\B@\count@ \fi
+ \A@=-\sd@X\A@ \B@=\sd@Y\B@ \wd8=\A@
+ \kern\X@c \count@=\z@ %?*[StrH5]
+ \loop@\ifnum\count@<\count@@ \advance\count@\@ne
+ \raise\Y@c\copy8\relax \advance\Y@c\B@ \repeat@}%
+ \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ {\Drop@@}}
+\DOCMODE)
+
+ The mosly vertical is analogous. \BUG: |\dimen@| holds the unadjusted
+ $h+d$ throughout -- somehow it works anyway!
+
+\DOCMODE(
+\xydef@\straightv@{\setbox\z@=\vtop{%
+ \setbox8=\copy\lastobjectbox@
+ \A@=\wd8\relax \B@=\dp8\relax \advance\B@\ht8\relax
+ \ifdim \B@=\z@ \count@@=\m@ne
+ \else \dimen@=\sd@Y\d@Y \divide\dimen@\B@ \count@@=\dimen@ \fi
+ \Spread@@
+ \dimen@=\dp8\relax \advance\dimen@\ht8\relax
+ \B@=\sd@Y\d@Y \advance\B@-\dimen@
+ \A@=\sd@Y\dimen@ \multiply\A@\K@dXdY \divide\A@\K@ \advance\A@-\d@X
+ \A@=\sd@X\A@ \count@=\count@@ \advance\count@\m@ne
+ \ifnum\z@<\count@ \divide\B@\count@ \divide\A@\count@ \fi
+ \B@=\sd@Y\B@ \A@=\sd@X\A@ \ht8=\B@ \dp8=\z@
+ \ifdim\d@Y<\z@
+ \advance\Y@c\dimen@ \advance\Y@c\Upness@\B@
+ \else
+ \advance\dimen@\Upness@\B@ \advance\Y@c-\dimen@ \advance\Y@c\B@
+ \fi
+ \advance\Y@c\B@
+ \ifdim\d@X<\z@ \else \advance\X@c-\wd8\relax \fi
+ \null \kern-\Y@c \count@=\z@
+ \loop@\ifnum\count@<\count@@ \advance\count@\@ne
+ \nointerlineskip \moveright\X@c\copy8\relax \advance\X@c\A@
+ \repeat@}%
+ \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ {\Drop@@}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+\section*{End \& log}
+
+ \Xy-pic ends with a message saying so.
+
+\DOCMODE(
+\message{ Xy-pic loaded}\xyuncatcodes \endinput
+\DOCMODE)
+
+ \Xy-pic is maintained using the RCS ``Revision Control System'' by
+ Walther F.~Tichy. The following is the revision history since the
+ first release to Usenet.
+
+\DOCMODE(
+% $Log: xy.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.5 1997/05/28 13:05:01 krisrose
+% Fixed missing breaks bug.
+%
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/05 22:20:09 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:55:12 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/11 09:31:09 kris
+% Second (bug fix) 3alpha release [corrected].
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% MAJOR REWRITE and REORGANISATION:
+% File xypic.doc split into separate files: xy.doc for `kernel' and other
+% files with the `extensions' and `features'.
+% Documented in special DOCMODE LaTeX-based format supported by xydoc.sty.
+%
+% Revision 2.6.1.1 1992/07/01 07:08:24 kris
+% Send to EuroTeX '92...
+%
+% Revision 2.6 1992/06/24 01:23:34 kris
+% Added hooks using font xyqc10.
+% Added new POSitions: * and !.
+% Added triple lines \Ssolid and \Ddashed.
+%
+% Revision 2.5 1992/02/24 03:30:54 kris
+% Fixed bugs in \Direction calculation logic...
+% Added (FACTOR) to \rotate to allow arbitrary rotation.
+% ` intermediate points now accept an optional /RADIUS argument.
+% Added \Tip with wide tip.
+% [See ChangeLog for further details].
+%
+% Revision 2.4 1992/01/22 02:15:10 kris
+% Fixed bugs [with thanks]:
+% No spurious arrow heads with LaTeX: \pit now undefined [Werner Struckmann]
+% \Solid works: sets \Density [Dave Bowen]
+% Short diagonal lines work...major rewrite of \connectv@ [Eric Domenjoud]
+%
+% Revision 2.3 1992/01/13 23:28:12 kris
+% Swapped definitions of \ddtoX and \uutoX [found by Nico Verwer].
+% Diagonal lines were wrong [Eric Domenjoud].
+%
+% Revision 2.2 1992/01/09 04:05:40 kris
+% Still problems with rules in frames and horizontal/vertical \solids. Grrr.
+%
+% Revision 2.1 1992/01/02 14:54:07 kris
+% Release version.
+%
+% Revision 1.40 1991/12/17 04:53:23 kris
+% Version distributed as `final draft' on Usenet.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% TeX-parse-self:nil
+% LaTeX-indent-level:1
+% TeX-brace-indent-level:1
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xy.sty b/Master/texmf-dist/source/generic/xypic/xy.sty
new file mode 100644
index 00000000000..32867e52f57
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xy.sty
@@ -0,0 +1,103 @@
+%% $Id: xy.sty,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+%%
+%% ``Xy-pic as LaTeX 2.09 style option and LaTeX 2e package''.
+%% Copyright (c) 1993-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+
+% Load Xy-pic with catcode of @ set as it will be in user text:
+\count255=\the\catcode`\@ {\catcode`\@=11 \xdef\xystycatcode{\the\count255}}
+\makeatletter
+
+% REPAIR bug of the 2e version of AMS-LaTeX where \makeatother is broken...
+\ifx\@ifpackageloaded\undefined \makeatother
+\else \@ifpackageloaded{amstex}{\catcode`\@=\active}{\makeatother}\fi
+
+\input xy
+
+% That is all unless this is called as a LaTeX2e `native mode' package. Is
+% there an official way to check this? Anyway, this seems to work:
+\makeatletter
+\ifx\if@compatibility\undefined \catcode`\@=\xystycatcode \endinput \fi
+
+% Ensure that we are *really* running LaTeX2e...!
+\NeedsTeXFormat{LaTeX2e}
+
+% This file provides the current version of Xy-pic!
+\edef\next{%
+ \noexpand\ProvidesPackage{xy}[\xydate\space Xy-pic version \xyversion]}\next
+
+% Recognise some standard LaTeX2e class options (cf. `LaTeX Companion' p.317):
+\DeclareOption{cmactex}{\xyoption{cmactex}}
+\DeclareOption{dvips}{\xyoption{dvips}\xyoption{ps}}
+\DeclareOption{dvitops}{\xyoption{dvitops}\xyoption{ps}}
+\DeclareOption{emtex}{\xyoption{emtex}}
+\DeclareOption{ln}{\xywarning@{`ln' DVI driver not yet fully supported}}
+\DeclareOption{oztex}{\xyoption{oztex}}
+\DeclareOption{textures}{\xyoption{textures}}
+\DeclareOption{xdvi}{\xyoption{xdvi}}
+
+% This is special:
+\DeclareOption{colour}{\xyoption{color}} % :-)
+
+% This (obsolete) cmtip style option should be activated after loading:
+\DeclareOption{cmtip}{\xyoption{cmtip}\UseComputerModernTips}
+
+% Pass the desired tip size if defined
+\DeclareOption{10pt}{\xywithoption{tips}{\def\tipsize@@{10}}}
+\DeclareOption{11pt}{\xywithoption{tips}{\def\tipsize@@{11}}}
+\DeclareOption{12pt}{\xywithoption{tips}{\def\tipsize@@{12}}}
+
+% Other options are just loaded.
+\DeclareOption*{\edef\next{\noexpand\xyoption{\CurrentOption}}\next}
+
+% Reinstall catcode of @...
+\catcode`\@=\xystycatcode
+
+% ... process the options, and that is all.
+\ProcessOptions
+
+\endinput
+
+% $Log: xy.sty,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% New for version 2.7.
diff --git a/Master/texmf-dist/source/generic/xypic/xy16textures.doc b/Master/texmf-dist/source/generic/xypic/xy16textures.doc
new file mode 100644
index 00000000000..c4a7545746f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xy16textures.doc
@@ -0,0 +1,294 @@
+%% $Id: xy16textures.doc,v 3.3 1996/12/18 14:21:23 ross Exp $
+%%
+%% Xy-pic ``Textures v1.6'' driver interface option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{16textures}{Textures v1.6 driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This driver provides support for versions 1.5b and 1.6 of Blue Sky Research's
+\Textures\ application for Macintosh\footnote{Macintosh is a trademark of
+Apple Computer Inc.}. It incorporates support for \PS\ colour and the
+\Xy-ps \PS\ back-end. This will {\em not} work with versions 1.7 and later;
+these require the <driver> option |\xyoption{textures}|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE(
+\xydef@\oldTextures@@#1{\dvimessage@{Textures v1.6}{#1}}
+
+\newdriver{%
+ \xyaddsupport{color}\oldtexturesColor@@
+ \xyaddsupport{crayon}\oldtexturesCrayon@@
+ \xyaddsupport{ps}\oldtexturesPS@@
+ \xyaddsupport{rotate}\oldtexturesRotate@@
+ \xyaddsupport{line}\oldtexturesLine@@
+ \xyaddsupport{frame}\oldtexturesFrames@@
+ \xyaddsupport{tile}\oldtexturesTiles@@
+ \xyaddsupport{cmtip}\relax
+}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Supported |\special| effects are...
+%
+\begin{itemize}
+
+\item colour, using \PS\
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Textures v1.6 cannot manage colours, except within imported graphics.
+It can put colours into the \PS\ output.
+
+\DOCMODE(
+\xydef@\oldTexturesColours@{\oldtexturesPStypes@
+ \let\xylocalColor@=\xyNoColor@@ \def\xycolor@{\xycolor@@}%
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}%
+ \installPScolor@ }\else\DN@{}\fi \next@
+ \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi
+ \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\oldtexturesCrayon@@{}}%
+ \else\let\next@=\xystandardcolors@ \fi \next@
+ \let\xycolorwarning@=\relax
+ \let\oldtexturesColor@@=\relax
+ \let\UnloadColor@@=\NooldTexturesColor@
+ }
+
+\xydef@\oldtexturesColor@@{\oldTexturesColours@}
+
+\xydef@\NooldTexturesColor@{%
+ \let\xylocalColor@=\xyNoColor@@
+ \let\xycolor@=\xyNoColor@
+ \let\xycolorwarning@=\xycolorwarning@@
+ \let\oldtexturesColor@@=\oldTexturesColours@
+ \let\UnloadColor@@=\UnloadColor@
+ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item crayon colours.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The 68 colours are those that |dvips| recognizes by name,
+thanks to Tomas Rokicki.
+
+\DOCMODE(
+\xydef@\oldtexturesCrayon@@{\oldtexturesColor@@\oldtexturesCrayon@}
+\xydef@\oldtexturesCrayon@{\installCrayolaColors@}%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \PS\ back-end.
+\DOCMODE(
+\xydef@\oldtexturesPS@@{\oldtexturesPS@}
+
+\xydef@\oldtexturesPSunload@{\UnloadPS@
+ \ifx\xyrealshipout@\undefined\else
+ \ifx\shipout\xyrealshipout@
+ \else \let\shipout=\xyrealshipout@\fi\fi
+ \let\installxyps@@=\relax
+ \let\UnloadPS@@=\UnloadPS@
+ \let\oldtexturesPS@@=\oldtexturesPS@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+We must return the binding of |\shipout| to its initial value.
+
+\medskip
+
+Early versions (1.5--1.6) of \Textures\ have two kinds of |\special|,
+for inserting \PS\ code into the dvi-file and two more for reading
+such code from a file:
+%
+\begin{itemize}
+\item |\special{rawpostscript #1}| puts code directly into the \PS\ file.
+\item |\special{postscript #1}| wraps the code within |sps|...|eps|,
+which involves graphics state changes within a |gsave/grestore| pair.
+\end{itemize}
+Each of these has a corresponding version for reading the \PS\ commands
+from a file.
+
+\DOCMODE(
+\xydef@\oldTexturesSpecial@#1{\firstPS@@\special{postscript #1}}
+\xydef@\oldTexturesMacro@#1{\special{postscript {#1}xy}}
+\xydef@\oldTexturesInclude@#1{\firstPS@@\special{rawpostscriptfile #1}}
+\xydef@\oldTexturesRaw@#1{\firstPS@@\special{rawpostscript #1}}
+
+\xydef@\oldtexturesPStypes@{%
+ \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \ifx\PSspecial@@\oldTexturesSpecial@\else
+ \let\PSspecial@@=\oldTexturesSpecial@
+ \let\PSmacro@@=\oldTexturesMacro@
+ \let\PSdict@@=\oldTexturesRaw@
+ \let\PSraw@@=\oldTexturesRaw@
+ \let\PSinclude@@=\oldTexturesInclude@
+ \let\PSspecialdict@@=\oldTexturesRaw@
+ \let\xyPSobeylines@@=\obeyoldTextureslines@
+ \oldTextures@@{PostScript}%
+ \fi
+% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \oldtexturesCurrpt@ \@PSshipout }
+
+{\catcode`\^^M=\active %
+ \gdef\next{\catcode`\^^M=\active \let^^M=\par \obeyspaces}}
+\xylet@\obeyoldTextureslines@=\next
+\DOCMODE)
+
+The |currentpoint| is defined for the ``raw'' specials.
+For Textures this is the same as |\xyPScurrpt@@@|, in |xyps-ps.doc|.
+
+\DOCMODE(
+\xydef@\oldtexturesCurrpt@{\let\xyPScurrpt@@=\oldtexturesCurrpt@@}%
+\xydef@\oldtexturesCurrpt@@{\PSspecial@@{xyi}\PSraw@@{userdict begin xyx end}}
+\DOCMODE)
+
+The \PS\ operator called |xyx| is defined in |xyps-ps| for storing the
+location placed on the stack by |xyi|.
+
+\medskip
+
+\Textures~v1.6 requires the \PS\ dictionary to be shipped-out with
+every page. To achieve this efficiently we rebind |\shipout|,
+as described in |xyps-ps.doc|. Next set the flag |\UsePSdict@@true|
+after having rebound |\includePSmessage@| to gobble the attempt to load
+the dictionary directly into the dvi-file.
+
+This installs the \PS\ backend.
+
+\DOCMODE(
+\xydef@\oldtexturesPS@{\oldtexturesPStypes@
+ \let\oldtexturesPS@@=\relax
+ \let\UnloadPS@@=\oldtexturesPSunload@
+ \let\installxyps@@=\@PSshipout \installxyps@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item rotated/scaled diagrams and text, using \PS.
+
+\DOCMODE(
+\xydef@\oldtexturesRotate@@{\oldtexturesRotate@}
+
+\xydef@\oldtexturesRotate@{\oldtexturesPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
+ \xyRotScale@@ \installPSrotscale@ }%
+ \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item variable line-widths and poly-lines, using \PS.
+\DOCMODE(
+\xydef@\oldtexturesLine@@{\oldtexturesLine@}
+
+\xydef@\oldtexturesLine@{\oldtexturesPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}%
+ \installPSline@ }%
+ \else\DN@{\xydriverfail@{line-styles are}\UnloadLine@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item extra frames and fills, using \PS.
+\DOCMODE(
+\xydef@\oldtexturesFrames@@{\oldtexturesFrames@}
+
+\xydef@\oldtexturesFrames@{\oldtexturesPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}%
+ \installPSframes@ }%
+ \else\DN@{\xydriverfail@{frames are}\UnloadPSFrames@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item patterns and tiles, using \PS.
+\DOCMODE(
+\xydef@\oldtexturesTiles@@{\oldtexturesTiles@}
+
+\xydef@\oldtexturesTiles@{\oldtexturesPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}%
+ \installPSpatterns@ \xystandardpatterns@}%
+ \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{itemize}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xy16textures.doc,v $
+% Revision 3.3 1996/12/18 14:21:23 ross
+% Ross's version
+%
+% Revision 3.3.1.1 1996/12/18 08:45:28 ross
+% *** empty log message ***
+%
+% Revision 3.2 1995/09/19 18:20:20 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\endinput
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xy17oztex.doc b/Master/texmf-dist/source/generic/xypic/xy17oztex.doc
new file mode 100644
index 00000000000..41f1f80a9c3
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xy17oztex.doc
@@ -0,0 +1,301 @@
+%% $Id: xy17oztex.doc,v 3.3 1996/12/18 14:21:23 ross Exp $
+%%
+%% Xy-pic ``OzTeX v1.7'' driver interface option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{17oztex}{OzTeX v1.7 driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This option provides the necessary interface to support the \PS\ back-end and
+other \PS\ effects when using the DVI driver of version 1.7 of \OzTeX\ by
+Andrew Trevorrow,\footnote{\OzTeX\ is a shareware implementation of \TeX\ for
+Macintosh available from many bulletin boards and ftp sites; v1.5 and earlier
+versions were freeware. Email contact: <akt@kagi.com>.} "Later versions
+of \OzTeX\ should instead use the driver option |\xyoption{oztex}|."
+Upgrading to version 1.9+ of\OzTeX\ is recommended.
+
+Does not support rotations, scaling and coloured text within diagrams and the
+\PS\ dictionary must be available in a file called |global.ps|.
+
+\NOTE: To use \Xy-pic effectively with \OzTeX\ requires changing several
+memory parameters. In particular a `Big-\TeX' is needed, along with an
+increase in the |pool_size| parameter. Explicit instructions are contained in
+the file |INSTALL.|\-|OzTeX| of the \Xy-pic distribution.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE(
+\xydef@\OzTeX@@#1{\dvimessage@{OzTeX v1.7}{#1}}
+
+\newdriver{%
+ \xyaddsupport{color}\oldoztexColor@@
+ \xyaddsupport{crayon}\oldoztexCrayon@@
+ \xyaddsupport{ps}\oldoztexPS@@
+ \xyaddsupport{rotate}\oldoztexRotate@@
+ \xyaddsupport{line}\oldoztexLine@@
+ \xyaddsupport{frame}\oldoztexFrames@@
+ \xyaddsupport{tile}\oldoztexTiles@@
+ \xyaddsupport{cmtip}\relax
+}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Supported |\special| effects are...
+%
+\begin{itemize}
+
+\item colour, using \PS, but not of font-characters.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\oldoztexColor@@{\oldOzTeXColours@}
+
+\xydef@\oldOzTeXColours@{\oldOzTeXPStypes@
+ \let\xylocalColor@=\xyNoColor@@ \def\xycolor@{\xycolor@@}%
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%\XYpredict@
+ \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}%
+ \installPScolor@ }\else\DN@{}\fi \next@
+ \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\oldOzTeXCrayon@@{}}%
+ \else\let\next@=\xystandardcolors@\fi \next@
+ \let\xycolorwarning@=\relax
+ \let\oldoztexColor@@=\relax
+ \let\UnloadColor@@=\NooldOzTeXColor@
+ }
+
+\xydef@\NooldOzTeXColor@{%
+ \let\xylocalColor@=\xyNoColor@@
+ \let\xycolor@=\xyNoColor@
+ \let\xycolorwarning@=\xycolorwarning@@
+ \let\oldoztexColor@@=\oldOzTeXColours@
+ \let\UnloadColor@@=\UnloadColor@
+ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item crayon colours, similarly restricted.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The 68 colours are those that |dvips| recognizes by name,
+thanks to Tomas Rokicki.
+
+\DOCMODE(
+\xydef@\oldOzTeXCrayon@@{\installCrayolaColors@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \PS\ back-end.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\oldoztexPS@@{\oldoztexPS@}
+
+\xydef@\oldoztexPSunload@{\UnloadPS@
+ \def\xyPSdictname{}\UsePSdict@@false
+ \let\installxyps@@=\relax
+ \let\UnloadPS@@=\UnloadPS@
+ \xyPSshapes@true
+ \let\oldoztexPS@@=\oldoztexPS@ }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\oldOzTeXSpecial@#1{\special{empty.ps {#1}xy}}
+\xydef@\oldOzTeXMacro@#1{\special{empty.ps {#1}xy}}
+\xydef@\oldOzTeXDict@#1{\special{empty.ps @obxy{#1}stopped pop @eoxy}}
+\xydef@\oldOzTeXinclude@#1{\special{#1}}
+\xydef@\oldOzTeXraw@#1{\special{empty.ps @boxy #1 @eoxy}}%
+
+\xydef@\oldOzTeXPStypes@{%
+ \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \ifx\PSspecial@@\oldOzTeXSpecial@\else
+ \let\PSspecial@@=\oldOzTeXSpecial@
+ \let\PSmacro@@=\oldOzTeXMacro@
+ \let\PSdict@@=\oldOzTeXDict@
+ \let\PSraw@@=\oldOzTeXraw@
+ \let\PSinclude@@=\oldOzTeXinclude@
+ \let\xyPSobeylines@@=\obeyoldOzTeXlines@
+ \let\PSspecialdict@@=\oldOzTeXDict@
+ \oldOzTeX@@{PostScript}%
+ \fi
+% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \oldOzTeXCurrpt@ }
+
+{\catcode`\^^M=\active %
+ \gdef\next{\catcode`\^^M=\active \let^^M=\space \obeyspaces}}
+\xylet@\obeyoldOzTeXlines@=\next
+\DOCMODE)
+
+The \PS\ operators |@boxy| and |@eoxy| are defined in |xyps-ps| for bypassing
+the mechanism used in \OzTeX\ to isolate code passed in |\special| commands.
+Although it is possible (albeit difficult) to devise \PS\ to deduce the
+current location for use with the ``raw'' specials, this information cannot
+be used to do rotations and scaling as with other <driver>s.
+Hence the value of |\xyPScurrpt@@| is taken to be empty.
+
+\DOCMODE(
+\xydef@\oldOzTeXCurrpt@{\let\xyPScurrpt@@=\OzTeXCurrpt@@}%
+\xydef@\oldOzTeXCurrpt@@{}
+\DOCMODE)
+
+\medskip
+
+This avoids dumping the dictionary into the dvi-file, making sure
+that instead it goes into a file, specified by |\xyPSdictname|,
+which defaults to |global.ps|.
+
+\DOCMODE(
+\xydef@\oldoztexPS@@{\oldOzTeXPStypes@
+ \let\installxyps@@=\old@OzTeX@PS@
+ \installxyps@ }
+
+% The parameter |#1| in this next macro is to gobble the |\dumpPSdict@|
+% which would otherwise dump the dictionary into the dvi-file. However
+% if |\xyPSdictname| is defined then this dump must occur into a file.
+%
+%\xydef@\old@OzTeX@PS@#1{%
+% \let\includePSmessage@=\xyoldOzTeXheader
+% \ifx\undefined\xyPSdictname\DN@{}%
+% \else\DN@{#1}\fi\next@ \UsePSdict@@true}
+
+\xydef@\old@OzTeX@PS@{\UsePSdict@@true
+ \let\includePSmessage@=\xyoldOzTeXheader
+ \ifx\undefined\xyPSdictname\def\xyPSdictname{global.ps}\fi}
+
+\xydef@\xyoldOzTeXheader#1#2#3{\UsePSdict@@true}
+\DOCMODE)
+
+The parameters |#1#2#3| of |\xyOzTeXheader| gobble tokens
+that are unnecessary with \OzTeX.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item variable line-widths and poly-lines, using \PS.
+\DOCMODE(
+\xydef@\oldoztexLine@@{\oldoztexLine@}
+
+\xydef@\oldoztexLine@{\oldOzTeXPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
+ \else\DN@{\xydriverfail@{line-styles are}\UnloadLine@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item extra frames and fills, using \PS.
+\DOCMODE(
+\xydef@\oldoztexFrames@@{\oldOzTeXFrames@}
+
+\xydef@\oldOzTeXFrames@{\oldOzTeXPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
+ \else\DN@{\xydriverfail@{frames are}\UnloadPSFrames@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item patterns and tiles, using \PS.
+\DOCMODE(
+\xydef@\oldoztexTiles@@{\oldOzTeXTiles@}
+
+\xydef@\oldOzTeXTiles@{\oldOzTeXPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@
+ \xystandardpatterns@ }%
+ \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item rotated/scaled diagrams and text, recognised but not supported.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+In fact \OzTeX\ cannot support rotations and scaling.
+Instead we go through all the motions of providing \PS\ support,
+then set a flag that causes a limited number of warning messages to be
+generated as requests are made for these effects.
+
+\DOCMODE(
+\xydef@\oldoztexRotate@@{\oldOzTeXRotate@}
+
+\xydef@\oldOzTeXRotate@{\oldOzTeXPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%\XYpredict@
+ \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
+ \xyRotScale@@ \installPSrotscale@ \xyPSshapes@false }%
+ \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+\end{itemize}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xy17oztex.doc,v $
+% Revision 3.3 1996/12/18 14:21:23 ross
+% Ross's version
+%
+% Revision 3.3.1.1 1996/12/18 08:47:45 ross
+% *** empty log message ***
+%
+% Revision 3.2 1995/09/19 18:20:20 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xy2cell.doc b/Master/texmf-dist/source/generic/xypic/xy2cell.doc
new file mode 100644
index 00000000000..18bab67ac1f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xy2cell.doc
@@ -0,0 +1,1839 @@
+%% $Id: xy2cell.doc,v 3.3 1996/12/18 14:21:23 ross Exp $
+%%
+%% Xy-pic ``2-cell'' feature.
+%% Copyright (c) 1993-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this macro package; if not, write to the Free Software Foundation,
+%% Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{2cell}{Two-cell feature}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+ This feature is designed to facilitate the typesetting of curved arrows,
+ either singly or in pairs, together with labels on each part and between.
+ The intended mathematical usage is for typesetting categorical ``2-cell''
+ morphisms and ``pasting diagrams'', for which special features are provided.
+ These features also allow attractive non-mathematical effects.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The 2-cell feature makes use of facilities from the `curve' extension
+ which is therefore automatically loaded.
+
+\DOCMODE(
+\xyrequire{curve}\xycatcodes
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Typesetting 2-cells in Diagrams}
+
+\noindent
+Categorical
+``2-cell'' morphisms are used in the study of tensor categories and elsewhere.
+The morphisms are displayed as a pair of curved arrows, symmetrically
+placed, together with an orientation indicated by a short broad arrow,
+or {\it Arrow}. Labels may be placed on all three components.
+
+\DOCMODE(
+\message{two-cells,}
+\DOCMODE)
+
+\UseAllTwocells
+
+\BUG: This document still uses version~2-style commmands, as described in
+appendix~??g[:v2].
+
+\xyrequire{v2}\xycatcodes
+
+\xymatrixcolsep{5pc}%
+\xymatrixrowsep{2pc}%
+
+\begin{code}
+\diagram
+A\rtwocell^f_g &B\\
+\enddiagram
+\end{code}
+$$ \docode $$
+\displaycode
+
+\begin{code}
+\diagram
+A\ruppertwocell^f{\alpha}
+ \rlowertwocell_h{\beta}
+ \rto_(.35)g & B\\
+\enddiagram
+\end{code}
+$$ \docode $$
+\displaycode
+
+These categorical diagrams frequently
+have a matrix-like layout, as with commutative diagrams.
+To facilitate this there are control sequences of the form:
+|\rtwocell| , |\ultwocell| , |\xtwocell| , \dots\
+analogous to the names defined in |xyv2| for use
+in diagrams produced using |xymatrix|.
+As this involves the definition of 21 new control sequences, many of which
+may never be used, these are not defined immediately upon loading |xy2cell|.
+Instead the user must first specify |\UseTwocells|.
+
+As in the second example above, just the upper or lower curved
+arrow may be set using control sequences of the form
+|\..uppertwocell| and |\..lowertwocell|.
+These together with the |\..compositemap| family, in which
+two abutting arrows are set with an empty object at the join,
+allow for the construction of complicated ``pasting diagrams''
+(see figure ??[f.pasting] for an example).
+
+The following initialise the families of control sequences
+for use in matrix diagrams.
+
+\begin{defs}
+ |\UseTwocells| &\quad two curves \cr
+ |\UseHalfTwocells| &\quad one curve \cr
+ |\UseCompositeMaps| &\quad 2 arrows, end-to-end \cr
+ |\UseAllTwocells| &\quad (all the above) \cr
+\end{defs}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\UseTwocells{\definesupermorphism{twocell}{%
+ \xy@{start of 2-cell}{\begingroup}%
+ \twocell@}}
+
+\xydef@\UseHalfTwocells{%
+ \definesupermorphism{uppertwocell}{%
+ \xy@{start of 2-cell}{\begingroup}%
+ \uppertwocell@}%
+ \definesupermorphism{lowertwocell}{%
+ \xy@{start of 2-cell}{\begingroup}%
+ \lowertwocell@}}
+
+\xydef@\UseCompositeMaps{\definesupermorphism{compositemap}{%
+ \xy@{start composite-map}{\begingroup}%
+ \compositemap@}}
+
+\xydef@\UseAllTwocells{%
+ \UseTwocells \UseHalfTwocells \UseCompositeMaps }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The families of connections are defined using the utility macro\dots
+%
+ |\definesupermorphism|
+%
+ which defines control sequences for morphisms between
+ neighbouring cells, and next-to-neighbouring cells.
+
+ More distant cells use |\xtwocell|, |\xcompositemap|, etc.
+ with <hop>s e.g.
+ |\xtwocell[1,3]| and |\xtwocell[llddd]|.
+
+\DOCMODE(
+\xydef@\supermorphism#1[#2]#3{\def\afterMORPHISM{[#2]#3}#1}
+\xydef@\afterMORPHISM{}
+
+\xydef@\definesupermorphism#1#2{%
+ \expandafter\def\csname x#1\endcsname{\supermorphism{#2}}%
+ \expandafter\def\csname u#1\endcsname{\supermorphism{#2}[-1,0]{}}%
+ \expandafter\def\csname d#1\endcsname{\supermorphism{#2}[1,0]{}}%
+ \expandafter\def\csname l#1\endcsname{\supermorphism{#2}[0,-1]{}}%
+ \expandafter\def\csname r#1\endcsname{\supermorphism{#2}[0,1]{}}%
+ \expandafter\def\csname uu#1\endcsname{\supermorphism{#2}[-2,0]{}}%
+ \expandafter\def\csname dd#1\endcsname{\supermorphism{#2}[2,0]{}}%
+ \expandafter\def\csname ll#1\endcsname{\supermorphism{#2}[0,-2]{}}%
+ \expandafter\def\csname rr#1\endcsname{\supermorphism{#2}[0,2]{}}%
+ \expandafter\def\csname ur#1\endcsname{\supermorphism{#2}[-1,1]{}}%
+ \expandafter\def\csname ul#1\endcsname{\supermorphism{#2}[-1,-1]{}}%
+ \expandafter\def\csname dr#1\endcsname{\supermorphism{#2}[1,1]{}}%
+ \expandafter\def\csname dl#1\endcsname{\supermorphism{#2}[1,-1]{}}%
+ \expandafter\def\csname uul#1\endcsname{\supermorphism{#2}[-2,-1]{}}%
+ \expandafter\def\csname uur#1\endcsname{\supermorphism{#2}[-2,1]{}}%
+ \expandafter\def\csname ull#1\endcsname{\supermorphism{#2}[-1,-2]{}}%
+ \expandafter\def\csname urr#1\endcsname{\supermorphism{#2}[-1,2]{}}%
+ \expandafter\def\csname ddl#1\endcsname{\supermorphism{#2}[2,-1]{}}%
+ \expandafter\def\csname ddr#1\endcsname{\supermorphism{#2}[2,1]{}}%
+ \expandafter\def\csname dll#1\endcsname{\supermorphism{#2}[1,-2]{}}%
+ \expandafter\def\csname drr#1\endcsname{\supermorphism{#2}[1,2]{}}%
+ \expandafter\def\csname uull#1\endcsname{\supermorphism{#2}[-2,-2]{}}%
+ \expandafter\def\csname uurr#1\endcsname{\supermorphism{#2}[-2,2]{}}%
+ \expandafter\def\csname ddll#1\endcsname{\supermorphism{#2}[2,-2]{}}%
+ \expandafter\def\csname ddrr#1\endcsname{\supermorphism{#2}[2,2]{}}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\bigskip
+
+Alternatively 2-cells can be set directly in \Xy-pictures without using the
+matrix feature. In this case the above commands are not needed. This is
+described in~\S??[standard].
+
+Furthermore a new directional |\dir{=>}| can be used to
+place an ``Arrow'' anywhere in a picture,
+after the direction has been established appropriately.
+It is used with all of the 2-cell types.
+
+\DOCMODE(
+\newdir{=>}{!/5pt/\dir{=}!/2.5pt/\dir{=}*!/-5pt/\dir2{>}}
+
+\xydef@\arrowobject#1{\def\Arrowobject@{#1}}
+\xydef@\Arrowobject@{\dir{=>}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%{\obeylines\long\outer\gdef\Pastingexample{%
+\begin{code}
+\xymatrixrowsep{1.5pc}
+\xymatrixcolsep{3pc}
+\diagram
+ & & \relax\rtwocell<0>^{f_3^{}\;\;}{\omit} & \relax\ddtwocell<0>{\omit}
+ \drtwocell<0>^{\;\;f_4^{}}{<3>}
+ \ddrrtwocell<\omit>{<8>}\\
+ & & & &\relax\drtwocell<0>^{\;\;f_5^{}}{\omit}\\
+A \uurrcompositemap<2>_{f_1^{}}^{f_2^{}}{<.5>}
+ \uurrlowertwocell<-6>{\omit}\relax
+ \drtwocell<0>_{g_1^{}\;}{\omit}
+ & & & \relax\urtwocell<0>{\omit}
+ & &\relax\rtwocell<0>^{f_6^{}\;}{\omit}
+ & \relax\rlowertwocell<-3>_{g_4^{}}{<-1>}
+ \rcompositemap<6>_{f_7^{}}^{f_8^{}}{\omit} & B \\
+ & \relax\urrtwocell<0>{\omit}
+ \xcompositemap[-1,4]{}<-4.5>_{g_2^{}}^{g_3^{}}{\omit}\\
+\enddiagram
+\end{code}
+
+\begin{figure*}[bt]
+$$ \docode $$
+\caption{Pasting diagram.}
+??=[f.pasting]
+\end{figure*}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Default positions:}
+
+ These set up default values for the parameters which
+ specify the position of each component
+ as well as the flags to indicate what type
+ of 2-cell is to be typeset.
+
+\begin{defs1}
+\begin{tabular}{c l}
+ |\toks6| &position of control point,
+ normal to line $\overline{pc}$ at midpoint\\
+ |\toks5| &position of central Arrow\\
+ |\toks7| &position of |^| label\\
+ |\toks8| &position of |_| label\\
+ |\toks3| &flag for number of pieces... \\
+ \quad |f| & \underline{f}ull: i.e. both curved arrows\\
+ \quad |o| & \underline{o}ne: |\uppertwocell| or |\lowertwocell|\\
+ \quad |t| & \underline{t}wo maps: |\compositemaps|\\
+\end{tabular}
+\end{defs1}
+
+\noindent
+|@| means to calculate from the value in |\toks6|, see |\tw@cell@@@|.
+
+\DOCMODE(
+\xydef@\twocell@{\toks6={3.5}\toks5={@}\toks7={@}\toks8={@}\toks3={f}%
+ \tw@cell@ }
+\xydef@\uppertwocell@{\toks6={7}\toks5={@}\toks7={@}\toks8={@}\toks3={o}%
+ \tw@cell@ }
+\xydef@\lowertwocell@{\toks6={-7}\toks5={@}\toks7={@}\toks8={@}\toks3={o}%
+ \tw@cell@ }
+\xydef@\compositemap@{\toks6={3.5}\toks5={@}\toks7={@}\toks8={@}\toks3={t}%
+ \tw@cell@ }
+\DOCMODE)
+
+ This collects together all the relevant data, and resolves the
+ default positions.
+
+\DOCMODE(
+\xydef@\tw@cell@@@{%
+ \expandafter\ifx\the\toks6\omit\relax\toks6={}\else
+%
+% default position of label on upper arrow,
+% relative to where it meets the perpendicular bisector
+%
+ \expandafter\ifx\expandafter @\the\toks7\relax\expandafter\dimen@\the\toks6\p@
+ \expandafter\if\the\toks3t\relax\dimen@=\p@
+ \else\expandafter\if\the\toks3o\divide\dimen@\tw@
+ \ifdim\dimen@<\z@ \dimen@ii-\p@ \advance\dimen@ii\dimen@
+ \dimen@=\dimen@ii \else \dimen@\p@ \fi
+ \else\dimen@\p@
+ \fi\fi
+ \edef\tmp@{\expandafter\removePT@\the\dimen@}%
+ \expandafter\toks\expandafter7\expandafter{\tmp@}\fi
+%
+% default position of label on lower arrow,
+% relative to where it meets the perpendicular bisector
+%
+ \expandafter\ifx\expandafter @\the\toks8\relax
+ \expandafter\dimen@\the\toks6\p@
+ \expandafter\if\the\toks3t\relax\dimen@\p@
+ \else\expandafter\if\the\toks3o\divide\dimen@\tw@
+ \ifdim\dimen@<\z@ \dimen@ii-\p@ \advance\dimen@ii\dimen@
+ \dimen@=\dimen@ii \else \dimen@\p@ \fi
+ \else\dimen@\p@
+ \fi\fi
+ \edef\tmp@{\expandafter\removePT@\the\dimen@}%
+ \expandafter\toks\expandafter8\expandafter{\tmp@}\fi
+%
+% default position of the Arrow, relative to midpoint
+%
+ \expandafter\ifx\expandafter @\the\toks5\relax
+ \expandafter\dimen@\the\toks6\p@
+ \expandafter\if\the\toks3o\divide\dimen@ by-4\relax
+ \else\dimen@\z@\fi
+ \edef\tmp@{\expandafter\removePT@\the\dimen@}%
+ \expandafter\toks\expandafter5\expandafter{\tmp@}\fi
+ \fi
+%
+% possible modifications for module maps
+%
+ \twocellmod@
+%
+% pass all the parameters to |\twocell@@@@|
+%
+ \expandafter\if\the\toks3t\relax
+%
+% composed maps: ^ : first map _ : second map
+%
+ \edef\tmp@{.[\noexpand\twocell@@@@{\the\toks6}{\the\toks5}%
+ {\the\toks7}{\the\toks8}{\the\toks3}%
+ {\the\toks2}{\the\toks1}{\the\toks@}{\the\toks4}!!!].\afterMORPHISM}%
+ \else
+%
+% curved arrow(s)
+%
+ \edef\tmp@{.[\noexpand\twocell@@@@{\the\toks6}{\the\toks5}%
+ {\the\toks7}{\the\toks8}{\the\toks3}%
+ {\the\toks1}{\the\toks2}{\the\toks@}{\the\toks4}!!!].\afterMORPHISM}%
+ \fi
+ \toks@={\endgroup}%
+ \expandafter\def\expandafter\next@\expandafter{%
+ \expandafter\def\expandafter\twocellhead@\expandafter{\twocellhead@}}%
+ \expandafter\addtotoks@\expandafter{\next@}%
+ \expandafter\def\expandafter\next@\expandafter{%
+ \expandafter\def\expandafter\twocelltail@\expandafter{\twocelltail@}}%
+ \expandafter\addtotoks@\expandafter{\next@}%
+ \expandafter\addtotoks@\expandafter{\expandafter\twocellPATH\tmp@}%
+ \the\toks@ }%
+\DOCMODE)
+
+ See below for the possible forms of |\twocellPATH|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Labels are placed labels on the upper and lower arrows,
+more correctly `anti-clockwise' and `clockwise', using |^| and |_|.
+These are entirely optional with the following token, or grouping, giving
+the contents of the label. When used with
+|\..compositemap| the |^| and |_| specify
+labels for the first and second arrows, respectively.
+
+\DOCMODE(
+\xydef@\twocellstyle{\scriptstyle}
+
+\xydef@\droptwocelllabel@#1{\xyFN@\droptwocelllabel@@#1@!}
+\xydef@\droptwocelllabel@@{%
+ \ifx*\next\DN@*{\droptwocelldrop@}%
+ \else\DN@##1@!{\droptwocelltext@{##1}}%
+ \fi \next@ }
+
+{\xyuncatcodes \gdef\next#1{\drop+!C{\twocellstyle #1}}}
+\xylet@\droptwocelltext@=\next
+
+\xydef@\droptwocelldrop@#1@!{\bgroup \let\xy@=\oxy@
+ \let\objectstyle=\twocellstyle \drop#1{}%
+ \edef\tmp@{\egroup \X@min=\the\X@min \X@max=\the\X@max
+ \Y@min=\the\Y@min \Y@max=\the\Y@max}\tmp@ }
+\DOCMODE)
+
+Normally the label is balanced text, set
+in \TeX's math mode, with |\twocellstyle| setting the style.
+The default definition is given by \dots
+
+|\def\twocellstyle{\scriptstyle}|
+
+\noindent
+This can be altered using |\def| in versions of \TeX\
+or |\redefine| in \LaTeX.
+However labels are not restricted to being simply text boxes.
+Any effect obtainable using the \Xy-pic kernel language can be set
+within an |\xybox| and used as a label. Alternatively if the first
+character in the label is |*| then the label is set as an
+\Xy-pic <object>, as if with |\drop<object>| or |*<object>| in
+the kernel language. The current direction is tangential to
+the curved arrows. Extra braces are needed to get a |*| as the label,
+as in |^{{{*}}}| or |_{{}*}|.
+
+The position of a label normal to the tangential direction
+can also be altered by {\em nudging} (see below).
+Although it is possible to specify multiple labels,
+only the last usage of each of |^| and |_| is actually set,
+previous specifications being ignored.
+
+Similarly a label for the central Arrow must be given,
+after the other labels, by enclosing it within braces |{...}|.
+An empty group |{}| gives an empty label; this is necessary
+to avoid misinterpretation of subsequent tokens. As above if the
+first character is |*| then the label is set as an \XY-pic <object>,
+the current direction being along the Arrow.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Parsing:}
+
+ Open a new group so the following registers can be used locally...
+ |\toks@=\toks0|, |\toks1|, ..., |\toks8|
+ the final parameter set is stored briefly in |\tmp@| before being used.
+
+ OPTIONS:
+\begin{defs1}
+\begin{tabular}{c c l}
+ && spaces are ignored \\
+ |<| & |<num>| &determines position of curves control point\\
+ & |<0>| &uses a single solid line,\\
+ & |<\omit>| &causes only the central Arrow (with label) to be set\\
+\noalign{\smallskip}
+ |\omit| &&omits the curved arrows, but allows their labels\\
+ |^| &&place ``above'' label (more correctly ``anti-clockwise'')\\
+ |_| &&place ``below'' label (more correctly ``clockwise'')\\
+ |~'| &&change the arrowhead \\
+ |~`| &&place/change the arrowtail\\
+\end{tabular}
+\end{defs1}
+
+ Label data e.g. |^{#1}| |_{#1}|
+ is stored temporarily in |\toks@| then passed via |\tw@@cell@@|
+ to |\tw@cell@@| for further parsing, as: |\the\toks@ @|
+
+ |~'| and |~`| change the values of |\twocellhead@| and |\twocelltail@|
+ Normally |\twocelltail@| is |{}|, so |~`| also changes a flag to
+ indicate that |\twocelltail@| is indeed required.
+
+ When the next token is a grouping |{...}|
+ then it gives the label for the central Arrow.
+ No other label specifications may follow.
+
+
+ Default head and tail ornaments...
+
+\DOCMODE(
+\xydef@\twocellhead#1{\def\twocellhead@{#1}}
+\xydef@\twocelltail#1{\def\twocelltail@{#1}}
+\xydef@\twocellhead@{\dir{>}}
+\xydef@\twocelltail@{}
+\DOCMODE)
+
+ clear |\toks..| registers for the new connection labels.
+
+\DOCMODE(
+\xywarnifdefined\twocellmod@
+\xydef@\tw@cell@{\begingroup
+ \toks@={{}}\toks1={{}}\toks2={{}}\toks4={{}}%
+ \def\twocellmod@{}\xyFN@\tw@@cell@}%
+
+\xydef@\tw@@cell@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\tw@@cell@}%
+ \else\ifx\bgroup\next \let\next@=\toks@\afterassignment\tw@@cell@@
+ \else\ifx ^\next \DN@^##1{\toks@={##1}\nudgepos@71\tw@@cell@}%
+ \else\ifx _\next \DN@_##1{\toks@={##1}\nudgepos@82\tw@@cell@}%
+ \else\addLT@\ifx \next \addGT@{\addLT@\DN@##1}{%
+ \toks6={##1}\ifx\omit##1\relax\toks3={t}\toks5={0}\fi\xyFN@\tw@@cell@}%
+ \else\ifx\omit\next \DN@\omit{\omitarrows@\xyFN@\tw@@cell@}%
+ \else\ifx~\next \DN@~{\xyFN@\whichCurveObject@}%
+ \else \DN@{\xyFN@\tw@cell@@\empty @}%
+ \fi\fi\fi\fi\fi\fi\fi%
+ \next@ }
+
+\xydef@\whichCurveObject@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\whichCurveObject@}%
+ \else\ifx\next^\DN@^##1{\xy@{~^{##1}}{\uppercurveobject{##1}}\xyFN@\tw@@cell@}%
+ \else\ifx\next_\DN@_##1{\xy@{~_{##1}}{\lowercurveobject{##1}}\xyFN@\tw@@cell@}%
+ \else\addRQ@\ifx\next \addRQ@\DN@##1{%
+ \xy@{~'{##1}}{\def\twocellhead@{##1}}\xyFN@\tw@@cell@}%
+ \else\addLQ@\ifx\next \addLQ@\DN@##1{%
+ \xy@{~`{##1}}{\def\twocelltail@{##1}}\xyFN@\tw@@cell@}%
+ \else\ifx!\next \DN@!{\xyFN@\checkmodmap@}%
+ \else\ifx\next\bgroup\DN@##1{\xy@{~{##1}}{\curveobject{##1}}\xyFN@\tw@@cell@}%
+ \else\DN@##1{\xy@{~##1}{\curveobject{##1}}\xyFN@\tw@@cell@}%
+ \fi\fi\fi\fi \fi\fi\fi
+ \next@ }
+
+\xydef@\checkmodmap@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\checkmodmap@}%
+ \else \def\twocellmod@{\modmap@}%
+ \ifx\next!\DN@!##1{%
+ \xy@{~!!{##1}}{\def\modmapobject@{##1}}\xyFN@\tw@@cell@}%
+ \else \DN@{\xyFN@\tw@@cell@}\fi
+ \fi \next@ }
+\DOCMODE)
+
+ With no arrows, still allow labels:
+ default positions are at $0$, $+X$, $-X$, with $X=${\em default value}.
+ These values are altered by ``nudging''.
+
+\DOCMODE(
+\xydef@\omitarrows@{\toks5={0}\toks6={}\toks7={0}\toks8={0}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{figure*}[tp]
+\begin{syntax}
+%
+<twocell>
+ &\iss & <2-cell><switches><Arrow>
+ & typeset <2-cell> with the <switches> and <Arrow>
+\cr
+\noalign{\smallskip}
+%
+<2-cell> &\iss & |\..twocell|
+ & typeset two curved arrows
+\cr
+ &\orr & |\..uppertwocell|
+ & typeset upper curved arrow only
+\cr
+ &\orr & |\..lowertwocell|
+ & typeset lower curved arrow only
+\cr
+ &\orr & |\..compositemap|
+ & use consecutive straight arrows
+\cr
+\noalign{\smallskip}
+%
+<Arrow> &\iss & |{|<tok><text>|}|
+ & specifies orientation and label
+\cr
+ &\orr & |{|<nudge><text>|}|
+ & adjust position, use default orientation
+\cr
+ &\orr & |{|<text>|}|
+ & use default position and orientation
+\cr
+ &\orr & |{|<tok>*<object>|}|
+ & use <object> as the label
+\cr
+ &\orr & |{|<nudge>*<object>|}| \orr |{|*<object>|}|
+\cr
+\noalign{\smallskip}
+%
+<tok> &\iss & |^| \orr |_| \orr |=|
+ & oriented anti-/clockwise/equality
+\cr
+ &\orr & |\omit|
+ & no Arrow, default is clockwise
+\cr
+ &\orr & |`| \orr |'| \orr |"| \orr |!|
+ & no Arrow; tips on two curved arrows as:\\
+ anti-/clockwise/double-headed/none
+\cr
+\noalign{\smallskip}
+%
+<switches> &\iss & <switch><switches>
+ & list of optional modifications
+\cr
+\noalign{\smallskip}
+%
+<switch> &\iss & <empty>
+ & use defaults
+\cr
+%
+ &\orr & |^| <label>
+ & place <label> on the upper arrow
+\cr
+ &\orr & |_| <label>
+ & place <label> on the lower arrow
+\cr
+ &\orr & <nudge>
+ & set the curvature, based on <nudge> value
+\cr
+ &\orr & |\omit|
+ & do not set the curved arrows
+\cr
+ &\orr & \ |!|
+ & place |\modmapobject| midway along arrows
+\cr
+ &\orr & |~| <what> |{| <object> |}|
+ & use <object> in place specified by <what>
+\cr
+\noalign{\smallskip}
+%
+<what> &\iss & <empty>
+ & set curves using the specified <object>
+\cr
+ &\orr & |^| \orr |_|
+ & use <object> with upper/lower curve
+\cr
+ &\orr & |`| \orr |'|
+ & use <object> for arrow head/tail
+\cr
+%
+\noalign{\medskip}
+%
+<label> &\iss & <text>\ \orr\ <nudge> <text>
+ & set <text>, displaced by <nudge>
+\cr
+ &\orr & *<object>\ \orr\ <nudge>*<object>
+ & set <object>, displaced by <nudge>
+\cr
+\noalign{\smallskip}
+%
+<nudge> &\iss & |<|<number>|>| & use <number> in an appropriate way,
+ \eg, to position object or label along a fixed axis
+\cr
+ &\orr & |<\omit>| & do not typeset the object/label
+\cr
+%
+\end{syntax}
+\caption{\protect<twocell\protect>s}
+??=[f.twocell]
+\end{figure*}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Standard Options}??=[Arrow]
+The orientation of the central Arrow may be reversed,
+turned into an equality, or omitted altogether.
+In each case a label may still be specified, so in effect the
+Arrow may be replaced by anything at all.
+
+These effects are specified by the first token in the central label,
+which thus has the form: |{|<tok><label>|}|
+where <tok> may be one of \dots
+
+\begin{defs1}
+\begin{tabular}{ c l }
+ |_| & Arrow points clockwise \cr
+ |^| & Arrow points anti-clockwise \cr
+ |=| & no tip, denotes equality \cr
+|\omit|& no Arrow at all. \cr
+\end{tabular}
+\end{defs1}
+
+\noindent
+When none of these occurs then the default of |_| is assumed.
+If the label itself starts with one of these characters then
+specify |_| explicitly, or enclose the label within a group |{...}|.
+See {\em Extra Options~1}, for more values of <tok>.
+Also note that |*| has a special role when used as the first character;
+however it is considered to be part of the <label>, see above.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ OPTIONS for the central Arrow:
+
+\begin{defs}{c l}
+ & ignore spaces\cr
+ |^| & points anti-clockwise\cr
+ |_| & points clockwise (default)\cr
+ |=| & no |\Tip|, equality\cr
+ |\omit|& no Arrow at all, just squine(s) or composed arrows\cr
+ |'| & no Arrow, opposite squine reversed\cr
+ |`| & no Arrow, forward squine reversed\cr
+ |"| & no Arrow, tips on both ends\cr
+ |!| & no Arrow, no tips on squines\cr
+\end{defs}
+
+ the position of the Arrow is determined by ``nudging'' (see below)
+ e.g.
+ |{^<num>label}|, where the actual dimen is |<num>\xydashl@|
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{code}
+\xymatrixcolsep{4pc}
+\xymatrixrowsep{1pc}
+\diagram
+A \rtwocell{_\alpha} & B \rtwocell{^\beta} &
+C \rtwocell{=\gamma} & D \rtwocell{\omit\Psi} & E \\
+\enddiagram
+\end{code}
+$$ \docode $$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph{Parsing of the Arrow's label}
+
+\DOCMODE(
+\xydef@\tw@@cell@@{\expandafter\xyFN@\expandafter\tw@cell@@\the\toks@ @}
+
+\xydef@\tw@cell@@{\ifx \space@\next\expandafter\DN@\space{\xyFN@\tw@cell@@}%
+ \else\ifx ^\next
+ \DN@^##1@{\toks@={##1}\toks4={^}\nudgepos@50\tw@cell@@@}%
+ \else\addEQ@\ifx\next
+ \addEQ@\DN@##1@{\toks@={##1}\toks4={=}\nudgepos@50\tw@cell@@@}%
+ \else\ifx _\next
+ \DN@_##1@{\toks@={##1}\toks4={_}\nudgepos@50\tw@cell@@@}%
+ \else\addLT@\ifx \next
+ \DN@##1@{\toks@={##1}\toks4={_}\nudgepos@50\tw@cell@@@}%
+ \else\ifx\omit\next \DN@\omit##1@{\toks4={@}\toks@={##1}\tw@cell@@@}%
+ \else\addRQ@\ifx\next \addRQ@\DN@##1@{\toks4={@}\toks3={/}\toks@={##1}%
+ \nudgepos@50\tw@cell@@@}%
+ \else\addLQ@\ifx\next \addLQ@\DN@##1@{\toks4={@}\toks3={b}\toks@={##1}%
+ \nudgepos@50\tw@cell@@@}%
+ \else\ifx"\next \DN@"##1@{\toks4={@}\toks3={B}\toks@={##1}%
+ \nudgepos@50\tw@cell@@@}%
+ \else\ifx!\next \DN@!##1@{\toks4={@}\toks3={@}\toks@={##1}%
+ \nudgepos@50\tw@cell@@@}%
+ \else\ifx\next\empty\DN@##1@{\toks@={{}}\toks4={_}\tw@cell@@@}%
+ \else\DN@##1@{\toks@={##1}\toks4={_}\tw@cell@@@}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Nudging}
+Positions of all labels may be adjusted,
+as can the amount of curvature for the curved arrows.
+The way this is done is by specifying a ``nudge'' factor <num>
+at the beginning of the label.
+Here <num> is a number which specifies the actual position of the label
+in units of |\xydashl@| (the length of a single dash, normally 5pt)
+except with |\..compositemap|, see below.
+Movement is constrained to the perpendicular bisector
+of the line $\overline{cp}$.
+When nudging the label for the central Arrow
+it is the whole Arrow which is moved, along with its label.
+
+Curvature of the arrows themselves is altered by
+a nudge of the form |\..twocell|<num>....
+The separation of the arrows, along the bisector,
+is set to be <num>|\xydashl@|.
+When <num> is zero, that is |\..twocell<0>...|,
+the result is a single straight arrow,
+its mid-point being the origin for nudging labels.
+A negative value for <num> is also acceptable;
+but check the orientation on the Arrow
+and which of |^| and |_| correspond to which component.
+
+The origin for nudging labels is where the arrow
+crosses the bisector. Positive nudges move
+the label outwards while negative nudges move towards $\overline{pc}$
+and possibly beyond.
+The default position of a label is on the outside, with edge at the origin.
+
+The origin for nudging the Arrow is at the midpoint of $\overline{pc}$.
+A positive nudge moves in the clockwise direction.
+This will be the direction of the arrowhead,
+unless it has been reversed using |^|.
+
+\smallskip
+
+Labels on a |\..compositemap| are placed relative to the midpoint
+of the component arrows. Nudges are in units of 1pt.
+Movement is in the usual \Xy-pic {\em above} and {\em below} directions,
+such that a positive nudge is always outside the triangle formed
+by the arrows and line $\overline{pc}$.
+
+\medskip
+
+The special nudge value |<\omit>| typesets just the Arrow,
+omitting the curved arrows entirely.
+When used with labels, the nudge value |<\omit>| causes the following label
+to be ignored.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{exercise}
+Give code to typeset figure ??[f.pasting].
+
+\noindent
+Such code is relatively straight-forward, using ``nudging''
+and |\omit| to help position the arrows, curves and Arrows.
+It also uses an {\em excursion},
+as described below in the subsection {\em Extra Options~3}.
+
+% code from the earlier ``Pasting diagram'' example.
+%\Pastingexample\gdef\Pastingexample{}%
+%
+\begin{code}
+\xymatrixrowsep{1.5pc}
+\xymatrixcolsep{3pc}
+\diagram
+ &&\relax\rtwocell<0>^{f_3^{}\;\;}{\omit}
+ &\relax\ddtwocell<0>{\omit}
+ \drtwocell<0>^{\;\;f_4^{}}{<3>}
+ \ddrrtwocell<\omit>{<8>}\\
+&&&&\relax\drtwocell<0>^{\;\;f_5^{}}{\omit}\\
+A \uurrlowertwocell<-6>{\omit}\relax
+\uurrcompositemap<2>_{f_1^{}}^{f_2^{}}{<.5>}
+ \drtwocell<0>_{g_1^{}\;}{\omit}
+ &&&\relax\urtwocell<0>{\omit}
+ &&\relax\rtwocell<0>^{f_6^{}\;}{\omit}
+ &\relax\rlowertwocell<-3>_{g_4^{}}{<-1>}
+ \rcompositemap<6>_{f_7^{}}^{f_8^{}}{\omit}
+ & B \\
+ &\relax\urrtwocell<0>{\omit}
+ \xcompositemap[-1,4]{}%
+ <-4.5>_{g_2^{}}^{g_3^{}}{\omit}\\
+\enddiagram
+\end{code}
+
+\answertext{Here is the code used to typeset the {\em pasting diagram} in
+figure~??g[xy2cell.doc:f.pasting].}
+\answercode
+\answertext\displaycode
+
+\answertext{\smallskip\noindent
+For the straight arrows, it would have been simpler to use |\..to|
+provided |xyarrow| has been loaded. Instead |\..twocell<0>...{\omit}|
+was used to illustrate the versatility of nudging and |\omit|;
+thus |xy2cell| can completely handle a wide range of diagrams,
+without requiring |xyarrow|. Note also the use of |\relax| at the start
+of each new cell, to avoid premature expansion of a complicated macro,
+which can upset the compiling mechanism.}
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph{NUDGE } position of labels
+
+\DOCMODE(
+\xywarnifdefined\whichnudge
+\xywarnifdefined\whichinfo
+\xywarnifdefined\afternudge
+\xydef@\nudgepos@#1#2#3{\def\whichnudge{\toks#1}\def\whichinfo{\toks#2}%
+ \def\afternudge{#3}\expandafter\xyFN@\expandafter\nudgepos@@\the\toks@ @}
+\DOCMODE)
+
+\begin{defs1}
+\begin{tabular}{c l}
+ |#1| & which token register to store nudge amount\cr
+ |#2| & which token register to store label\cr
+ |#3| & what to do next, after parsing \cr
+\end{tabular}
+\end{defs1}
+
+\paragraph{Parsing: }
+%
+ <num><label>|@|, <num> = nudge amount, as multiple of |\xydashl@|.
+
+\DOCMODE(
+\xydef@\nudgepos@@{\ifx \space@\next\expandafter\DN@\space{\xyFN@\nudgepos@}%
+ \else\addLT@\ifx \next
+ \addGT@{\addLT@\DN@##1}##2@{%
+ \ifx\omit##1\relax\whichnudge={0}\whichinfo={}%
+ \else\whichnudge={##1}\whichinfo={##2}\fi\xyFN@\afternudge}%
+ \else \DN@##1@{\whichinfo={##1}\xyFN@\afternudge}%
+ \fi\fi \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Extra Options}
+The following features are useful in non-mathematical applications.
+
+\subsubsection*{1. no Arrow}
+This is determined by special values for <tok> as the
+first (or only) character in the central label, as in the above
+description of the standard switches.
+
+\begin{defs1}
+\begin{tabular}{c l}
+ |'| & arrowheads pointing clockwise;\cr
+ |`| & arrowheads pointing anti-clockwise;\cr
+ |"| & arrow tips on both ends;\cr
+ |!| & no tips at all.\cr
+\end{tabular}
+\end{defs1}
+
+\noindent
+The central Arrow is omitted, leaving symmetrically placed
+curved connections with arrowheads at the specified ends.
+A label can be placed where the Arrow would have been.
+
+If a special arrowhead is specified using |~'{..}|
+(see Extra Options~2, below)
+then this will be used instead of the standard |\dir{>}|.
+
+\ifx\undefined\mathbf\def\mathbf{\boldmath}\fi
+\begin{code}
+\xymatrixcolsep{5pc}
+\diagram
+ \relax\txt{Clouds }\rtwocell<10>
+ _{\hbox{\tiny evaporation }}
+ ^{\hbox{\tiny precipitation }}
+{'{\mathbf{H_2 O}}}
+&\relax\txt{Oceans}\\
+\enddiagram
+\end{code}
+$$ \docode $$
+\displaycode
+
+\begin{code}
+\xymatrixcolsep{5pc}
+\diagram
+\relax\txt{\llap{Math}ematics }\rtwocell
+_{\hbox{\tiny experiment }}
+^{\hbox{\tiny theory }}{"}
+& \relax\txt{Physics} \\
+\enddiagram
+\end{code}
+$$ \docode $$
+\displaycode
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{2. Changing Tips and Module Maps }
+The following commands are provided for specifying the <object>
+to be used when typesetting various parts of the twocells.
+
+\medskip
+\noindent
+\begin{tabular}{l c}
+\noalign{\hrule}
+\noalign{\smallskip}
+{\em command} \hfill & {\em default} \cr
+\noalign{\smallskip}
+\noalign{\hrule}
+\noalign{\smallskip}
+ |\modmapobject{|<object>|}| & |\dir{|$\vert$|}| \cr
+ |\twocellhead{|<object>|}| & |\dir{>}| \cr
+ |\twocelltail{|<object>|}| & |\dir{}| \cr
+ |\arrowobject{|<object>|}| & |\dir{=>}| \cr
+\noalign{\smallskip}
+ |\curveobject{|<object>|}| & \cr
+ |\uppercurveobject{|<object>|}| & |{}| \cr
+ |\lowercurveobject{|<object>|}| & |{}| \cr
+\noalign{\smallskip}
+\noalign{\hrule}
+\end{tabular}
+\medskip
+
+
+These commands set the object to be used for all subsequent
+2-cells at the same level of \TeX\ grouping.
+|\curveobject| specifies both of the upper- and lower-curve objects.
+For some of these there is also a way to change the object for the
+current 2-cell only.
+This requires a |~|-<switch> which is described below,
+except for the |\..curveobject| types, which are discussed in
+{\em Extra Options~4}.
+
+\medskip
+
+These effects are specified by placing switches
+after the |\..twocell| control sequence,
+\eg\ |\rtwocell| {\em switches\/} {\em labels\/}\dots~.
+Each switch is either a single token <tok>, or a
+|~|<tok> with a single argument: |~|<tok>|{|{\em arg\/}|}|.
+Possibilities are listed in the following table,
+in which |{..}| denotes the need for an argument.
+
+\begin{defs1}
+\begin{tabular}{c l}
+ |\omit| & no arrows, Arrow and label only;\cr
+ |!| & place module-map indicator;\cr
+|~'{..}| & change arrow-head to |{..}|;\cr
+|~`{..}| & place/change tail on arrow(s);\cr
+|~{..}| & change object used to set curves;\cr
+|~^{..}| & use object |{..}| to set upper curve;\cr
+|~_{..}| & use object |{..}| to set lower curve;\cr
+\end{tabular}
+\end{defs1}
+
+\noindent
+Here we discuss the use of |!|, |~'|, |~`| and |\omit|.
+The description of |~^|, |~_| and |~{..}| is given in {\em Extra Options~4}.
+
+\medskip
+The default module map indicator places a single
+dash crossing the arrow at right-angles,
+located roughly midway along the actual printed portion of the arrow,
+whether curved or straight.
+This takes into account the sizes of the objects being connected,
+thereby giving an aesthetic result when these sizes differ markedly.
+This also works with |\..compositemap| where an indicator is placed
+on each arrow. The actual object can be changed using |\modmapobject|.
+
+\medskip
+Any of the standard \Xy-pic tips may be used for arrow-heads.
+This is done using |~'{..}|,
+for example |~'{\dir{>>}}| gives double-headed arrows.
+Similarly |~`{..}| can be used to place an arrow-tail.
+Normally the arrow-tail is {}, so is not placed;
+but if a non-empty tail has been specified then it will
+be placed, using |\drop|.
+No guarantee is offered for the desired result being obtained
+when an arrow-tail is mixed with the features of {\em Extra Options~1}.
+
+\begin{code}
+\modmapobject{\objectbox{\otimes}}
+\xymatrixcolsep{5pc}
+\diagram
+P\rtwocell~!~'{\dir{>>}}~`{\dir{|}}
+ ^{<1.5>M}_{<1.5>M'}{=f} & S \\
+\enddiagram
+\end{code}
+$$ \docode $$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ switch for module maps...
+ ...places decoration called |\modmapobject| half way along arrows
+
+\DOCMODE(
+\xydef@\modmap@{%
+ \expandafter\ifx\the\toks4@\toks4={!}%
+ \else\expandafter\ifx\the\toks4=\toks4={H}%
+ \else\expandafter\ifx\the\toks4^\toks4={A}%
+ \else\expandafter\ifx\the\toks4_\toks4={V}\fi\fi\fi\fi
+ \expandafter\DN@\expandafter{\the\toks6}%
+ \ifx\next@\empty\relax\else\expandafter\moddefs@\fi}
+\DOCMODE)
+
+ also adjust curvature and label positions
+
+\DOCMODE(
+\xydef@\moddefs@{%
+ \expandafter\dimen@\the\toks6\p@
+ \ifdim\dimen@=\z@\relax
+ \expandafter\dimen@\the\toks7\p@
+ \ifdim\dimen@<\z@\advance\dimen@.5\p@\else\advance\dimen@-.5\p@\fi
+ \edef\tmp@{\noexpand\toks7={\expandafter\removePT@\the\dimen@}}\tmp@
+ \expandafter\dimen@\the\toks8\p@
+ \ifdim\dimen@<\z@\advance\dimen@-.5\p@\else\advance\dimen@.5\p@\fi
+ \expandafter\ifx\the\toks3t\advance\dimen@-1\p@\fi
+ \edef\tmp@{\noexpand\toks8={\expandafter\removePT@\the\dimen@}}\tmp@
+ \else
+ \ifdim\dimen@<\z@\advance\dimen@-.5\p@\else\advance\dimen@.5\p@\fi
+ \edef\tmp@{\noexpand\toks6={\expandafter\removePT@\the\dimen@}}\tmp@
+% \expandafter\dimen@\the\toks5\p@
+% \ifdim\dimen@<\z@\advance\dimen@-.5\p@\else\advance\dimen@.5\p@\fi
+% \edef\tmp@{\noexpand\toks5={\expandafter\removePT@\the\dimen@}}\tmp@
+ \expandafter\dimen@\the\toks7\p@
+ \ifdim\dimen@<\z@\advance\dimen@-.5\p@\else\advance\dimen@.5\p@\fi
+ \expandafter\ifx\the\toks3t\advance\dimen@-2\p@\fi
+ \edef\tmp@{\noexpand\toks7={\expandafter\removePT@\the\dimen@}}\tmp@
+ \expandafter\dimen@\the\toks8\p@
+ \ifdim\dimen@<\z@\advance\dimen@-.5\p@\else\advance\dimen@.5\p@\fi
+ \expandafter\ifx\the\toks3t\advance\dimen@-2\p@\fi
+ \edef\tmp@{\noexpand\toks8={\expandafter\removePT@\the\dimen@}}\tmp@
+ \fi }%
+
+%\def\moddefs@{}
+\DOCMODE)
+
+ default object is |\stop|, user can change this with |\modmapobject#1|
+
+\DOCMODE(
+\xydef@\modmapobject#1{\def\modmapobject@{#1}}
+\xydef@\modmapobject@{\dir{|}}
+\xydef@\@modmapobject@{{\if\@mod@\relax\expandafter\empty
+ \else\expandafter\modmapobject@\fi}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{3. Excursions}
+Syntax for |\xcompositemap| and |\x..twocell| types
+is a little different to
+what might be expected from that for |\xto|, |\xline|, etc.
+For example,
+%
+\begin{defs1}
+|\xtwocell[|<hop>|]{|<displace>|}...|
+\end{defs1}
+%
+\noindent
+connects to the <pos> displaced by <displace> from
+the relative cell location specified by <hop>.
+The displacement can be any string of valid \Xy-pic commands,
+but they must be enclosed within a group |{...}|.
+When the cell location is the target,
+a~null grouping |{}| {\em must} be given.
+
+When used with the |<\omit>| nudge, such excursions allow a labelled Arrow
+to be placed anywhere within an \Xy-pic diagram;
+furthermore the Arrow can be oriented to point in any direction.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\curveobject#1{\def\ucurveObject@{~*#1}\def\dcurveObject@{~*#1}}
+\xydef@\uppercurveobject#1{\def\ucurveObject@{~*#1}}
+\xydef@\lowercurveobject#1{\def\dcurveObject@{~*#1}}
+\xydef@\ucurveObject@{}
+\xydef@\dcurveObject@{}
+\DOCMODE)
+
+The empty object gives the default of closely spaced tiny dots,
+resulting in a ``smooth'' curve.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The following macro is used in conjunction with compiling diagrams,
+to include the global parameters in the compiled file.
+
+\DOCMODE(
+\xydef@\savetwocellobjects{%
+ \xy@{twocell objects}{%
+ \expandafter\uppercurveobject\expandafter{\ucurveObject@}%
+ \expandafter\lowercurveobject\expandafter{\dcurveObject@}%
+ \expandafter\modmapobject\expandafter{\modmapobject@}%
+ \expandafter\twocellhead\expandafter{\twocellhead@}%
+ \expandafter\twocelltail\expandafter{\twocelltail@}%
+ \expandafter\arrowobject\expandafter{Arrowobject@}%
+ }}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{4. Fancy curves}
+By specifying |\curveobject| an arbitrary object may be used to
+construct the curved arrows. Indeed with a
+|\..twocell| different objects can be used with
+the upper and lower curves by specifying
+|\uppercurveobject| and |\lowercurveobject|.
+
+These specifications apply to all 2-cells subsequently constructed at
+the same level of \TeX\ grouping.
+Alternatively using a |~|-switch, as in {\em Extra Options~2},
+allows such a specification for a single 2-cell or curved part.
+
+Objects used to construct curves can be of two types.
+Either a single <object> is set once, with copies placed along the curve.
+Alternatively a directional object can be aligned with
+the tangent along the curve. In this case use a specification takes the
+form:
+
+|\curveobject{|<spacer>|~**|<object>|}|.
+
+\noindent
+Here <spacer> may be any <object> of non-zero size.
+Typically it is empty space, \eg\ |+|<dimen>|{}|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{exercise}
+Give code to typeset the following diagrams.
+
+\begin{code}
+{\uppercurveobject{{?}}
+ \lowercurveobject{{\circ}}
+\xymatrixcolsep{5pc}
+\xymatrixrowsep{2pc}
+\diagram
+ \relax\txt{ FUn }\rtwocell<8>{!\&}
+ & \relax\txt{ gaMES }
+ \enddiagram}
+\end{code}
+$$\docode$$
+
+\answertext{Here is the code
+used by the author to set the first diagram.}
+\answercode
+\answertext\displaycode
+
+\begin{code}
+\xymatrixcolsep{2.5pc}
+\xymatrixrowsep{4pc}
+\diagram
+ \relax\txt<1.5cm>{\bf Ground State}
+ \rrtwocell<12>~^{+{}~**!/-2.5pt/\dir{>}}
+ ~_{++{}~**!/5pt/\dir{<<}}
+ ^{<1.5>\txt{\small continuous power}}
+ _{<1.5>\txt{\small pulsed emission}}{!}
+& \relax\;\; N\!i\,C\!d\;\; \Circled
+& \relax\txt<1.50cm>{\bf Excited State}
+\enddiagram
+\end{code}
+$$\docode$$
+
+\answertext{Here is the code
+used for the second diagram.}
+\answercode
+\answertext\displaycode
+
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{After Parsing...}
+
+ Values for |\twocellPATH|, depends on the mode of picture/diagram
+ as to whether the |@c| and |@p| are known yet, or still have
+ to be read.
+
+\DOCMODE(
+\xydef@\twocell@path.[#1].{%
+ \expandafter\ifx\csname Q@@c\endcsname\relax
+ \DN@{\enter@{\cfromthec@ \pfromthep@ \basefromthebase@}%
+ \xy@{}{\expandafter\edef\csname Q@@\endcsname{\cfromthec@}}%
+ \afterPOS{\xy@{}%
+ {\expandafter\edef\csname Q@@c\endcsname{\cfromthec@}}%
+ \xy@{}%
+ {\cfromid@{@}\expandafter\edef\csname Q@@p\endcsname{\cfromthec@}}%
+ \xy@{twocell #1}{#1}\leave@\aftertwoCELL};p,}%
+ \else
+ \DN@{\enter@{\cfromthec@ \pfromthep@ \basefromthebase@}%
+ \xy@{twocell #1}{#1}\leave@\aftertwoCELL}%
+ \fi \next@ }
+
+\xydef@\twocellpath.[#1].{%
+ \expandafter\edef\csname Q@@p\endcsname{\cfromthec@}%
+ \xy@{}{\enter@{\pfromthep@}}%
+ \xy@{}{\enter@{\cfromthec@ \pfromthep@ \basefromthebase@}%
+ \enter@{\pfromthec@}}%
+ \afterPOS{\xy@{}{\leave@\setupDirection@}#1\restore\restore
+ \xy@{end of 2-cell}\xysaveMinMax@ }}%
+
+\xydef@\xysaveMinMax@{\edef\tmp@{\endgroup
+ \noexpand\ifdim\X@max<\the\X@max \X@max=\the\X@max\noexpand\fi
+ \noexpand\ifdim\X@min>\the\X@min \X@min=\the\X@min\noexpand\fi
+ \noexpand\ifdim\Y@max<\the\Y@max \Y@max=\the\Y@max\noexpand\fi
+ \noexpand\ifdim\Y@min>\the\Y@min \Y@min=\the\Y@min\noexpand\fi
+ }\tmp@ }
+\DOCMODE)
+
+\DOCMODE(
+\xylet@\twocellPATH=\twocellpath
+\xydef@\aftertwo@CELL{\let\twocellPATH=\twocellpath \def\aftertwoCELL{}}
+\xydef@\aftertwoCELL{}
+\DOCMODE)
+
+ It remains to collect everything together and place it on the queue.
+
+\DOCMODE(
+\xydef@\twocell@@@@#1!!!{\xy@{twocell #1}{\twocell@@#1!!!}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{2-cells in general \Xy-pictures}
+??=[standard]
+Two-cells can also be set directly within any \Xy-picture, without the
+matrix feature, using either |\drop| or |\connect|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\let\xystatus=\xystatus@
+\xydef@\twocell{\hbox\bgroup\@twocell}
+\xydef@\uppertwocell{\hbox\bgroup\@uppertwocell}
+\xydef@\lowertwocell{\hbox\bgroup\@lowertwocell}
+\xydef@\compositemap{\hbox\bgroup\@compositemap}
+
+\xydef@\twocelll#1#{\hbox\bgroup\xy@\save\save@\@twocelll{#1}}
+\xydef@\@twocelll#1#2{%
+ \afterPOS{\@twocelll@\xyFN@\twocell@#1{#2}}}
+
+\xydef@\uppertwocelll#1#{\hbox\bgroup\xy@\save\save@\@uppertwocelll{#1}}
+\xydef@\@uppertwocelll#1#2{%
+ \afterPOS{\@twocelll@\xyFN@\uppertwocell@#1{#2}}}
+
+\xydef@\lowertwocelll#1#{\hbox\bgroup\xy@\save\save@\@lowertwocelll{#1}}
+\xydef@\@lowertwocelll#1#2{%
+ \afterPOS{\@twocelll@\xyFN@\lowertwocell@#1{#2}}}
+
+\xydef@\compositemapp#1#{\hbox\bgroup\xy@\save\save@\@compositemapp{#1}}
+\xydef@\@compositemapp#1#2{%
+ \afterPOS{\@twocelll@\xyFN@\compositemap@#1{#2}}}
+%
+\xydef@\@twocelll@{%
+% \idfromc@{@c}\swap@\idfromc@{@p}\swap@
+ \expandafter\edef\csname Q@@c\endcsname{\cfromthec@}\swap@
+ \expandafter\edef\csname Q@@p\endcsname{\cfromthec@}\swap@
+ \let\twocellPATH=\twocell@path
+% \def\aftertwoCELL{\twocell@DONE}}
+ \def\aftertwoCELL{\twocell@DONE \xy@\restore \leave@
+% \cfromid@{@c}\no@@ \xystatus@{end: }
+ }}
+
+\xydef@\@twocell#1{\DN@{\@twocell@\twocell@}\xyFN@\next@[#1]}
+\xydef@\@uppertwocell#1{\DN@{\@twocell@\uppertwocell@}\xyFN@\next@[#1]}
+\xydef@\@lowertwocell#1{\DN@{\@twocell@\lowertwocell@}\xyFN@\next@[#1]}
+\xydef@\@compositemap#1{\DN@{\@twocell@\compositemap@}\xyFN@\next@[#1]}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{code}
+\def\myPOS#1{\POS}\def\goVia#1{%
+ \afterPOS{\connect#1\myPOS}}
+\xy
+ *+{A}="A",+<1cm,1.5cm>*+{B}="B",
+ +<2.0cm,0pt>*+{C}="C",
+ +<1cm,-1.5cm>*+{D}="D",
+"A";\goVia{\uppertwocell^\alpha{}}"B"{}
+;\goVia{\twocell^\zeta_\xi{\gamma}}"C"{}
+;\goVia{\compositemap{}}"D"{},
+"A";\goVia{\lowertwocell{}}"D"{}
+\endxy
+\end{code}
+
+\displaycode
+%\begin{figure}[hbt]
+$$\docode$$
+%??=[f.xypic]
+%\caption{2-cells in \protect\Xy-pictures}
+%\end{figure}
+
+\begin{code}
+\xy *+{A}="A",+<1cm,1.5cm>*+{B}="B",
+ +<2cm,0pt>*+{C}="C",
+ +<1cm,-1.5cm>*+{D}="D",
+"A";"B",{\uppertwocell^\alpha{}},
+"B";"C",{\twocell^\zeta_\xi{\gamma}},
+"C"; \afterPOS{\drop\compositemap{}}"D"
+\POS "A";
+ \afterPOS{\drop\lowertwocell{}}"D"
+\endxy
+\end{code}
+
+The code shown is a compact way to place a chain
+of 2-cells within a picture.
+It illustrates a standard technique for using
+|\afterPOS| to find a <pos> to be used for part of
+a picture, then subsequently reuse it.
+Also it is possible to use |\drop| or <decor>s
+to specify the 2-cells, giving the same picture.
+
+\displaycode
+
+The |\connect| variant is usually preferable
+as this maintains the size of the object at $c$,
+while the |\drop| variant leaves
+a rectangular object having $p$ and $c$ on opposite sides.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This is used outside of diagrams.
+
+\DOCMODE(
+\xydef@\@twocell@#1{\ifx\next[\DN@[{\toks@={#1}\xyFN@\@@twocell@}%
+ \else\DN@{#1{}}\fi
+%%
+% \idfromc@{@c}\swap@\idfromc@{@p}\swap@
+ \expandafter\edef\csname Q@@c\endcsname{\cfromthec@}\swap@
+ \expandafter\edef\csname Q@@p\endcsname{\cfromthec@}\swap@
+ \let\twocellPATH=\twocell@path
+ \def\aftertwoCELL{\twocell@DONE}\next@}
+\DOCMODE)
+
+This hack is necessary, since |\DN@[##1]{#1##1}| will strip braces.
+
+\DOCMODE(
+\xydef@\@@twocell@{\ifx\next\bgroup\DN@##1]{\the\toks@{##1}}%
+ \else\DN@##1]{\the\toks@##1}\fi\next@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\TODO:
+ These are supposed to allow |\dir\...twocell{...}| to work.
+ At present it seems to be impossible to do this.
+
+\DOCMODE(
+% \expandafter\xydefcsname@\expandafter{\codeof\twocell}{\@twocell}
+% \expandafter\xydefcsname@\expandafter{\codeof\uppertwocell}{\@uppertwocell}
+% \expandafter\xydefcsname@\expandafter{\codeof\lowertwocell}{\@lowertwocell}
+% \expandafter\xydefcsname@\expandafter{\codeof\compositemap}{\@compositemap}
+%% \DN@{\twocell}%
+%% \expandafter\def\csname*dir@@\codeof\next@ @\endcsname{\@twocell}
+%% \DN@{\uppertwocell}%
+%% \expandafter\def\csname*dir@@\codeof\next@ @\endcsname{\@uppertwocell}
+%% \DN@{\lowertwocell}%
+%% \expandafter\def\csname*dir@@\codeof\next@ @\endcsname{\@lowertwocell}
+%% \DN@{\compositemap}%
+%% \expandafter\def\csname*dir@@\codeof\next@ @\endcsname{\@compositemap}
+\DOCMODE)
+
+...since the contents of |{..}| is variable.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Finish off the box, set up the object size,
+ establish the |\Drop@@| and |\Connect@@| methods.
+
+\DOCMODE(
+\xydef@\twocell@DONE{%
+ \edef\tmp@{\egroup \X@min=\the\X@min \X@max=\the\X@max
+ \Y@min=\the\Y@min \Y@max=\the\Y@max}\tmp@
+ \L@c=\X@c \advance\L@c-\X@min \R@c=\X@max \advance\R@c-\X@c
+ \D@c=\Y@c \advance\D@c-\Y@min \U@c=\Y@max \advance\U@c-\Y@c
+ \ht\z@=\U@c \dp\z@=\D@c \dimen@=\L@c \advance\dimen@\R@c \wdz@=\dimen@
+ \computeLeftUpness@
+%
+\setboxz@h{\kern-\X@p \raise-\Y@c\boxz@ }%
+\dimen@=\L@c \advance\dimen@\R@c \wdz@=\dimen@ \ht\z@=\U@c \dp\z@=\D@c
+%
+ \Edge@c={\rectangleEdge}\Invisible@false \Hidden@false
+ \edef\Drop@@{\noexpand\drop@Twocell
+ \noexpand\def\noexpand\Leftness@{\Leftness@}%
+ \noexpand\def\noexpand\Upness@{\Upness@}}%
+ \edef\Connect@@{\noexpand\connect@Twocell
+ \noexpand\ifdim\X@max<\the\X@max \X@max=\the\X@max\noexpand\fi
+ \noexpand\ifdim\X@min>\the\X@min \X@min=\the\X@min\noexpand\fi
+ \noexpand\ifdim\Y@max<\the\Y@max \Y@max=\the\Y@max\noexpand\fi
+ \noexpand\ifdim\Y@min>\the\Y@min \Y@min=\the\Y@min\noexpand\fi }}%
+\DOCMODE)
+
+ modified |\Drop@@| and |\Connect@@|
+
+\DOCMODE(
+\xydef@\drop@Twocell{\boxz@ }
+
+\xydef@\connect@Twocell{%
+ \setboxz@h{\kern\X@p \raise\Y@c\box\lastobjectbox@ }%
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \Drop@@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+|\twocell@@| is the main switching engine, taking 9 parameters determining
+ which pieces to set and where to position them. This includes
+ curvature of the squines, whether to draw two squines
+ or only one, or to use straight lines,
+ whether to have a central Arrow and its orientation,
+ contants of labels and their positions.
+
+ The current p and c are the extents of the connection
+ these are stored as |"@p"| and |"@c"| for repeated use;
+
+\begin{defs1}
+\begin{tabular}{c l}
+ |#1| & determines location of control point |"@m"|\cr
+ |#2| & location of |=>|, as multiple of |\xydashl@| from |"@m"|\cr
+ |#3| & location of |_| label (source arrow)\cr
+ |#4| & location of |^| label (target arrow)\cr
+ |#5| & flag for how many squines to draw \& which tips\cr
+ |#6| & label for source arrow\cr
+ |#7| & label for target arrow\cr
+ |#8| & label for |=>| (2-cell morphism)\cr
+ |#9| & determines orientation of 2-cell \cr
+\end{tabular}
+\end{defs1}
+
+The following tokens may appear as parameters in |#9|:
+|!|, |^|, |_|, |=|, |A|, |V|, |H|
+
+\DOCMODE(
+\xywarnifdefined\@mod@
+\xywarnifdefined\Arrowtok@
+
+\xydef@\twocell@@#1#2#3#4#5#6#7#8#9!!!{%
+ \def\@mod@{@}\DN@{#9}%
+ \ifx #9!\def\Arrowtok@{@}\else\ifx #9A\def\Arrowtok@{^}%
+ \else\ifx #9V\def\Arrowtok@{_}\else\ifx #9H\def\Arrowtok@{=}%
+ \else\def\@mod@{\relax}%
+ \ifx #5/\def\Arrowtok@{@}\else\ifx #5b\def\Arrowtok@{@}%
+ \else\ifx #5B\def\Arrowtok@{@}\else\ifx #5@\def\Arrowtok@{@}%
+ \else\def\Arrowtok@{#9}%
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \addEQ@\ifx #9\def\Arrowtok@{=}\fi
+ \DN@{\omit}\ifx\next@\Arrowtok@\def\Arrowtok@{}\else
+ \edef\Arrowtok@{\codeof\Arrowtok@}\fi
+ \save@ \idfromc@{@c}\swap@\idfromc@{@p}\swap@
+ \cfromid@{@c}\no@@
+%
+ \ifdim \X@c<\X@p \X@min=\X@c \X@max=\X@p \else \X@min=\X@p \X@max=\X@c \fi
+ \ifdim \Y@c<\Y@p \Y@min=\Y@c \Y@max=\Y@p \else \Y@min=\Y@p \Y@max=\Y@c \fi
+%
+ \Calong@@{.5}\idfromc@{@m}\idfromc@{@m1}\idfromc@{@m2}%
+%
+ \ifx #5t\relax
+ \enter@{\cplusthec@\pfromthep@}%
+ \enter@\DirectionfromtheDirection@ \begingroup\aboveDirection@ \xydashl@
+ \DN@{#1}\ifx\next@\empty\dimen@=\z@\else\dimen@=#1\p@\fi
+ \ifdim\dimen@=\z@ \DN@{\vfromslide@i{\xydashl@}@}\relax
+ \else\DN@{\vfromslide@i{#1\xydashl@}@}\fi \next@
+ \czeroEdge@ \leave@ \no@@ \drop@{+}{}\idfromc@{@m1}%
+ \DN@{#1}\ifx\next@\empty\DN@{\no@@}\else\DN@{\connect@{\dir}{-}}\fi
+ \else
+ \DN@{#1}\ifx\next@\empty\dimen@=\z@\else\dimen@=#1\p@\fi
+ \ifdim\dimen@=\z@ \enter@{\cplusthec@\pfromthep@}%
+ \enter@\DirectionfromtheDirection@ \begingroup\aboveDirection@\xydashl@
+ \vfromslide@i{\xydashl@}@\czeroEdge@ \leave@ \idfromc@{@m1}%
+ \cfromid@{@p}\swap@\cfromid@{@c}%
+ \DN@{#1}\ifx\next@\empty\DN@{\no@@}\else\DN@{\connect@{\dir}{-}}\fi
+ \else \DN@{\enter@\cplusthec@
+ \enter@\DirectionfromtheDirection@ \begingroup\aboveDirection@ \xydashl@
+ \vfromslide@i{#1\xydashl@}@\czeroEdge@ \leave@
+ \idfromc@{@m1}\cfromid@{@p}\swap@\cfromid@{@c}%
+ \edef\next@{\codeof\ucurveObject@}%
+ \ifx\next@\empty\DN@{\connect@\crv{"@m1"}}%
+ \else
+ \DNii@####1{\connect@\crv{####1}}\expandafter\DN@\expandafter{%
+ \expandafter\nextii@\expandafter{\ucurveObject@"@m1"}}%
+ \fi \next@ }%
+%% \ifx\next@\empty\def\ucurveObject@{.}\fi
+%% \enter@\cfromthec@\sinit@\cfromid@{@m1}\senter@\leave@
+%% \expandafter\connect@\expandafter\crvs\expandafter{\ucurveObject@}%
+%% \sinit@\sleave@ }%
+ \fi
+ \fi \next@
+%
+ \DN@{#1}\ifx\next@\empty\relax\else
+ \if\@mod@ @\relax
+ \enter@\pfromthep@ \Creset@@
+ \ifx #5t\relax
+ \PLACEedgec@ \PLACEedgep@ \def\PLACEf@{{.5}}%
+ \else \def\next@{\crvreset@}%
+ \ifx\next@\Creset@@
+ \gettwocelledges@ \edef\PLACEf@{{\expandafter\removePT@\the\dimen@}}%
+ \else \PLACEedgec@ \PLACEedgep@ \def\PLACEf@{{.5}}\fi
+ \fi
+ \expandafter\Calong@@\PLACEf@ \czeroEdge@ \leave@
+ \edef\tmp@{\codeof\modmapobject@}%
+ \ifx\tmp@\empty \DN@{\drop@{\dir}{|}}%
+ \else \DNii@##1##{\drop@{##1}}%
+ \DN@{\expandafter\nextii@\modmapobject@{}}%
+ \fi \next@
+ \fi\fi
+%
+ \DN@{#6}\ifx\next@\empty\DN@{\relax}\else
+ \DNii@{{}}\ifx\next@\nextii@\DN@{\relax}\else
+ \ifx @#3\relax\DN@{\relax}\else
+ \DN@{\enter@\pfromthep@ \Creset@@
+ \Calong@@{.5}\czeroEdge@ \leave@
+ \enter@\cplusthec@
+ \enter@\DirectionfromtheDirection@\begingroup
+ \DN@{#1}\ifx\next@\empty\dimen@\z@\else\dimen@=#1\p@\fi
+ \ifdim\dimen@<\z@ \belowDirection@ \xydashl@
+ \else \aboveDirection@ \xydashl@ \fi
+% \vfromslide@i{#3\xydashl@}@\czeroEdge@ \leave@
+% \droptwocelllabel@{#6}}%
+ \dimen@=#3\p@ \if\@mod@ @\relax
+ \advance\dimen@\ifdim\dimen@<\z@-\fi.5\p@\fi
+ \edef\next@{\expandafter\removePT@\the\dimen@}%
+ \expandafter\vfromslide@i\expandafter{\next@\xydashl@}@\leave@
+ \droptwocelllabel@{#6}}%
+ \fi\fi\fi \next@
+%
+%
+ \DN@{#1}\ifx\next@\empty\relax\else
+ \ifx #5b\relax % tip at start only
+ \enter@ {\pfromthep@ }\Creset@@ \PLACEedgep@
+ \Calong@@{0}\czeroEdge@ \leave@
+ \edef\next@{\codeof\twocelltail@}%
+ \ifx\next@\empty \DN@{\dir{>}}%
+ \ifx\next@\twocellhead@\drop@{\dir}{<}%
+ \else
+ \reverseDirection@ \DNii@##1##{\drop@{##1}}%
+ \expandafter\nextii@\twocellhead@{}\reverseDirection@
+ \fi
+ \else
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\twocelltail@{}%
+ \fi
+ \else\ifx #5@\relax % no tips at all
+ \else % tip at end...
+ \enter@\pfromthep@ \Creset@@ \PLACEedgec@
+ \Calong@@{1}\czeroEdge@ \leave@
+ \edef\next@{\codeof\twocellhead@}%
+ \ifx\next@\empty\drop@{\dir}{>}%
+ \else
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\twocellhead@{}%
+ \fi
+ \ifx #5B\relax % ... and also at start.
+ \enter@ {\pfromthep@ }\Creset@@ \PLACEedgep@
+ \Calong@@{0}\czeroEdge@ \leave@
+ \edef\next@{\codeof\twocelltail@}%
+ \ifx\next@\empty \DN@{\dir{>}}%
+ \ifx\next@\twocellhead@\drop@{\dir}{<}%
+ \else
+ \reverseDirection@\DNii@##1##{\drop@{##1}}%
+ \expandafter\nextii@\twocellhead@{}\reverseDirection@
+ \fi
+ \else
+ \DNii@##1##{\drop@{##1}}\expandafter\drop\twocelltail@{}%
+ \fi
+ \else\ifx #5/\relax
+ \else \edef\next@{\codeof\twocelltail@}%
+ \ifx\next@\empty\relax\else
+ \enter@\pfromthep@ \Creset@@ \PLACEedgep@
+ \Calong@@{0}\czeroEdge@ \leave@
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\twocelltail@{}%
+ \fi\fi\fi
+ \fi\fi\fi
+%
+ \cfromid@{@p}\swap@\cfromid@{@c}\no@@ \cfromid@{@m}%
+ \ifx #5t\relax
+ \idfromc@{@m2}\cfromid@{@m1}\swap@ \cfromid@{@c}\no@@
+ \DN@{#1}\ifx\next@\empty\DN@{\no@@}\else\DN@{\connect@{\dir}{-}}\fi
+ \else\ifx #5o\relax
+ \idfromc@{@m2}\DN@{}%
+ \else % second curved arrow
+ \DN@{#1}\ifx\next@\empty\dimen@=\z@\else\dimen@=#1\p@\fi
+ \ifdim\dimen@=\z@
+ \enter@{\cplusthec@\pfromthep@}%
+ \enter@\DirectionfromtheDirection@ \begingroup \belowDirection@\xydashl@
+ \vfromslide@i{\xydashl@}@\czeroEdge@ \leave@ \idfromc@{@m2}%
+ \DN@{\cfromid@{@p}\swap@\cfromid@{@c}\no@@}%
+ \else \DN@{\enter@\cplusthec@
+ \enter@\DirectionfromtheDirection@ \begingroup \belowDirection@ \xydashl@
+ \vfromslide@i{#1\xydashl@}@\czeroEdge@ \leave@
+ \idfromc@{@m2}\cfromid@{@p}\swap@\cfromid@{@c}%
+ \edef\next@{\codeof\dcurveObject@}%
+ \ifx\next@\empty\DN@{\connect@\crv{"@m2"}}%
+ \else
+ \DNii@####1{\connect@\crv{####1}}\expandafter\DN@\expandafter{%
+ \expandafter\nextii@\expandafter{\dcurveObject@"@m2"}}%
+ \fi \next@ }\fi
+%% \enter@\cfromthec@\sinit@\cfromid@{@m2}\senter@\leave@
+%% \expandafter\connect@\expandafter\crvs\expandafter{\dcurveObject@}%
+%% \sinit@\sleave@
+%% }\fi
+ \fi\fi \next@
+%
+ \DN@{#1}\ifx\next@\empty\relax\else \ifx #5o\relax\else
+ \if\@mod@ @\DN@{\enter@\pfromthep@ \Creset@@
+ \ifx #5t\relax
+ \PLACEedgec@ \PLACEedgep@ \def\PLACEf@{{.5}}%
+ \else \def\next@{\crvreset@}%
+ \ifx\next@\Creset@@
+ \gettwocelledges@ \edef\PLACEf@{{\expandafter\removePT@\the\dimen@}}%
+ \else \PLACEedgec@ \PLACEedgep@ \def\PLACEf@{{.5}}\fi
+ \fi
+ \expandafter\Calong@@\PLACEf@ \czeroEdge@ \leave@
+ \edef\tmp@{\codeof\modmapobject@}\ifx\tmp@\empty\DN@{\drop@{\dir}{|}}%
+ \else \DNii@####1####{\drop@{####1}}%
+ \DN@{\expandafter\nextii@\modmapobject@{}}\fi
+ \next@ }\else\DN@{\relax}\fi
+ \next@ \fi\fi
+%
+ \DN@{#7}\ifx\next@\empty\DN@{\relax}\else
+ \DNii@{{}}\ifx\next@\nextii@\DN@{\relax}\else
+ \ifx @#4\relax\DN@{\relax}\else
+ \DN@{\enter@\pfromthep@ \Creset@@
+ \Calong@@{.5}\czeroEdge@ \leave@
+ \enter@\cplusthec@
+ \enter@\DirectionfromtheDirection@ \begingroup
+ \DN@{#1}\ifx\next@\empty\dimen@\z@ \else\dimen@=#1\p@\fi
+ \ifx #5t\relax \ifdim\dimen@<\z@ \belowDirection@ \xydashl@
+ \else \aboveDirection@ \xydashl@ \fi
+ \else \ifdim\dimen@<\z@ \aboveDirection@ \xydashl@
+ \else \belowDirection@ \xydashl@ \fi
+ \fi \dimen@=#4\p@ \if\@mod@ @\relax
+ \advance\dimen@\ifdim\dimen@<\z@-\fi.5\p@\fi
+ \edef\next@{\expandafter\removePT@\the\dimen@}%
+ \expandafter\vfromslide@i\expandafter{\next@\xydashl@}@\leave@
+ \droptwocelllabel@{#7}}%
+ \fi\fi\fi \next@
+%
+ \DN@{#1}\ifx\next@\empty\relax\else
+ \ifx #5o\relax
+ \else\ifx #5b\relax % tip at start only
+ \enter@ {\pfromthep@ }\Creset@@ \PLACEedgec@
+ \Calong@@{1}\czeroEdge@ \leave@
+ \edef\next@{\codeof\twocelltail@}%
+ \ifx\next@\empty \DN@{\dir{>}}%
+ \ifx\next@\twocellhead@\drop@{\dir}{>}%
+ \else
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\twocellhead@{}%
+ \fi
+ \else
+ \DNii@##1##{\drop@{##1}}\expandafter\drop\twocelltail@{}%
+ \fi
+ \else\ifx #5/\relax
+ \enter@{\pfromthep@}\Creset@@ \PLACEedgep@
+ \Calong@@{0}\czeroEdge@ \leave@
+ \edef\next@{\codeof\twocelltail@}%
+ \ifx\next@\empty \DN@{\dir{>}}%
+ \ifx\next@\twocellhead@\drop@{\dir}{<}%
+ \else
+ \reverseDirection@\DNii@##1##{\drop@{##1}}%
+ \expandafter\nextii@\twocellhead@{}\reverseDirection@
+ \fi
+ \else
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\twocelltail@{}%
+ \fi
+ \else\ifx #5@\relax % no tips at all
+ \else % tip at end...
+ \enter@\pfromthep@ \Creset@@ \PLACEedgec@
+ \Calong@@{1}\czeroEdge@ \leave@
+ \edef\next@{\codeof\twocellhead@}%
+ \ifx\next@\empty\drop@{\dir}{>}%
+ \else
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\twocellhead@{}%
+ \fi
+ \ifx #5B\relax % ... and also at start.
+ \enter@ {\pfromthep@ }\Creset@@ \PLACEedgep@
+ \Calong@@{0}\czeroEdge@ \leave@
+ \edef\next@{\codeof\twocelltail@}%
+ \ifx\next@\empty\DN@{\dir{>}}%
+ \ifx\next@\twocellhead@\drop@{\dir}{<}%
+ \else
+ \reverseDirection@\DNii@##1##{\drop@{##1}}%
+ \expandafter\nextii@\twocellhead@{}\reverseDirection@
+ \fi
+ \else
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\twocelltail@{}%
+ \fi
+ \else
+ \edef\next@{\codeof\twocelltail@}%
+ \ifx\next@\empty\relax\else
+ \enter@ {\pfromthep@ }\Creset@@ \PLACEedgep@
+ \Calong@@{0}\czeroEdge@ \leave@
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\twocelltail@{}%
+ \fi\fi
+ \fi\fi\fi
+ \fi\fi
+%
+% the Arrow
+%
+ \DN@{#1}\ifx\next@\empty\dimen@=\z@\else\dimen@=#1\p@\fi
+ \ifdim\dimen@<\z@ \cfromid@{@m2}\swap@\cfromid@{@m1}%
+ \else \cfromid@{@m1}\swap@\cfromid@{@m2}%
+ \fi \no@@ \cfromid@{@m}%
+%
+ \ifx\Arrowtok@\empty
+%
+ \else\DN@{_}\edef\next@{\codeof\next@}\ifx\next@\Arrowtok@
+ \enter@{\pfromthep@ \cplusthec@}\dimen@=#2\xydashl@
+ \enter@\DirectionfromtheDirection@ \begingroup
+ \expandafter\vfromslide@i\expandafter{\the\dimen@}@\czeroEdge@
+ \leave@ \idfromc@{@m}%
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\Arrowobject@{}%
+% \drop@{\dir}{=>}%
+%
+ \else\DN@{^}\edef\next@{\codeof\next@}\ifx\next@\Arrowtok@
+ \DN@{_}\edef\Arrowtok@{\codeof\next@}%
+ \enter@{\pfromthep@ \cplusthec@}\dimen@=#2\xydashl@
+ \enter@\DirectionfromtheDirection@ \begingroup
+ \expandafter\vfromslide@i\expandafter{\the\dimen@}@\czeroEdge@
+ \leave@ \idfromc@{@m}\reverseDirection@
+ \DNii@##1##{\drop@{##1}}\expandafter\nextii@\Arrowobject@{}%
+% \drop@{\dir}{=>}%
+%
+ \else \DN@{=}\edef\next@{\codeof\next@}\ifx\next@\Arrowtok@
+ \enter@{\pfromthep@ \cplusthec@}%
+ \dimen@=#2\xydashl@ \advance\dimen@\xydashl@
+ \enter@\DirectionfromtheDirection@ \begingroup
+ \expandafter\vfromslide@i\expandafter{\the\dimen@}@\czeroEdge@
+ \leave@ \idfromc@{@m2}%
+ \cfromid@{@m}%
+ \enter@{\pfromthep@ \cplusthec@}%
+ \dimen@=#2\xydashl@ \advance\dimen@-\xydashl@
+ \enter@\DirectionfromtheDirection@ \begingroup
+ \expandafter\vfromslide@i\expandafter{\the\dimen@}@\czeroEdge@
+ \leave@ \idfromc@{@m1}%
+ \cfromid@{@m2}\swap@\cfromid@{@m1}\connect@{\dir 2}{-}%
+ \fi\fi\fi\fi
+%
+% label on the Arrow
+%
+ \DN@{#8}\ifx\next@\empty\DN@{}\else\DN@{%
+ \ifx\Arrowtok@\empty
+ \Calong@@{.5}%
+ \else\DN@{=}\edef\next@{\codeof\next@}\ifx\next@\Arrowtok@
+ \Calong@@{.5}%
+ \else\DN@{_}\edef\next@{\codeof\next@}\ifx\next@\Arrowtok@
+ \cfromid@{@m}%
+ \fi\fi\fi
+ \enter@\cplusthec@
+ \enter@\DirectionfromtheDirection@ \begingroup \aboveDirection@\xydashl@
+ \ifx\Arrowtok@\empty
+ \def\tmp@{0pt}%
+ \else\DN@{=}\edef\next@{\codeof\next@}\ifx\next@\Arrowtok@
+ \def\tmp@{\xydashl@}%
+ \else\DN@{_}\edef\next@{\codeof\next@}\ifx\next@\Arrowtok@
+ \def\tmp@{1.2\xydashl@}%
+ \else\def\tmp@{0pt}%
+ \fi\fi\fi
+ \expandafter\vfromslide@i\expandafter{\tmp@}@\czeroEdge@ \leave@
+ \droptwocelllabel@{#8}%
+ }\fi \next@
+ \leave@ }%
+\DOCMODE)
+
+These are used to establish the location for
+the module-map indicator, giving best aesthetic appeal.
+It finds the location whose parameter value is
+the average of half-way along the complete curve and
+the average of parameter values at the the edges.
+
+\DOCMODE(
+\xydef@\gettwocelledges@{%
+ \bgroup \the\crvpts@
+ \edef\next@{\edges@}%
+ \expandafter\gettwocelledges@@\next@ }
+
+\xydef@\gettwocelledges@@#1;#2,#3;#4,{%
+ \dimen@=#2\advance\dimen@-#4\relax
+ \advance\dimen@ 2\p@ \divide\dimen@ by4 \relax
+ \edef\next@{\egroup\dimen@=\the\dimen@ }\next@}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xy2cell.doc,v $
+% Revision 3.3 1996/12/18 14:21:23 ross
+% Ross's version
+%
+% Revision 3.3.1.1 1996/12/18 08:49:34 ross
+% *** empty log message ***
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/05 22:11:25 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.12 1994/10/25 03:01:14 ross
+% Final 3beta release [bug fixes & AMS-LaTeX fitting].
+%
+% Revision 2.10 1994/07/01 01:19:46 ross
+% removed undefined references
+%
+% Revision 2.9 1994/06/09 12:51:27 ross
+% Release 3beta.
+%
+% NEW for version 2.9 based on unreleased code for version 2.6+.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyall.doc b/Master/texmf-dist/source/generic/xypic/xyall.doc
new file mode 100644
index 00000000000..d1a376d5dbc
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyall.doc
@@ -0,0 +1,93 @@
+%% $Id: xyall.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+%%
+%% Xy-pic ``All features'' option.
+%% Copyright (c) 1993-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{all}{All features}{\stripRCS$Revision: 3.3 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+As a special convenience, this feature loads a subset of
+\Xy-pic,\footnote{The name `all' hints at the fact that these were all the
+ available options at the time `all' was added.} namely the extensions:
+|curve| (\cf~\S??g[:curve]), |frame| (\S??g[:frame]), |cmtip| (\S??g[:tips]),
+|line| (\S??g[:line]), |rotate| (\S??g[:rotate]), |color| (\S??g[:color]),
+and the following features: |matrix| (\S??g[:matrix]), |arrow|
+(\S??g[:arrow]), and |graph| (\S??g[:graph]).
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\DOCHEADER
+
+Here we go:
+
+\DOCMODE(
+\xyrequire{curve}
+\xyrequire{frame}
+\xyrequire{cmtip}
+\xyrequire{line}
+\xyrequire{rotate}
+\xyrequire{color}
+
+\xyrequire{matrix}
+\xyrequire{arrow}
+\xyrequire{graph}
+\DOCMODE)
+
+That is all.
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyall.doc,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% NEW file to go in version 2.9!
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyarc.doc b/Master/texmf-dist/source/generic/xypic/xyarc.doc
new file mode 100644
index 00000000000..5c392285b70
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyarc.doc
@@ -0,0 +1,1436 @@
+%% $Id: xyarc.doc,v 3.4 1997/05/18 01:13:24 ross Exp $
+%%
+%% Xy-pic ``Circles, Ellipses and Arcs'' feature.
+%% Copyright (c) 1995-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The XY-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The XY-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{arc}{Circle, Ellipse, Arc feature}{\stripRCS$Revision: 3.4 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+This feature provides a means to a specify circles of arbitrary radius,
+drawn with a variety of line styles. Similarly ellipses may be specified,
+having arbitrary major/minor axes aligned in any direction.
+A circular arc joining two points can be constructed with specified
+tangent direction at one end.
+
+All the curves described here---circles, ellipses and sectors of
+these---are constructed using the curves from the |xycurve| extension.
+As such any comments given there concerning memory requirements are
+equally valid here, perhaps even more so. Use of the |xyps| \PS\
+back-end is highly recommended.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+The arcs are not truly circular or elliptical, but are approximations
+given by cubic B\'ezier segments. Hence the |xycurve| feature must be loaded.
+
+\DOCMODE(
+\xyrequire{curve}
+\xycatcodes
+\DOCMODE)
+
+The basic <object> defined here is |\arc|.
+So far it is only implemented as a <decor>ation,
+called |\ellipse|.
+
+\DOCMODE(
+\xydef@\ellipse#1#{\xy@{ELLIPSE}{\hbox\bgroup\save@}%
+ \let\endarc@=\endellipse@@ \xyFN@\preARC@ #1@}
+
+\xydef@\endellipse@@{\xy@{endELLIPSE}{\leave@\origDirection@
+ \edef\next@{\egroup \X@min=\the\X@min \X@max=\the\X@max
+ \Y@min=\the\Y@min \Y@max=\the\Y@max }\next@}\let\bstartPLACE@=\relax}
+
+\xydef@\preARC@{%
+ \ifx\next\space@ \expandafter\DN@\space{\xyFN@\preARC@}%
+ \else\ifx\next @\DN@{\xy@{ellipseARC}\ellipticARC@ \arc@}%
+ \else\ifx\next ~\DN@~##1{\tildeARC@{##1}}%
+ \else\DN@{\xy@{ellipticARC}\ellipticARC@ \arc@}%
+ \fi\fi\fi \next@ }
+
+%\xydef@\arc#1#{\xy@{ARC}{\hbox\bgroup\save@}%
+% \let\endarc@=\endarc@@\arc@{#1}}
+%\xydef@\endarc@@{\xy@{endARC}{\leave@\origDirection@
+\DOCMODE)
+
+
+We start by recording the curve <style> and initialising
+some methods and <pos> names, to be able to easily access
+important <pos> and <direction> information.
+
+When the |...| in |\arc...{|<style>|}| is particularly simple,
+e.g. <empty> or |^| or |_|, then we can branch immediately
+to |\fullCircle@|. Otherwise more parsing is required.
+
+\DOCMODE(
+\xydef@\arc@#1@#2{\DN@{#2}%
+ \ifx\next@\empty \xy@{arcSTYLE}{\def\arcSTYLE{-}}%
+ \else \xy@{arcSTYLE}{\def\arcSTYLE{#2}}\fi \arc@i
+ \DNii@{#1}%
+ \ifx\nextii@\empty \DN@{\fullCircle@}%
+ \else \DN@{_}%
+ \ifx\next@\nextii@ \xy@{_}{\def\arcOrient@@{_}}%
+ \let\arcOrient@@=\next@ \DN@{\fullCircle@}%
+ \else \DN@{^}%
+ \ifx\next@\nextii@ \xy@{^}{\def\arcOrient@@{^}}%
+ \let\arcOrient@@=\next@ \DN@{\fullCircle@}%
+ \else \DN@{\def\afterARCextents@@{%
+ \xy@{aftARCext}{\let\doCircleArc@=\doCircleArc@@}%
+ \ellipseArc@ \xy@{doCircARCs}{\doCircleArcs@}\endarc@ }%
+% \xy@{doCircARCs}{\leave@ \doCircleArcs@}\endarc@ }%
+ \xyFN@\getarcparams@#1@}\fi\fi\fi
+ \next@ }
+\DOCMODE)
+
+When further parsing is required, using |\getarcparams@|, then
+an |@| token is used to mark the end of the relevant tokens.
+
+Before any parsing at all the current $p$ and $c$ are recorded as named
+<pos>itions "0@p" and "0@c", as well as a point "0@m" along the line in the
+current direction from $p$. A method |\origDirection@| is defined to
+artificially re-impose this direction independent of the $p$ and $c$
+that may be current at the time. |\startDirection@| is initialised to
+this method, though parsing may change its value.
+Other methods are initialised, in particular the default orientation;
+their values can be expected to change with subsequent parsing.
+
+\DOCMODE(
+\xydef@\arc@i{\xy@{ARCi}{%
+ \save@\idfromc@{0@c}\cfromp@\idfromc@{0@p}%
+ \enter@\cplusthec@ \enter@\relax\begingroup\vfromslide@i{}@\czeroEdge@
+ \leave@\idfromc@{0@m}\leave@ \zeroDivideLimit@{50}%
+ \edef\origDirection@{\Direction=\the\Direction
+ \relax\noexpand\imposeDirection@}%
+ \let\startDirection@=\origDirection@ \def\startDirection@@{}%
+ \def\endDirection@{}\def\endDirection@@{}\def\arcOrient@@{^}}%
+ \def\arcOrient@@{^}\let\processDirections@=\checkstartDirection@
+ \def\arcRadius@{}\def\ellipseRatio@{}\def\arcScale@{\arcScale@@}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\message{circles,}
+\DOCMODE)
+
+\subsection{Full Circles}
+
+The |xyarc| feature allows a much wider range of possibilities
+for typesetting circles than is available with |\cir|.
+Firstly the radius is no longer restricted to a finite collection of sizes.
+Secondly fancy line (curve) styles are available, as with curved arrows.
+Finally there are a variety of ways of specifying the desired radius,
+relative to other parts of the picture being built, as in the following
+example.
+
+\begin{code}
+\xy 0;/r5pc/:*\dir{*}="p",*+!DR{p};
+p+(.5,-.5)*\dir{*}="c",*+++!L{c}**\dir{-}
+,{\ellipse<>{:}},{\ellipse(.5){}}
+,0;(.5,.5)::,"p";"c",{\ellipse(.5){.}}
+,{\ellipse<5pt>{=}}\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+The following give circles centred at $c$.
+\begin{defs}
+|\ellipse<>{|<style>|}| & radius $ = \mathop{\hbox{dist}}(p,c)$ \cr
+|\ellipse<|<dimen>|>{..}| & radius is the <dimen> \cr
+|\ellipse(|<num>|){|<style>|}| & unit circle scaled <num>,\hfill\break
+in the current basis. \cr
+\end{defs}%
+%
+\noindent
+Note that if the current basis is not square then the latter variant,
+namely |\ellipse(|<num>|)|, will typeset an ellipse rather than a circle.
+On the other hand the first two variants always specify true circles.
+In the 2nd case, i.e. when <dimen> is <empty>, the size of the object
+at $p$ is taken into account when drawing the circle; if this is not
+desired then kill the size using a null object, e.g. |;*{};|.
+
+Currently the |\ellipse| macro works only as a <decor>. In future versions
+there will be an <object> called |\arc| having elliptical shape,
+via |\circleEdge| with possibly unequal extents. Also it will be possible
+to |\connect\arc|, which will set the current connection so that any place
+on the full ellipse, not just the visible sector, will be accessible using
+an extension to the usual <place> mechanism.
+
+\TODO: make this be!!
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The simplest cases of full circles go straight to |\circleArc@|.
+
+\DOCMODE(
+\xydef@\fullCircle@{\xy@{fullCIRC}{\let\endDirection@=\relax
+ \let\doCircleArc@=\doMergeEndArc@@}\circleArc@ }%
+\DOCMODE)
+
+If the first non-space token following |\arc| is |<| then the current
+$c$ is taken to be the centre of the circle or ellipse, or sector thereof.
+The first parsing is done to interpret information concerning the radius,
+(or axes of an ellipse) along with an orientation. This can be specified
+either as absolute dimensions, enclosed in |<|\dots|>|,
+or relative to the current basis by |(|\dots|)|, or based on the line
+$\overline{pc}$ using |<>| or |<,|<dimen>|>| or |(,|<num>|)|.
+
+\DOCMODE(
+\xydef@\getarcparams@{%
+ \ifx\space@\next \expandafter\DN@\space{\xyFN@\getarcparams@}%gobble spaces
+ \else\addLT@\ifx \next \xy@{<}{}%
+ \addGT@{\addLT@\DN@##1}{\splitRadius@dim##1,,@}%
+% \else\ifx \next (\xy@{(}{}\DN@(##1){\splitRadius@##1,,@}%
+ \else\ifx\next (\DN@({\xyFN@\checkRadOpen@}%
+ \else\ifx\next @\xy@{@}{}\DN@ @{\fullEllipse@}%
+ \else \addLQ@\ifx \next \addLQ@\DN@{\xy@`{}\ARCturn@}%
+ \else \DN@{\getarcExtents@}%
+ \fi\fi\fi\fi\fi \next@ }
+
+\xydef@\checkRadOpen@{%
+ \ifx\next *\DN@{\xyFN@\getarcExtents@ (}%
+ \else \xy@{(}{}\DN@##1){\splitRadius@##1,,@}%
+ \fi \next@ }
+\DOCMODE)
+
+The centre is now stored as |"0@0"|, since the value of |"0@c"|
+will be changed to agree with |"0@p"|. This is so that start/finish
+directions will agree, ensuring all four quadrants be drawn.
+The following method is actually executed after all the radius/axes
+information has been parsed.
+
+\DOCMODE(
+\xydef@\fixedRadiusArc@{%
+ \xy@{fixRadArc}{\save@ \idfromc@{0@0}\cfromp@\idfromc@{0@c}\leave@}%
+ \xyFN@\fixedRadiusArc@i }
+
+\xydef@\fixedRadiusArc@i{%
+ \ifx\next\space@ \expandafter\DN@\space{\xyFN@\fixedRadiusArc@i}%
+ \else\ifx\next @\xy@{@}{}\DN@ @{\fullEllipse@}%
+ \else\DN@{\let\processDirections@=\processArcDirections@
+ \def\afterARCextents@@{\xy@{aftARCext}{\let\doCircleArc@=\doCircleArc@@
+ \ellipseSector@}}\xyFN@\getarcExtents@}%
+ \fi\fi \next@ }
+\DOCMODE)
+
+When a full circle or ellipse is required then there are three methods
+which must be invoked when establishing the local basis change.
+
+\begin{itemize}
+\item[|\arcScale@|]
+Initially this has value |\arcScale@@| which is based on $\overline{pc}$.
+It is changed only by |(|<num>|)| and |(|<num>|,|<num>|)|;
+see the code for |\splitRadius@| below. When executed,
+this method will establish the required basis, at least partially.
+
+\DOCMODE(
+\xydef@\arcScale@@{\xy@{arcSCALE@@}{\save@
+ \cfromid@{0@0}\pfromc@\cfromid@{0@p}\setbase@\X@p\Y@p\X@c\Y@c}}
+\DOCMODE)
+
+\item[|\arcRadius@|]
+Initially <empty>, this changes with |<|<dimen>|,|<dimen>|>| and
+|<|<dimen>|>| to |\arcScale@dim| which gets the radius by a <slide>
+of given <dimen> along the line $\overline{pc}$.
+
+\DOCMODE(
+\xydef@\arcScale@dim#1{\xy@{arcSCALEdim}{\save@
+ \cfromid@{0@0}\pfromc@ \cfromid@{0@p}\setupDirection@\cfromp@
+ \enter@\cplusthec@ \begingroup\vfromslide@i#1@%
+ \setbase@\X@p\Y@p\X@c\Y@c \idfromc@{0@p}}}
+\DOCMODE)
+
+
+\item[|\ellipseRatio@|]
+Initially <empty>, this changes with |<|<dimen>|,|<dimen>|>| to
+|\ellipseScale@dim| which establishs the $(|\X@basey|,|\Y@basey|)$
+by a <slide> perpendicular to the line $\overline{pc}$,
+or to |\ellipseScale@| with |(,|<num>|)| to simply set the
+perpendicular basis direction using <num> as a coordinate.
+
+\DOCMODE(
+\xydef@\ellipseScale@dim#1{\xy@{ellSCALEdim}{\setupDirection@\cfromp@
+ \enter@\cplusthec@ \aboveDirection@\xydashl@ \vfromslide@{#1}\leave@
+ \setbase@@\X@c\Y@c}}
+
+\xydef@\ellipseScale@#1{\xy@{ellSCALE@}%
+ {\vfromcartesian@@0,#1@\setbase@@\X@c\Y@c}}
+\DOCMODE)
+
+\end{itemize}
+
+The methods |\splitRadius@dim| and |\splitRadius@| complete the
+interpretation of the radius/axes specification. They must determine
+whether one or two pieces of information have been explicitly provided,
+and act accordingly.
+
+\DOCMODE(
+\xydef@\splitRadius@dim#1,#2,#3@{%
+ \DN@{#1}\ifx\next@\empty\dimen@=\z@\else\dimen@=#1\relax%\splinetracing
+ \expandafter\def\expandafter\arcRadius@
+ \expandafter{\arcScale@dim{#1}}\fi
+ \DN@{#2}\ifx\next@\empty\dimen@ii=\z@\def\ellipseRatio@{}%
+ \else\dimen@ii=#2\relax \expandafter
+ \def\expandafter\ellipseRatio@\expandafter{\ellipseScale@dim{#2}}%
+ \fi \fixedRadiusArc@ }
+
+\xydef@\splitRadius@#1,#2,#3@{%
+ \DN@{#1}\ifx\next@\empty\dimen@=\z@\else\dimen@=#1\p@\relax\fi
+ \DN@{#2}\ifx\next@\empty\dimen@ii=\z@\else\dimen@ii=#2\p@\relax\fi
+ \ifdim\dimen@=\z@ \ifdim\dimen@ii=\z@\else \expandafter
+ \def\expandafter\ellipseRatio@\expandafter{\ellipseScale@{#2}}\fi
+ \else
+ \ifdim\dimen@ii=\z@
+ \def\arcScale@{\xy@{arcSCALE@}{\save@\cfromid@{0@0}%
+ \X@origin=\X@c \Y@origin=\Y@c
+ \X@xbase=#1\X@xbase \Y@xbase=#1\Y@xbase
+ \X@ybase=#1\X@ybase \Y@ybase=#1\Y@ybase
+ \advance\X@c\X@xbase \advance\Y@c\Y@xbase \czeroEdge@
+ \idfromc@{0@p}\idfromc@{0@c}}}%
+ \else
+ \def\arcScale@{\xy@{arcSCALE@}{\save@\cfromid@{0@0}%
+ \X@origin=\X@c \Y@origin=\Y@c
+ \X@xbase=#1\X@xbase \Y@xbase=#1\Y@xbase
+ \X@ybase=#2\X@ybase \Y@ybase=#2\Y@ybase
+ \advance\X@c\X@xbase \advance\Y@c\Y@xbase \czeroEdge@
+ \idfromc@{0@p}\idfromc@{0@c}}}%
+ \fi
+ \fi \fixedRadiusArc@ }
+
+\xydef@\baseOrient@{\DN@{_}\ifx\next@\arcOrient@@
+ \X@ybase=-\X@ybase \Y@ybase=-\Y@ybase \fi }
+\DOCMODE)
+
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\message{ellipses,}
+\DOCMODE)
+
+\subsection{Ellipses}
+
+There are several ways to specify an ellipse, apart from the method
+illustrated above in which the basis must be changed from square.
+Basically we must specify the lengths of the major and minor axes.
+Also it is necessary to specify an alignment for one axis.
+
+\medskip
+In the following, the ellipse is centred on $c$ and one axis is aligned
+along the line $\overline{pc}$, except with the final variant where
+it aligns with the current basis. When used <num> is treated
+as a scale factor, multiplying an appropriate length.
+%
+\begin{defs}
+|\ellipse<|<dimen>|,|<dimen>|>{|..|}| & given axes lengths \cr
+|\ellipse<,|<dimen>|>{|<style>|}| & one axis is $\overline{pc}$ \cr
+|\ellipse(,|<num>|){|<style>|}| & ...perp. axis scaled \cr
+|\ellipse(|<num>|,|<num>|){|..|}| & scaled axes aligned\hfill\break
+with basis. \cr
+\end{defs}
+
+In the latter variant, if the second <num> is <empty> then
+this is equivalent to both <num>s having the same value,
+which is in turn equivalent to the final variant for circles.
+
+\begin{code}
+\xy 0;/r5pc/:*\dir{*},*++!DR(.5){p}
+*\frm{-};p+(.5,-.5)*\dir{*}="c",
+**\dir{-},*+!UL{c},"c",
+,{\ellipse(1,.4){:}},{\ellipse(,.75){}}
+,{\ellipse<15pt,10pt>{=}}
+;*{};{\ellipse<,10pt>{.}}\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+As with full circles, full ellipses require little preparation.
+
+\DOCMODE(
+\xydef@\fullEllipse@{\xy@{fullELLIPSE}%
+ {\def\startDirection@{}\let\doCircleArc@=\doMergeEndArc@@}%
+ \ellipseArc@
+ \xy@{doCIRCarcs}{\leave@ \doCircleArcs@}\endarc@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Drawing arcs}
+
+This method is common to full circles, ellipses and circular arcs.
+It first executes the methods |\arcScale@|, |\arcRadius@|, |\ellipseRatio@|
+where necessary, then examines |\arcOrient@@| to decide if the arc is to be
+typeset clockwise or counter-clockwise.
+
+\DOCMODE(
+\xydef@\ellipseArc@{%
+ \arcScale@ \arcRadius@ \ellipseRatio@
+ \xy@{arcCONTROLS}{\baseOrient@ \arcControls@ \let\bstartPLACE@=\relax }}
+\DOCMODE)
+
+Here is where the ``control points'' are defined, for each of the
+four B\'ezier cubic segments, using coordinates in the constructed
+basis. The endpoints of the segments---though, not necessarily
+of the arc---are stored as "0p", "1c", "2c", "3c" and the tangential
+control points are stored as "1m", "2m", \dots, "8m".
+
+\DOCMODE(
+\xydef@\cubicARCcontrols@@{\czeroEdge@
+ \vfromcartesian@@0,1@\idfromc@{1@c}%
+ \vfromcartesian@@-1,0@\idfromc@{2@c}%
+ \vfromcartesian@@0,-1@\idfromc@{3@c}%
+ \vfromcartesian@@1,\arcparam@ @\idfromc@{1@m}%
+ \vfromcartesian@@\arcparam@,1@\idfromc@{2@m}%
+ \vfromcartesian@@-\arcparam@,1@\idfromc@{3@m}%
+ \vfromcartesian@@-1,\arcparam@ @\idfromc@{4@m}%
+ \vfromcartesian@@-1,-\arcparam@ @\idfromc@{5@m}%
+ \vfromcartesian@@-\arcparam@,-1@\idfromc@{6@m}%
+ \vfromcartesian@@\arcparam@,-1@\idfromc@{7@m}%
+ \vfromcartesian@@1,-\arcparam@ @\idfromc@{8@m}%
+ }
+\DOCMODE)
+
+Drawing the circle/ellipse/arc means tracing along the requisite cubic
+segments. The method |\doCircleArc@@| is used for full circles/ellipses
+when complete segments are to be typeset.
+The methods |\doMergeStartArc@|, |\doMergeEndArc@@| and |\doMergeBothArc@|
+are used when a segment is not complete. The work by ``merging'' the
+initial/final point of the curved segment with the appropriate point
+required to be at the extremity of the arc. Typesetting of the curve
+should not take place within the region covered by this merged object.
+
+To overcome the difficulty of the curve leaving then re-entering this
+region, a second merge is performed to extend it suitably. This is
+the purpose of |\cfromcontrols@|. Due to the ``convex-hull property''
+of the B\'ezier cubic segment, a point can be constructed from
+the end-points and control points which can be used to extend
+the rectangle to cover a suitable portion of the curve.
+
+\DOCMODE(
+\xydef@\doCircleArc@@#1#2{\save@ \ifcase#2\relax
+ \doCircleArc@@@{0@p}{1@m}{2@m}{1@c}{#1}\or
+ \doCircleArc@@@{1@c}{3@m}{4@m}{2@c}{#1}\or
+ \doCircleArc@@@{2@c}{5@m}{6@m}{3@c}{#1}\or
+ \doCircleArc@@@{3@c}{7@m}{8@m}{0@p}{#1}\or
+ \doCircleArc@@@{0@p}{1@m}{2@m}{1@c}{#1}\or
+ \doCircleArc@@@{1@c}{3@m}{4@m}{2@c}{#1}\or
+ \doCircleArc@@@{2@c}{5@m}{6@m}{3@c}{#1}\or
+ \doCircleArc@@@{3@c}{7@m}{8@m}{0@p}{#1}\fi \leave@ }
+
+\xydef@\doCircleArc@@@#1#2#3#4#5{%
+ \cfromid@{#1}\pfromc@\senter@
+ \cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}%
+ \connect@\crvs{#5}\relax\sinit@\sleave@}
+
+\xydef@\doMergeEndArc@@#1#2{\save@\ifcase#2\relax
+ \doMergeEnd@@@{0@p}{1@m}{2@m}{1@c}{#1}\relax\or
+ \doMergeEnd@@@{1@c}{3@m}{4@m}{2@c}{#1}\relax\or
+ \doMergeEnd@@@{2@c}{5@m}{6@m}{3@c}{#1}\relax\or
+ \doMergeEnd@@@{3@c}{7@m}{8@m}{0@p}{#1}@\fi \leave@ }
+
+\xydef@\doMergeEnd@@@#1#2#3#4#5#6{%
+ \cfromid@{#1}\pfromc@\senter@
+ \cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}%
+ \ifx#6\relax
+ \L@c=.1\p@ \R@c=\L@c \U@c=\L@c \D@c=\L@c \Edge@c={\rectangleEdge}\fi
+ \enter@\cmergethec@\cfromid@{0@c}\leave@
+ \enter@\cmergethec@\cfromcontrols@{#1}{#2}{#3}{#4}\leave@
+ \connect@\crvs{#5}\relax
+ \sinit@\sleave@}
+
+\xydef@\doMergeStartArc@#1#2{\save@\ifcase#2\relax
+ \doMergeStart@@{0@p}{1@m}{2@m}{1@c}{#1}@\or
+ \doMergeStart@@{1@c}{3@m}{4@m}{2@c}{#1}\relax\or
+ \doMergeStart@@{2@c}{5@m}{6@m}{3@c}{#1}\relax\or
+ \doMergeStart@@{3@c}{7@m}{8@m}{0@p}{#1}\relax\fi \leave@ }
+
+\xydef@\doMergeStart@@#1#2#3#4#5#6{%
+ \cfromid@{#1}\ifx#6\relax
+ \L@c=.1\p@ \R@c=\L@c \U@c=\L@c \D@c=\L@c \Edge@c={\rectangleEdge}\fi
+ \enter@\cmergethec@\cfromid@{0@x}\leave@
+ \enter@\cmergethec@\cfromcontrols@{#4}{#3}{#2}{#1}\leave@
+ \pfromc@
+ \senter@ \cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}%
+ \connect@\crvs{#5}\relax\sinit@\sleave@}
+
+\xydef@\doMergeBothArc@#1#2{\save@\ifcase#2\relax
+ \doMergeBoth@@{0@p}{1@m}{2@m}{1@c}{#1}@\or
+ \doMergeBoth@@{1@c}{3@m}{4@m}{2@c}{#1}\relax\or
+ \doMergeBoth@@{2@c}{5@m}{6@m}{3@c}{#1}\relax\or
+ \doMergeBoth@@{3@c}{7@m}{8@m}{0@p}{#1}\relax\fi \leave@ }
+
+\xydef@\doMergeBoth@@#1#2#3#4#5#6{%
+ \cfromid@{#1}\ifx#6\relax
+ \L@c=.1\p@ \R@c=\L@c \U@c=\L@c \D@c=\L@c \Edge@c={\rectangleEdge}\fi
+ \enter@\cmergethec@\cfromid@{0@x}\leave@
+ \enter@\cmergethec@\cfromcontrols@{#4}{#3}{#2}{#1}\leave@
+ \pfromc@
+ \senter@ \cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}%
+ \enter@\cmergethec@\cfromid@{0@c}\leave@
+ \enter@\cmergethec@\cfromcontrols@{#1}{#2}{#3}{#4}\leave@
+ \connect@\crvs{#5}\relax\sinit@\sleave@}
+
+\xydef@\doMergeEndArc@#1#2{\count@@=#2\relax
+ \ifnum\count@@>\thr@@ \advance\count@@-4\fi\relax
+ \doMergeEndArc@@{#1}\count@@ }
+
+\xydef@\doStraightArc@@#1{\xy@{STRAITarc}{\save@
+ \cfromid@{0@p}\pfromc@\cfromid@{0@c}%
+ \senter@\connect@\crvs{#1}\sinit@\sleave@\leave@}}
+
+\xydef@\cfromcontrols@#1#2#3#4{\bgroup
+ \cfromid@{#1}\L@p=\X@c \U@p=\Y@c
+ \cfromid@{#4}\R@p=\X@c \D@p=\Y@c
+ \cfromid@{#3}\A@=\X@c \B@=\Y@c \cfromid@{#2}%
+ \ifdim\R@p>\L@p \ifdim\A@>\R@p \R@p=\A@
+ \ifdim\X@c>\R@p \R@p=\X@c\fi\fi
+ \else \ifdim\A@<\R@p \R@p=\A@
+ \ifdim\X@c<\R@p \R@p=\X@c\fi\fi
+ \fi
+ \ifdim\D@p>\U@p \ifdim\B@>\D@p \D@p=\B@
+ \ifdim\Y@p>\D@p \D@p=\Y@p\fi\fi
+ \else \ifdim\B@<\D@p \D@p=\B@
+ \ifdim\Y@p<\D@p \D@p=\Y@p\fi\fi
+ \fi
+ \edef\next@{\egroup \X@c=\the\R@p \Y@c=\the\D@p}\next@ }
+\DOCMODE)
+
+The next method controls which segments are typeset.
+It is rather primitive and could well be improved; e.g. to be more like
+|\doEllipseSectors@| with |\forwardSectors@| and |\backwardSectors@|.
+
+First it calculates the |\startDirection@@| as a number, using the current
+base. Next it calculates |\quadDirection@| which records the angle of
+the $y$-axis in the current base.
+Depending on the required orientation, read from |\arcOrient@@|, this
+latter number is adjusted to be minimal greater than |\startDirection@@|
+for a counter-clockwise arc, or maximal less than it for a clockwise one.
+Similarly the value of |\endDirection@@| is made larger or smaller
+than |\startDirection@@|, according to orientation, by adding $\pm8192$
+if necessary.
+
+Each required segment is typeset using |\doCircleArc@@| except that the
+final segment uses the value of |\doCircleArc@|. When the end-point is
+the original $c$ then this value is |\doMergeEndArc@@|, so that the arc will
+stop at the edge of this <pos>, otherwise |\doCircleArc@@| is used.
+
+(The following macro can be shortened by making use of the methods
+|\forwardSectors@| and |\backwardSectors@|, as in |\doEllipseSectors@|.
+
+\DOCMODE(
+\xydef@\doCircleArcs@{\save@
+ \cfromid@{0@0}\pfromc@\cfromid@{0@p}\setupDirection@
+ \startDirection@ \edef\startDirection@@{\the\Direction}%
+ \cfromid@{1@c}\setupDirection@ \edef\quadDirection@{\the\Direction}\relax
+ \count@=\quadDirection@ \relax\def\nextii@{^}%
+ \let\preDirection@@=\startDirection@@
+ \ifx\nextii@\arcOrient@@
+ \ifnum\quadDirection@>\startDirection@@ \relax
+ \else \advance\count@ by8192 \relax\edef\quadDirection@{\the\count@}\fi
+ \ifx\endDirection@@\empty
+ \ifx\endDirection@\relax
+ \bgroup\cfromid@{0@c}\setupDirection@
+ \edef\next@{\egroup \count@@=\the\Direction}\next@ \relax
+ \ifnum\count@@<\startDirection@@ \advance\count@@ 8192 \fi
+ \edef\endDirection@@{\the\count@@}%
+ \else
+ \count@@=\startDirection@@
+ \advance\count@@ by8192 \edef\endDirection@@{\the\count@@}%
+ \fi
+ \else
+ \count@@=\endDirection@@ \relax\ifnum\count@@<\startDirection@@ \relax
+ \advance\count@@ by8192 \edef\endDirection@@{\the\count@@}\fi
+ \fi % \forwardSectors@
+ \ifnum\endDirection@@>\quadDirection@
+ \DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{0}}%
+ \else
+ \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{0}}%
+ \fi
+%
+ \else % \arcOrient@@ = _
+%
+ \ifnum\count@<\startDirection@@\relax\else\advance\count@ by-8192 \relax
+ \edef\quadDirection@{\the\count@}\fi
+ \ifx\endDirection@@\empty
+ \ifx\endDirection@\relax
+ \bgroup\cfromid@{0@c}\setupDirection@
+ \edef\next@{\egroup \count@@=\the\Direction}\next@ \relax
+ \ifnum\count@@>\startDirection@@ \advance\count@@-8192 \fi
+ \edef\endDirection@@{\the\count@@}%
+ \else
+ \count@@=\startDirection@@
+ \advance\count@@ by-8192 \edef\endDirection@@{\the\count@@}%
+ \fi
+ \else
+ \count@@=\endDirection@@ \relax \ifnum\count@@>\startDirection@@
+ \advance\count@@ by-8192 \edef\endDirection@@{\the\count@@}\fi
+ \fi %\backwardSectors@
+ \ifnum\endDirection@@<\quadDirection@
+ \DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{0}}%
+ \else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{0}}\fi
+ \fi
+ \next@ \relax
+%
+ \count@=\quadDirection@ \relax\def\nextii@{^}\DN@{}%
+ \ifx\nextii@\arcOrient@@
+ \count@@=\startDirection@@ \advance\count@@ by4096 \relax
+ \ifnum \count@<\endDirection@@ \relax
+ \ifnum\endDirection@@>\count@@
+ \DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{1}}%
+ \else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{1}}\fi
+ \fi
+ \else
+ \count@@=\startDirection@@ \advance\count@@ by-4096 \relax
+ \ifnum \count@>\endDirection@@ \relax
+ \ifnum\endDirection@@<\count@@
+ \DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{1}}%
+ \else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{1}}\fi
+ \fi\fi
+ \next@ \relax
+%
+ \ifx\next@\empty \else \relax
+ \count@=\startDirection@@ \relax\def\nextii@{^}\DN@{}%
+ \ifx\nextii@\arcOrient@@ \advance\count@ by4096 \relax
+ \count@@=\quadDirection@ \advance\count@@ by4096 \relax
+ \ifnum \count@<\endDirection@@
+ \ifnum\endDirection@@>\count@@
+ \DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{2}}%
+ \else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{2}}\fi
+ \fi
+ \else \advance\count@ by-4096 \relax
+ \count@@=\quadDirection@ \advance\count@@ by-4096 \relax
+ \ifnum \count@>\endDirection@@ \relax
+ \ifnum\endDirection@@<\count@@
+ \DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{2}}%
+ \else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{2}}\fi
+ \fi\fi
+ \next@ \relax
+ \fi
+%
+ \ifx\next@\empty \else \relax
+ \count@=\quadDirection@ \def\nextii@{^}\DN@{}%
+ \ifx\nextii@\arcOrient@@ \advance\count@ by4096 \relax
+ \ifnum \count@<\endDirection@@
+ \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{3}}\fi
+ \else \advance\count@ by-4096 \relax
+ \ifnum \count@>\endDirection@@
+ \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{3}}\fi
+ \fi \next@ \relax
+ \fi
+%
+ \leave@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\message{elliptical arcs,}
+\DOCMODE)
+
+\subsection{Circular and Elliptical Arcs}
+
+The |xyarc| feature handles arcs to be specified in two essentially
+different ways, according to what information is provided by the user.
+We call these the ``radius-unknown/end-points known'' and the
+``radius-known/end-points unknown'' cases.
+
+\subsubsection*{radius unknown, end-points known}
+The simplest case, though not necessarily the most common, is that of
+a circular arc from $p$ to $c$, with radius and centre unspecified.
+To uniquely specify the arc, the tangent direction at $p$ is taken
+to be along the current direction, given by |\Direction|, as set by the
+latest <connect>ion. If no connection has been used, then the default
+<direction> is ``up''.
+%
+\begin{defs}
+|\ellipse_{|<style>|}| & clockwise arc from $p$ to $c$ \cr
+|\ellipse^{|<style>|}| & counter-clockwise arc \cr
+|\ellipse{|<style>|}| & also counter-clockwise \cr
+\end{defs}
+%
+With this information only, a unique circle can be found
+whose radius and centre need not be specified in advance.
+For a unique arc it is sufficient to specify the orientation
+around the circle.
+
+The exception is when the current direction is from $p$ to $c$,
+in which case no circle exists. Instead a straight line is typeset
+accompanied by the following message:
+$$
+|Xy-pic Warning: straight arc encountered |
+$$
+
+The following example shows how, given three points $o$, $p$ and $c$,
+to continue the line $\overline{op}$ by a circular arc to $c$ joining
+smoothly at $p$.
+
+\begin{code}
+\xy 0;/r5pc/:*=+\dir{*}*+!UR{p};
+p+(.5,-.5)*\dir{*}="o",*+!UL{o}
+,+(0,.81)*=<6.1pt>\dir{*}*\frm{-}="c"
+,*+!DL{c},"o",**\dir{-},
+"c",{\ellipse_{}},{\ellipse^{.}}
+%
+,"o"+(1.5,.2)*\dir{*}="a"*+!UL{a}
+,"o";p+/_1pc/,**{},"a",{\ellipse_{}}
+\endxy
+\end{code}
+$$\docode$$
+\displaycode
+%
+\noindent
+Note how the remainder of the circle can be specified separately.
+The example also shows how to specify an arc which leaves a particular
+point perpendicular to a specific direction.
+
+\medskip
+Slightly more complicated is when the tangent direction at $p$ is specified,
+but different from the current direction; a unique circular arc can still
+be defined. More complicated is when a specific tangent direction is
+required also at $c$. In this case the arc produced is a segment
+of an ellipse. (If the required tangent at $p$ points to $c$ then a straight
+segment is drawn, as in the circular case described above.)
+%
+\begin{defs}
+|\ellipse|<dir>$_p$|,|<orient>|{..}| & circular \cr
+|\ellipse|<dir>$_p$|,|<orient>|,|<dir>$_c$|{..}| & elliptical \cr
+|\ellipse|<dir>$_p$|,|<orient><dir>$_c$|{..}| & elliptical\cr
+|\ellipse|<dir>$_p$|,|<orient>,=<dir>$_c$|{..}| & elliptical\cr
+|\ellipse`|<coord><orient>|{..}| & elliptical\cr
+\end{defs}
+%
+In these cases <dir>$_p$ and <dir>$_c$ are <direction> specifications,
+as in figure~??g[xy.doc:f.object] and note~??g[xy.doc:<direction>],
+and <orient> must be either |^| or |_|
+for anti-/clockwise respectively, defaulting to |^| if <empty>.
+Beware that the |(*|<pos><decor>|*)| form {\em must\/} be used for this
+<direction> variant, as if an object modifier.
+
+The second and third cases in the above table generally
+give identical results. The second `|,|' is thus optional, except
+in two specific situations:
+\begin{itemize}
+\item[1.] <orient> is empty and <dir>$_c$ has |^| or |_| as
+the first token;
+\item[2.] <orient> is |^| and <dir>$_c$ has |^| as first token.
+Without the |,| then |^|{}|^| would be interpreted by \TeX\ as part of
+a special ligature for a hexadecimal character code.
+\end{itemize}
+If both <orient> and <dir>$_c$ are <empty> then even the first `|,|'
+can be omitted.
+%
+\begin{code}
+\xy 0;/r5pc/:*=<8.1pt>\dir{*}="p",*\frm{-}
+,*++!U{p},"p";p+(.5,-.5)*+\dir{*}="o"
+,*+!UL{o},+(0,.81)*=<8.1pt>\dir{*}="c"
+,*\frm{-},*++!L{c},"o"**\dir{-},"c"
+,{\ellipse :a(50),_:0{:}}
+,{\ellipse :a(30),_:a(-45){}}
+,{\ellipse :a(40),_{.}},
+;*{};{\ellipse :a(20),^=_{=}}\endxy
+\end{code}
+$$\docode$$
+\displaycode
+%
+Note that only the slope of <dir>$_p$ and <dir>$_c$ is significant;
+rotations by 180$^\circ$ being immaterial.
+
+\begin{code}
+\xy 0;/r5pc/:*\dir{*}="p",*+!UR{p}
+;p+(.5,-.5)*\dir{*}="o",*++!L{o}**\dir{-}
+,p+(.5,.5)*\dir{*}="c",*++!D{c},"c"
+;p+(1,.1)*\dir{*}="q",*++!L{q}**\dir{-}
+,"o";"p",**{};"c"
+,{\ellipse![["o";"p"]],_![["q";"c"]]{}}
+,{\ellipse![["o";"p"]],![["c";"q"]]{.}}
+\endxy
+\end{code}
+$$\docode$$
+\displaycode
+%
+The |=| variant establishes the <direction> parsing to begin with
+the direction resulting from <dir>$_p$ instead of the original direction.
+If <dir>$_c$ is required to be the original direction then use |:0|.
+It cannot be <empty> since this is interpreted as requiring
+a circular arc with unspecified tangent at $c$; see the example above.
+However when <dir>$_p$ and <dir>$_c$ are parallel there is a
+whole family\footnote{Indeed this is always so. The algorithm used for
+the general case tends toward parallel lines---clearly unsuitable.}
+of possible ellipses with the specified tangents.
+
+With no further hint available, a choice is made based on the distance
+between $p$ and $c$. If the required direction is perpendicular to
+$\overline{pc}$ this choice results in a circular arc.
+The optional factor in |=(|<num>|)| is used to alter this choice;
+the default |(1)| is assumed when nothing follows the |=|.
+This factor is used to ``stretch'' the ellipse along the specified direction.
+For a negative <num> the orientation reverses.
+%
+\begin{code}
+\xy ;/r5pc/:*+=<10.1pt>\dir{*}="p";p*\frm{-}
+,*++!UR{p},p+(.5,-.5)*\dir{*}="o",**\dir{-}
+,*+!UL{o},+(0,.81)*=<8.1pt>\dir{*}="c"
+,*\frm{-},*++!DL{c},"c"
+,{\ellipse r,={}},{\ellipse r,=(2){.}}
+,{\ellipse r,^=(3){.}},{\ellipse r,=(-2){}}
+,{\ellipse r,=(-1){.}}\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+The final variant uses the directions from $p$ and $c$ to the
+given <coord>. If <orient> is <empty> then the orientation is
+determined to give the shortest path along the ellipse. Specifying
+an <orient> of |^| or |_| will force the orientation, even if this
+means travelling `the long way' around the ellipse.
+For example, see next figure.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph{Alternative curves}
+In some cases the circular or elliptic curve can be replaced by a curve with
+different shape, having the same tangent directions at the end-points.
+When a full circle/ellipse is specified then one gets instead a closed
+curve constructed from 4 spline segments. Other variants use a single
+segment, 2 or 3 segments, or some portion of all 4 segments.
+Possibilities are given in the following table.
+%
+\begin{defs}
+|\ellipse~e ...{|<..>|}| & elliptical, as above \cr
+|\ellipse~q ...{|<..>|}| & parabolic segments \cr
+|\ellipse~c ...{|<..>|}| & cubic segments \cr
+|\ellipse~i ...{|<..>|}| & interpolating cubic \cr
+|\ellipse~p ...{|<..>|}| & cuspidal cubic \cr
+|\ellipse~c(|<num>|)...{|<..>|}|\kern-20pt &\kern20pt cubic segments,
+ \hfil\break with ``looseness''\cr
+\end{defs}%
+%
+In the latter case the <num>, typically between 0 and 1, controls
+how soon the curve begins to bend away from the tangent direction.
+Smaller values give tighter curves --- 0 for straight lines ---
+with |~c| being the same as |~c(1)| and |~q| is |~c(.66667)|,
+that is <num>$={2\over3}$.
+
+The curve produced by the ``interpolating'' variant |~i| actually
+passes through the control point |"x"|, with slope parallel
+to the line $\overline{pc}$. Since the tangents at $p$ and $c$
+point toward |"x"| the curvature is quite gentle until near |"x"|
+where the curve bends rapidly, yet smoothly. This is obtained also
+by using |~c(1.33333)|, that is <num>$={4\over3}$. Since $|<num>|>1$
+the ``convex hull property'' does not hold; indeed the curve is entirely
+outside the convex hull of $p$, $c$ and |"x"|, apart from those points
+themselves.
+
+The `cuspidal' variant |~p| is equivalent to |~c(2)|. It exhibits a cusp.
+For $|<num>|>2$ the curve is so ``loose'' that it exhibits loops.
+(The author offers no guarantees on the usefulness of such curves
+for any particular purpose; however they do look nice.~\smiley)
+
+\begin{code}
+\xy 0;/r6pc/:*+\dir{*}="p",*+!UR{p},"p";
+p+(.5,-.5)*+\dir{*}="c",*+!UL{c}
+,"p"+(.825,-.25)="x"*\dir{+},"c"
+,{\xycompile{\ellipse`"x"{-}}}
+,{\xycompile{\ellipse~q`"x"^{.}}}
+,{\xycompile{\ellipse~c`"x"{.}}}
+,{\xycompile{\ellipse~c(.3)`"x"^{:}}}
+,{\xycompile{\ellipse~c(2.3)`"x"{-}}}
+,{\xycompile{\ellipse~i`"x"^{.}}}
+,{\xycompile{\ellipse~p`"x"^{-}}}
+\endxy
+\end{code}
+$$\hss\docode\hss$$
+\displaycode
+
+{\bf Hint: }
+When exploring to find the best location for the ``control-point''
+(e.g. the |"x"| in the above example), then use |\xycompile| as
+shown, changing the location outside of the compilation. This speeds up
+the reprocessing with the changed value.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Furthermore, the ellipses are not true ellipses, but are constructed from
+four B\'ezier cubic curves, one for each quadrant of the circle or ellipse.
+To do this it is sufficient to establish
+the control points for each cubic segment. This is straightforward, using
+the following ``magic number'', given a square basis such that the desired
+circle is the unit circle, or rectangular basis for which the ``unit circle''
+is the desired ellipse. Thus |~e| is equivalent to |~c(.5517847)|.
+
+\DOCMODE(
+\xydef@\arcmagic@@{0.5517847}
+\xylet@\arcmagic=\arcmagic@@
+\DOCMODE)
+
+This is the magic number, exactly given by
+${1\over12}\bigl(\sqrt{385}-13\bigr)$,
+that helps construct the B\'ezier cubic curve
+that best approximates a quarter-turn arc of a circle.
+It does so with remarkable accuracy,
+differing by at most .5\% of the radius at any angle;
+the average deviation along the whole quadrant being less than .13\%.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\tildeARC@#1{%
+ \if q#1\DN@{\xy@{quadARC}\quadARC@ \arc@}%
+ \else\if c#1\DN@{\xyFN@\cubicARC@i}%
+ \else\if e#1\DN@{\xy@{ellipticARC}\ellipticARC@ \arc@}%
+ \else\if i#1\DN@{\xy@{interpARC}\interpARC@ \arc@}%
+ \else\if p#1\DN@{\xy@{cuspidalARC}\cuspidalARC@ \arc@}%
+ \else\xywarning@{unknown arc type: #1 }%
+ \DN@{\xy@{ellipticARC}\ellipticARC@ \arc@}%
+ \fi\fi\fi\fi\fi \next@ }
+
+\xydef@\cubicARC@i{%
+ \ifx\next\space@ \expandafter\DN@\space{\xyFN@\cubicARC@i}%
+ \else\ifx\next (\DN@(##1){\xy@{cubicARC(##1)}{\cubicARC@{##1}}\arc@}%
+ \else \DN@{\xy@{cubicARC(1)}{\cubicARC@{1}}\arc@}%
+ \fi\fi \next@ }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\ellipticARC@{\let\arcControls@=\cubicARCcontrols@@
+ \edef\arcparam@{\arcmagic@@}}
+
+\xydef@\cubicARC@#1{\let\arcControls@=\cubicARCcontrols@@
+ \dimen@=#1\p@ \edef\arcparam@{\expandafter\removePT@\the\dimen@}}
+
+\xydef@\quadARC@{\let\arcControls@=\cubicARCcontrols@@
+ \def\arcparam@{.66667}}
+
+\xydef@\cuspidalARC@{\let\arcControls@=\cubicARCcontrols@@
+ \def\arcparam@{2}}
+
+\xydef@\interpARC@{\let\arcControls@=\cubicARCcontrols@@
+ \def\arcparam@{1.33333}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph{Avoiding overflows}
+If <dir>$_p$ and <dir>$_c$ are intended to be equal then the method of
+the previous paragraph should be used. However it may happen that
+``nearly parallel'' directions may be specified, perhaps by accident.
+There is then the possibility of ``numerical overflow'' or a ``division by
+zero'' error. The latter may be accompanied by a warning message:
+\begin{eqnarray*}
+&|Xy-pic Warning: division by 0 in |\\
+&\qquad |\intersect@, replaced by 50|
+\end{eqnarray*}
+This indicates that the number 50 has been used as the result of a
+division by zero. In many contexts this will produce an acceptable result.
+However it may lead to an ``overflow'' in other situations, or to drawing
+beyond the normal page boundary. This can be controlled using a <decor>
+of type |,{\zeroDivideLimit{|<num>|}},| prior to specifying the |\ellipse|.
+The value 50 will be replaced by <num> whenever a ``division by zero''
+would otherwise be encountered in an intersection calculation.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\ARCturn@{\xy@@\bgroup\afterCOORD{%
+ \xy@@{\edef\next@{\egroup \A@=\the\X@c \B@=\the\Y@c}\next@}\ARCturn@@}}
+
+\xydef@\ARCturn@@#1@{\DN@{#1}\DNii@{^}%
+ \ifx\next@\nextii@ \xy@{^}{\def\arcOrient@@{^}}%
+ \else\DNii@{_}\ifx\next@\nextii@ \xy@{_}{\def\arcOrient@@{_}}%
+ \else\xy@{}{\def\arcOrient@@{}}\fi\fi
+ \xy@@\ARCturn@@@ \processDirections@@ }
+
+\xydef@\ARCturn@@@{%
+ \bgroup\cfromid@{0@p}\X@p=\X@c \Y@p=\Y@c \X@c=\A@ \Y@c=\B@
+ \setupDirection@ \edef\next@{\egroup\count@=\the\Direction}\next@\relax
+ \edef\startDirection@@{\the\count@ }%
+ \bgroup\cfromid@{0@c}\X@p=\A@ \Y@p=\B@
+ \setupDirection@ \edef\next@{\egroup\count@=\the\Direction}\next@\relax
+ \edef\endDirection@@{\the\count@}%
+ \ifx\arcOrient@@\empty
+ \bgroup\cfromid@{0@p}\X@p=\X@c \Y@p=\Y@c \cfromid@{0@c}%
+ \setupDirection@ \edef\next@{\egroup\count@@=\the\Direction}\next@\relax
+ \count@=-\count@@ \advance\count@\startDirection@@ \relax \count@=-\count@
+ \ifnum\count@>4096 \def\arcOrient@@{_}%
+ \else\ifnum\count@<-4096 \def\arcOrient@@{^}%
+ \else\ifnum\count@>\z@ \def\arcOrient@@{^}%
+ \else\def\arcOrient@@{_}\fi\fi\fi
+ \fi }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\circleArc@{%
+ \xy@{circARC@}{\cfromid@{0@p}\pfromc@\cfromp@\startDirection@
+ \arcCenter@\idfromc@{0@0}%
+ \def\startDirection@{\bgroup
+ \cfromid@{0@0}\pfromc@\cfromid@{0@p}\setupDirection@
+ \edef\next@{\egroup \Direction=\the\Direction}\next@
+ \relax\imposeDirection@}}%
+ \ifx\endDirection@@\empty
+ \ifx\arcRadius@\empty \ifx\ellipseRatio@\empty\else
+ \DN@{\arcScale@@}\ifx\arcScale@\next@\else
+ \xy@@{\bgroup\cfromid@{0@0}\pfromc@\cfromid@{0@c}\setupDirection@
+ \edef\next@{\egroup \Direction=\the\Direction}\next@
+ \edef\endDirection@@{\the\Direction}}\fi\fi\fi\fi
+ \ellipseArc@ \xy@@{\leave@ \doCircleArcs@}\endarc@ }
+% \ellipseArc@ \xy@@{\doCircleArcs@}\endarc@ }
+\DOCMODE)
+
+The following methods calculate the centre of a circle using the
+perpendicular to the required angle at $p$ and the perpendicular bisector
+of the line $\overline{pc}$.
+
+\DOCMODE(
+\xydef@\arcbisector{%
+ \cfromid@{0@p}\pfromc@\cfromid@{0@c}\setupDirection@
+ \advance\X@c\X@p\divide\X@c\tw@
+ \advance\Y@c\Y@p\divide\Y@c\tw@ \czeroEdge@ \pfromc@
+ \enter@\cplusthec@ \enter@\relax\begingroup
+ \aboveDirection@\xydashl@ \vfromslide@i{}@\leave@ }
+
+\xydef@\arcCenter@{%
+ \cfromid@{0@p}\pfromc@\cfromid@{0@m}\setupDirection@
+ \cfromp@\enter@\cplusthec@ \enter@\relax\begingroup
+ \aboveDirection@\xydashl@ \vfromslide@i{}@\leave@\no@@
+ \arcCenter@i }
+
+\xydef@\arcCenter@i{%
+ \enter@{\pfromthep@}\setupDirection@ \Creset@@
+ \let\PLACEedgep@@=\PLACEedgep@ \let\PLACEedgec@@=\PLACEedgec@
+ \enter@{\pfromthep@\basefromthebase@}\bgroup
+ \arcbisector \edef\next@{\egroup
+ \X@c =\the\X@c \Y@c=\the\Y@c \X@p=\the\X@p \Y@p=\the\Y@p }%
+ \next@ \Cintercept@@ \leave@\leave@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{radius known, end-points unknown}
+The language for these is a combination of most of that used above,
+but the interpretation of the <direction>s is different...
+%
+\begin{defs1}
+|\ellipse<|<radius>|>|<dir>$_1$|,|<orient>|,|<dir>$_2$|{..}|\cr
+|\ellipse<|<radius>|>|<dir>$_1$|,|<orient>|,=|<dir>$_2$|{..}|\cr
+\end{defs1}
+%
+where <radius> is one of the forms used above to describe a circle
+or ellipse. Not all of the ellipse will be typeset---only that arc
+starting with <dir>$_1$ as tangent vector, tracing via <orient>
+until the tangent points in direction <dir>$_2$.
+This effectively extends the notation used with |\cir|
+in ??g[xy.doc:objectlib.circles].
+Note that rotating a given <dir>$_i$ by 180$^\circ$ specifies
+a different arc on the same ellipse/circle.
+Reversing the <orient> no longer gives the complementary arc,
+but this complement rotated 180$^\circ$.
+%
+\begin{code}
+\xy 0;/r5pc/:*\dir{*}="p",*+!DR{p};
+p+(.5,-.5)*\dir{*}="c",*+!UL{c}**\dir{-}
+,"c",{\ellipse<15pt>_,=:a(45){=}}
+ ,{\ellipse<>__,=:a(30){-}}
+,{\ellipse(1,.4){.}}
+ ,{\ellipse(1,.4)_,=:a(120){-}}
+,{\ellipse(,.75){.}}
+ ,{\ellipse(,.75)_,^,^{-}}\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph{parsing of directions}
+
+\DOCMODE(
+\xydef@\getarcExtents@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\getarcExtents@}%
+ \else\ifx\next @\xy@{@}{}\DN@ @{\fullEllipse@}%
+ \else\DN@{\xy@{arcEXTENTs}{\save@
+ \def\startDirection@{\Direction=\startDirection@@ \imposeDirection@}}%
+ \xyFN@\getarcExtents@ii}\fi\fi \next@ }
+
+\xydef@\getarcExtents@ii{%
+ \ifx\next!\xy@{![[}{}\DN@![[##1]]{\getxyDirection@{##1}\getarcExtents@iv}%
+ \else\DN@{\getarcExtents@iv}\fi \next@ }
+
+\xydef@\getarcExtents@iv{\afterDIRECTIONorEMPTY
+ {\xy@{startDIR}{\edef\startDirection@@{\the\Direction}\leave@}%
+ \xyFN@\getarcOrientation@}%
+ {\xy@{startDIR}{\edef\startDirection@@{\the\Direction}\leave@}%
+ \xyFN@\getarcOrientation@}}
+
+\xydef@\getarcOrientation@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\getarcOrientation@}%
+ \else\ifx\next @\xy@{@}{}\DN@{\getEndDirection@x}%
+ \else\ifx\next,\xy@{,}{}\DN@,{\xyFN@\getarcOrientation@i}%
+ \else\DN@{\getarcOrientation@i}\fi\fi\fi \next@ }%
+
+\xydef@\getarcOrientation@i{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\getarcOrientation@i}%
+ \else\ifx\next @\xy@{@}{}\DN@{\getEndDirection@x}%
+ \else\ifx\next^{}\DN@##1{\xy@{^}{\def\arcOrient@@{^}}%
+ \def\arcOrient@@{^}\xyFN@\getEndDirection@}%
+ \else\ifx\next_\DN@##1{\xy@{_}{\def\arcOrient@@{_}}%
+ \def\arcOrient@@{_}\xyFN@\getEndDirection@}%
+ \else\DN@{\xyFN@\getEndDirection@}%
+ \fi\fi\fi\fi \next@ }
+
+\xydef@\getEndDirection@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\getEndDirection@}%
+ \else\ifx\next,\DN@,{\xy@{,}{}\xyFN@\getEndDirection@}%
+ \else\addEQ@\ifx\next\addEQ@\DN@{\xy@{=}{\save@\startDirection@}%
+ \xyFN@\getEqDirection@}%
+ \else \ifx\next!\DN@![[##1]]{\xy@{![[}{\save@}\getxyDirection@{##1}%
+ \xy@{endDIR}{\edef\endDirection@@{\the\Direction}}%
+ \xyFN@\getEndDirection@i}%
+ \else \DN@{\xy@{origDIR}{\save@\origDirection@}\getEndDirection@i}%
+ \fi\fi\fi\fi \next@ }
+
+\xydef@\getEqDirection@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\getEqDirection@}%
+ \else\ifx\next @\xy@{@}{}\DN@ @{%
+ \xy@{sameDIR}{\edef\endDirection@@{\startDirection@@}\leave@}%
+ \parEllipse@{1}{}}%
+% \else\ifx\next (\DN@(##1)##2@{\xy@{()}{\leave@}\parEllipse@{##1}{##2}}%
+ \else\ifx\next (\DN@({\xyFN@\checkEqOpen@}%
+ \else \DN@{\getEndDirection@i}\fi\fi\fi \next@ }
+
+\xydef@\checkEqOpen@{%
+ \ifx\next *\DN@{\getEndDirection@i (}%
+ \else \DN@##1)##2@{\xy@{()}\leave@ \parEllipse@{##1}{##2}}%
+ \fi \next@ }
+
+\xydef@\getEndDirection@i{\afterDIRECTIONorEMPTY
+ {\xy@{endDIR}{\edef\endDirection@@{\the\Direction}\leave@}%
+ \getEndDirection@x }%
+ {\xy@{endDIR}\leave@ \getEndDirection@x }}
+
+\xydef@\getEndDirection@x#1@{%
+ \DN@{#1}\ifx\next@\empty\relax \else\xywarning@{\omittingTokens@}\fi
+ \processDirections@ }
+
+\xydef@\omittingTokens@{omitting unused tokens: \codeof\next@ }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\processDirections@@{%
+ \ifx\endDirection@@\empty \skewCircle@
+ \else \skewEllipse@ \expandafter \afterARCextents@@ \fi }
+
+\xydef@\processArcDirections@{%
+ \xy@{ARCdirs}{\ifx\endDirection@@\empty
+ \origDirection@ \edef\endDirection@@{\the\Direction}\fi}%
+ \ellipseArc@
+ \xy@{procARCdirs}\processArcDirections@@
+ \let\arcScale@\ellsave@ \let\arcRadius@\ellsave@ \def\ellipseRatio@{}%
+ \xy@{circSECTORS}{\doCircleSectors@}\endarc@ }
+
+\xydef@\ellsave@{\xy@@{\save@}}
+
+\xydef@\processArcDirections@@{\save@
+ \bgroup \cfromid@{0@0}\pfromc@ \Direction=\startDirection@@
+ \DN@{_}\ifx\next@\arcOrient@@
+ \advance\Direction \ifnum\Direction<\z@-\fi 4096 \relax\fi
+ \imposeDirection@
+ \d@X=\cosDirection\Y@ybase \advance\d@X-\sinDirection\X@ybase
+ \d@Y=-\cosDirection\Y@xbase \advance\d@Y\sinDirection\X@xbase
+ \setupDirection@i
+ \d@X=-\cosDirection\X@ybase \advance\d@X\sinDirection\X@xbase
+ \d@Y=-\cosDirection\Y@ybase \advance\d@Y\sinDirection\Y@xbase
+ \enter@\cplusthec@\X@c=\d@X \Y@c=\d@Y \leave@ \czeroEdge@
+ \setupDirection@i
+ \czeroEdge@
+ \edef\next@{\egroup \cfromthec@ \count@=\the\Direction}\next@
+ \edef\startDirection@@{\the\count@}\idfromc@{0@x}%
+%
+ \bgroup \cfromid@{0@0}\pfromc@ \Direction=\endDirection@@
+ \DN@{_}\ifx\next@\arcOrient@@
+ \advance\Direction \ifnum\Direction<\z@-\fi 4096 \relax\fi
+ \imposeDirection@
+ \d@X=\cosDirection\Y@ybase \advance\d@X-\sinDirection\X@ybase
+ \d@Y=-\cosDirection\Y@xbase \advance\d@Y\sinDirection\X@xbase
+ \setupDirection@i
+ \d@X=-\cosDirection\X@ybase \advance\d@X\sinDirection\X@xbase
+ \d@Y=-\cosDirection\Y@ybase \advance\d@Y\sinDirection\Y@xbase
+ \enter@\cplusthec@\X@c=\d@X \Y@c=\d@Y \leave@
+ \czeroEdge@
+ \setupDirection@i
+ \edef\next@{\egroup \cfromthec@ \count@=\the\Direction}\next@
+ \edef\endDirection@@{\the\count@}\idfromc@{0@c}%
+%
+ \count@=\startDirection@@ \relax \count@@=\endDirection@@ \relax
+ \DN@{^}\ifx\arcOrient@@\next@
+ \ifnum\count@@>\count@ \else\advance\count@@ 8192 \relax\fi
+ \else
+ \ifnum\count@@<\count@ \else\advance\count@@-8192 \relax\fi\fi
+ \edef\startDirection@@{\the\count@}%
+ \edef\endDirection@@{\the\count@@}}%
+
+\xydef@\doCircleSectors@{%
+ \let\doCircleArc@=\doMergeEndArc@@ \leave@ \leave@
+ \cfromid@{0@0}\pfromc@\cfromid@{0@p}\setupDirection@
+ \count@=\Direction \DN@{^}\ifx\arcOrient@@\next@
+ \ifnum\count@>\startDirection@@ \advance\count@-8192 \fi\relax
+ \count@@=\count@ \advance\count@@ 8192 \relax
+ \ifnum\count@@<\endDirection@@ \advance\count@@ 8192 \fi\relax
+ \else
+ \ifnum\count@<\startDirection@@ \advance\count@ 8192 \fi\relax
+ \count@@=\count@ \advance\count@@-8192 \relax
+ \ifnum\count@@>\endDirection@@ \advance\count@@-8192 \fi\relax
+ \fi \relax
+ \edef\preDirection@@{\the\count@}\edef\postDirection@@{\the\count@@}%
+ \cfromid@{1@c}\setupDirection@ \count@=\Direction
+ \def\nextii@{^}\ifx\nextii@\arcOrient@@
+ \DN@{\forwardSectors@\doEllipseSectors@}%
+ \ifnum\count@<\preDirection@@ \advance\count@ 8192 \relax
+ \else \count@@=\count@\advance\count@-8192 \relax
+ \ifnum\count@@<\preDirection@@ \else\count@=\count@@ \fi\fi
+ \else
+ \DN@{\backwardSectors@\doEllipseSectors@}%
+ \ifnum\count@>\preDirection@@ \advance\count@-8192 \relax
+ \else \count@@=\count@\advance\count@ 8192 \relax
+ \ifnum\count@@>\preDirection@@ \else\count@=\count@@ \fi\fi
+ \fi \edef\quadDirection@{\the\count@}%
+ \next@ }
+
+\xydef@\forwardSectors@{%
+ \ifnum \startDirection@@<\quadDirection@ \def\startSector@@{0}%
+ \else\count@=\preDirection@@ \advance\count@ 4096 \relax
+ \ifnum \startDirection@@<\count@ \def\startSector@@{1}%
+ \else\count@=\quadDirection@ \advance\count@ 4096 \relax
+ \ifnum\startDirection@@<\count@ \def\startSector@@{2}%
+ \else \def\startSector@@{3}\fi\fi\fi
+%
+ \ifnum\quadDirection@ <\endDirection@@ \relax
+ \count@=\preDirection@@ \advance\count@ 4096 \relax
+ \ifnum\count@<\endDirection@@ \relax
+ \count@=\quadDirection@ \advance\count@ 4096 \relax
+ \ifnum\count@<\endDirection@@ \relax
+ \count@=\preDirection@@ \advance\count@ 8192 \relax
+ \ifnum\count@<\endDirection@@ \relax
+ \count@=\quadDirection@ \advance\count@ 8192 \relax
+ \ifnum\count@<\endDirection@@ \relax
+ \count@=\preDirection@@ \advance\count@ 12288 \relax
+ \ifnum\count@<\endDirection@@ \relax
+ \count@=\quadDirection@ \advance\count@ 12288 \relax
+ \ifnum\count@<\endDirection@@ \def\endSector@@{7}%
+ \else \def\endSector@@{6}\fi
+ \else \def\endSector@@{5}\fi
+ \else \def\endSector@@{4}\fi
+ \else \def\endSector@@{3}\fi
+ \else \def\endSector@@{2}\fi
+ \else \def\endSector@@{1}\fi
+ \else \def\endSector@@{0}\fi }
+
+\xydef@\backwardSectors@{%
+ \ifnum \startDirection@@>\quadDirection@ \def\startSector@@{0}%
+ \else\count@=\preDirection@@ \advance\count@-4096 \relax
+ \ifnum \startDirection@@>\count@ \def\startSector@@{1}%
+ \else\count@=\quadDirection@ \advance\count@-4096 \relax
+ \ifnum\startDirection@@>\count@ \def\startSector@@{2}%
+ \else \def\startSector@@{3}\fi\fi\fi
+%
+ \ifnum\quadDirection@>\endDirection@@ \relax
+ \count@=\preDirection@@ \advance\count@-4096 \relax
+ \ifnum\count@>\endDirection@@ \relax
+ \count@=\quadDirection@ \advance\count@-4096 \relax
+ \ifnum\count@>\endDirection@@ \relax
+ \count@=\preDirection@@ \advance\count@-8192 \relax
+ \ifnum\count@>\endDirection@@ \relax
+ \count@=\quadDirection@ \advance\count@-8192 \relax
+ \ifnum\count@>\endDirection@@ \relax
+ \count@=\preDirection@@ \advance\count@-12288 \relax
+ \ifnum\count@>\endDirection@@ \relax
+ \count@=\quadDirection@ \advance\count@-12288 \relax
+ \ifnum\count@>\endDirection@@ \def\endSector@@{7}%
+ \else \def\endSector@@{6}\fi
+ \else \def\endSector@@{5}\fi
+ \else \def\endSector@@{4}\fi
+ \else \def\endSector@@{3}\fi
+ \else \def\endSector@@{2}\fi
+ \else \def\endSector@@{1}\fi
+ \else \def\endSector@@{0}\fi }
+
+\xydef@\doEllipseSectors@{%
+ \ifx\startSector@@\endSector@@
+ \DN@{\expandafter\doMergeBothArc@\expandafter{\arcSTYLE}{\endSector@@}}%
+ \else
+ \expandafter\doMergeStartArc@\expandafter{\arcSTYLE}{\startSector@@}%
+ \edef\countArcs@@{\startSector@@}%
+ \loop@ \count@=\countArcs@@ \relax \advance\count@\@ne
+ \ifnum \count@ < \endSector@@ \edef\countArcs@@{\the\count@}%
+ \bgroup\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{\countArcs@@}%
+ \egroup
+ \repeat@
+ \DN@{\expandafter\doMergeEndArc@\expandafter{\arcSTYLE}{\endSector@@}}%
+ \fi \next@ }
+\DOCMODE)
+
+When the starting direction is along the line $\overline{pc}$ then a
+straight segment is typeset, ignoring any requested ending direction.
+
+\DOCMODE(
+\xydef@\checkstartDirection@{%
+ \bgroup\no@@ \edef\next@{\egroup\count@@=\the\Direction}\next@\relax
+ \ifnum\count@@=\startDirection@@ \relax \DN@{\straightArc@}%
+ \else \advance\count@@-\startDirection@@ \relax
+ \ifnum\count@@=\ifnum\count@@<\z@-\fi 4096 \relax \DN@{\straightArc@}%
+ \else \DN@{\processDirections@@}\fi\fi \next@ }
+
+\xydef@\straightArc@{\xywarning@{straight arc encountered}%
+ \xy@@{\let\bstartPLACE@=\relax
+ \expandafter\doStraightArc@@\expandafter{\arcSTYLE}}\endarc@ }%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\skewEllipse@{\xy@@{\doskewEllipse@}%
+ \def\afterARCextents@@{\xy@{aftARCext}{\let\doCircleArc@=\doMergeEndArc@@}%
+ \ellipseArc@ \xy@{doCircARCs}{\doCircleArcs@}\endarc@ }%
+ \let\arcScale@=\relax \def\arcRadius@{}\def\ellipseRatio@{}}
+
+\xydef@\skewCircle@{\xy@@{\setupDirection@}%
+ \ifnum\Direction=\startDirection@@\relax\DN@{\halfEllipse@{1}}%
+ \else
+ \xy@@{\def\startDirection@{\Direction=\startDirection@@\imposeDirection@}%
+ \cfromid@{0@p}\enter@\cplusthec@ \startDirection@
+ \enter@\relax\begingroup\vfromslide@i{}@\czeroEdge@\leave@\idfromc@{0@m}%
+ \let\endDirection@=\relax \let\doCircleArc@=\doMergeEndArc@@}%
+ \DN@{\circleArc@}%
+ \fi \next@ }
+
+\xydef@\doskewEllipse@{%
+ \def\startDirection@{\Direction=\startDirection@@ \relax
+ \imposeDirection@}\startDirection@ \cfromid@{0@p}%
+ \enter@\cplusthec@ \enter@\relax\begingroup\vfromslide@i{}@\leave@
+ \idfromc@{0@x}%
+ \ifx\endDirection@@\empty \parallelDirection@
+ \else
+ \def\endDirection@{\Direction=\endDirection@@ \relax
+ \imposeDirection@ }\endDirection@ \skewEllB@
+ \bgroup\setupDirection@\edef\next@{\egroup\count@@=\the\Direction}\next@
+ \edef\endDirection@@{\the\count@@}%
+ \fi
+ \cfromid@{0@p}\bgroup \setupDirection@
+ \edef\next@{\egroup \count@@=\the\Direction}\next@
+ \edef\startDirection@@{\the\count@@}}
+
+\xydef@\halfEllipse@#1{\xy@@{%
+ \cfromid@{0@p}\pfromc@\cfromid@{0@c}\no@@
+ \edef\endDirection@@{\the\Direction}%
+ \advance\X@c\X@p \divide\X@c\tw@ \advance\Y@c\Y@p \divide\Y@c\tw@
+ \idfromc@{0@0}\pfromc@ \cfromid@{0@p}\setbase@\X@p\Y@p\X@c\Y@c
+ \dimen@=\X@origin \advance\dimen@-\X@c \dimen@ii=\cosDirection\dimen@
+ \dimen@=\Y@origin \advance\dimen@-\Y@c \advance\dimen@ii \sinDirection\dimen@
+ \X@c=\X@origin \Y@c=\Y@origin \enter@\cplusthec@
+ \dimen@=#1\p@ \ifdim\dimen@<\z@ \DN@{^}\dimen@ii=-#1\dimen@ii
+ \ifx\next@\arcOrient@@\def\arcOrient@@{_}\else\def\arcOrient@@{^}\fi
+ \else \dimen@ii=#1\dimen@ii\fi
+ \startDirection@ \enter@\relax\begingroup\expandafter
+ \vfromslide@i\expandafter{\the\dimen@ii}@\leave@
+ \idfromc@{1@c}\setbase@@ \X@c \Y@c \adjustBaseOrient@
+ \count@@=\endDirection@@ \relax
+ \DN@{^}\advance\count@@\ifx\arcOrient@@\next@\else-\fi 4096 \relax
+ \edef\startDirection@@{\the\count@@}%
+ \def\startDirection@{\Direction=\startDirection@@ \imposeDirection@ }%
+ \let\doCircleArc@=\doMergeEndArc@@ }%
+ \let\arcScale@=\relax \ellipseArc@
+% \xy@@{\leave@ \doCircleArcs@}\endarc@ }
+ \xy@@{\doCircleArcs@}\endarc@ }
+
+\xydef@\parallelDirection@{\show\parallelDirection@}%
+
+\xydef@\parEllipse@#1#2{\DN@{#2}\ifx\next@\empty
+ \else\xywarning@{\omittingTokens@ }\fi \halfEllipse@{#1}}
+
+\xydef@\skewEllB@{\cfromid@{0@c}\pfromc@\enter@\cplusthec@
+ \enter@\relax\begingroup\vfromslide@i{}@\leave@
+ \enter@{\pfromthep@\basefromthebase@}\no@@
+ \bgroup \cfromid@{0@p}\pfromc@\cfromid@{0@x}\edef\next@{\egroup
+ \X@c =\the\X@c \Y@c=\the\Y@c \X@p=\the\X@p \Y@p=\the\Y@p }\next@
+ \Cintercept@@\leave@ \idfromc@{0@x}\cfromid@{0@p}\enter@\cplusthec@
+ \cfromid@{0@c}\leave@ \enter@\cplusthec@ \cfromid@{0@x}%
+ \X@c=-\X@c \Y@c=-\Y@c \leave@ \idfromc@{0@0}\pfromc@\cfromid@{0@p}%
+ \setbase@\X@p\Y@p\X@c\Y@c \cfromid@{0@c}\setbase@@\X@c\Y@c
+ \adjustBaseOrient@ }
+
+\xydef@\adjustBaseOrient@{%
+ \edef\tmp@{\expandafter\removePT@\the\X@xbase}\dimen@=\Y@ybase
+ \divide\dimen@ 64 \relax \dimen@ii=\tmp@\dimen@
+ \edef\tmp@{\expandafter\removePT@\the\X@ybase}\dimen@=\Y@xbase
+ \divide\dimen@ 64 \relax \dimen@=\tmp@\dimen@
+ \ifdim\dimen@>\dimen@ii \X@ybase=-\X@ybase \Y@ybase=-\Y@ybase \fi }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%\begin{code}
+%\end{code}
+%$$\docode$$
+
+%\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyarc.doc,v $
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 14:21:23 ross
+% Ross's version
+%
+% Revision 3.3.1.1 1996/12/18 08:50:58 ross
+% *** empty log message ***
+%
+% Revision 3.2 1995/09/19 18:20:20 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/source/generic/xypic/xyarrow.doc b/Master/texmf-dist/source/generic/xypic/xyarrow.doc
new file mode 100644
index 00000000000..203c877c451
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyarrow.doc
@@ -0,0 +1,1881 @@
+%% $Id: xyarrow.doc,v 3.5 1997/05/28 13:05:01 krisrose Exp $
+%%
+%% Xy-pic ``Arrows and Paths'' feature.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{arrow}{Arrow and Path feature}{\stripRCS$Revision: 3.5 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This feature provides \Xy-pic with the arrow paradigm presented
+ in~\cite{R92:HowTPDAT}.
+
+ \NOTE: |\PATH| command incompatibly changed for version 3.3 (the
+ |\ar| command is unaffected).
+
+ The basic concept introduced is the "path": a connection that
+ "starts" from $c$ (the current object), "ends" at a specified object,
+ and may be split into several "segments" between intermediate
+ specified objects that can be individually labelled, change style,
+ have breaks, etc.
+
+ \S??[path] is about the |\PATH| primitive, including the syntax of
+ paths, and \S??[arrow] is about the |\ar| customisation of paths to
+ draw arrows using \Xy-pic directional objects.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Paths}
+??=[path]
+
+\DOCMODE(
+\message{path,}
+\DOCMODE)
+
+ The fundamental commands of this feature are ??c![\PATH] and
+ ??c![\afterPATH] that will parse the <path> according to the grammar
+ in figure~??[f.path] with notes below.
+
+\begin{figure*}[tb]
+\begin{syntax}
+%
+ \multispan{3}{{\tt\string\PATH} <path>\hfil}
+ & interpret <path>
+\cr
+%
+ \multispan{3}{{\tt\string\afterPATH\string{<decor>\string}} <path>\hfil}
+ & interpret <path> and then run <decor>
+\cr
+\noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+%
+ <path>
+ &\iss & ??c![~] <action> |{| <stuff> |}| <path>
+ & set ??!^[<action>] to <stuff>
+\cr
+ &\orr & ??c![~] <which> |{| <labels> |}| <path>
+ & add ??!^[<labels> prefix for some segments]
+\cr
+ &\orr & ??c![~] |{| <stuff> |}| <path>
+ & set ??!^[failure continuation] to <stuff>
+\cr
+ &\orr & ??c!['] <segment> <path>
+ & make ??!^[straight segment]
+\cr
+ &\orr & ??c![`] <turn> <segment> <path>
+ & make ??!^[turning segment]
+\cr
+ &\orr & <segment>
+ & make ??!^[last segment]
+\cr
+\noalign{\smallskip}
+%
+ <turn>
+ &\iss & <diag> <turnradius>
+ & ??!^[1/4 turn] starting in <diag>
+\cr
+ &\orr & <cir> <turnradius>
+ & ??!^[explicit turn]
+\cr
+%
+ <turnradius>
+ &\iss & <empty>
+ & use default turn radius
+\cr
+ &\orr & ??c![/] <dimen>
+ & set "turnradius" to <dimen>
+\cr
+\noalign{\smallskip}
+%
+ <segment>
+ &\iss & <path-pos> <slide> <labels>
+ & ??!^[segment] with <slide> and <labels>
+\cr
+\noalign{\smallskip}
+%
+ <slide>
+ &\iss & <empty> \orr\ ??c![<] <dimen> ??c![>]
+ & optional ??!^[slide]: <dimen> in the ``above'' direction
+\cr
+\noalign{\smallskip}
+%
+ <labels>
+ &\iss & ??c![^] <anchor> <it> <alias> <labels>
+ & ??!^[label with <it>] "above" <anchor>
+\cr
+ &\orr & ??c![_] <anchor> <it> <alias> <labels>
+ & ??!^[label with <it>] "below" <anchor>
+\cr
+ &\orr & ??c![|] <anchor> <it> <alias> <labels>
+ & ??!^[break with <it>] at <anchor>
+\cr
+ &\orr & <empty>
+ & no more labels
+\cr
+\noalign{\smallskip}
+%
+ <anchor>
+ &\iss & ??c![-] <anchor> \orr\ <place>
+ & label/break placed relative to the <place> where ??c![-] is a synonym
+ for ??c![<>(.5)]
+\cr
+\noalign{\smallskip}
+%
+ <it>
+ &\iss & <digit>\orr<letter>\orr|{|<text>|}|\orr<cs>
+ & <it> is a ??!^[default label]
+\cr
+ &\orr & ??c![*] <object>
+ & <it> is an <object>
+\cr
+ &\orr & ??c![@] <dir>
+ & <it> is a <dir>ectional
+\cr
+ &\orr & |[| <shape> |]| <it>
+ & use |[|<shape>|]| for <it>
+\cr
+\noalign{\smallskip}
+%
+ <alias>
+ &\iss & <empty> \orr\ ??c![=]|"|<id>|"|
+ & optional ??!^[name for label object]
+\cr
+\end{syntax}
+\caption{\protect<path>s}
+??=[f.path]
+\end{figure*}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Parsing:}
+
+ |\afterPATH| sets up |\afterPATH@| and initialise all the actions
+ (see note~??[<action>] below) before invoking the actual <path>
+ parser. |\PATH| is just a dummy interface.
+
+\DOCMODE(
+\xydef@\PATH{\afterPATH{}}
+
+\xylet@\afterPATH@=\empty
+
+\xydef@\afterPATH#1{\save
+ \DN@##1{\def\afterPATH@{\restore \def\afterPATH@{##1}#1}}%
+ \expandafter\next@\expandafter{\afterPATH@}%
+ \let\PATHfail@@=\empty
+ \let\PATHbefore@@=\empty
+ \let\PATHafter@@=\empty
+ \let\PATHlabelsevery@@=\empty
+ \let\PATHlabelsnext@@=\empty
+ \let\PATHlabelslast@@=\empty
+ \xy@{\afterPATH{#1}}{\def\PATHslide@@{\z@}}%
+ \def\PATHcontinue@@{\xyFN@\PATH@}%
+ \xyFN@\PATH@}
+\DOCMODE)
+
+ |\PATH@| is the parser for <path>: it eats the <path> until it fails
+ and then calls the `failure continuation' which will eventually
+ become |\empty| which ends the parsing. \HACK: The
+ `|\ifPATHsingle@|' switch switches the <segment> parsing "off"; this
+ is used by the graph feature to parse stand-alone <slide> <labels>
+ sequences.
+
+\DOCMODE(
+\xynew@{if}\ifPATHsingle@
+
+\xydef@\PATH@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PATH@}%
+ \else\ifPATHsingle@ \let\next@=\PATH@single
+ \else \let\next@=\PATH@normal \fi\fi \next@}
+
+\xydef@\PATH@normal{%
+ \ifx ~\next \DN@ ~{\xyFN@\PATHsetting@}%
+ \else \addRQ@\ifx \next \addRQ@\DN@{\xy@'{}\xyFN@\PATHstraight@}%
+ \else \addLQ@\ifx \next \addLQ@\DN@{\xy@`{}\xyFN@\PATHturn@}%
+ \else\ifx \PATHfail@@\PATH@x \DN@{\xyFN@\PATHfinal@}%
+ \else
+ \DNii@{\let\PATHfail@@=\PATH@x \xyFN@\PATH@}%
+ \DN@{\expandafter\nextii@\PATHfail@@}%
+ \fi\fi\fi\fi \next@}
+\DOCMODE)
+
+ |\PATHsetting@| just reads an <action> or <which> determining which
+ action stuff to set and then does it---we treat the failure
+ continuation as an action here even though it is not, strictly
+ speaking. The four actions are explained in the appropriate notes
+ below.
+
+\DOCMODE(
+\xylet@\PATHfail@@=\empty
+
+\xylet@\PATHbefore@@=\empty
+\xylet@\PATHafter@@=\empty
+
+\xylet@\PATHlabelsevery@@=\empty
+\xylet@\PATHlabelsnext@@=\empty
+\xylet@\PATHlabelslast@@=\empty
+
+\xydef@\PATHsetting@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHsetting@}%
+ \else\ifx \bgroup\next
+ \DN@##1{\xy@{~{##1}}{}\def\PATHfail@@{##1}\xyFN@\PATH@}%
+ \else \addEQ@\ifx \next
+ \addEQ@\DN@##1{\xy@{~={##1}}{}\def\PATHbefore@@{##1}\xyFN@\PATH@}%
+ \else \addLT@\ifx \next
+ \addLT@\DN@##1{\xy@{~<{##1}}{}\def\PATHlabelsnext@@{##1}\xyFN@\PATH@}%
+ \else \addGT@\ifx \next
+ \addGT@\DN@##1{\xy@{~>{##1}}{}\def\PATHlabelslast@@{##1}\xyFN@\PATH@}%
+ \else \addPLUS@\ifx \next
+ \addPLUS@\DN@##1{\xy@{~+{##1}}{}\def\PATHlabelsevery@@{##1}\xyFN@\PATH@}%
+ \else \ifx /\next
+ \DN@/##1{\xy@{~/{##1}}{}\def\PATHafter@@{##1}\xyFN@\PATH@}%
+ \else \addDASH@\ifx \next
+ \xywarning@{Obsolete `-' PATH <action> translated to `='.}%
+ \addDASH@\DN@##1{\xy@{~-{##1}}{}\def\PATHbefore@@{##1}\xyFN@\PATH@}%
+ \else
+ \xyerror@{Unknown \string~ setting: \meaning\next}%
+ {See the Xy-pic arrow feature documentation for help.}%
+ \fi\fi\fi\fi\fi\fi\fi\fi \next@}
+\DOCMODE)
+
+ Next the setup for straight segments including the last: they set
+ |\PATHinit@@| to initialise, \ie, slide, |\PATHextra@@| to do what is
+ needed after the ??c![=] action, and finally |\PATHpost@@| is set to
+ any operations to be done after the entire segment is typeset but
+ before the next is read. |\PATHcontinue@@| is used internally to
+ distinguish the ordinary segments from the last.
+
+\DOCMODE(
+\xylet@\PATHinit@@=\empty
+
+\xylet@\PATHextra@@=\empty
+\xylet@\PATHpost@@=\empty
+\xylet@\PATHcontinue@@=\empty
+
+\xydef@\PATHstraight@{%
+ \def\PATHinit@@{\PATHinitstraight@}%
+ \let\PATHextra@@=\empty
+ \let\PATHpost@@=\empty
+ \let\PATHlabelsextra@@=\relax
+ \xy@@\pfromc@ \PATHafterPOS{\xyFN@\PATHsegment@}}
+
+\xydef@\PATHfinal@{%
+ \def\PATHinit@@{\PATHinitstraight@}%
+ \def\PATHextra@@{\let\PATHcontinue@@=\afterPATH@}%
+ \let\PATHpost@@=\empty
+ \let\PATHlabelsextra@@=\PATHlabelsextralast@
+ \xy@@\pfromc@ \PATHafterPOS{\xyFN@\PATHsegment@}}
+
+\xydef@\PATHlabelsextralast@{\let\PATHlabelsextra@@=\relax
+ \expandafter\xyFN@\expandafter\PATHlabels@\PATHlabelslast@@}
+
+\xydef@\PATHinitstraight@{\xy@@{\setupDirection@ \dimen@=\PATHslide@@
+ \dimen@ii=-\sinDirection\dimen@
+ \ifPATHomitslide@@\else\advance\X@p\dimen@ii\fi \advance\X@c\dimen@ii
+ \dimen@ii= \cosDirection\dimen@
+ \ifPATHomitslide@@\else\advance\Y@p\dimen@ii\fi \advance\Y@c\dimen@ii
+ \PATHomitslide@@false \resetupDirection@}}
+\DOCMODE)
+
+ Setup for turning segments is in note~??[turning segment].
+
+ A <segment> is interpreted as follows after $p$ has been set to the
+ previous end object, $c$ to the <pos> given at the start of the
+ segment, and |\PATHslide@@| to the slide:
+
+\DOCMODE(
+\xydef@\PATHslide@@{\z@}
+\xynew@{if}\ifPATHomitslide@@
+
+\xydef@\PATHsegment@{%
+ \addLT@\ifx\next
+ \addGT@{\addLT@\DN@##1}{%
+ \xy@{<##1>}{\dimen@=##1\relax \edef\PATHslide@@{\the\dimen@}}%
+ \xyFN@\PATHsegment@@}%
+ \else \let\next@=\PATHsegment@@
+ \fi \next@}
+\DOCMODE)
+
+\begin{enumerate}
+\item
+ Expand |\PATHinit@@| (for straight segments this just sets up the
+ direction and applies the <slide>).
+\item
+ Expand |\PATHaction={|<stuff>|}| as set using |~={|<stuff>|}|.
+\item
+ Sets |\PATHcontinue@@| to any continuation set with |~{|<stuff>|}|).
+\item
+ Construct list of <labels> specified by the user through |~|<which>
+ setup. Those applicable to the present segment are inserted before
+ the user's <labels> in the sequence |<>=|.
+\item
+ Store $p,c$ as "start","end" of segment.
+\item
+ Interpret <labels> (see below), including the ones added by the
+ |~|<when>\dots\ <setup>.
+\end{enumerate}
+%
+ |\PATHsegment@@| performs this except the last two points:
+
+\DOCMODE(
+\xydef@\PATHsegment@@{\PATHinit@@ \addEQ@\PATHaction@\PATHbefore@@ \PATHextra@@
+ \expandafter\toks@\expandafter{\PATHlabelsnext@@}\let\PATHlabelsnext@@=\empty
+ \expandafter\addtotoks@\expandafter{\PATHlabelsevery@@}%
+ \expandafter\def\expandafter\PATHlabels@@\expandafter{\the\toks@}%
+ \toks@={}\expandafter\xyFN@\expandafter\PATHlabels@\PATHlabels@@}
+\DOCMODE)
+
+ |\PATHlabels@| parses all <labels> of a <segment>. This sets
+ |\PATHlabelit@@| to the operation building the label in question.
+ Then some parsing stores the tokens ??c![<>(.5)] for each ??c![-] in
+ the <anchor> and finally passes control to the kernel <place> parser
+ with these tokens as the head. This then in turn calls |\PATHit@|
+ that parses <it> and applies the chosen operation. After the last we
+ continue with the accumulated subsegment actions.
+
+\DOCMODE(
+\xylet@\PATHlabelit@@=\empty
+
+\xydef@\PATHlabels@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHlabels@}%
+ \else \ifx ^\next
+ \DN@##1{\xy@^{}\let\PATHlabelit@@=\PATHlabelabove@@
+ \DNii@{}\xyFN@\PATHanchor@}%
+ \else \ifx _\next
+ \DN@##1{\xy@_{}\let\PATHlabelit@@=\PATHlabelbelow@@
+ \DNii@{}\xyFN@\PATHanchor@}%
+ \else \ifx |\next
+ \DN@##1{\xy@|{}\let\PATHlabelit@@=\PATHlabelbreak@
+ \DNii@{}\xyFN@\PATHanchor@}%
+ \else \let\next@=\PATHfinishsegments@ \fi\fi\fi\fi \next@}
+
+\xydef@\PATHanchor@{\begingroup \toks@={}\PATHanchor@i}
+
+\xydef@\PATHanchor@i{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHanchor@i}%
+ \else\addDASH@\ifx \next
+ \addDASH@\DN@{\expandafter\addtotoks@\expandafter{\PATHanchor@toks}%
+ \xyFN@\PATHanchor@i}%
+ \else
+ \DNii@##1{\endgroup\afterPLACE{\xyFN@\PATHit@}##1}%
+ \DN@{\expandafter\nextii@\expandafter{\the\toks@}}%
+ \fi\fi \next@}
+
+{\xyuncatcodes \gdef\next{<>(.5)}}
+\xylet@\PATHanchor@toks=\next
+
+\xylet@\PATHitshapes@@=\empty
+
+\xydef@\PATHit@{\let\PATHitshape@@=\empty \xyFN@\PATHit@i}
+
+\xydef@\PATHit@i{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHit@i}%
+ \else \ifx *\next \DN@*##1##{\PATHlabelit@@{!C##1}}%
+ \else \addAT@\ifx\next \addAT@\DN@##1##{\PATHlabelit@@{\dir##1}}%
+ \else \ifx [\next \DN@[##1]{%
+ \expandafter\def\expandafter\PATHitshape@@\expandafter{\PATHitshape@@[##1]}%
+ \xyFN@\PATHit@i}%
+ \else \DN@{\PATHlabelit@@{}}%
+ \fi\fi\fi\fi \next@}
+\DOCMODE)
+
+ The individual operations bound to |\PATHlabelit@@| are discussed as
+ appropriate in the notes.
+
+ After the last break and label we typeset the last piece of the
+ connection.
+
+\DOCMODE(
+\xydef@\PATHfinishsegments@{%
+ \ifx\PATHlabelsextra@@\relax \expandafter\PATHfinishsegments@i
+ \else
+ \expandafter\PATHlabelsextra@@ \fi}
+
+\xydef@\PATHfinishsegments@i{%
+ \xy@@{\Clast@@}\the\toks@ \toks@={}%
+ \xy@@\setupDirection@
+ \PATHpost@@ \PATHaction@/\PATHafter@@
+ \PATHcontinue@@}
+\DOCMODE)
+
+ \BUG: The order of the breaks determines the order of the
+ subsegments. This is maybe a feature.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notes}
+
+\note??=[<action>]
+%
+ An <action> can be either of the characters |=/|. The associated
+ <stuff> is saved and used to call
+$$
+ ??c![\PATHaction]<action>|{|<stuff>|}|
+$$
+ "before" and "after" each segment (including all <labels>) for
+ ??c![=] and ??c![/], respectively.
+
+ The default ??c![\PATHaction] macro just expands to ``??c![\POS]
+ <stuff> |\relax|'' thus <stuff> should be of the form <pos> <decor>.
+ The user can redefine this---in fact the ??c![\ar] command described
+ in \S??[arrow] below is little more than a special ??c![\PATHaction]
+ command and a clever defaulting mechanism.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Here is the default ??c![\PATHaction]:
+
+\DOCMODE(
+\xydef@\PATHaction@default#1#2{\xy@{PATHaction#1{#2}}{}\POS#2\relax}
+\xylet@\PATHaction=\PATHaction@default
+\DOCMODE)
+
+ It is called using |\PATHaction@| to expand the action control
+ sequences back to their <stuff> first:
+
+\DOCMODE(
+\xydef@\PATHaction@#1#2{\expandafter\PATHaction\expandafter#1\expandafter{#2}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[<labels> prefix for some segments]
+%
+ It is possible to include a number of default <labels> "before" the
+ <labels> of the actual <segment> are interpreted, using
+ |~|<which>|{|<labels>|}|. The specified <which> determines for which
+ segments the indicated <labels> should be prefixed as follows:
+$$
+\begin{tabular}{\otherbar c\otherbar l\otherbar}
+\hline
+ <which> & applied to\dots \\
+\hline
+ ??c![<] & next segment only \\
+ ??c![>] & last segment only \\
+ ??c![=] & every segment \\
+\hline
+\end{tabular}
+$$
+ (when several apply to the same segment they are inserted in the
+ sequence |<>+|).
+
+ This is useful to draw connections with a `center marker' in
+ particular with arrows, \eg, the `mapsto' example explained below can
+ be changed into a `breakto' example: typing
+%
+\begin{code}
+\xy*+{0}\PATH
+ ~={**\dir{-}}
+ ~>{|>*\dir{>}}
+ ~+{|*\dir{/}}
+ '(10,1)*+{1} '(20,-2)*+{2} (30,0)*+{3}
+\endxy
+\end{code}
+\displaycode
+\noindent\unskip
+%
+ will typeset
+$$
+ \docode
+$$
+ Note, however, that what goes into |~+{|\dots|}| is <labels> and thus
+ not a <pos> -- it is not an action in the sense explained above.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[failure continuation]
+%
+ Specifying |~{|<stuff>|}| will set the ``failure continuation'' to
+ <stuff>. This will be inserted when the last <segment> is
+ expected---it can even replace it or add more <segment>s, \ie,
+%
+\begin{code}
+\xy *+{0} \PATH ~={**\dir{-}}
+ ~{'(20,-2)*+{2} (30,0)*+{3}} '(10,1)*+{1}
+\endxy
+\end{code}
+\displaycode
+%
+ is equivalent to
+%
+\begin{code}
+\xy *+{0} \PATH ~={**\dir{-}}
+ '(10,1)*+{1} '(20,-2)*+{2} (30,0)*+{3}
+\endxy
+\end{code}
+\displaycode
+%
+ typesetting
+$$
+ \docode
+$$
+ because when |\endxy| is seen then the parser knows that the next
+ symbol is neither of the characters |~'`| and hence that the last
+ <segment> is to be expected. Instead, however, the failure
+ continuation is inserted and parsed, and the <path> is finished by
+ the inserted material.
+
+ Failure continuations can be nested:
+%
+\begin{code}
+\xy *+{0} \PATH ~={**\dir{-}}
+ ~{~{(30,0)*+{3}}
+ '(20,-2)*+{2}} '(10,1)*+{1}
+\endxy
+\end{code}
+\displaycode
+%
+ will also typeset the connected digits.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[straight segment]
+%
+ A ``straight segment'' is interpreted as follows:
+%
+\begin{enumerate}
+\item
+ First $p$ is set to the end object of the previous segment (for the
+ first segment this is $c$ just before the path command) and $c$ is
+ set to the <pos> starting the <segment>, and the current <slide> is
+ applied.
+\item
+ Then the |=| and |<| "segment actions" are expanded (in that
+ sequence) and the |<| action is cleared. The resulting $p$ and $c$
+ become the "start" and "end" object of the segment.
+\item
+ Then all <labels> (starting with the ones defined as described in
+ note~??[<labels> prefix for some segments] below).
+\end{enumerate}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ The code expanding the actions is part of the parsing above.
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[segment]
+%
+ A "segment" is a part of a <path> between a previous and a new
+ "target" given as a <path-pos>: normally this is just a <pos> as
+ described in~\S??g[xy.doc:pos] but it can be changed to something
+ else by changing the control sequence ??c![\PATHafterPOS] to be
+ something other than ??c![\afterPOS].
+
+\DOCMODE(
+\xylet@\PATHafterPOS@default=\afterPOS
+\xylet@\PATHafterPOS=\PATHafterPOS@default
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[turning segment]??=[1/4 turn]??=[explicit turn]
+%
+ A "turning" segment is one that does not go all the way to the given
+ <pos> but only as far as required to make a turn towards it. The $c$
+ is set to the actual turn object after a turning segment such that
+ subsequent turning or other segments will start from there, in
+ particular the last segment (which is always straight) can be used to
+ finish a winding line.
+
+ What the turn looks like is determined by the <turn> form:
+%
+\begin{description}
+
+\item[<empty>]
+ Nothing between the ??c![`] and the <pos> is interpreted the same as
+ giving just the <diag> last used "out" of a turn.
+
+\item[<diag>]
+ Specifying a single <diag> $d$ is the same as specifying either of
+ the <cir>cles $d$??c![^] or $d$??c![_], depending on whether the specified
+ <pos> has its center `above' or `below' the line from $p$ in the
+ <diag>onal direction.
+
+\item[<cir>]
+ When a full explicit <cir>cle is available then the corresponding
+ <cir>cle object is placed such that its ingoing direction is a
+ continuation of a straight connection from $p$ and the outgoing
+ direction points such that a following straight (or last) segment
+ will connect it to $c$ (with the same slide).
+
+\end{description}
+%
+ Here is an example using all forms of <turn>s:
+%
+\begin{code}
+\xy <4pc,0pc>:(0,0)
+ *+\txt{base}="base"
+ \PATH ~={**\dir{-}?>*\dir{>}}
+ `l (-1,-1)*{A} ^a
+ ` (1,-1)*{B} ^b
+ `_ul (1, 0)*{C} ^c
+ `ul^l "base" ^d
+ "base" ^e
+\endxy
+\end{code}
+$$
+\docode
+$$
+ was typeset by
+%
+\displaycode
+
+ \BUG: Turns are only really resonable for paths that use straight
+ lines like the one above.
+
+ \NOTE: Always write a valid <pos> after a <turn>, otherwise any
+ following ??c![^] or ??c![_] labels can confuse the parser. So if
+ you intend the |^r| in |`^r| to be a label then write |`,^r|, using a
+ dummy ??c![,] <pos>ition.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ We need to keep track of the current "in" and "out" <diag>
+ directions as well as the current radius.
+
+\DOCMODE(
+\xydef@\PATHlastout@@{3}
+\DOCMODE)
+
+ The startup routine is just a selection of the two kinds of <turn>:
+
+\DOCMODE(
+\xydef@\PATHturn@{\afterCIRorDIAG\PATHturn@cir\PATHturn@diag}
+\DOCMODE)
+
+ In both cases the trick is to set up a |\PATHinit@@| method that
+ typesets the right circle segment at the right location. The
+ simplest one is when there is a full <cir> available because that
+ should just be used directly. The only complication is that we
+ forbid $180^\circ$ turns:
+
+\DOCMODE(
+\xydef@\PATHturn@cir{\toks@={\xy@@{%
+ \count@=\CIRin@@ \ifnum\count@<4\else\advance\count@-4\fi
+ \count@@=\CIRout@@ \ifnum\count@@<4\else\advance\count@@-4\fi
+ \ifnum\count@=\count@@ \xyerror@{<turn> cannot be half or full}{%
+You asked for a <turn>ed segment with parallel in- and out-direction.^^J%
+This is not allowed because it is not possible to position it uniquely.}\fi}}%
+ \edef\next@{{\CIRin@@}{\expandafter\noexpand\CIRorient@@}{\CIRout@@}}%
+ \expandafter\PATHturn@i\next@}
+\DOCMODE)
+
+ "Procedure for <diag> turns": Builds initial part of |\PATHinit@@|
+ that computes the missing "orient" and "out" from "in" and the $c$
+ passed through the segment. This initial segment should set
+ "orient" as follows:
+$$
+ \xy <9mm,0mm>: <0mm,4mm>::
+ ,(1,1) *+\dir{*}!D *!LU{p}
+ ,(0,0);(4,4)**\dir{-}
+ ?< *!/+\jot/\composite{{.}*!/+\jot/{.}*!/+2\jot/{.}}
+ ?> *!/-\jot/\composite{{.}*!/-\jot/{.}*!/-2\jot/{.}}
+ ?(.6)*!/1ex/\dir{>} *^!/-1ex/{|^|} *_!/-1ex/{|_|}
+ \endxy
+$$
+ \ie, as the sign of the inner product $\vec{pc} \cdot \hat{"in"}$,
+ and set "out" as for the <cir>cle "in" "orient".
+
+\DOCMODE(
+\xydef@\PATHturn@diag{\toks@={\xy@@{%
+ \setupDirection@ \count@=\CIRin@@ \dimen@=\xydashl@ \ABfromdiag@
+ \ifdim \sinDirection\A@>\cosDirection\B@ \def\CIRorient@@{\CIRacw@}%
+ \advance\count@\ifnum\count@<6 \tw@ \else -6\fi
+ \else \def\CIRorient@@{\CIRcw@}%
+ \advance\count@\ifnum\count@>\@ne -\tw@ \else 6\fi
+ \fi
+ \edef\CIRout@@{\the\count@}}}%
+ \edef\next@{{\CIRin@@}{}{}}%
+ \expandafter\PATHturn@i\next@}
+\DOCMODE)
+
+ |\PATHturn@i| is where |\PATHinit@@| is defined to do the following:
+%
+\begin{itemize}
+
+\item[{??_[turni1]}]
+ Setup the default "in", "orient", and "out" as defined by the call
+ from the above macros. Set "radius" parameter to the current
+ "turnradius" value. The commands in |\toks@| are run to do any
+ last-minute fixing of the defaults.
+
+\item[{??_[turni2]}]
+ The segment will leave $p$ in direction "in" and pretend to be
+ meeting $c$ in direction "out". Thus the center of the <cir>cle
+ object to be used for the actual <turn> object is located at the
+ intersection of the line through $p+"radius"\hat{v}_"in"$ in
+ direction $\vec{v}_"in"$ and the line through
+ $c+"radius"\hat{v}_"out"$ in direction $\vec{v}_"out"$. Here we
+ compute $p+R\hat{v}_"in"$ using $R="radius"$ if this is the initial
+ turn and $R="radius"\pm"slide"$ if it is a continuation turn.
+
+\item[{??_[turni2b]}]
+ Save $p$ and "base" for later.
+
+\item[{??_[turni3]}]
+ Compute $c+"radius"\hat{v}_"out"$ and use the kernel |\intersect@|
+ primitive to compute the turn circle segment center.
+
+\item[{??_[turni3b]}]
+ However, if the intersection point lies on the `wrong side' of $p$,
+ \ie, if $\vec{pc} \cdot "in"$ is negative, then we should not use the
+ intersection point but the point as close to $p$ as possible because
+ the connection from $p$ to the turn should at least have zero
+ length---in fact we set it to have 8sp length to make sure that a
+ sugsegment is typeset!
+
+\item[{??_[turni4]}]
+ Modify "radius" to use for the actual circle segment by the "slide":
+ either positively (for "orient" ??c![_]) or negatively (for "orient"
+ ??c![^]), and drop the circle segment (bypassing |\cir| to use the
+ internal settings from above).
+
+\item[{??_[turni5]}]
+ Store in |\PATHpostpos@@| the true end of the circle segment and code
+ to prevent the application of the "slide" for the start of the next
+ <segment>.
+
+\item[{??_[turni6]}]
+ Move $c$ to true beginning of the circle segment.
+
+\item[{??_[turni7]}]
+ Restore saved $p$ and "base", and slide $p$ finally.
+
+\end{itemize}
+
+\DOCMODE(
+\xylet@\PATHpostpos@@=\empty
+
+\xydef@\PATHturn@i#1#2#3{%
+ \DN@##1{\def\PATHinit@@{\xy@@{%
+ \def\CIRin@@{#1}\def\CIRorient@@{#2}\def\CIRout@@{#3}%?*[turni1]
+ \ifnum\CIRin@@=8 \let\CIRin@@=\PATHlastout@@ \fi
+ \R@=\turnradius@
+ ##1\relax}%
+ \xy@@{\count@=\CIRin@@ %?*[turni2]
+ \ifPATHomitslide@@ \dimen@=-\PATHslide@@
+ \ABfromdiag@ \advance\X@p-\B@ \advance\Y@p\A@ \fi
+ \enter@{\pfromthep@ \basefromthebase@}}%?*[turni2b]
+ \xy@@{\dimen@=\expandafter\ifx\CIRorient@@\CIRcw@-\fi\R@
+ \ABfromdiag@ \advance\X@p-\B@ \advance\Y@p\A@
+ \X@origin=\X@p \Y@origin=\Y@p}%?*[turni3]
+ \xy@@{\dimen@=\xydashl@ \ABfromdiag@ \R@c=\A@ \U@c=\B@
+ \count@=\CIRout@@
+ \dimen@=\expandafter\ifx\CIRorient@@\CIRcw@-\fi\R@
+ \ABfromdiag@ \advance\X@c-\B@ \advance\Y@c\A@
+ \dimen@=\xydashl@ \X@p=\X@c \Y@p=\Y@c
+ \ABfromdiag@ \advance\X@p-\A@ \advance\Y@p-\B@
+ \intersect@
+ \count@=\CIRin@@ \dimen@=\p@ \ABfromdiag@}%?*[turni3b]
+ \xy@@{\edef\next@{\expandafter\removePT@\the\A@}%
+ \edef\nextii@{\expandafter\removePT@\the\B@}%
+ \A@=\X@c \advance\A@-\X@origin \B@=\Y@c \advance\B@-\Y@origin
+ \ifdim \next@\A@<-\nextii@\B@
+ \dontleave@ \cfromp@
+ \count@=\CIRin@@ \advance\count@\ifnum\count@<4 +4\else -4\fi
+ \dimen@=\xydashl@ \Directionfromdiag@
+ \the\Edge@c\z@
+ \count@=\CIRin@@ \dimen@=\expandafter\ifx\CIRorient@@\CIRcw@-\fi\R@
+ \ABfromdiag@ \advance\X@c-\B@ \advance\Y@c\A@
+ \dimen@=5sp \ABfromdiag@ \advance\X@c\A@ \advance\Y@c\B@
+ \fi
+ \dimen@ii=\expandafter\ifx\CIRorient@@\CIRacw@-\fi\PATHslide@@ %?*[turni4]
+ \advance\R@\dimen@ii
+ \drop@\literal@{\hbox\bgroup\cir@i}}%
+ \xy@@{\X@p=\X@c \Y@p=\Y@c %?*[turni5]
+ \count@=\CIRout@@
+ \dimen@=\expandafter\ifx\CIRorient@@\CIRacw@-\fi\R@c
+ \ABfromdiag@ \advance\X@p-\B@ \advance\Y@p\A@
+ \edef\PATHpostpos@@{\X@c=\the\X@p \Y@c=\the\Y@p \noexpand\czeroEdge@
+ \noexpand\PATHomitslide@@true}}%
+ \xy@@{\count@=\CIRin@@ %?*[turni6]
+ \dimen@=\expandafter\ifx\CIRorient@@\CIRacw@-\fi\R@c
+ \ABfromdiag@ \advance\X@c-\B@ \advance\Y@c\A@ \czeroEdge@}%
+ \xy@@{\leave@ %?*[turni7]
+ \count@=\CIRin@@ \dimen@=\PATHslide@@
+ \ABfromdiag@ \advance\X@p-\B@ \advance\Y@p\A@
+ \edef\PATHlastout@@{\CIRout@@}%
+ \count@=\CIRout@@ \dimen@=\xydashl@ \Directionfromdiag@}}}%
+ \expandafter\next@\expandafter{\the\toks@}\toks@={}%
+ \let\PATHextra@@=\empty
+ \def\PATHpost@@{\xy@@\PATHpostpos@@}%
+ \let\PATHlabelsextra@@=\relax
+ \xyFN@\PATHturn@ii}
+\DOCMODE)
+
+ The final macro takes care of the v2.6 format for changing
+ "turnradius": using ??c![/]<dimen> right after the <turn>.
+
+\DOCMODE(
+\xydef@\PATHturn@ii{%
+ \ifx /\next
+ \DN@ /{\afterassignment\nextii@\dimen@=}%
+ \DNii@{%
+ \edef\next@{\noexpand\xy@@{\edef\noexpand\turnradius@{\the\dimen@}}}\next@
+ \xy@@\pfromc@ \PATHafterPOS{\xyFN@\PATHsegment@}}%
+ \else \DN@{\xy@@\pfromc@ \PATHafterPOS{\xyFN@\PATHsegment@}}\fi
+ \next@}
+\DOCMODE)
+
+ This just stores a <diag> vector of the specified lenght in
+ $|<|A|,|B|>|$ thus acting as an optimised version of
+ |\Directionfromdiag@|:
+
+\DOCMODE(
+\xydef@\ABfromdiag@{\ifcase\count@\relax
+ \A@=-.7071\dimen@ \B@=-.7071\dimen@ \or \A@=\z@ \B@=-\dimen@
+ \or \A@=+.7071\dimen@ \B@=-.7071\dimen@ \or \A@=\dimen@ \B@=\z@
+ \or \A@=+.7071\dimen@ \B@=+.7071\dimen@ \or \A@=\z@ \B@=+\dimen@
+ \or \A@=-.7071\dimen@ \B@=+.7071\dimen@ \or \A@=-\dimen@ \B@=\z@
+ \else\xybug@{impossible <diag>?}\fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The default used for "turnradius" can be set by the operation
+%
+\begin{defs1}
+ ??c![\turnradius] <add op> |{|<dimen>|}|\cr
+\end{defs1}
+\noindent\unskip
+%
+ that works like the kernel ??c![\objectmargin] etc. commands; it defaults
+ to 10pt.
+
+\DOCMODE(
+\xydef@\turnradius@{10pt}
+
+\xydef@\turnradius{\afterADDOP{\Addop@@\turnradius@}}
+\DOCMODE)
+
+\begin{exercise}
+ Typeset
+\begin{code}
+\xy *+{A}*\cir<10pt>{}="me"
+ \PATH `ul^ur,"me" "me" |>*:(1,-.25)\dir{>}
+\endxy
+\end{code}
+$$\docode$$
+%
+ using <turn>s.
+%
+\answertext{Here is what the author did:??c[\cir]}
+\answercode
+\answertext\displaycode
+\answertext{The trick is getting the arrow head right: the |:| modifier to
+ the explicit {\tt\string\dir} <object> does that.}
+\end{exercise}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[last segment]
+%
+ The last segment is exactly as a straight one except that the ??c![>]
+ action (if any) is executed (and cleared) just after the ??c![<]
+ action.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ (The code implementing this is merged with the parsing.)
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[slide]
+%
+ ``Sliding'' a segment means moving each of the $p,c$ objects in the
+ direction perpendicular to the current direction at each.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ (The code implementing this is merged with the parsing, using the
+ |\PATHslide@@| control sequence to hold the current slide.)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[label with <it>]
+%
+ Labelling means that <it> is dropped relative to the current segment
+ using a ??c![?] <pos>ition. This thus depends on the user setting up
+ a connection with a ??c![**] <pos> as one of the actions---typically
+ the~??c![=] action is used for this (see note~??[straight segment]
+ for the details). The only difference between ??c![^] and ??c![_] is
+ that they shift the label in the ??c![^] respectively ??c![_]
+ direction; for straight segments it is placed in the ``superscript''
+ or ``subscript'' position.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The operations used by |\PATHlabels@| to put labels above and below
+ (with ??c![^] and ??c![_]) are trivial, taking two arguments and
+ placing the label immediately; for convenience the |\drop| head are
+ named separately such that they may be redefined:
+
+\DOCMODE(
+\xydef@\PATHlabelabove@#1#2{\droplabel@\belowDirection@{#1}{#2}%
+ \let\afteraliases@@=\empty \xyFN@\PATHlabelalias@}
+
+\xydef@\PATHlabelbelow@#1#2{\droplabel@\aboveDirection@{#1}{#2}%
+ \let\afteraliases@@=\empty \xyFN@\PATHlabelalias@}
+
+\xylet@\PATHlabelabove@@=\PATHlabelabove@
+\xylet@\PATHlabelbelow@@=\PATHlabelbelow@
+
+\xydef@\droplabel@#1#2#3{\xy@@{\enter@\DirectionfromtheDirection@}%
+ \DN@{#2}\ifx\next@\empty
+ \expandafter\xy@@ix@\expandafter{\PATHitshape@@\labelbox{#3}}%
+ \else \expandafter\xy@@ix@\expandafter{\PATHitshape@@#2{#3}}\fi
+ \xy@@{\setbox\z@=\expandafter\object\the\toks9 %
+ \advance\L@c\labelmargin@ \advance\R@c\labelmargin@
+ \advance\D@c\labelmargin@ \advance\U@c\labelmargin@
+ \setboxz@h{\kern\labelmargin@\boxz@\kern\labelmargin@}%
+ \A@=\X@c \B@=\Y@c #1\xydashl@ \the\Edge@c\thr@@
+ \advance\A@-\X@c \advance\B@-\Y@c \advance\X@c 2\A@ \advance\Y@c 2\B@
+ \ht\z@=\U@c \dp\z@=\D@c \dimen@=\L@c \advance\dimen@\R@c \wd\z@=\dimen@
+ \setbox\lastobjectbox@=\hbox{\X@c=\L@c \Y@c=\z@ \Drop@@}%
+ \drop@{\box\lastobjectbox@}{}%
+ \leave@}}
+
+\xydef@\PATHlabelbreak@#1#2{%
+ \DN@{#1}\ifx\next@\empty \drop\labelbox{#2}\else \drop#1{#2}\fi
+ \def\afteraliases@@{\xy@@\Cbreak@@}\xyFN@\PATHlabelalias@}
+\DOCMODE)
+
+ These emulate the effect of the <modifier>s |!C|
+ |+<|2"labelmargin"|>| <perp> |!P| <unperp> where <perp>,<unperp> are
+ |^|,|_| for |^|-labels and |_|,|^| for |_|-labels. The last hack
+ using |\lastobjectbox@| aims at both setting that right and setting
+ the label as an object (such that modifiers take effect) even though
+ its placement is peculiar.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Labels will be separated from the connection by the "label"\-"margin"
+ that you can set with the operation
+%
+\begin{defs1}
+ ??c![\labelmargin] <add op> |{|<dimen>|}|
+\end{defs1}
+\noindent\unskip
+%
+ that works like the kernel ??c![\objectmargin] command; in fact
+ "labelmargin" defaults to use "objectmargin" if not set.
+
+\DOCMODE(
+\xylet@\labelmargin@=\objectmargin@
+
+\xydef@\labelmargin{\afterADDOP{\Addop@@\labelmargin@}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[break with <it>]??=[piece]
+%
+ Breaking means to ``slice a hole'' in the connection and insert <it>
+ there. This is realized by typesetting the connection in question in
+ "subsegments", one leading to the break and one continuing after the
+ break as described in notes~??[<action>] and~??[straight segment].
+
+ The special control sequence ??c![\hole] is provided to make it easy to
+ make an empty break.
+
+\DOCMODE(
+\xydef@\hole{\hbox{\dimen@=\objectmargin@ \kern2\dimen@
+ \vrule height\dimen@ depth\dimen@ width\z@}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Subsegments are typeset using the `|\Cbreak@@|' method.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[default label]
+%
+ Unless <it> is a full-fledged <object> (by using the ??c![*] form),
+ it is typeset using a ??c![\labelbox] object (initially similar to
+ ??c![\objectbox] of basic \Xy-pic but using ??c![\labelstyle] for the
+ style).
+
+ \REMARK: You can only omit the |{}|s around single letters, digits,
+ and control sequences.
+
+\DOCMODE(
+\xylet@\labelstyle=\scriptstyle
+\xydef@\labelbox#1{\hbox{$\m@th\labelstyle{#1}$}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[name for label object]
+%
+ A label is an object like any other in the \Xy-picture. Inserting an
+ <alias> ??c![=]|"|<id>|"| saves the label object as |"|<id>|"| for
+ later reference.
+
+\begin{exercise}
+ Typeset
+%
+\begin{code}
+\xy(0,0)
+ \ar @{-->} (30,7) ^A="a"
+ \POS(10,12)*+\txt{label} \ar "a"
+\endxy
+\end{code}
+$$\docode$$
+%
+\answercode
+\answertext{The author did \displaycode}
+\end{exercise}
+
+\DOCMODE(
+\xydef@\PATHlabelalias@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHlabelalias@}%
+ \else \addEQ@\ifx \next
+ \addEQ@\DN@"##1"{\savealias@{##1}\xyFN@\PATHlabelalias@}%
+ \else \DN@{\afteraliases@@\PATHlabels@}\fi\fi \next@}
+
+\xylet@\afteraliases@@=\empty
+
+%{\xyuncatcodes \gdef\next#1{\POS!C="#1"\relax}}
+\xydef@\savealias@#1{\xy@@{\enter@\cfromthec@
+ \advance\X@c-\L@c \advance\L@c\R@c \L@c=.5\L@c \R@c=\L@c \advance\X@c\L@c
+ \advance\Y@c-\D@c \advance\D@c\U@c \D@c=.5\D@c \U@c=\D@c \advance\Y@c\D@c
+ \idfromc@{#1}\leave@}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Arrows}
+??=[arrow]
+
+\begin{figure*}[tb]
+\vfil
+\begin{syntax}
+%
+ \multispan{3}{{\tt\string\ar} <arrow> <path>\hfil}
+ & make <arrow> along <path>
+\cr
+\noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+%
+ <arrow>
+ &\iss & <form>\star
+ & <arrow> has the <form>s
+\cr
+\noalign{\smallskip}
+%
+ <form>
+ &\iss & ??c![@] <variant>
+ & use <variant> of arrow
+\cr
+ &\orr & ??c![@] <variant> |{| <tip> |}|
+ & ??!^[build arrow] using <variant> of a standard stem and <tip> for
+ the head
+\cr
+ &\orr & ??c![@] <variant> |{| <tip> <conn> <tip> |}|
+ & ??!^[build arrow] using <variant> of <tip>, <conn>, <tip>
+ as arrow tail, stem, and head (in that order)
+\cr
+ &\orr & ??c![@] <connchar>
+ & change stem to the indicated <connchar>
+\cr
+ &\orr & ??c![@!]
+ & dash the arrow stem by doubling it
+\cr
+ &\orr & ??c![@/] <direction> <dist> |/|
+ & ??!^[curve] arrow the <dist>ance towards <direction>
+\cr
+ &\orr & ??c![@(] <direction> |,| <direction> |)|
+ & curve to fit with ??!^[in-out directions]
+\cr
+ &\orr & ??c![@`] |{| <control point list> |}|
+ & ??!^[curve setup] with explicit control points
+\cr
+ &\orr & |@[| <shape> |]|
+ & add |[|<shape>|]| to ??!^[object <modifier>s] for all objects
+\cr
+ &\orr & ??c![@*] |{| <modifier>\star\ |}|
+ & add ??!^[object <modifier>s] for all objects
+\cr
+ &\orr & ??c![@<] <dimen> |>|
+ & ??!^[slide arrow] the <dimen>
+\cr
+ &\orr & ??c![|] <anchor> <it>
+ & break each segment at <anchor> with <it>
+\cr
+ &\orr & ??c![^] <anchor> <it> \orr\ ??c![_] <anchor> <it>
+ & label each segment at <anchor> with <it>
+\cr
+ &\orr & ??c![@?]
+ & ??!^[reverse meaning of above and below]
+\cr
+\noalign{\smallskip}
+%
+ <variant>
+ &\iss & <empty> \orr\ ??c![^] \orr\ ??c![_] & \cr
+ & & \orr\ ??c![0] \orr\ ??c![1] \orr\ ??c![2] \orr\ ??c![3]
+ & <variant>: plain, above, below, double, or triple
+\cr
+\noalign{\smallskip}
+%
+ <tip>
+ &\iss & <tipchar>\star
+ & directional named as the sequence of <tipchar>s
+\cr
+ &\orr & <dir>
+ & ??!^[any <dir>ectional]
+\cr
+\noalign{\smallskip}
+%
+ <tipchar>
+ &\iss & |<|\orr|>|\orr|(|\orr|)|\orr||||\orr|'|\orr|`|\orr|+|\orr|/|
+ & recognised tip characters
+\cr
+ &\orr & <letter> \orr\ <space>
+ & more tip characters
+\cr
+\noalign{\smallskip}
+%
+ <conn>
+ &\iss & <connchar>\star
+ & directional named as the sequence of <connchar>s
+\cr
+ &\orr & <dir>
+ & ??!^[any <dir>ectional]
+\cr
+\noalign{\smallskip}
+%
+ <connchar>
+ &\iss & |-|\orr|.|\orr|~|\orr|=|\orr|:|
+ & recognised connector characters
+\cr
+\end{syntax}
+\caption{\protect<arrow>s.}??=[f.arrow]
+\vfil
+\end{figure*}
+
+\DOCMODE(
+\message{\string\ar,}
+\DOCMODE)
+
+ Arrows are paths with a particularly easy syntax for setting up
+ arrows with "tail", "stem", and "head" in the style
+ of~\cite{R92:HowTPDAT}. This is provided by a single <decor>ation
+ the syntax of which is described in figure~??[f.arrow] (with the
+ added convention that a raised `\star' means 0 or more repetitions of
+ the preceeding nonterminal).
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Parsing:}
+
+ The ??c![\ar] command effectively translates the <arrow> into a
+ ??c![\PATH] command that initialises the tail, stem, and head of it as
+ required to get the desired <arrow>.
+
+ The translation of the <arrow> is saved in the following variables:
+
+\DOCMODE(
+\xylet@\arvariant@@=\empty
+\xylet@\arstemprefix@@=\empty
+\xylet@\artail@@=\empty
+\xylet@\arstem@@=\empty
+\xylet@\arhead@@=\empty
+\xylet@\armodifiers@@=\empty
+\xylet@\arlabels@@=\empty
+\xylet@\arafterPOS@@=\empty
+\xylet@\arinit@@=\empty
+\xylet@\arexit@@=\empty
+
+\xylet@\arcomponent@@=\relax
+\xylet@\arcomponenttype@@=\relax
+
+\xylet@\afterar@@=\relax
+\DOCMODE)
+
+ ??c![\ar] stores the defaults; it loads an intermediate command to
+ avoid problems when used as first command in compiled matrix
+ entry\dots
+
+\DOCMODE(
+\xydef@\ar{\relax\arSAFE}
+
+\xydef@\arSAFE{%
+ \let\arvariant@@=\empty
+ \def\arstemprefix@@{\dir}%
+ \edef\artail@@{\arvariant@@{}}%
+ \edef\arstem@@{\arvariant@@{-}}%
+ \edef\arhead@@{\arvariant@@{>}}%
+ \def\armodifiers@@{}%
+ \def\arafterPOS@@{}%
+ \def\arlabels@@{}%
+ \def\arinit@@{}%
+ \def\arexit@@{}%
+ \let\PATHlabelabove@@=\PATHlabelabove@
+ \let\PATHlabelbelow@@=\PATHlabelbelow@
+ \xyFN@\ar@}
+\DOCMODE)
+
+ |\ar@| is where we parse the sequence of <form>s and continue with
+ typesetting the arrow afterwards.
+
+\DOCMODE(
+\xydef@\ar@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\ar@}%
+ \else \addAT@\ifx\next \addAT@\DN@{\xyFN@\ar@form}%
+ \else\ifx |\next
+ \DN@ |{\ar@anchor|}%
+ \else\ifx ^\next
+ \DN@ ^{\ar@anchor^}%
+ \else\ifx _\next
+ \DN@ _{\ar@anchor_}%
+ \else \let\next@=\ar@x \fi\fi\fi\fi\fi \next@}
+\DOCMODE)
+
+ \NOTE: Makes use of the "new compilation principle" to parse a
+ <place> vacuously\dots
+
+\DOCMODE(
+\xydef@\addtoarinit@#1{%
+ \expandafter\def\expandafter\arinit@@\expandafter{\arinit@@ #1}}
+
+\xydef@\addtoarlabels@#1{%
+ \expandafter\def\expandafter\arlabels@@\expandafter{\arlabels@@ #1}}
+
+\xydef@\ar@anchor#1{\begingroup
+ \def\PATHlabelit@@##1##2{%
+ \DN@{##1}\ifx\next@\empty
+ \DN@####1{\expandafter\endgroup\expandafter\addtoarlabels@
+ \expandafter{\the\toks@####1{##2}}\xyFN@\ar@}%
+ \else
+ \DN@####1{\expandafter\endgroup\expandafter\addtoarlabels@
+ \expandafter{\the\toks@*!C####1##1{##2}}\xyFN@\ar@}\fi
+ \expandafter\next@\expandafter{\PATHitshape@@}}%
+ \toks@={#1}%
+ \def\xy@##1##2{\addtotoks@{##1}}\change@oxy@\xy@ \let\xy@@ix@=\eat@
+ \DNii@{}\xyFN@\PATHanchor@}
+\DOCMODE)
+
+ |\ar@form| handles one <form>:
+
+\DOCMODE(
+\xydef@\ar@form{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\ar@form}%
+ \else\ifx ^\next \DN@ ^{\xyFN@\ar@style}\edef\arvariant@@{\string^}%
+ \else\ifx _\next \DN@ _{\xyFN@\ar@style}\edef\arvariant@@{\string_}%
+ \else\ifx 0\next \DN@ 0{\xyFN@\ar@style}\def\arvariant@@{0}%
+ \else\ifx 1\next \DN@ 1{\xyFN@\ar@style}\def\arvariant@@{1}%
+ \else\ifx 2\next \DN@ 2{\xyFN@\ar@style}\def\arvariant@@{2}%
+ \else\ifx 3\next \DN@ 3{\xyFN@\ar@style}\def\arvariant@@{3}%
+ \else\ifx \bgroup\next \let\next@=\ar@style
+ \else\ifx [\next \DN@[##1]{\ar@modifiers{[##1]}}%]
+ \else\ifx *\next \DN@ *{\ar@modifiers}%
+ \else\addLT@\ifx\next \let\next@=\ar@slide
+ \else\ifx /\next \let\next@=\ar@curveslash
+ \else\ifx (\next \let\next@=\ar@curveinout %)
+ \else\addRQ@\ifx\next \addRQ@\DN@{\ar@curve@}%
+ \else\addLQ@\ifx\next \addLQ@\DN@{\xyFN@\ar@curve}%
+ \else\addDASH@\ifx\next \addDASH@\DN@{\defarstem@-\xyFN@\ar@}%
+ \else\addEQ@\ifx\next \addEQ@\DN@{\def\arvariant@@{2}\defarstem@-\xyFN@\ar@}%
+ \else\addDOT@\ifx\next \addDOT@\DN@{\defarstem@.\xyFN@\ar@}%
+ \else\ifx :\next \DN@:{\def\arvariant@@{2}\defarstem@.\xyFN@\ar@}%
+ \else\ifx ~\next \DN@~{\defarstem@~\xyFN@\ar@}%
+ \else\ifx !\next \DN@!{\dasharstem@\xyFN@\ar@}%
+ \else\ifx ?\next \DN@?{\ar@upsidedown\xyFN@\ar@}%
+ \else \let\next@=\ar@error
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\defarstem@#1{\edef\arstem@@{\arvariant@@{\string#1}}%
+ \DNii@##1##{\next@}%
+ \edef\next@##1{\def\noexpand\artail@@{\arvariant@@{##1}}}%
+ \expandafter\nextii@\artail@@
+ \edef\next@##1{\def\noexpand\arhead@@{\arvariant@@{##1}}}%
+ \expandafter\nextii@\arhead@@}
+
+\xydef@\dasharstem@{%
+ \DN@##1##{\nextii@{##1}}\DNii@##1##2{\def\arstem@@{##1{##2##2}}}%
+ \expandafter\next@\arstem@@}
+
+\xydef@\ar@error#1{\xyerror@{Illegal <form>ation (\meaning\next)}{}%
+ \xyFN@\ar@}
+\DOCMODE)
+
+ |\ar@i| sets the remaining defaults and then allows |\ar@ii|-|iv| to
+ pick up any tail, stem, and head using a {|$|} as terminator.%$
+
+\DOCMODE(
+\xydef@\ar@style{%
+ \ifx \bgroup\next \def\artail@@{{}}%
+ \edef\arstem@@{\arvariant@@{-}}\edef\arhead@@{\arvariant@@{>}}%
+ \expandafter\ar@i
+ \else \resetvariant@\artail@@ \resetvariant@\arstem@@ \resetvariant@\arhead@@
+ \expandafter\xyFN@\expandafter\ar@ \fi}
+
+\xydef@\resetvariant@#1{%
+ \DN@##1##{\DN@{##1}\ifx\next@\empty
+ \DN@{\expandafter\nextii@\expandafter{\arvariant@@}}%
+ \else \DN@{\nextii@{##1}}\fi \next@}%
+ \DNii@##1##2{\def#1{##1{##2}}}%
+ \expandafter\next@#1}
+
+\xydef@\ar@i#1{\DN@{#1}%
+ \ifx\next@\empty \edef\arstem@@{\arvariant@@{}}\edef\arhead@@{\arvariant@@{}}%
+ \DN@{\xyFN@\ar@}%
+ \else
+ \let\arcomponent@@=\ar@ii \let\arcomponenttype@@=\artip@
+ \DN@{\xyFN@\arcomponent@#1$}%
+ \fi \next@}
+
+\xydef@\ar@ii{\ifx $\next \let\next@=\ar@iv
+ \else \expandafter\def\expandafter\artail@@\expandafter{\the\toks@}%
+ \let\arcomponent@@=\ar@iii \let\arcomponenttype@@=\arconn@
+ \DN@{\xyFN@\arcomponent@}\fi \next@}
+
+\xydef@\ar@iii{%
+ \expandafter\def\expandafter\arstem@@\expandafter{\the\toks@}%
+ \resetvariant@\artail@@
+ \let\arcomponent@@=\ar@iv \let\arcomponenttype@@=\artip@
+ \xyFN@\arcomponent@}
+
+\xydef@\ar@iv{%
+ \expandafter\def\expandafter\arhead@@\expandafter{\the\toks@}%
+ \ifx $\next \DN@ ${\xyFN@\ar@}%
+ \else \xyerror@{illegal <arrow>: \meaning\next\space not valid}{}\fi \next@}
+\DOCMODE)
+
+ |\ar@x| is the final macro that passes control to the <path>
+ interpreter. It is a bit clumsy because we must pass the right
+ character tokens; it could definitely be more efficient by calling
+ <path> internals directly\dots
+
+\DOCMODE(
+\xydef@\ar@x{%
+ \let\arsavedPATHafterPOS@@=\PATHafterPOS \let\PATHafterPOS=\arafterPOS@
+ \toks@={\ar@PATH}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\artail@@}}%#1
+ \expandafter\addtotoks@\expandafter{\expandafter{\arstem@@}}%#2
+ \expandafter\addtotoks@\expandafter{\expandafter{\arstemprefix@@}}%#3
+ \expandafter\addtotoks@\expandafter{\expandafter{\arhead@@}}%#4
+ \expandafter\addtotoks@\expandafter{\expandafter{\armodifiers@@}}%#5
+ \expandafter\addtotoks@\expandafter{\expandafter{\arinit@@}}%#6
+ \expandafter\addtotoks@\expandafter{\expandafter{\arexit@@}}%#7
+ \expandafter\addtotoks@\expandafter{\expandafter{\arlabels@@}}%#8
+ \addtotoks@{\afterar@@}%#9
+ \expandafter\DNii@\expandafter{\the\toks@}\toks@={}%
+%
+%{\let\x=\expandafter \x\x\x\DNii@\x\x\x{\nextii@}\W@{RUN: \codeof\nextii@}}%
+%
+ \nextii@}
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{%
+ \def\next{%
+ \afterPATH{#9}%
+ ~={#6\preconnect#5#3#2}%
+ ~/{#7}%
+ ~<{|<*h#5\dir#1}%
+ ~>{|>*h#5\dir#4}%
+ ~+{#8}%
+ }%
+ \next}}
+
+\xylet@\ar@PATH=\next
+
+\xydef@\arafterPOS@#1{%
+ \arsavedPATHafterPOS@@{\let\PATHafterPOS=\arsavedPATHafterPOS@@
+ \DN@{#1}\expandafter\next@\arafterPOS@@}}%
+
+\xylet@\arsavedPATHafterPOS@@=\relax
+\DOCMODE)
+
+ <tip>s and <conn>ectors are interpreted by these that leave any
+ <variant> in |\toks@ii| and the sequence of <tipchar>s or <connchar>s
+ characters in |\toks@|:
+
+ The work is really done in |\arcomponent@| that builds |\toks@|
+ with something conforming to the |\arcomponenttype@@| and then
+ passes control to |\arcomponent@@|:
+
+\DOCMODE(
+\xydef@\arcomponent@{%
+ \ifx ^\next \toks@ii={^}\DN@ ^{\xyFN@\arcomponent@i}%
+ \else\ifx _\next \toks@ii={_}\DN@ _{\xyFN@\arcomponent@i}%
+ \else\ifx 1\next \toks@ii={1}\DN@ 1{\xyFN@\arcomponent@i}%
+ \else\ifx 2\next \toks@ii={2}\DN@ 2{\xyFN@\arcomponent@i}%
+ \else\ifx 3\next \toks@ii={3}\DN@ 3{\xyFN@\arcomponent@i}%
+ \else\ifx \bgroup\next \expandafter\toks@ii\expandafter{\arvariant@@}%
+ \let\next@=\arcomponent@i
+ \else\ifx *\next \DN@*##1##{\arcomponent@ii{##1}}%
+ \else \expandafter\toks@ii\expandafter{\arvariant@@}\toks@={}%
+ \let\next@=\arcomponenttype@@
+ \fi\fi\fi\fi\fi\fi\fi
+ \next@}
+
+\xydef@\arcomponent@i#1{\toks@={#1}\arcomponent@x}
+
+\xydef@\arcomponent@ii#1#2{\toks@={*#1{#2}}\xyFN@\arcomponent@@}
+
+\xydef@\artip@{%
+ \addGT@\ifx\next \addGT@\addtotoks@ \addGT@\DN@{\xyFN@\artip@}%
+ \else\addLT@\ifx\next \addLT@\addtotoks@ \addLT@\DN@{\xyFN@\artip@}%
+ \else\ifx (\next \addtotoks@(\DN@({\xyFN@\artip@}%
+ \else\ifx )\next \addtotoks@)\DN@){\xyFN@\artip@}%
+ \else\ifx |\next \addtotoks@|\DN@|{\xyFN@\artip@}%
+ \else\addLQ@\ifx\next \addLQ@\addtotoks@ \addLQ@\DN@{\xyFN@\artip@}%
+ \else\addRQ@\ifx\next \addRQ@\addtotoks@ \addRQ@\DN@{\xyFN@\artip@}%
+ \else\addPLUS@\ifx \next \addPLUS@\addtotoks@ \addPLUS@\DN@{\xyFN@\artip@}%
+ \else\ifx /\next \addtotoks@/\DN@/{\xyFN@\artip@}%
+ \else\ifcat A\noexpand\next \DN@##1{\addtotoks@{##1}\xyFN@\artip@}%
+ \else\ifx\space@\next \addtotoks@{ }\expandafter\DN@\space{\xyFN@\artip@}%
+ \else \let\next@=\arcomponent@x
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\arconn@{%
+ \addDASH@\ifx\next \addDASH@\addtotoks@ \addDASH@\DN@{\xyFN@\arconn@}%
+ \else\addEQ@\ifx\next \addEQ@\addtotoks@ \addEQ@\DN@{\xyFN@\arconn@}%
+ \ifx\arvariant@@\empty \def\arvariant@@{2}\fi
+ \else\addDOT@\ifx\next \addDOT@\addtotoks@ \addDOT@\DN@{\xyFN@\arconn@}%
+ \else\ifx :\next \addtotoks@:\DN@:{\xyFN@\arconn@}%
+ \ifx\arvariant@@\empty \def\arvariant@@{2}\fi
+ \else\ifx ~\next \addtotoks@~\DN@~{\xyFN@\arconn@}%
+ \else \let\next@=\arcomponent@x
+ \fi\fi\fi\fi\fi \next@}
+
+\xydef@\arcomponent@x{%
+ \DN@##1{\toks@=\expandafter{\the\toks@ii{##1}}}%
+ \expandafter\next@\expandafter{\the\toks@}%
+ \xyFN@\arcomponent@@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notescontd}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[build arrow]
+
+ Building an <arrow> is simply using the specified directionals (using
+ ??c![\dir] of~\S??g[xy.doc:objectlib.directionals]) to build a path:
+ the first <tip> becomes the "??w![arrow tail]" of the arrow, the
+ <conn>ection in the middle becomes the "??w![arrow stem]", and the
+ second <tip> becomes the "??w![arrow head]". If a <variant> is given
+ before the |{| then that variant ??c![\dir] is used for all three.
+ For example,
+%
+\begin{code}
+\xy\ar @^{(->} (20,7)\endxy
+\end{code}
+\displaycode
+%
+ typesets
+%
+$$\docode$$
+
+\begin{exercise}
+ Typeset these arrows:
+%
+\begin{code}
+\xy ;<1pc,0pc>:
+ \POS(0,0)*+{A}
+ \ar +(-2,3)*+{A'}*\cir{}
+ \ar @2 +( 0,3)*+{A''}*\cir{}
+ \ar @3 +( 2,3)*+{A'''}*\cir{}
+ \POS(6,0)*+{B}
+ \ar @1{||.>>} +(-2,3)*+{B'}*\cir{}
+ \ar @2{||.>>} +( 0,3)*+{B''}*\cir{}
+ \ar @3{||.>>} +( 2,3)*+{B'''}*\cir{}
+\endxy
+\end{code}
+$$\docode$$
+%
+\answertext{Here is the entire \Xy-picture of the exercise:}
+\answercode
+\answertext\displaycode
+\answertext{The first batch use the default |{->}| specification.}
+\end{exercise}
+
+ The above is a flexible scheme when used in conjunction with the
+ kernel ??c![\newdir] to define all sorts of arrowheads and -tails. For
+ example,
+%
+\begin{code}
+\newdir{|>}{!/4.5pt/\dir{|}
+ *:(1,-.2)\dir^{>}
+ *:(1,+.2)\dir_{>}}
+\end{code}
+\displaycode
+\gdocode
+%
+ defines a new arrow tip that makes
+%
+\begin{code}
+\xy (0,0)*+{A}
+ \ar @{=|>} (20,3)*+{B}
+\endxy
+\end{code}
+\displaycode
+%
+ typeset
+%
+$$\docode$$
+%
+ Notice that the fact that the directional uses only <tipchar>
+ characters means that it blends naturally with the existing tips.
+
+\begin{exercise}
+ Often tips used as `tails' have their ink on the wrong side of the
+ point where they are placed. Fortunately space is also a <tipchar>
+ so we can define |\dir{ >}| to generate a `tail' arrow. Do this such
+ that
+%
+\begin{code}
+\xy (0,0)*+{A}="a", (20,3)*+{B}="b"
+ \ar @{>->} "a";"b" < 2pt>
+ \ar @{ >->} "a";"b" <-2pt>
+\endxy
+\end{code}
+\displaycode
+%
+ typesets
+%
+$$
+ \newdir{ >}{{}*!/-5pt/\dir{>}}
+ \docode
+$$
+%
+\begin{code}
+\newdir{ >}{{}*!/-5pt/\dir{>}}
+\end{code}
+\answercode
+\answertext{The author used \displaycode}
+\end{exercise}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[any <dir>ectional]
+
+ Specifying a <dir> as a <tip> or <conn> means that ??c![\dir]<dir> is
+ used for that <tip> or <conn>. For example,
+%
+\begin{code}
+\xy\ar @{<^{|}>} (20,7)\endxy
+\end{code}
+\displaycode
+%
+ typesets
+%
+$$\docode$$
+%
+ When using this you must specify a |{}| dummy <dir>ectional in order
+ to ignore one of the tail, stem, or tip components, \eg,
+%
+\begin{code}
+\xy\ar @{{}{+}>} (20,7)\endxy
+\end{code}
+\displaycode
+%
+ typesets
+%
+$$\docode$$
+%
+ In particular ??c![*]<object> is a <dir> so any <object> can be used
+ for either of the tail, stem, or head component:
+%
+\begin{code}
+\xy\ar @{*{x}*{y}*{z}} (20,7)\endxy
+\end{code}
+\displaycode
+%
+ typesets
+%
+$$\docode$$
+%
+ \NOTE: A |*| introduces an <object> whereas the directional
+ `$\xy*+!<0pt,-\jot>\dir{*}\endxy$' is typeset by the <dir> |{*}|.
+
+\begin{exercise}
+ Typeset
+\begin{code}
+\xy
+ \ar @{>>*\composite{\dir{x}*\dir{+}}<<}
+ (20,7)
+\endxy
+\end{code}
+$$\docode$$
+ using only one |\ar| command.
+%
+\answertext{The author used}
+\answercode
+\answertext\displaycode
+\end{exercise}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[curve]
+%
+ "Curving" the arrow using $??c![/]d\ell|/|$, where $d$ is a
+ <direction> and $\ell$ a <dimen>sion, makes the stem a curve which is
+ similar to a straight line but has had it's center point `dragged'
+ the distance~$\ell$ in~$d$:
+%
+\begin{code}
+\xy
+ \POS (0,10) *\cir<2pt>{} ="a"
+ , (20,-10)*\cir<2pt>{} ="b"
+ \POS"a" \ar @/^1ex/ "b"|\uparrow
+ \POS"a" \ar @/_1ex/ "b"|\downarrow
+%
+ \POS (20,10) *\cir<2pt>{} ="a"
+ , (40,-10)*\cir<2pt>{} ="b"
+ \POS"a" \ar @/u1ex/ "b"|u
+ \POS"a" \ar @/d1ex/ "b"|d
+\endxy
+\end{code}
+$$\docode$$
+%
+ was typeset by
+%
+\displaycode
+%
+ $\ell$ defaults to |.5pc| if omitted.
+
+ This is really just a shorthand for curving using the more general
+ form described next: $??c![@/]d\ell|/|$ is the same as |@`{{**{}
+ ?+/|$d~2\ell~$|/}}| which makes the (quadratic) curve pass through
+ the point defined by the <pos> |**{} ?+/|$d\ell$|/|.
+
+\DOCMODE(
+\xydef@\ar@curveslash/#1/{\expandafter\ar@curve@\ar@slashing{#1}}
+
+\xydef@\ar@slashing#1{{\xy@{**{} ?+/#1/+/#1/ @+c}{\setupDirection@
+ \vfromslide@{#1}%
+ \X@c=2\X@c \advance\X@c\X@p \advance\X@c.5\d@X
+ \Y@c=2\Y@c \advance\Y@c\Y@p \advance\Y@c.5\d@Y
+ \czeroEdge@
+ \spushc@}}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[in-out directions]
+%
+ Using ??c![@(]$d_2$|,|$d_2$|)| where $d_1,d_2$ are simple
+ <direction>s (as described in note~??g[xy.doc:<direction>] except it
+ is not possible to use |()|s) will typeset the arrow curved such that
+ it leaves the source in direction $d_1$ and enters the target from
+ direction~$d_2$.
+
+\begin{exercise}
+ Typeset
+%
+\begin{code}
+\xy *{\circ}="b" \ar@(ur,ul) c
+ \ar@{.>}@(dr,ul) (20,0)*{\bullet}
+\endxy
+\end{code}
+$$\docode$$
+\answercode
+\answertext{The author used \displaycode\noindent Note that it is essential
+ that the curving specification comes after the arrow style.}
+\end{exercise}
+
+\DOCMODE(
+{\xyuncatcodes \catcode`\#=6 %
+ \gdef\next(#1,#2){{+/#1 3pc/,p+/#2 3pc/}}}
+\xylet@\ar@curveinout@=\next
+
+\xydef@\ar@curveinout{\expandafter\ar@curve@load\ar@curveinout@}
+\DOCMODE)
+
+ \TODO: implement this efficiently and properly get rid of the no-|()|
+ restriction!
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[curve setup]
+%
+ The final curve form is the most general one: |@`{|<control point
+ lists>|}| sets the control points explicitly to the ones in the
+ <control point lists> (where they should be separated by~|,|). See
+ the curve extension described in~\S??g[:curve] for the way the
+ control points are used; when the control points list is parsed $p$
+ is the source and $c$ the target of the arrow.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Curving simply uses ??c![\crvi] instead of ??c![\dir]. The
+ only tricky bit is to put the control points on the stack
+ right.
+
+\DOCMODE(
+\xydef@\ar@curve{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\ar@curve}%gobble spaces
+ \else\ifx \bgroup\next \let\next@=\ar@curve@load
+ \else\ifx "\next \DN@"##1"{\ar@curve@{"##1"}}%
+ \else \xyerror@{@= <form> must be followed by \string"<id>\string" or
+ {<control point list>}}{}%
+ \fi\fi\fi \next@}
+
+{\xyuncatcodes \gdef\next#1#2{\def#1##1{#2{;@={##1}}}}}
+\next\ar@curve@load\ar@curve@
+
+\xydef@\ar@curve@#1{\curve@check
+ \setcurvearinit@{#1}\setcurvearexit@\arexit@@
+ \def\arstemprefix@@{\crvi}\xyFN@\ar@}
+
+{\xyuncatcodes \gdef\next#1{\save @(,#1\restore}}
+\xylet@\setcurvearinit@i=\next
+\xydef@\setcurvearinit@#1{%
+ \expandafter\addtoarinit@\expandafter{\setcurvearinit@i{#1}}}
+
+{\xyuncatcodes \gdef\next#1{\def#1{\POS @i @) }}}
+\xylet@\setcurvearexit@=\next
+
+\xydef@\curve@check{%
+ \xyerror@{Forms @/.../, @(...), and @`{...}, only available when curve
+ extension loaded}{}}
+\xywithoption{curve}{\let\curve@check=\relax}
+\DOCMODE)
+
+ \TODO: The parsing is trivial and should be extended to include more
+ exotic control point forms.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[object <modifier>s]
+%
+ |@[|\dots|]| and |@*{|\dots|}| formations define what object
+ <modifier>s should be used when building objects that are part of the
+ arrow. This is mostly useful in conjunction with extensions that
+ define additional |[|<shape>|]| modifiers, \eg, if a |[red]|
+ <modifier> changes the colour of an object to red then |@[red]|
+ will make the entire arrow red; similarly if it is desired to make
+ and entire arrow invisible then |@*{i}| can be used.
+
+\DOCMODE(
+\xydef@\ar@modifiers#1{%
+ \expandafter\def\expandafter\armodifiers@@\expandafter{\armodifiers@@#1}%
+ \xyFN@\ar@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[slide arrow]
+%
+ ??c![@<]$D$|>| will slide (each segment of) the arrow the dimension $D$
+ as explained in note~??[slide].
+
+\DOCMODE(
+{\xyuncatcodes \catcode`\#=6 \catcode`\@=11 %
+ \gdef\next<#1>{\def\arafterPOS@@{<#1>}\xyFN@\ar@}}
+\xylet@\ar@slide=\next
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[reverse meaning of above and below]
+%
+ ??c![@?] reverse the meaning of `above' and `below' for this particular
+ arrow.
+
+\DOCMODE(
+\xydef@\ar@upsidedown{\let\next=\PATHlabelabove@@
+ \let\PATHlabelabove@@=\PATHlabelbelow@@ \let\PATHlabelbelow@@=\next}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notescontd}
+
+ All the features of <path>s described above are available for arrows.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection*{End \& log}
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyarrow.doc,v $
+% Revision 3.5 1997/05/28 13:05:01 krisrose
+% Fixed missing breaks bug.
+%
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 10:25:18 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% NEW for version 2.7 based of path and arrow code in xypic.doc 2.6.1.1.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs how we are formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xycmactex.doc b/Master/texmf-dist/source/generic/xypic/xycmactex.doc
new file mode 100644
index 00000000000..5e156789e39
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xycmactex.doc
@@ -0,0 +1,71 @@
+%% $Id: xycmactex.doc,v 3.3 1996/12/18 08:54:25 ross Exp $
+%%
+%% Xy-pic ``CMacTeX'' driver interface option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{cmactex}{CMacTeX driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Thomas Kiffe's {CMac\TeX} application uses \dvips\ as its dvi-driver.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE(
+\xyrequire{dvips}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xycmactex.doc,v $
+% Revision 3.3 1996/12/18 08:54:25 ross
+% no changes
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xycmtip.doc b/Master/texmf-dist/source/generic/xypic/xycmtip.doc
new file mode 100644
index 00000000000..5f337fb6c15
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xycmtip.doc
@@ -0,0 +1,93 @@
+%% $Id: xycmtip.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+%%
+%% Xy-pic ``Computer Modern tips'' extension.
+%% Copyright (c) 1992-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{cmtip}{Computer Modern tip extension}{\stripRCS$Revision: 3.3 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This extension is a dummy that merely loads the `tips' extension and
+ defines the obsolete ??c![\UseComputerModernTips] and
+ ??c![\NoComputerModernTips] selection commands.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\subsection{Fonts}
+
+ Load `tips'; the default is |cm| at |10| point so all is well.
+
+\DOCMODE(
+\xyrequire{tips}\xycatcodes
+\DOCMODE)
+
+ Define the obsolete selection commands.
+
+\DOCMODE(
+\xydef@\UseComputerModernTips{\SelectTips{cm}{10}\UseTips}
+\xydef@\NoComputerModernTips{\NoTips}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{End \& log}
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xycmtip.doc,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.6 1993/10/21 20:36:09 kris
+% NEW file to go in version 2.7!
+%
+% Extracted from xypic.doc 2.6.1.1.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs how we are formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xycolor.doc b/Master/texmf-dist/source/generic/xypic/xycolor.doc
new file mode 100644
index 00000000000..dfbb4d05b4f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xycolor.doc
@@ -0,0 +1,349 @@
+%% $Id: xycolor.doc,v 3.3 1996/12/19 03:50:08 ross Exp $
+%%
+%% Xy-pic ``Colour extension'' option.
+%% Copyright (c) 1993-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{color}{Colour extension}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This extension provides the ability to request that any object be displayed
+in a particular colour.
+
+It requires a suitable `driver' option to provide the necessary |\special|
+commands to implement the effects. Thus
+$$
+\xy
+ *+\txt<.8\hsize>{Using this extension will have no effect on the output
+ unless used with a dvi-driver that explicitly supports it.}
+ *\frm{-}
+\endxy
+$$
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+All effects defined in the |color| extension can be implemented using most
+\PS\ <driver>s, and some non-\PS\ ones, loaded using |\xyoption{xyps}|.
+This file provides `generic' code which is known to work correctly with
+most drivers. For driver-specific variations, consult the appropriate
+<driver> file.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%\paragraph*{Colour}
+Colours are specified as a <shape> modifier which gives the name of the
+colour requested. It is applied to the whole of the current <object>
+whether this be text, an \Xy-pic line, curve or arrow-tip, or a composite
+object such as a matrix or the complete picture. However some DVI drivers
+may not be able to support the colour in all of these cases.
+%
+\begin{defs}
+|[|<colour name>|]| & use named colour\cr
+\noalign{\smallskip}
+??c![\newxycolor]|{|<name>|}{|<code>|}|\kern-20pt &\kern25pt
+ define colour \cr
+??c![\UseCrayolaColors] & load colour names \cr
+\end{defs}
+%
+If the DVI-driver cannot support colour then a request for colour
+only produces a warning message in the log file. After two such
+messages subsequent requests are ignored completely.
+
+\DOCMODE(
+\xydef@\xycolorwarning@@{\xycolormessage@
+ \gdef\xycolorwarning@{\xycolormessage@
+ \xywarning@{...no further colour warnings will be given.}%
+ \global\let\xycolorwarning@=\relax }}
+\xylet@\xycolorwarning@=\xycolorwarning@@
+
+\xydef@\xycolormessage@{%
+ \xywarning@{Current driver does not support colour.}}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+There are two methods, perhaps used simultaneously, for handling requests
+for colour. The |\xylocalColor@| is the normal method, colouring whatever
+objects \TeX\ typesets from fonts. The more specialized |\xycolor@| is used
+with the \PS\ back-end. This is necessary since some <driver>s assume that
+the current colour should be `black' when the contents of a |\special| is
+interpreted, e.g. within \PS.
+
+Thus a <driver> which supports both colour and \PS\ must define a method
+to handle |\xylocalColor@| but should leave alone |\xycolor@|. The latter
+method will be adjusted appropriately when a \PS\ <driver> is installed.
+
+\DOCMODE(
+\xydef@\xyNoColor@#1{}
+\xylet@\xycolor@@=\xyNoColor@
+\xydef@\xyNoColor@@#1#2{\xycolorwarning@}
+
+\xydef@\xycolor@{\xycolor@@}
+\xylet@\xylocalColor@=\xyNoColor@@
+
+\xydef@\UnloadColor@{%
+ \let\xylocalColor@=\xyNoColor@@
+% \let\xycolor@=\xyNoColor@
+ \let\xycolor@@=\xyNoColor@
+ \let\xycolorwarning@=\xycolorwarning@@ }
+\xylet@\UnloadColor@@=\UnloadColor@
+
+\xyaddunsupport{color}{\UnloadColor@@\relax}
+\DOCMODE)
+
+This next macro is to inherit a default colour from the surrounding
+document, perhaps using one already defined by \LaTeXe
+
+\DOCMODE(
+\ifx\current@color\undefined \xydef@\xybasecolor@{}%
+\else \def\xybasecolor@{\current@color}\fi
+
+%\xydef@\xycmath@{\hbox\bgroup\dimen@=.55ex \checkxycolor@ \xyinside@}
+%\xydef@\xycnomath@{\hbox\bgroup\dimen@=\z@ \checkxycolor@ \xyinside@}
+
+%\xydef@\checkxycolor@{\ifx\xybasecolor@\empty\else
+% \expandafter\imposexycolor@\fi}
+%\xydef@\imposexycolor@{\xylocalColor@}
+\DOCMODE)
+
+A commonly used method is to maintain a colour-stack.
+The following commands are for use with such a setup, however they should
+only be called from code installed from a <driver>-file. Different drivers
+may do things differently; e.g. |dvips| uses a single |\special| via:
+|\def\xycolor@push@@#1{\special{color push #1}}|, but Textures uses two:
+|\xydef@\xycolor@push#1{\special{color push}\special{color #1}}|.
+Since the colour-stack idea was proposed by Tomas Rokicki,the |dvips| method
+is the default behaviour.
+
+\DOCMODE(
+\xydef@\xystackcolor@{\bgroup \DN@##1##2{\egroup}%
+ \ifInvisible@\else\ifHidden@\else\DNii@{\no@@}\ifx\nextii@\Connect@@
+ \else\DN@{\xystackcolor@i}\fi\fi\fi \next@ }
+
+\xydef@\xystackcolor@i#1#2{\checkXyStyle@
+ \DN@{#2}\ifx\next@\empty
+ \def\tmp@##1{\DN@{\xycolor@push{#1}##1\xycolor@pop}}%
+ \else\def\tmp@##1{\DN@{\xycolor@push{#2 #1}##1\xycolor@pop}}\fi
+ \toks@={\egroup \let\xy@style@=\relax \def\Drop@@}%
+ \expandafter\tmp@\expandafter{\Drop@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\next@}\def\Connect@@}%
+ \expandafter\tmp@\expandafter{\Connect@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\next@}}%
+ \the\toks@ }%
+
+\xydef@\xycolor@push@@#1{\special{color push #1}}
+\xydef@\xycolor@pop{\special{color pop}}
+\xylet@\xycolor@push=\xycolor@push@@
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Named colours and colour models}
+
+New colour names are created with |\newxycolor|, taking two arguments.
+Firstly a name for the colour is given, followed by the code which will
+ultimately be passed to the output device in order to specify the colour.
+If the current driver cannot support colour, or grayscale shading, then
+the new name will be recognised, but ignored during typesetting.
+
+\DOCMODE(
+\xydef@\newxycolor#1#2{\newxyColor{#1}{}{}{#2}{}}
+\xydef@\newxyColor#1#2#3#4{\newxycolor@{#1}{#2}{#3}{#4}{}}
+\DOCMODE)
+
+For \PS\ devices, the \Xy-ps \PS\ dictionary defines operators |rgb|,
+|cmyk| and |gray| corresponding to the standard RGB and CMYK colour models
+and grayscale shadings.
+Colours and shades are described as:
+$r\;g\;b$ |rgb| or $c\;m\;y\;k$ |cmyk| or $s$ |gray|, where the parameters
+are numbers in the range $0\le r,g,b,c,m,y,k,s\le 1$.
+The operators link to the built-in colour models
+ or, in the case of |cmyk| for earlier versions of \PS, give a simple
+emulation in terms of the RGB model.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Existing color names can be overridden using |\newxycolor@#1#2\relax|.
+
+\DOCMODE(
+\xydef@\newxycolor@#1#2#3#4#5{%
+ \expandafter\let\expandafter\next@\csname shape [#1]\endcsname
+ \ifx\next@\relax
+ \DN@{#4}\ifx\next@\empty
+ \DN@{#2}\ifx\next@\empty
+ \DN@{\newxystyle{#1}{\xylocalColor@{}{#3}\xycolor@{#3}}}%
+ \else
+ \DN@{\newxystyle{#1}{\xylocalColor@{#2}{#3}\xycolor@{#2 #3}}}%
+ \fi
+ \else\DN@{#2#3}\ifx\next@\empty
+ \DN@{\newxystyle{#1}{\xylocalColor@{#4}{}\xycolor@{#4}}}%
+ \else
+ \DN@{\newxystyle{#1}{\xylocalColor@{#2}{#3}\xycolor@{#4}}}%
+ \fi \fi
+ \else \def\tmp@{\relax}\DNii@{#5}%
+ \ifx\nextii@\tmp@
+ \DN@{#4}\ifx\next@\empty
+ \DN@{#2}\ifx\next@\empty
+ \DN@{\newxystyle{#1}{\xylocalColor@{}{#3}\xycolor@{#3}}}%
+ \else
+ \DN@{\newxystyle{#1}{\xylocalColor@{#2}{#3}\xycolor@{#2 #3}}}%
+ \fi
+ \else
+ \DN@{#2#3}\ifx\next@\empty
+ \DN@{\newxystyle{#1}{\xylocalColor@{#4}{}\xycolor@{#4}}}%
+ \else
+ \DN@{\newxystyle{#1}{\xylocalColor@{#2}{#3}\xycolor@{#4}}}%
+ \fi \fi
+ \else\DN@{}\fi\fi \next@\relax}
+\DOCMODE)
+
+Standard colour names which are defined automatically correspond
+to the three primaries |red|, |green|, |blue| and their complements
+|cyan|, |magenta|, |yellow| as well as three extreme grayscale shades
+|black|, |white|, |gray|.
+
+\DOCMODE(
+\xydef@\xystandardcolors@{%
+% \newxycolor@{black}{1.}{gray}{}\relax % Textures reverses gray-scales
+% \newxycolor@{white}{0.}{gray}{}\relax %
+% \newxycolor@{black}{0.}{gray}{}\relax % This is normal for PostScript
+% \newxycolor@{white}{1.}{gray}{}\relax %
+ \newxycolor@{black}{0. 0. 0.}{rgb}{}\relax % avoid the hassles.
+ \newxycolor@{white}{1. 1. 1.}{rgb}{}\relax %
+ \newxycolor@{gray}{.5}{gray}{}\relax
+ \newxycolor@{grey}{.5}{gray}{}\relax
+ \newxycolor@{red}{1. 0. 0.}{rgb}{}\relax
+ \newxycolor@{green}{0. 1. 0.}{rgb}{}\relax
+ \newxycolor@{blue}{0. 0. 1.}{rgb}{}\relax
+ \newxycolor@{cyan}{0. 1. 1.}{rgb}{}\relax
+ \newxycolor@{magenta}{1. 0. 1.}{rgb}{}\relax
+ \newxycolor@{yellow}{1. 1. 0.}{rgb}{}\relax
+ \xyuncatcodes }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\NOTE: The driver file must call |\xystandardcolors@| before these colours
+become accessible. This is to allow any <driver>-specific definitions
+to be active when these colours are defined.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Saving colour and styles}
+%
+When styles are saved using |[=|<word>|]|, see~??c[[=],
+then the current colour setting (if any) is saved also.
+Subsequent use of |[|<word>|]| recovers the colour and accompanying
+line-style settings.
+
+Further colour names are defined by the command |\UseCrayolaColours| that
+loads the |crayon| option, in which more colours are defined. Consult the
+file |xyps-col.doc| for the colours and their specifications in the RGB
+or CMYK models.
+
+\DOCMODE(
+\xydef@\UseCrayolaColors{\xyrequire{crayon}\xyuncatcodes}%
+% \xyinputorelse@{xyps-col}{\xyerror@{Could not load xyps-col}{}}}
+\DOCMODE)
+
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\subparagraph*{xyps-col.tex:}
+\subparagraph*{xycrayon.tex:}
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\subsubsection{{\tt xyps-col.doc}:}
+\subsubsection{{\tt xycrayon.doc}:}
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\inputdoc!{xyps-col.doc}
+\inputdoc!{xycrayon.doc}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{\PS\ colour}
+%
+When \PS\ driver support is available, the method for handling colour
+within diagrams may be different. The reason for this is that some
+dvi-drivers reset the colour to black before placing the contents of the
+|\special|. To counter this, the \PS\ code maintains its own colour-stack.
+Support is established within a separate file |xyps-c.tex|, loaded from
+the appropriate <driver>-files.
+
+\DOCMODE(
+\xydef@\xyBEcolorcheck@{\ifx\xycolor@@\xyNoColor@\else
+ \xywarning@{PostScript colour support should be OK.}\fi }%
+
+\xywithoption{ps}{%
+ \xyinputorelse@{xyps-c}{\xyerror@{Could not load xyps-c}{}}}%
+ \xycatcodes
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xycolor.doc,v $
+% Revision 3.3 1996/12/19 03:50:08 ross
+% Maintenance release.
+%
+% Revision 3.3 1996/12/18 08:56:49 ross
+% minor updates
+%
+% Revision 3.2 1995/09/19 18:20:20 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/06 02:56:02 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.10 1994/06/15 12:46:03 ross
+% Second release 3beta.
+% Colour and line style saving works; label colouring bug fixed.
+%
+% Revision 2.9 1994/06/09 14:39:49 ross
+% Release 3beta.
+%
+% NEW for version 2.9 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xycrayon.doc b/Master/texmf-dist/source/generic/xypic/xycrayon.doc
new file mode 100644
index 00000000000..4be9d637d29
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xycrayon.doc
@@ -0,0 +1,82 @@
+%% $Id: xycrayon.doc,v 3.3 1996/12/18 08:58:16 ross Exp $
+%%
+%% Xy-pic ``Crayola colours'' PostScript backend support.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{crayon}{Crayola Colours}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This option provides the command to install definitions for the 68 colours
+recognised by name by Tomas Rokicki's |dvips| driver~\cite{dvips}.
+This command must be called from a <driver>-file which can actually
+support the colours.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\DOCHEADER
+
+The colour definitions themselves are in the file |xyps-col.tex|.
+They are not loaded directly here since it is not known which <driver> is
+to be used. Different <driver>s may redefine the |\xynewcolor@| macro
+to set the colour by name or colour-model.
+
+\DOCMODE(
+\xydef@\installCrayolaColors@{%
+ \xyinputorelse@{xyps-col}{\xyerror@{Could not load Crayola colours}{}}%
+ \let\installCrayolaColors@=\relax
+ \xyuncatcodes }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xycrayon.doc,v $
+% Revision 3.3 1996/12/18 08:58:16 ross
+% cosmetic updates
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/05 07:58:43 ross
+% Ready for v3 release?
+%
+#
+% NEW for version 3.1 by Ross Moore 1995/03/18.
+%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xycurve.doc b/Master/texmf-dist/source/generic/xypic/xycurve.doc
new file mode 100644
index 00000000000..0c14745e7c0
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xycurve.doc
@@ -0,0 +1,4920 @@
+%% $Id: xycurve.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Curves and Splines'' extension.
+%% Copyright (c) 1993-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{curve}{Curve and Spline extension}{\stripRCS$Revision: 3.7 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This option provides \Xy-pic with the ability to typeset spline curves
+by constructing curved connections using arbitrary directional objects
+and by encircling objects similarly. "Warning": Using curves can be
+quite a strain on \TeX's memory; you should therefore limit the length
+and number of curves used on a single page. Memory use is less when
+combined with a backend capable of producing its own curves; \eg, the
+\PS\ backend).
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Curved connections}
+??=[curved connections]
+
+\DOCMODE(
+\message{curve,}
+\DOCMODE)
+
+ Simple ways to specify curves in \Xy-pic are as follows:
+ \begin{defs}
+|**\crv{|<poslist>|}| & curved connection \cr
+|**\crvs{|<dir>|}| & get <poslist> from the stack \cr
+|\curve{|<poslist>|}| & as a <decor>ation \cr
+ \end{defs}
+\noindent\unskip
+ in which <poslist> is a list of valid <pos>itions.
+ The decoration form |\curve| is just an abbreviation for |\connect\crv|.
+ As usual, the current $p$ and $c$
+ are used as the start and finish of the connection, respectively.
+ Within <poslist> the <pos>itions are separated by |&|.
+A full description of the syntax for |\crv| is given in figure~??[f.curve].
+
+\begin{code}
+\xy (0,20)*[o]+{A};(60,0)*[o]+{B}="B"
+**\crv{}\POS?(.4)*_+!UR{0},"B"
+**\crv{(30,30)}\POS?*^+!D{1},"B"
+**\crv{(20,40)&(40,40)} \POS?*^+!D{2},"B"
+**\crv{(10,20)&(30,20)&(50,-20)&(60,-10)}
+\POS?*+^!UR{4} \endxy
+\end{code}
+$$\docode$$\goodbreak\goodbreak
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+We need a counter to track the number of control points, (i.e. the number of
+<pos>s in <poslist>) and provide a macro to read it.
+Also a token list which will store the vital information for
+later use, to allow curved connections to work properly.
+
+\DOCMODE(
+\xynew@{count}\crv@cnt@
+\xydef@\xynumctrlpts@{\the\crv@cnt@}
+\xynew@{toks}\crvpts@
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+If <poslist> is empty a straight connection is computed.
+When the length of <poslist> is one or two then the curve is uniquely
+determined as a single-segment B\'ezier quadratic or cubic spline.
+The tangents at $p$ and $c$ are along the lines connecting
+with the adjacent control point.
+With three or more <pos>itions a cubic B-spline construction is used.
+B\'ezier cubic segments are calculated from the given control points.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\setcurve@{%
+ \edef\xysplineparams@{%
+ \expandafter\noexpand\csname params@\endcsname}%
+ \edef\xysplineedges@{%
+ \expandafter\noexpand\csname edges@\endcsname}%
+ \edef\xycrvcnt@{%
+ \expandafter\noexpand\csname crvcnt@\endcsname}%
+ \expandafter\edef\xycrvcnt@{\number\crv@cnt@}%
+ \ifcase\crv@cnt@
+ \expandafter\xycvxhull@\or
+ \expandafter\xyquadbezier@\or
+ \expandafter\xycubicbezier@\or
+ \expandafter\xybspline@iii\or
+ \expandafter\xybspline@iv\else
+ \expandafter\xybspline@
+ \fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The previous picture was typeset using:
+\begin{code}
+\xy (0,20)*+{A};(60,0)*+{B}
+**\crv{}
+**\crv{(30,30)}
+**\crv{(20,40)&(40,40)}
+**\crv{(10,20)&(30,20)&(50,-20)&(60,-10)}
+\endxy
+\end{code}
+\displaycode
+\noindent except for the labels, which denote the number of entries in the
+<poslist>. (Extending this code to include the labels is set below as
+an exercise).
+
+\begin{code}
+\xy (0,20)*[o]+{A};(60,0)*[o]+{B}="B"
+**\crv{} \POS?(.4)*_+!UR{0},"B"
+**\crv{(30,30)} \POS?*^+!D{1},"B"
+**\crv{(20,40)&(40,40)} \POS?*^+!D{2},"B"
+**\crv{(10,20)&(30,20)&(50,-20)&(60,-10)}
+\POS?*+^!UR{4} \endxy
+\end{code}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The |?|-operator of \S??g[xy.doc:pos] (note~??g[xy.doc:<place>])
+ is used to find arbitrary <place>s along a curve in the usual way.
+
+\begin{exercise}
+Extend the code given for the curves in the previous picture
+so as to add the labels giving the number of control points.
+\answertext{This is the code that was actually used:}
+\answercode
+\answertext\displaycode
+\end{exercise}
+
+ Using |?| will set the current direction to be tangential at that
+ <place>, and one can <slide> specified distances
+ along the curve from a found <place> using the |?|\dots|/|<dimen>|/|
+ notation:
+
+\begin{code}
+\xy (0,20)*+{A};(60,0)*+{B}
+**\crv{(10,20)&(30,20)&(50,-20)&(60,-10)}
+ ?<*\dir{<} ?>*\dir{>}
+ ?(.65)*{\oplus} *!LD!/^-5pt/{x}
+ ?(.65)/12pt/*{\oplus} *!LD!/^-5pt/{x'}
+ ?(.28)*=0{\otimes}-/40pt/*+{Q}="q"
+ +/100pt/*+{P};"q" **\dir{-}
+\endxy
+\end{code}
+
+$$\docode$$
+
+\begin{exercise}
+Suggest code to produce something like the above picture;
+the spline curve is the same as in the previous picture.
+"Hints": The line is 140pt long and touches $0.28$ of the way from
+$A$ to $B$ and the $x$ is 0.65 of the way from $A$ to $B$.
+\answertext{This is the code that was used to typeset the picture:}
+\answercode
+\answertext\displaycode
+\end{exercise}
+
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The positions in <poslist> specify
+{\em control points\/} which determine the initial and final directions
+of the curve---leaving $p$ and arriving at $c$---and how the curve
+behaves in between, using standard spline constructions.
+In general, control points need not lie upon the actual curve.
+
+A natural spline parameter varies in the interval $[0,1]$ monotonically
+along the curve from $p$ to $c$. This is used to specify <place>s along
+the curve, however there is no easy relation to arc-length.
+Generally the parameter varies more rapidly where the curvature is
+greatest. The following diagram illustrates this effect for a cubic
+spline of two segments (3 control points).
+
+\begin{code}
+\def\ssz#1{\hbox{$_{^{#1}}$}}
+\xy (0,0)*+{A};(30,-10)*+{B}="B",**\dir{-},
+"B"**\crv{(5,20)&(20,25)&(35,20)}
+ ?<(0)*\dir{<}="a" ?>(1)*\dir{>}="h"
+ ?(.1)*\dir{<}="b" ?(.9)*\dir{>}="i"
+ ?(.2)*\dir{<}="c" ?(.8)*\dir{>}="j"
+ ?(.3)*\dir{<}="d" ?(.7)*\dir{>}="k"
+ ?(.4)*\dir{<}="e" ?(.6)*\dir{>}="l"
+ ?(.5)*\dir{|}="f",
+ "a"*!RC\txt{\ssz{(\lt)}};
+ "h"*!LC\txt{\ssz{\;(\gt)}},**\dir{.},
+ "b"*!RD{\ssz{.1}};
+ "i"*!L{\ssz{\;.9}},**\dir{-},
+ "c"*!RD{\ssz{.2}};
+ "j"*!L{\ssz{\;.8}},**\dir{-},
+ "d"*!RD{\ssz{.3}};
+ "k"*!L{\ssz{\;.7}},**\dir{-},
+ "e"*!RD{\ssz{.4}};
+ "l"*!LD{\ssz{.6}},**\dir{-},
+ "f"*!D!/^-3pt/{\ssz{.5}}
+\endxy
+\end{code}
+$$\docode$$
+
+\begin{exercise}
+Write code to produce a picture such as the one above.
+("Hint": Save the locations of places along the curve for later
+use with straight connections.)
+\answertext{Here is the code that was used to typeset the picture:}
+\answercode
+\answertext\displaycode
+\end{exercise}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+To have the same <pos> occuring as a multiple control point simply use
+a delimiter, which leaves the <pos> unchanged. Thus
+|\curve{|<pos>|&}| uses a cubic spline, whereas |\curve{|<pos>|}| is
+quadratic.
+
+Repeating the same control point three times in succession results in
+straight segments to that control point. Using the default styles this
+is an expensive way to get straight lines, but it allows for extra
+effects with other styles.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Curve Objects:}
+
+At present the syntax is supported for using a |\curve| object only
+as a decoration, constructed from a |\crv| object used as a connection.
+
+\DOCMODE(
+\xydef@\curve{\connect\crv}
+\DOCMODE)
+
+The more general |\crv| object currently works as a connection.
+In future this object-type will be extended to allow closed curves as
+the boundaries of objects.
+
+\DOCMODE(
+\xydef@\crv#1#{\hbox \bgroup \crvresetbreaks@ \initshape@
+ \def\pure@crv{\crv@saveStyles@}\crv@{#1}}
+
+\xydef@\crv@#1#2{%
+ \DN@{#1}\ifx\empty\next@
+ \DN@{\def\afterCURVEaction@{}\parsecurve@\xycurve@@}%
+ \else\DN@{\parseCURVE@#1\parsecurve@\curveSTYLE@}\fi
+ \next@ #2\@endcurve\endcrv@ }
+
+\xydef@\curveSTYLE@{\xycurve@@}% default style
+\xydef@\afterCURVEaction@{}% default after-curve action
+\xydef@\@endcurve{}%
+\xydef@\endcrv@@{\endcrv@\POS}%
+\xydef@\pure@crv{\relax}
+\DOCMODE)
+
+ The |\@endcurve| inserted here ensures that subsequent parsing
+ with |\checkendcurve@| (see below) will terminate cleanly.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The |\crvs| object has restricted functionality with choice of styles and
+is always used for curves only.
+It has a single braced argument which can be used to set curve styles.
+Its main use is for re-typesetting different portions of the same curve,
+for example the subsegments of a curved arrow/path segment.
+
+This is done by first examinining |\bstartPLACE@|.
+If |\relax| or undefined, then the curve is set using |\@crv@| to
+decide the style. If |\bstartPLACE@| is |\empty| then the curve is fully
+processed as a connection but nothing is actually typeset; this is used
+by curved arrows where the curve is first set as ``invisible'' before
+breaks and labels are processed.
+When |\bstartPLACE@| contains a number, normally within the range 0 to 1,
+this is interpreted as a <place> along a curved connection that has already
+been established. No typesetting may occur before this <place>.
+
+In this case the control point information is discarded since the curve
+can be recovered using |\splinereset@|. The current $p$ and $c$ are no
+longer the endpoints of the curve but are <pos>itions along the curve
+between which the typesetting should occur.
+The value of |\bstartPLACE@| is typically a <place> along the curve
+which is within the <pos> at $p$. It is used to help locate the edge of
+this <pos> where typesetting should commence.
+Similarly |\bendPLACE@| is typically a <place> along the curve
+which is within the <pos> at $c$.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xywarnifdefined\crv@normaltemplate
+\xywarnifdefined\crv@othertemplate
+\xywarnifdefined\crv@specialtemplate@@
+{\xyuncatcodes \catcode`\@=11 \catcode`\#=6
+ \gdef\crv@normaltemplate#1{{}{~**#1\xy@@crvaddstack@}}
+ \gdef\crv@othertemplate#1{{}{~*=<2\jot>{}~**#1\xy@@crvaddstack@}}
+ \gdef\crv@specialtemplate@@#1{{}{~**\dir{#1}\xy@@crvaddstack@}}
+}
+
+\xydef@\crvs#1#{\hbox \bgroup \def\pure@crv{\relax}\crvs@{#1}}%
+\xydef@\crvi#1#{\hbox \bgroup \def\pure@crv{\relax}\invisbreaks@ \crvs@{#1}}%
+
+\xydef@\crvs@#1{\DN@{\initshape@ \@crv@{#1}}%
+ \def\crv@defaultshape{-}%
+ \ifx\bstartPLACE@\relax \else
+ \ifx\bstartPLACE@\empty \Invisible@true \else
+\splinetrace@{bstartPLACE@=\bstartPLACE@, bendPLACE@=\bendPLACE@}%
+ \DN@{\let\xy@@crvaddstack@=\xy@@samecurve@
+ \let\saveshape@=\savesame@
+ \let\savectrlptsnum@=\relax
+ \let\startxycurve@=\recovercurve@
+ \crv@cnt@=\xycrvptsnum@\relax \@crv@{#1}}%
+ \fi \fi \next@ }
+
+
+
+\xydef@\xy@@samecurve@{\xyFN@\checkendcurve@}
+\xydef@\savesame@{\egroup }
+\xydef@\recovercurve@{%
+ \crv@cnt@=\xycrvptsnum@ \splinereset@ \recovercv@end
+ \ifx\bendPLACE@\relax \def\bendPLACE@{1}\fi
+ \ifdim\zz@\R@c \ifdim\zz@\L@c \ifdim\zz@\D@c \ifdim\zz@\U@c
+ \Edge@c={\zeroEdge}\fi\fi\fi\fi
+ \edef\cv@end{\cfromthec@}\edef\cv@start{\cfromthep@}}
+
+\xydef@\recovercv@end{\count@=\ptsnum@\relax\advance\count@\@ne
+ \edef\tmp@{\the\count@}\csname cv@\tmp@\endcsname}%
+
+\xydef@\crvSTYLE@@{}
+\expandafter\xydef@\expandafter\crv@defaultshape\expandafter{\addDASH@{}}
+\xydef@\crv@noobject{\Invisible@true}
+
+\xydef@\@crv@#1#2{\DN@{#1#2}%
+ \ifx\next@\empty \edef\next@{\crv@defaultshape}%
+ \ifx\bstartPLACE@\empty \xdef\crvSTYLE@@{{\crv@defaultshape}}\fi
+ \else
+ \ifx\bstartPLACE@\empty \gdef\crvSTYLE@@{#1{#2}}\fi
+ \fi
+ \ifx\next@\empty \crv@noobject \DN@{\crv@{}{\xy@@crvaddstack@}}%
+ \else\def\tmp@{-}\ifx\next@\tmp@ \DN@{\crv@{}{\xy@@crvaddstack@}}%
+ \else\def\tmp@{=}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@normaltemplate{\dir{=}}}%
+ \else\def\tmp@{2-}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@normaltemplate{\dir{2.}}}%
+ \else\def\tmp@{3-}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@normaltemplate{\dir{3.}}}%
+ \else\def\tmp@{--}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@specialtemplate@{--}}%
+ \else\def\tmp@{==}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@normaltemplate{\dir2{--}}}%
+ \else\def\tmp@{2--}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@normaltemplate{\dir2{--}}}%
+ \else\def\tmp@{3--}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@normaltemplate{\dir3{--}}}%
+ \else\def\tmp@{.}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@specialtemplate@{.}}%
+ \else\def\tmp@{:}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@normaltemplate{\dir{:}}}%
+ \else\def\tmp@{2.}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@normaltemplate{\dir{:}}}%
+ \else\def\tmp@{..}\ifx\next@\tmp@
+ \DN@{\expandafter\crv@\crv@specialtemplate@{.}}%
+ \else
+ \DN@{\expandafter\crv@\crv@othertemplate{\dir#1{#2}}}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xylet@\crv@specialtemplate@=\crv@specialtemplate@@
+\xydef@\crv@special#1{}
+\DOCMODE)
+
+\BUG: this should use a |\Step@@| method to get the spacing for dotting; this
+will eliminate the need for templates\dots
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{figure*}[tp]
+\begin{syntax}
+%
+ \multispan{3}{{\tt\string\curve}<modifier>|{|<curve-object><poslist>|}|\hfil}
+ & construct curved connection
+\cr
+%
+\noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+%
+ <modifier>
+ &\iss & <empty>
+ & zero or more modifiers possible; default is |~C|
+\cr
+ &\orr & |~|<curve-option> <modifier>
+ & set <curve-option>
+\cr
+%
+\noalign{\smallskip}
+%
+ <curve-option>
+ &\iss & |p|\orr|P|\orr|l|\orr|L|\orr|c|\orr|C|
+ & ??!^[show only] control points (|p|=points),
+ joined by lines (|l|=lines), or curve only (|c|=curve)
+\cr
+%
+ &\orr & |pc|\orr|pC|\orr|Pc|\orr|PC|
+ & show ??!^[control points] ??!^[and curve]
+\cr
+%
+ &\orr & |lc|\orr|lC|\orr|Lc|\orr|LC|
+ & show ??!^[lines joining] control points ??!^[and curve]
+\cr
+%
+ &\orr & |cC|
+ & plot curve twice, with and without specified formatting
+\cr
+%
+\noalign{\smallskip}
+%
+ <curve-object>
+ &\iss & <empty>
+ & use the appropriate default style
+\cr
+%
+ & \orr & |~*|<object> <curve-object>
+ & specify the ??!^[``drop'' object] and ??!^[maybe more]
+\cr
+%
+ & \orr & |~**|<object> <curve-object>
+ & specify ??!^[``connect'' object] and ??!^[maybe more]
+\cr
+%
+\noalign{\smallskip}
+%
+ <poslist>
+ &\iss & <empty> \orr\ <pos> <delim> <poslist>\kern-15pt
+ & \kern20pt list of positions for control points
+\cr
+%
+ &\orr & |~@| \orr\ |~@| <delim> <poslist>
+ & add the current ??!^[stack] to the control points
+\cr
+%
+\noalign{\smallskip}
+%
+ <delim>
+ & \iss & {\tt\&}
+ & allowable delimiter
+\cr
+%
+\end{syntax}
+\caption{Syntax for curves.}
+??=[f.curve]
+\vfil
+\end{figure*}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Parsing:}
+
+Two separate parsers are required: one for |\curve...|, the other for the
+contents of |{...}|.
+
+Set |\curveSTYLE@| to be the default of |\xycurve@@| then examine
+the following tokens to see if this must be changed.
+
+ Set |\curveSTYLE@| to be the default of |\xycurve@@| then examine
+ the following tokens to see if this must be changed.
+
+"Procedure": If the first token of |#1| (from |\crv@|) is |~| then
+ a letter should follow, determining how to set the style.
+ If instead it is an active control sequence then issue
+ a warning message, but let it do its thing anyway.
+ However |\parsecurve@| is a normal thing to encounter,
+ so no warning is required.
+ Currently a single letter without the |~| will be recognised,
+ but two-letter combinations definitely need the |~|.
+
+\DOCMODE(
+\xydef@\parseCURVE@{\def\curveSTYLE@{\xycurve@@}\def\afterCURVEaction@{}%
+ \xyFN@\parseCURVE@@}
+\xydef@\parseCURVE@@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\parseCURVE@@}% gobble spaces
+ \else\ifx ~\next \DN@ ~{\xy@~{}\xyFN@\setcurveSTYLE@@}%
+ \else\ifx\parsecurve@\next\DN@{}%
+ \else\ifcat\active\noexpand\next\DN@{\xyactive@Warning}%
+ \else\ifcat a\noexpand\next\DN@##1{\xytilde@Warning\setcurveSTYLE@{##1}%
+ \xyFN@\parseCURVE@@}%
+ \else\DN@{}\fi\fi\fi\fi\fi \next@ }%
+\DOCMODE)
+
+ Options are normally specified using |~|.
+ Sometimes this can be safely omitted; if such a case is
+ encountered then a warning message is issued advising to use |~|.
+ This nicety may be removed in future versions.
+
+\DOCMODE(
+\xydef@\xyactive@Warning{\xywarning@{expandable control sequences should
+ not be here, results are unpredictable in diagrams.}}% (2)
+\xydef@\xytilde@Warning{Please use ~ to set curve style.}% (3a)
+\DOCMODE)
+
+ Examine the next token to see if it determines a curve style.
+ Currently only |p|, |l| and |c| are recognised, along with
+ the uppercase variants |P|, |L| and |C|.
+ When one of these letters is encountered, set |\curveSTYLE@|
+ and keep examining tokens with |\setafterCURVEaction@|.
+
+\DOCMODE(
+\xydef@\setcurveSTYLE@#1{\xyFN@\setcurveSTYLE@@#1}
+\xydef@\setcurveSTYLE@@{%
+ \ifx\next p\def\curveSTYLE@{\xyc@trlpts@@}%
+ \DN@ p{\xyFN@\setafterCURVEaction@}%
+ \else\ifx\next P\def\curveSTYLE@{\xyc@trlpts@}%
+ \DN@ P{\xyFN@\setafterCURVEaction@}%
+ \else\ifx\next l\def\curveSTYLE@{\xyc@vxhull@@}%
+ \DN@ l{\xyFN@\setafterCURVEaction@}%
+ \else\ifx\next L\def\curveSTYLE@{\xyc@vxhull@}%
+ \DN@ L{\xyFN@\setafterCURVEaction@}%
+ \else\ifx\next c\def\curveSTYLE@{\xycurve@@}%
+ \DN@ c{\xyFN@\setafterCURVEaction@}%
+ \else\ifx\next C\def\curveSTYLE@{\xycurve@@}%
+ \DN@ C{\xyFN@\setafterCURVEaction@}%
+ \else \DN@##1{\xywarning@{unknown curve style ##1}\xyFN@\parseCURVE@@}%
+ \fi\fi\fi\fi\fi\fi \next@ }
+\DOCMODE)
+
+ |\setafterCURVEaction@| examines tokens to see if a 2-letter
+ combination is being specified; e.g. |pc|, |lC|, etc.
+ Alternatively another |~| can set a new specification.
+
+\DOCMODE(
+\xydef@\setafterCURVEaction@{%
+ \ifx\next~\DN@~{\xyFN@\setcurveSTYLE@@}%
+ \else\ifcat a\noexpand\next\DN@{\setafterCURVEaction@@}%
+ \else\DN@{\xyFN@\parseCURVE@@}%
+ \fi\fi \next@}
+\DOCMODE)
+
+ Currently the only 2-letter specifications have either
+ |c| or |C| as the 2nd letter.
+
+\DOCMODE(
+\xydef@\setafterCURVEaction@@{%
+ \ifx\next c\DN@ c{%
+ \def\afterCURVEaction@{\noexpand\endcurve\noexpand\xy@curve@}%
+ \xyFN@\parseCURVE@@ }%
+ \else\ifx\next C\DN@ C{%
+ \def\afterCURVEaction@{\noexpand\endcurve\noexpand\xy@curve@@}%
+ \xyFN@\parseCURVE@@ }%
+ \else \DN@##1{\xywarning@{unknown after-curve action ##1}%
+ \xyFN@\parseCURVE@@ }%
+ \fi\fi \next@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ When |\parsecurve@| is encountered, this signifies the end
+ of this part of the parsing. The only active control
+ sequence that should be encountered legitimately here is
+ |\@endcurve|, which signifies that the <poslist> is
+ empty and default styles are required. Otherwise assume we
+ the subsequent tokens are from |#2| of |\crv@|. Control
+ passes to |\xycurve@@| to prepare for reading the <crv-object>s
+ and <poslist>.
+
+\DOCMODE(
+\xydef@\parsecurve@{\xyFN@\parsecurve@@}
+\xydef@\parsecurve@@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\parsecurve@@}%
+ \else\ifx\next\@endcurve\DN@\@endcurve{\checkafterCURVE@}%
+ \else\ifcat\active\noexpand\next\DN@{\relax}%
+ \else\DN@{\xycurve@@}\fi\fi\fi\next@}%
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xycurve@{\begingroup\afterCURVE{\setcurve@\endgroup}\crvobjects@
+ \startxycurve@\xycrvmods@}
+\xydef@\xycurve@@{\afterCURVE{\setcurve@}\crvobjects@\startxycurve@
+ \xycrvmods@}
+\xydef@\xy@curve@{\xy@curve@@@{\splinedefaulttol@\crvobjects@}}
+\xydef@\xy@curve@@{\xy@curve@@@{\resetcrvobjects@}}
+\xydef@\xy@curve@@@#1{\ifx\cv@start\relax
+ \DN@{\xywarning@{There is no curve to plot}}.
+ \else\DN@{\begingroup\afterCURVE{\setcurve@\endgroup}#1\cv@end}%
+ \fi \next@ }
+\xydef@\crvobjects@{\def\xycrvdrop@{}\def\xycrvconn@{}}
+\xydef@\resetcrvobjects@{\crvobjects@}
+\DOCMODE)
+
+ These were originally provided for sophisticated-user access.
+ They are otherwise undocumented and may be removed.
+
+\DOCMODE(
+\xylet@\savecurve=\xycurve@@
+\xylet@\samecurve=\xy@curve@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ |\xy@crvmods@| handles reading the <curve-object>s,
+ \ie\ the ``drop'' object and the ``connect'' object.
+
+\medskip
+"Procedure":??_[crvob1]~Get next token.??_[crvob2]~Is it a |~|?
+ ??_[crvob4]~If not, exit.
+??_[crvob2a]~If so, is it followed by a |*|?
+??_[crvob2b]~If not, issue a message and go back to ??_[crvob1].
+ Otherwise, ??_[crvob3]~is there a second |*|?
+??_[crvob3a]~If not then read and store the ``drop'' object,
+??_[crvob3b]~else, read and store the ``connect'' object.
+When finished, in either case, ??_[crvob5]~look for further specifications.
+??_[crvob3c]~An empty ``drop'' object is not allowed, so this actually
+gives the default of |\zerodot|.
+
+\DOCMODE(
+\xydef@\xycrvmods@{\xyFN@\xy@crvmods@}%?*[crvob1]
+
+\xydef@\xy@crvmods@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\xy@crvmods@}%gobble spaces
+ \else\ifx\next ~\DN@ ~{\xyFN@\xy@crvmods@@}%?*[crvob2]
+ \else\DN@{\xy@crvmods@@@@}\fi\fi \next@}%?*[crvob4]
+\xydef@\xy@crvmods@@@@{\xyFN@\checkendcurve@}%
+
+\xydef@\xy@crvmods@@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\xy@crvmods@@}%gobble spaces
+ \else\ifx\next *\DN@ *{\xyFN@\xy@@crvmods@}%?*[crvob2a]
+ \else\addAT@\ifx\next\addAT@\DN@{\xyFN@\xy@@crvaddstack}%
+ \else\DN@{\xywarning@{badly-formed curve option}\xyFN@\xy@crvmods@}%?*[crvob2b]
+ \fi\fi\fi \next@}%
+
+\xydef@\xy@@crvmods@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\xy@@crvmods@}%gobble spaces
+ \else\ifx\next *\DN@ *{\xyFN@\xy@@crvmods@@}%?*[crvob3]
+ \else\DN@{\xy@crv@mods@@}\fi\fi \next@}%?*[crvob3a]
+
+\xydef@\xy@crv@mods@@#1#{\DN@##1{\xy@crvmods@@@{#1}{##1}}\next@}%
+\xydef@\xy@crvmods@@@#1#2{%
+ \DN@{#1#2}\ifx\next@\empty \def\xycrvdrop@{ #1{\zerodot}}%?*[crvob3c]
+ \else \def\xycrvdrop@{ #1{#2}}\fi
+ \xyFN@\xy@crvmods@ }%?*[crvob5]
+
+\xydef@\xy@@crvmods@@#1#{\DN@##1{\xy@@crvmods@@@{#1}{##1}}\next@}%?*[crvob3b]
+\xydef@\xy@@crvmods@@@#1#2{\def\xycrvconn@{ #1{#2}}\xyFN@\xy@crvmods@ }%
+\DOCMODE)
+%
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Parsing of the <poslist> is quite simple, recognising few special tokens:
+
+\begin{itemize}
+\item
+ |\endcurve| and |\endxy| terminate reading of control points.
+\item
+ |&|, |\\| and |\relax| delimit $<pos>$itions
+\item
+ anything else is treated as a $<pos>$, being handled by the |\POS@|
+ parser.
+\end{itemize}
+
+\DOCMODE(
+\xydef@\checkendcurve@{%
+ \ifx\space@\next\expandafter\DN@\space{\xyFN@\checkendcurve@}%gobble spaces
+ \else\ifx\next\endcurve\DN@\endcurve{\clearsearchflag@\endxycurve@}%
+ \else\ifx\next\@endcurve\DN@\@endcurve{\checkafterCURVE@}%
+ \else\ifx\next\xy@@crvaddstack@\DN@{}%
+ \else\ifx\next\endxy\DN@{\clearsearchflag@\sloppyendcrv@}%
+% \else\addAND@\ifx\next\addAND@\DN@{\clearsearchflag@\searchnextpt@}%
+ \else\testAND@\iffalse \DN@##1{\clearsearchflag@\searchnextpt@}%
+ \else\ifx ~\next\DN@ ~{\xyFN@\checkcrvtilde@}%
+ \else\ifx\next\relax\DN@\relax{\clearsearchflag@\searchnextpt@}%
+ \else\ifx\next\\\DN@\\{\clearsearchflag@\searchnextpt@}%
+ \else\ifx\searchflag@\relax
+ \DN@{\setsearchflag@\searchnextpt@}%
+ \else\DN@##1{\flagwarn@{##1}}\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi \next@ }
+\xydef@\searchnextpt@{\afterPOS{\xy@@\addtocrv@ \xyFN@\checkendcurve@}}
+\DOCMODE)
+
+There could be a problem in that an invalid token would cause
+an infinite loop, passing back and forth between |\checkendcurve@|
+and |\POS@|. This is avoided by setting a flag |\setsearchflag@|
+when the |\POS@| parser is called, not following a valid delimiter.
+Encountering a valid delimiter clears the flag. If |\checkendcurve@|
+is called with the flag set, a warning message is issued
+and the token is skipped; the flag remains set.
+Processing continues, but it is possible that the wrong number of
+positions will be read; presumably there is some kind of error that
+needs to be fixed anyway.
+
+\DOCMODE(
+\xydef@\checkafterCURVE@{%
+ \edef\tmp@{\noexpand\xyFN@\noexpand\checkendcurve@ %
+ \afterCURVEaction@\noexpand\endcurve}\tmp@ }
+
+\xylet@\searchflag@=\relax
+\xydef@\setsearchflag@{\let\searchflag@=@}
+\xydef@\clearsearchflag@{\let\searchflag@=\relax}
+\xydef@\flagwarn@#1{%
+ \ifx\next\@endcurve\DN@{\xyFN@\checkendcurve@\endcurve}%
+ \else\setsearchflag@\DN@{\xyFN@\checkendcurve@}%
+ \xywarning@{skipping invalid token \string#1\space in curve}%
+ \fi \next@ }
+\DOCMODE)
+
+It is possible for the final |\endcurve| to be omitted, but only when the
+next token is |\endxy|. A warning message is written to the log file,
+protesting against this sloppy \TeX-ing.\smiley
+
+\DOCMODE(
+\xydef@\sloppyendcrv@{%
+\xywarning@{Please use \string\endcurve\space to end the curve.}\endxycurve@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Creation of the |\crv| is completed when |\endcrv@| is encountered.
+ At this point the usual methods |\Drop@@| and |\Connect@@| are
+ defined. Extra information is retained, using |\saveshape@| and
+ |\savecrvparams@| for the benefit of methods which treat the curve
+ as a connection.
+
+\DOCMODE(
+\xydef@\endcrv@{\saveshape@ %\def\Upness@{0}%
+ \Edge@c={\splineEdge}\Invisible@false\Hidden@false
+ \edef\Drop@@{\noexpand\ifInvisible@ \setbox\z@=\copy\voidb@x
+ \noexpand\else
+ \noexpand\wdz@=\z@
+ \noexpand\ht\z@=\z@ \noexpand\dp\z@=\z@
+ \noexpand\splineDrop@
+ \noexpand\fi }%
+%
+ \edef\Connect@@{%
+ \noexpand\setbox\z@=\noexpand\box\lastobjectbox@
+ \noexpand\wdz@=\z@
+ \noexpand\ht\z@=\z@ \noexpand\dp\z@=\z@
+ \expandafter\noexpand\pure@crv
+ \noexpand\ifInvisible@ \noexpand\crv@saveStyles@ \noexpand\else
+ \noexpand\crv@getStyles@\noexpand\styledboxz@ \noexpand\fi
+%
+ \noexpand\ifHidden@\noexpand\else
+ \noexpand\ifx\noexpand\COORD@\noexpand\xymatrixCOORD@ \noexpand\else
+ \noexpand\X@min=\the\X@min \noexpand\X@max=\the\X@max
+ \noexpand\Y@min=\the\Y@min \noexpand\Y@max=\the\Y@max
+ \noexpand\fi \noexpand\fi
+ \savecrvparams@ \noexpand\crvconnect@ %\noexpand\initbreaks@
+ }%
+ \wdz@=\z@
+ \ht\z@=\z@ \dp\z@=\z@ }
+\DOCMODE)
+
+The control names |\crvXY@pre@| and |\crvXY@post@| are used to
+transfer style information passed with |\preconnect@| to subsegments.
+
+\DOCMODE(
+\xydef@\crvXY@pre@{}
+\xydef@\crvXY@post@{}
+
+\xydef@\crv@saveStyles@{\def\xy@style@{}%
+ \expandafter\def\expandafter\crvXY@pre@\expandafter{\preXY@style@}%
+ \expandafter\def\expandafter\crvXY@post@\expandafter{\postXY@style@}}
+
+\xydef@\crv@getStyles@{\def\xy@style@{}%
+ \gdef\preXY@style@{\crvXY@pre@}\gdef\postXY@style@{\crvXY@post@}}
+\DOCMODE)
+
+ The values of |\X@min|, |\X@max|, \etc\ are used to compute the extents
+ |\L@c|, |\R@c|, \etc\ of the object. This information must be maintained
+ after the group is closed, unless the ``hidden'' attribute is required
+ or we are inside a matrix construction.
+
+ In calculating the size of the box containing the curve |\X@min|,
+ |\X@max|, \etc\ are initialised to describe the minimum rectangle
+ enclosing $p$ and $c$. At the same time we save the current scope.
+
+\DOCMODE(
+\xydef@\initshape@{\savescope@
+ \ifdim\X@c>\X@p \X@min=\X@p \X@max=\X@c \else \X@max=\X@p \X@min=\X@c \fi
+ \ifdim\Y@c>\Y@p \Y@min=\Y@p \Y@max=\Y@c \else \Y@max=\Y@p \Y@min=\Y@c \fi }
+\DOCMODE)
+
+ |\saveshape| is used to pass necessary information up one level of
+ grouping.
+
+\DOCMODE(
+\xydef@\saveshape@{\savectrlptsnum@
+ \R@c=\X@max \advance\R@c-\X@c \L@c=\X@c \advance\L@c-\X@min
+ \U@c=\Y@max \advance\U@c-\Y@c \D@c=\Y@c \advance\D@c-\Y@min
+ \edef\tmp@{\egroup \U@c=\the\U@c \D@c=\the\D@c \L@c=\the\L@c \R@c=\the\R@c
+ \noexpand\ifdim\noexpand\X@min>\the\X@min\noexpand\X@min=\the\X@min\noexpand\fi
+ \noexpand\ifdim\noexpand\Y@min>\the\Y@min\noexpand\Y@min=\the\Y@min\noexpand\fi
+ \noexpand\ifdim\noexpand\X@max<\the\X@max\noexpand\X@max=\the\X@max\noexpand\fi
+ \noexpand\ifdim\noexpand\Y@max<\the\Y@max\noexpand\Y@max=\the\Y@max\noexpand\fi
+ \savecrvparams@ \def\noexpand\pure@crv{\expandafter\noexpand\pure@crv}}%
+ \tmp@ }
+
+\xydef@\savecrvparams@{\crvpts@={\the\crvpts@}%
+ \noexpand\def\noexpand\crvconnect@{\expandafter\noexpand\crvconnect@}}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\splineEdge{\rectangleEdge}
+\DOCMODE)
+
+\TODO:
+This can be improved. For example, trace along the spline until an
+appropriate point is found. There may be more than one such point,
+so extra criteria may be required.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notes}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[``drop'' object]
+The ``drop'' object is set once, then ``dropped'' many times at appropriately
+spaced places along the curve. If directional, the direction from $p$ to $c$
+is used.
+Default behaviour is to have tiny dots spaced sufficiently closely as to
+give the appearance of a smooth curve.
+Specifying a larger size for the ``drop'' object is a way of getting
+a dotted curve (see the example in the next note).
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[``connect'' object]
+The ``connect'' object is also dropped at each place along the curve.
+However, if non-empty, this object uses the tangent direction at each
+place. This allows a directional object to be specified, whose
+orientation will always match the tangent. To adjust the spacing of
+such objects, use an empty ``drop'' object of non-zero size as shown here:
+%
+\begin{code}
+\xy (0,0)*+{A}; (50,-10)*+{B}
+**\crv{~*=<4pt>{.} (10,10)&(20,0)&(40,15)}
+**\crv{~*=<8pt>{}~**!/-5pt/\dir{>}(10,-20)
+ &(40,-15)} \endxy
+\end{code}
+$$\docode$$
+\displaycode
+%
+\noindent
+When there is no ``connect'' object then the tangent calculations
+are not carried out, resulting in a saving of time and memory;
+this is the default behaviour.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[maybe more]
+The ``drop'' and ``connect'' objects can be specified as many times
+as desired. Only the last specification of each type will actually have
+any effect. (This makes it easy to experiment with different styles.)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[show only]
+Complicated diagrams having several spline curves can take quite a long time
+to process and may use a lot of \TeX's memory. A convenient device,
+especially while developing a picture, is to show only the location of the
+control points or to join the control points with lines, as a stylized
+approximation to the spline curve. The <curve-option>s |~p| and |~l| are
+provided for this purpose. Uppercase versions |~P| and |~L| do the same
+thing but use any <curve-object>s that may be specified, whereas the
+lowercase versions use plain defaults: small cross for |~p|, straight
+line for |~l|.
+Similarly |~C| and |~c| set the spline curve using any
+specified <curve-option>s or as a (default) plain curve.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[and curve]
+Use of |~p|, |~l|, etc. is extended to enable both the curve
+and the control points to be easily shown in the same picture.
+Mixing upper- and lower-case specifies whether the <curve-option>s are
+to be applied to the spline curve or the (lines joining) control points.
+See the examples accompanying the next two notes.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[control points]
+By default the control points are marked with a small cross,
+specified by |*\dir{x}|. The ``connect'' object is ignored completely.
+
+\begin{code}
+\xy (0,0)*+{A};(50,-10)*+{B}
+**\crv~pC{~*=<\jot>{.}(10,-10)&(20,15)
+ &(40,15)} \endxy
+\end{code}
+$$\docode$$
+was typeset by \dots
+\displaycode
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[lines joining]
+With lines connecting control points the default ``drop'' object is empty,
+while the ``connect'' object is |\dir{-}| for simple straight lines.
+If non-empty, the ``drop'' object is placed at each control point.
+The ``connect'' object may be used to specify a fancy line style.
+
+\begin{code}
+\xy (0,0)*+{A};(50,-10)*+{B}
+**\crv~Lc{~**\dir{--}~*{\oplus}
+ (20,20)&(35,15)} \endxy
+\end{code}
+$$\docode$$
+was typeset by \dots
+\displaycode
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[stack]
+When a stack of <pos>itions has been established using the |@i| and |@+|
+commands, these positions can be used and are appended to the <poslist>.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xy@@crvaddstack{%
+ \ifx\next ~\xywarning@{there should be a poslist here, \string~@ ignored}%
+ \DN@{\xy@crvmods@}%
+ \else\DN@{\xy@@crvaddstack@}\fi \next@}
+
+\xydef@\xy@@crvaddstack@{\smapxy@@\addtocrv@ \xyFN@\checkendcurve@}
+
+\xydef@\checkcrvtilde@{%
+ \addAT@\ifx\next\addAT@\DN@{\xy@@crvaddstack@}%
+ \else\xywarning@{invalid token after ~, ignored}%
+ \DN@##1{\xyFN@\checkendcurve@}%
+ \fi \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Spline Methods}
+
+Each |\curve| has to set the sliding abilities.
+This is done by a call to |\crvconnect@@| which gives values to
+the methods |\Creset@@|, |\Cshavep@|, etc.
+These values depend on the style of the curve itself.
+
+\DOCMODE(
+\xydef@\crvconnect@@{%
+ \def\Creset@@{\crvreset@}%
+ \def\Cshavep@@{\crvshavep@}%
+ \def\Cshavec@@{\crvshavec@}%
+ \def\Cslidep@@{\crvslidep@}%
+ \def\Cslidec@@{\crvslidec@}%
+ \def\Calong@@{\crvalong@}%
+ \def\Cintercept@@{\crvintercept@}%
+ \def\Cbreak@@{\crvbreak@}%
+ \def\Clast@@{\crvlast@}%
+}
+\DOCMODE)
+
+When straight lines are required \dots
+
+\DOCMODE(
+\xydef@\straitconnect@{\crvconnect@@
+ \let\crvreset@=\straitreset@
+ \let\crvshavep@=\straitshavep@
+ \let\crvshavec@=\straitshavec@
+ \let\crvslidep@=\straitslidep@
+ \let\crvslidec@=\straitslidec@
+ \let\crvalong@=\straitalong@
+ \let\crvintercept@=\straitintercept@
+ \let\crvbreak@=\straitbreak@
+ \let\crvlast@=\straitlast@
+}
+\DOCMODE)
+
+These are the actual methods used for a sequence of straight segments.
+
+\DOCMODE(
+\xydef@\straitreset@{\the\crvpts@
+ \edef\xycrvptsnum@{\csname ptsnum@\endcsname}%
+ \def\segmentnum@{0}}
+\xydef@\straitslidep@{\setupDirection@ii \noCslidep@@ }
+\xydef@\straitslidec@{\setupDirection@ii \noCslidec@@ }
+
+\xydef@\straitshavep@{%
+ \expandafter\ifnum\xycrvptsnum@>\z@
+ \def\segmentnum@{0}%
+ \csname cv@1\endcsname
+ \resetDirection@ \setupDirection@ii
+ \fi \noCshavep@@ }
+
+\xydef@\straitshavec@{%
+ \expandafter\ifnum\xycrvptsnum@>\z@
+ \expandafter\count@@\xycrvptsnum@\relax
+ \bgroup \csname cv@\number\count@@\endcsname
+ \edef\tmp@{\egroup \X@p=\the\X@c \Y@p=\the\Y@c}\tmp@
+ \edef\segmentnum@{\xycrvptsnum@}%
+ \resetDirection@ \setupDirection@ii
+ \fi \noCshavec@@ }
+
+\xydef@\straitalong@#1{%
+ \ifdim#1\p@<\z@
+ \xywarning@{parameter value #1 is negative, using 0}%
+ \cfromp@ \def\PLACEf@{{0}}%
+ \else
+ \dimen@=#1\p@ \count@=\dimen@ \divide\count@\p@
+ \expandafter\count@@\xycrvptsnum@\relax \advance\count@@\@ne
+ \advance\dimen@\segmentnum@\p@
+ \advance\count@\segmentnum@\relax
+ \def\segmentnum@{0}%
+ \ifnum\count@@<\count@
+ \xywarning@{parameter value #1 too large, using \the\count@@}%
+ \count@=\count@@ \advance\count@\m@ne \edef\PLACEf@{{1}}%
+ \else
+ \advance\dimen@-\count@\p@
+ \ifdim\zz@\dimen@\ifnum\count@>\z@
+ \advance\count@\m@ne \advance\dimen@\p@ \fi\fi
+ \edef\PLACEf@{{\expandafter\removePT@\the\dimen@}}%
+ \fi
+ \ifnum\count@=\z@\else \bgroup
+ \csname cv@\number\count@\endcsname
+ \edef\tmp@{\egroup \X@p=\the\X@c \Y@p=\the\Y@c}\tmp@
+ \fi
+ \advance\count@\@ne
+ \ifnum\count@<\count@@
+\splinetrace@{find place \the\dimen@\space along straight segment
+ \the\count@}%
+ \csname cv@\number\count@\endcsname
+ \fi
+ \d@X=\X@c \advance\d@X-\X@p \d@Y=\Y@c \advance\d@Y-\Y@p
+ \fi \expandafter\noCalong@@\PLACEf@ \czeroEdge@ }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\straitintercept@{\noCintercept@@}
+\xydef@\straitbreak@{\straightCbreak@@}
+\xydef@\straitlast@{\straightClast@@}
+\DOCMODE)
+
+When curved segments are required \dots
+
+\DOCMODE(
+\xydef@\splineconnect@{%
+ \let\crvreset@=\splinereset@
+ \let\crvshavep@=\splineshavep@
+ \let\crvshavec@=\splineshavec@
+ \let\crvslidep@=\splineslidep@
+ \let\crvslidec@=\splineslidec@
+ \let\crvalong@=\splinealong@
+ \let\crvintercept@=\splineintercept@
+ \let\crvbreak@=\splinebreak@
+ \let\crvlast@=\splinelast@
+}
+\DOCMODE)
+
+These are the actual methods.
+
+{\em Reset} the spline parameters:
+\begin{description}
+\item[|\xycrvptsnum@|:] expands to a control sequence, whose name
+incorporates the correct scoping level, giving the number of control points.
+
+\item[|\the\crvpts@|:]
+reads the control point locations and other information from a token list.
+
+\item[|\xysplineparams@|:]
+set to a control sequence name, incorporating the correct scoping level,
+which will allow access to the Be\'zier control points for each
+spline segment, when required.
+
+\item[|\xysplineedges@|:]
+set to a control sequence name, incorporating the correct scoping level,
+which gives the spline parameters of the edges of objects at $p$ and $c$;
+
+\item[|\segmentnum@|:] reset to $0$.
+
+\item[|\splinecorrect@p| and |\splinecorrect@c|:] reset to $0$
+until changed by a |\Cshavep@| or |\Cshavec@|.
+
+\item[|\splinelength@|:] reset to $0$ until changed by a |\Cshavep@|,
+|\Cshavec@| or |\Calong@|; this is needed by |\Cshavep@| and |\Cshavec@|
+to quickly locate where to slide from, especially when it is necessary
+to slide across more than a single spline segment.
+
+\item[|\splineplace@|:] reset to $.5$.
+\end{description}
+
+\DOCMODE(
+\xydef@\splinereset@{\the\crvpts@
+ \edef\xycrvptsnum@{\csname ptsnum@\endcsname}%
+ \edef\xysplineparams@{%
+ \expandafter\noexpand\csname params@\endcsname}%
+ \edef\xysplineedges@{%
+ \expandafter\noexpand\csname edges@\endcsname}%
+ \def\segmentnum@{1}\def\splinecorrect@p{0}\def\splinecorrect@c{0}%
+ \splinelength@=\z@ \def\splineplace@f{.5}%
+}
+\DOCMODE)
+
+{\em Shaving} to the appropriate edge.
+This is simply a matter of reading the stored edge information
+and storing the appropriate value in |\splinecorrect@p|
+or |\splinecorrect@c|. The difficult part is to construct the
+correct control sequence name and then to extract the correct
+part of the text in its expansion.
+
+\DOCMODE(
+\xydef@\splineshavep@{\begingroup
+ \edef\xysplineedges@{%
+ \expandafter\noexpand\csname edges@\endcsname}%
+ \expandafter\expandafter\expandafter\getsplineedges@safe\xysplineedges@ @@%
+ \edef\tmp@{\noexpand\removePT@\the\dimen5}%
+ \edef\tmp@{\endgroup
+ \noexpand\def\noexpand\splinecorrect@p{\tmp@}}\tmp@
+ \setupDirection@ii }
+
+\xydef@\splineshavec@{\begingroup
+ \edef\xysplineedges@{%
+ \expandafter\noexpand\csname edges@\endcsname}%
+ \expandafter\expandafter\expandafter\getsplineedges@safe\xysplineedges@ @@%
+ \dimen@=-\dimen7\relax \advance\dimen@\p@
+%% \getcrvsegsnum@ \advance\dimen@\count@\p@
+ \edef\tmp@{\noexpand\removePT@\the\dimen@}%\W@{**shave**<\tmp@>***}%
+ \edef\tmp@{\endgroup
+ \noexpand\def\noexpand\splinecorrect@c{\tmp@}}\tmp@
+ \setupDirection@ii }
+
+\xydef@\splineslidep@#1{\enter@{\pfromthep@}%
+ \begingroup \splinealong@@{0}{#1}+\splineslidep@@@
+ \setupDirection@ii \leave@ }%
+
+\xydef@\splineslidep@@@{%
+ \d@X=\dimen5 \d@Y=\dimen7 \edef\tmp@{\postfind@}\tmp@ \dimen@=\splineval@
+ \expandafter\count@\xycrvptsnum@\relax
+ \ifnum\count@>\tw@ \advance\count@\m@ne
+ \advance\dimen@\segmentnum@\p@ \advance\dimen@-\p@
+ \fi
+ \edef\tmp@{\endgroup \endgroup
+ \noexpand\def\noexpand\xysplineval@{\the\splineval@}%
+ \noexpand\def\noexpand\splinecorrect@p{\expandafter\removePT@\the\dimen@}%
+\splinetrace@{slide = \the\splinelength@}%
+ \X@c=\dimen@i \Y@c=\dimen3 % something may be wrong here!!
+ \d@X=\the\d@X \d@Y=\the\d@Y %
+ \noexpand\def\noexpand\segmentnum@{\segmentnum@}}\tmp@ }
+
+\xydef@\splineslidec@#1{\enter@{\pfromthep@}%
+ \begingroup
+ \expandafter\splinealong@@\PLACEf@{#1}+\splineslidec@@@
+ \setupDirection@ii \leave@ }
+
+\xydef@\splineslidec@@@{%
+ \d@X=\dimen5 \d@Y=\dimen7 \edef\tmp@{\postfind@}\tmp@ \dimen@=\splineval@
+ \expandafter\count@\xycrvptsnum@\relax
+ \ifnum\count@>\tw@ \advance\count@\m@ne
+ \advance\dimen@\segmentnum@\p@ \advance\dimen@-\p@
+ \dimen@=-\dimen@ \advance\dimen@\count@\p@
+ \else \dimen@=-\dimen@ \advance\dimen@\p@ \fi %\W@{**slide**<\the\dimen@>***}%
+%% splinecorrect@c is probably wrong here!!
+ \edef\tmp@{\endgroup \endgroup
+ \noexpand\def\noexpand\xysplineval@{\the\splineval@}%
+ \noexpand\def\noexpand\splinecorrect@c{\expandafter\removePT@\the\dimen@}%
+\splinetrace@{slide = \the\splinelength@; correct@c=\noexpand\splinecorrect@c}%
+ \X@c=\dimen@i \Y@c=\dimen3 %
+ \d@X=\the\d@X \d@Y=\the\d@Y %
+ \noexpand\def\noexpand\segmentnum@{\segmentnum@}}\tmp@ }
+
+\xydef@\checkslidemore@#1{%
+ \dimen@ii=-#1\relax\ifdim\dimen@ii<\z@\multiply\dimen@ii\m@ne\fi
+ \dimen@=-\splinelength@ \advance\dimen@\dimen@ii\relax
+ \ifdim\dimen@<\z@\dimen@ii=-\dimen@\else\dimen@ii=\dimen@\fi
+ \ifdim\dimen@ii<.2\p@\DN@{\splineslidec@@ \leave@}%%%% ?
+ \else \splinetrace@{not found yet, \the\dimen@ii\space still to go}%
+ \dimen@ii=#1\relax\ifdim\dimen@ii<\z@\multiply\dimen@\m@ne\fi
+ \DN@{\expandafter\splineslidemore@\expandafter{\the\dimen@}}\fi
+ \next@}%
+
+\xydef@\splineslidemore@#1{%
+ \expandafter\count@\segmentnum@\relax
+ \ifdim#1<\z@\advance\count@\m@ne\dimen@=\p@
+ \else\advance\count@\@ne\dimen@=\z@\fi
+ \ifnum\count@<\@ne
+ \expandafter\splinesegment@\expandafter{\segmentnum@}%
+ \DN@{\xywarning@{cannot slide beyond start of curve}%
+ \spline@find{\z@}{\z@}{}\splineslidec@@ \leave@ }%%%% ?
+ \else \expandafter\count@@\xycrvptsnum@\relax\advance\count@@\m@ne
+ \expandafter\ifnum\count@@<\count@\relax
+ \expandafter\splinesegment@\expandafter{\segmentnum@}%
+ \DN@{\xywarning@{cannot slide beyond end of curve}%
+ \spline@find{\p@}{\z@}{}\splineslidec@@ \leave@ }%%%%% ?
+ \else
+ \edef\segmentnum@{\the\count@}%
+ \expandafter\splinesegment@\expandafter{\segmentnum@}%
+\splinetrace@{sliding onto segment \segmentnum@}%
+ \expandafter\spline@find\expandafter{\the\dimen@}{#1}{}%
+ \DN@{\checkslidemore@{#1}}%
+ \fi\fi \next@ }
+
+\xydef@\splineslidec@@{%
+ \dimen@=\splineval@ \advance\dimen@\segmentnum@\p@\advance\dimen@-\p@
+ \edef\tmp@{\endgroup
+ \noexpand\def\noexpand\xysplineval@{\the\dimen@}%
+\splinetrace@{slide = \the\splinelength@}%
+ \X@c=\the\dimen@i \Y@c=\the\dimen3 \d@X=\the\dimen5 \d@Y=\the\dimen7 \postfind@
+ \noexpand\def\noexpand\segmentnum@{\segmentnum@}}\tmp@
+ \setupDirection@ii}
+\DOCMODE)
+
+The method |\splinealong@#1| finds places along the curve, when |#1| is
+given as a factor, normally between 0 and 1. The location of the edges
+of the objects at $p$ and $c$ are stored in |\splinecorrect@p| and
+|\splinecorrect@c|.
+These are the places found if the factor is either 0 or 1.
+If an edge is non-zero then it is actually possible to move to points inside
+that edge by specifying a factor less than 0 or greater than 1.
+
+\DOCMODE(
+\xydef@\splinealong@#1{\def\postfind@{}\splinealong@@{#1}\z@+%
+ \splineslidec@@
+ \dimen@=\xysplineval@\relax
+ \count@=\xycrvptsnum@\relax \ifnum\count@>\@ne \advance\count@\m@ne\fi
+ \ifnum\count@>\@ne \dimen@nth\count@\dimen@
+ \fi \edef\bthisPLACE@{\expandafter\removePT@\the\dimen@}%
+\splinetrace@{bthisPLACE@=\bthisPLACE@}}%
+\DOCMODE)
+
+The parameter |#2| in |\splinealong@@#1#2#3| allows for a subsequent slide
+through a given <dimen> along the curve, from the place specifed by the
+factor in |#1|.
+
+The information supplied in |#1| must be converted to the segment number and
+parameter value of the specified point. These will be calculated and stored
+temporarily in |\count@| and |dimen@| before the values are passed respectively
+to |\splinesegment@| which chooses the segment, and |\spline@find| to locate
+the point on this segment.
+
+To do the calculation, first we correct for the parameter values of the edges
+ of the objects at the end-points, which are stored in |\splinecorrect@p| and
+|\splinecorrect@c|. If the resulting number $x$ is not an integer then
+|\count@| is set to $1+\floor{x}$ while |\dimen@| becomes $(x-\floor{x})|\p@|$.
+If $x$ is an integer: $x=0$ gives |\count@=1| and |\dimen@=\z@|,
+otherwise $|\count@|=x$ and |\dimen@=\p@|.
+
+\DOCMODE(
+\xydef@\splinealong@@#1#2#3{%
+ \edef\tmp@{#1}\relax \dimen@ii\tmp@\p@
+%% \getcrvsegsnum@
+%% \dimen@=-\count@\p@
+ \dimen@=-\p@
+ \expandafter\advance\expandafter\dimen@\splinecorrect@p\p@
+ \expandafter\advance\expandafter\dimen@\splinecorrect@c\p@
+ \edef\tmp@{#1}\relax \dimen@=-\tmp@\dimen@ \relax
+ \expandafter\advance\expandafter\dimen@\splinecorrect@p\p@
+ \getcrvsegsnum@ \multiply \dimen@ by\count@\relax
+\splinetrace@{actual:\the\dimen@; f:\the\dimen@ii; p:\splinecorrect@p, c:\splinecorrect@c}%
+ \count@=\dimen@ \divide\count@\p@ \DN@{\relax}%
+ \def\tmp@{\relax}\ifx\next@\tmp@
+ \expandafter\ifnum\xycrvptsnum@<\count@
+ \xywarning@{parameter value #1 too large}%
+ \DNii@{\relax}\DN@{\begingroup}%
+ \else
+ \edef\xysplineval@{\the\dimen@}%
+ \advance\dimen@-\count@\p@
+ \ifdim\dimen@=\z@
+\splinetrace@{find knot point \the\count@}%
+ \ifnum\count@=\z@ \count@=\@ne \else \dimen@=\p@ \fi
+ \else \advance\count@\@ne
+\splinetrace@{find point \the\dimen@\space on spline segment \the\count@}%
+ \fi
+ \edef\segmentnum@{\the\count@}%
+ \edef\next@{\begingroup\noexpand\splinesegment@{\the\count@}}%
+ \edef\nextii@{%
+ \noexpand\spline@find{\the\dimen@}{#2}{}\noexpand\checksplinefind@{#2}}%
+ \ifx>#3\relax
+ \edef\nextii@{%
+ \noexpand\spline@find{\the\dimen@}{#2}#3\noexpand\checksplinefind@{#2}}%
+ \else\ifx-#3\relax \ifdim\dimen@>\z@\relax \ifdim\dimen@<\p@
+ \dimen@=-\dimen@ \advance\dimen@\p@
+ \edef\nextii@{\noexpand\splinereverse@
+ \noexpand\spline@find{\the\dimen@}{#2}{}\noexpand\checksplinefind@{#2}}%
+ \fi\fi
+ \else\ifx<#3\relax \ifdim\dimen@>\z@\relax \ifdim\dimen@<\p@
+ \dimen@=-\dimen@ \advance\dimen@\p@
+ \edef\nextii@{\noexpand\splinereverse@
+ \noexpand\spline@find{\the\dimen@}{#2}#3\noexpand\checksplinefind@{#2}}%
+ \fi\fi
+ \fi\fi\fi
+ \fi\fi \expandafter\next@\nextii@ }
+\DOCMODE)
+
+ This macro checks whether the required sliding has been carried out,
+or whether it is necessary to continue sliding along the next segment.
+
+\DOCMODE(
+\xydef@\checksplinefind@#1{%
+ \dimen@ii=#1\relax \dimen@=\splinelength@
+ \ifdim\dimen@ii=\z@\DN@{}%
+ \else
+ \ifdim\dimen@ii<\z@\advance\dimen@\dimen@ii
+ \else\advance\dimen@-\dimen@ii\fi
+ \ifdim\dimen@<\z@\multiply\dimen@\m@ne\fi
+ \ifdim\dimen@<.2\p@\DN@{}%
+ \else
+ \count@=\segmentnum@\relax
+ \ifdim\dimen@ii<\z@\advance\dimen@ii\splinelength@
+ \ifnum\count@>\@ne\advance\count@\m@ne
+ \edef\next@{\noexpand\splinesegment@{\the\count@}%
+ \noexpand\spline@find\p@{\the\dimen@ii}{}%
+ \noexpand\checksplinefind@{\the\dimen@ii}}%
+ \else
+ \xywarning@{cannot slide \the\dimen@ii\space before start}%
+ \DN@{\splinesegment@\@ne \spline@find\z@\z@{}}\fi
+ \else\advance\dimen@ii-\splinelength@
+ \count@@=\numcontrolpts
+ \ifnum\count@<\count@@ \advance\count@\@ne
+ \edef\next@{\noexpand\splinesegment@{\the\count@}%
+ \noexpand\spline@find\z@{\the\dimen@ii}{}%
+ \noexpand\checksplinefind@{\the\dimen@ii}}%
+ \else
+ \xywarning@{cannot slide \the\dimen@ii\space beyond end}%
+ \DN@{\splinesegment@{\the\count@@}\spline@find\p@\z@{}}\fi
+ \fi
+ \fi\fi \next@ }
+\DOCMODE)
+
+
+\paragraph*{Breaks}
+%
+Typesetting breaks in curves is quite involved.
+The |\bstartPLACE@| and |\bendPLACE@| are used to hold parameter
+values for the positions of the beginning and end of a segment,
+respectively, when known. The default values of |\relax| indicate
+that these values need to be found, usually from the start- and
+end-edges of the curve. The value of |\empty| for |\bstartPLACE@|
+is used initially with a new curved connection, to set up all its
+parameters --- no typesetting takes place. This is used by curved
+arrows to set up the connection before places can
+be found for any breaks.
+
+\DOCMODE(
+\xydef@\resetbreaks@{%
+ \let\bstartPLACE@=\relax \let\bthisPLACE@=\empty
+ \let\bendPLACE@=\relax \let\bprevPLACE@=\relax}
+
+\xydef@\invisbreaks@{\resetbreaks@ \let\bstartPLACE@=\empty}
+\xydef@\crvresetbreaks@{\resetbreaks@ \let\bstartPLACE@=\relax }
+
+\xydef@\initbreaks@{\xy@@{\ifx\bstartPLACE@\relax
+ \def\bstartPLACE@{0}\def\bendPLACE@{1}\else
+ \ifx\bstartPLACE@\empty\def\bstartPLACE@{0}\def\bendPLACE@{1}%
+ \fi\fi}}
+
+\xydef@\lastbreaks@{\ifx\bprevPLACE@\relax \def\bstartPLACE@{0}%
+ \else \expandafter \bprevPLACE@ \fi
+ \let\bprevPLACE@\relax \let\bendPLACE@\relax}
+
+\xylet@\bstartPLACE@\relax
+\xylet@\bendPLACE@\relax
+\xylet@\bprevPLACE@\relax
+\xydef@\bthisPLACE@{1}
+\DOCMODE)
+
+These are called in the actual setting of curved sub-segments.
+
+\DOCMODE(
+\xydef@\splinebreak@{%
+\splinetrace@{***new break*** this:\bthisPLACE@ }%
+ \ifx\bthisPLACE@\empty\def\bendPLACE@{1}%
+ \else\edef\bendPLACE@{\bthisPLACE@}\let\bthisPLACE@\empty\fi
+%\xystatus@{BR1}%
+ \ifx\bprevPLACE@\relax\def\bstartPLACE@{0}\else\expandafter\bprevPLACE@\fi
+ \edef\bprevPLACE@{\def\noexpand\bstartPLACE@{\bendPLACE@}\pfromthec@}%
+\splinetrace@{splineBREAK: \bstartPLACE@ <> \bendPLACE@}%
+%\xystatus@{BR}%
+ \edef\cv@brend{\cfromthec@}%
+ \edef\cv@brstart{\cfromthep@}%
+ \expandafter\connect\expandafter\crvs\crvSTYLE@@{}% ? optimise
+ \let\cv@brend=\relax
+ \let\cv@brstart=\relax
+\splinetrace@{**break done**}%
+}
+
+\xydef@\splinelast@{\splinereset@ \lastbreaks@ %\splinetracing
+\splinetrace@{splineLAST}%
+%\xystatus@{LA}%
+ \edef\cv@brend{\cfromthec@}%
+ \edef\cv@brstart{\cfromthep@}%
+ \expandafter\connect\expandafter\crvs\crvSTYLE@@{}% ? optimise
+ \let\cv@brend=\relax
+ \let\cv@brstart=\relax
+\splinetrace@{**last done**}%
+ \resetbreaks@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Intersection with a curved connection}
+Just as the intersection of two lines (??g[xy.doc:intercept]) can be found,
+so can the intersection of a straight line with a curved connection,
+or the intersection of a curve with a straight connection.
+
+\begin{code}
+\xy*+{A}="A";p+/r5pc/+(0,15)*+{B}="B"
+ ,p+<1pc,3pc>*+{C}="C"
+ ,"A"+<4pc,-1pc>*+{D}="D",{\ar@/_/"C"}
+ ,?!{"A";"B"**@{-}}*++{\oplus}
+\endxy \quad \xy
+ *+{A}="A";p+/r5pc/+(0,15)*+{B}="B",
+ ,p+<1pc,3pc>*+{C}="C"
+ ,"A"+<4pc,-1pc>*+{D}="D","A";"B"**@{-}
+ ,?!{"D",{\ar@/_/"C"}}*++{\oplus}
+\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+When the line separates the end-points of a curve an intersection can always
+be found. If there is more than one then that occurring earliest along the
+curve is the one found.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Presume the end-points of the spline segment are at $(X_p,Y_p)$ and
+$(X_c,Y_c)$ with $(L_p,U_p)$ and $(R_p,D_p)$ as two points on the line.
+Then the macro |\xysidesofinterval@| returns 3 pieces of information.
+\begin{itemize}
+\item |\next| expands to 2 characters, each from $\{+,-,0\}$
+ indicating which side of, or on, the line lies either end-point;
+\item |\this@| expands to either $+$ or $-$ indicating which
+ end is closer to the line, returning $+$ if equi-distant;
+\item |\howclose@| contains a non-negative <num> indicating the distance
+ to the nearest end-point.
+\end{itemize}
+
+\DOCMODE(
+\xydef@\splineNointercept@{\enter@{\pfromthep@}%
+ \begingroup \splinereset@ \csname cv@0\endcsname \swap@
+ \count@=\ptsnum@ \advance\count@\@ne \csname cv@\the\count@\endcsname
+ \edef\tmp@{\endgroup \X@origin=\the\X@p \Y@origin=\the\Y@p
+ \R@c=\the\d@X \U@c=\the\d@Y}\tmp@
+ \loop@
+ \dimen@=\ifdim\R@c<\z@-\fi\R@c
+ \advance\dimen@ \ifdim\U@c<\z@-\fi\U@c
+ \ifdim\dimen@>10\p@
+ \advance\R@c \ifdim\R@c<\z@-\fi 16sp \divide\R@c\KK@
+ \advance\U@c \ifdim\U@c<\z@-\fi 16sp \divide\U@c\KK@
+ \repeat@
+ \intersect@ \leave@}
+
+\xydef@\splineintercept@{\Hidden@true\Invisible@true\splineintercept@i}
+
+\xydef@\splineintercept@i{\enter@{\pfromthep@}\begingroup
+ \R@p=\X@c \L@p=\X@p \d@X=\R@p \advance\d@X-\L@p
+ \D@p=\Y@c \U@p=\Y@p \d@Y=\D@p \advance\d@Y-\U@p
+ \dimen@nth\KK@\d@X \edef\sd@X{\expandafter\removePT@\the\d@X}%
+ \dimen@nth\KK@\d@Y \edef\sd@Y{\expandafter\removePT@\the\d@Y}%
+ \dimen@=\sd@Y\L@p \advance\dimen@-\sd@X\U@p
+ \edef\sideOffset@{\the\dimen@}\def\closestseg@{1}%
+ \let\crvconnect@@=\relax \crvconnect@
+ \let\spline@end=\splinef@end
+ \def\spline@start{\bgroup \def\prevnext@{+-}%
+ \def\splinerec@{\let\splinerec@=\splineIrec@ \splineinterceptTest@}%
+ \def\splinedecast@{\let\splinedecast@=\splinedecast@@
+ \def\splineadvance@{\splineIadvance@@}\splinedecast@@}%
+ \def\splineadvance@{\intercepthull@}%
+% \def\splinepoint@{\splineIpt@@}%
+ \global\let\splinepoint=\splineIpt@@
+ \global\let\splinegoal@=\splinef@pt
+ \global\let\splinefinish@=\splinefinish@@}%
+ \begingroup \splineIsegment@
+ \splinesetparams@ \splined@@ \def\postfind@{}\splineIplace@
+ \setupDirection@ii \leave@ }
+
+
+\xydef@\splineIplace@{%
+ \d@X=\dimen5 \d@Y=\dimen7 \dimen@=\splineval@
+ \expandafter\count@\xycrvptsnum@\relax
+ \ifnum\count@>\tw@ \advance\count@\m@ne %\advance\count@\m@ne
+ \advance\dimen@\segmentnum@\p@ \advance\dimen@-\p@
+ \dimen@nth\count@\dimen@ % \divide\dimen@\count@
+ \fi \edef\tmp@{\endgroup \endgroup
+ \def\noexpand\PLACEf@{{\expandafter\removePT@\the\dimen@}}%
+ \X@c=\dimen@i \Y@c=\dimen3 %
+ \d@X=\the\d@X \d@Y=\the\d@Y }\tmp@
+\splinetrace@{PLACE = \PLACEf@:(\the\X@c, \the\Y@c)}%
+ \expandafter\edef\expandafter\bthisPLACE@\PLACEf@
+ }
+
+\xydef@\splineIrec@{\splineinterceptTest@ }
+
+\xydef@\squineIpt@{\edef\tmp@{\endgroup
+ \def\noexpand\prevnext@{\next}\begingroup}\tmp@ }
+\xydef@\squineIadvance@{\edef\tmp@{\endgroup
+ \def\noexpand\prevnext@{\next}\def\noexpand\howclose@{\howclose@}}%
+ \tmp@ \splineadvance@@\begingroup}
+
+\xydef@\cubicIpt@{\edef\tmp@{\endgroup
+ \def\noexpand\prevnext@{\next}\begingroup}\tmp@ }
+\xydef@\cubicIadvance@{\edef\tmp@{\egroup
+ \def\noexpand\prevnext@{\next}\def\noexpand\howclose@{\howclose@}}%
+ \tmp@ \splineadvance@@\bgroup}
+
+\xydef@\splineIsegment@{\DN@{\splinesegment@\@ne}%
+ \ifx\splinesegment@\squinesegment@\else
+ \ifx\splinesegment@\cubicsegment@\else\DN@{\findIsegment@}%
+ \fi\fi\next@}
+
+\xydef@\findIsegment@{\expandafter\count@\xycrvptsnum@ \count@@\z@
+ \loop@ \advance\count@@\@ne \bgroup
+ \expandafter\splinesegment@\expandafter{\the\count@@}%
+ \xysidesofinterval@
+ \findIsegment@i \repeat@
+ \expandafter\dimen@\prevhowclose@ \relax
+ \ifdim\dimen@=\z@ \edef\closestseg@{\the\count@@}\fi
+ \expandafter\splinesegment@\expandafter{\closestseg@}}
+
+\xydef@\findIsegment@i{%
+ \expandafter\ifx\next \expandafter\findIsegment@ii
+ \else\expandafter\findIsegment@x\fi \next@ }
+
+\xydef@\findIsegment@ii{\expandafter\count@\xycrvptsnum@ \relax
+ \advance\count@\m@ne \ifnum\count@>\segmentnum@\relax
+ \expandafter\findIsegment@y\else\expandafter\findIsegment@x\fi}
+
+\xydef@\findIsegment@x{%
+ \edef\next@{\egroup\def\noexpand\next{\next}%
+ \def\noexpand\prevhowclose@{\prevhowclose@}%
+ \def\noexpand\closestseg@{\closestseg@}\noexpand\iffalse}}
+
+\xydef@\findIsegment@y{%
+ \edef\next@{\egroup\def\noexpand\next{\next}%
+ \def\noexpand\prevhowclose@{\prevhowclose@}%
+ \def\noexpand\closestseg@{\closestseg@}\noexpand\iftrue}}
+
+\xydef@\xysidesofinterval@{\bgroup
+ \L@p=\sd@X\Y@p \advance\L@p-\sd@Y\X@p \advance\L@p\sideOffset@
+ \U@p=\sd@X\Y@c \advance\U@p-\sd@Y\X@c \advance\U@p\sideOffset@
+ \def\this@{}\ifdim\L@p>\almostz@ \ifdim\U@p>\almostz@ \def\next{++}\else
+ \ifdim\U@p<-\almostz@ \def\next{+-}\else\def\next{+0}\def\this@{-}\fi\fi
+ \else\ifdim\L@p<-\almostz@ \ifdim\U@p>\almostz@ \def\next{-+}\else
+ \ifdim\U@p<-\almostz@ \def\next{--}\else\def\next{-0}\def\this@{+}\fi\fi
+ \else \ifdim\U@p>\almostz@ \def\next{0+}\else
+ \ifdim\U@p<-\almostz@ \def\next{0-}\else\def\next{00}\def\this@{+}\fi\fi
+ \fi\fi
+ \ifx\this@\empty
+ \L@p=\ifdim\L@p<\z@-\fi\L@p \U@p=\ifdim\U@p<\z@-\fi\U@p
+ \ifdim\L@p<\U@p \edef\howclose@{\the\L@p}\def\this@{-}%
+ \else \edef\howclose@{\the\U@p}\def\this@{+}\fi
+ \else\def\howclose@{0.0pt}\fi
+\splinetrace@{\next:\this@:\howclose@;\the\splineval@:%
+ (\the\X@p,\the\Y@p);(\the\X@c,\the\Y@c)}%
+ \ifdim\howclose@<\prevhowclose@\relax
+ \edef\tmp@{\egroup\def\noexpand\this@{\this@}\def\noexpand\next{\next}%
+ \def\noexpand\howclose@{\howclose@}\def\noexpand\prevhowclose@{\howclose@}%
+ \def\noexpand\closestseg@{\segmentnum@}}%
+\splinetrace@{closest yet: \howclose@, in segment \segmentnum@}%
+ \else
+ \edef\tmp@{\egroup\def\noexpand\this@{\this@}\def\noexpand\next{\next}%
+ \def\noexpand\howclose@{\howclose@}}%
+ \fi \tmp@ }
+
+\xydef@\splineinterceptTest@{%
+ \xysidesofinterval@ \DN@{\splineadvance@}%
+ \DNii@{0.0pt}\ifx\howclose@\nextii@ \DN@{\splineclosest@}%
+ \else\expandafter\ifx\next \expandafter\ifx\prevnext@
+ \ifx\next\prevnext@\else\DN@{\X@c=\X@p \Y@c=\Y@p
+ \splinefinishf@}\fi\fi
+ \else \DN@{\splinedecast@}\fi\fi
+ {\splinefar@false \splinenear@\X@p\X@c\Y@p\Y@c
+ \ifsplinefar@ \aftergroup\next@
+ \else\aftergroup\splineclosest@
+\splinetrace@{too close: (\the\X@p,\the\Y@p)::(\the\X@c,\the\Y@c)}%
+ \fi}}
+
+\xydef@\splineclosest@{%\global\advance\splineval@-.5\splinedepth@
+ \expandafter\ifx\this@-\relax
+ \X@c=\X@p \Y@c=\Y@p \global\advance\splineval@-\splinedepth@
+ \fi \splinefinishf@ }%
+\DOCMODE)
+
+When the line misses the convex hull of the curve's control points
+it is still possible to get the point of closest approach.
+
+\DOCMODE(
+\xydef@\squinetestcvxhull@{\begingroup
+\splinetrace@{hull: closest in segment \closestseg@}%
+ \expandafter\splinesegment@\ifx\undefined\closestseg@\@ne\else\closestseg@\fi
+ \X@c=\L@c \Y@c=\U@c \xysidesofinterval@
+ \expandafter\ifx\next \expandafter\splineoutsidehull@@
+ \else \expandafter\splineinsidehull@\fi}
+
+\xydef@\cubictestcvxhull@{\begingroup
+ \expandafter\splinesegment@\ifx\undefined\closestseg@\@ne\else\closestseg@\fi
+ \X@c=\L@c \Y@c=\U@c \xysidesofinterval@
+ \expandafter\ifx\next \expandafter\cubictestcvxhull@i
+ \else \expandafter\splineinsidehull@\fi}
+
+\xydef@\cubictestcvxhull@i{%\begingroup
+ \X@c=\R@c \Y@c=\D@c \xysidesofinterval@
+ \expandafter\ifx\next \expandafter\splineoutsidehull@@
+ \else \expandafter\splineinsidehull@\fi}
+
+
+\xydef@\xysidesofhull@{\bgroup
+ \L@p=\sd@X\Y@p \advance\L@p-\sd@Y\X@p \advance\L@p\sideOffset@
+ \U@p=\sd@X\Y@c \advance\U@p-\sd@Y\X@c \advance\U@p\sideOffset@
+ \L@p=\ifdim\L@p<\z@-\fi\L@p \U@p=\ifdim\U@p<\z@-\fi\U@p
+ \ifdim\L@p<\U@p \edef\howclose@{\the\L@p}\def\this@{-}%
+ \else \edef\howclose@{\the\U@p}\def\this@{+}\fi
+ \ifx\splinedecast@\squinedecast@ \D@c=\U@c \R@c=\L@c \fi
+ \L@p=\sd@X\U@c \advance\L@p-\sd@Y\L@c \advance\L@p\sideOffset@
+ \L@p=\ifdim\L@p<\z@-\fi\L@p
+ \expandafter\if\this@-%
+ \ifdim\L@p<\prevhowclose@ \def\next{-+}\else \def\next{--}\fi
+ \else
+ \ifdim\L@p<\howclose@ \def\next{-+}\else
+ \U@p=\sd@X\D@c \advance\U@p-\sd@Y\R@c \advance\U@p\sideOffset@
+ \U@p=\ifdim\U@p<\z@-\fi\U@p
+ \ifdim\U@p<\howclose@ \def\next{+-}\else \def\next{++}\fi
+ \fi\fi
+ \edef\tmp@{\egroup\def\noexpand\this@{\this@}\def\noexpand\next{\next}%
+ \def\noexpand\howclose@{\howclose@}}\tmp@ }
+\DOCMODE)
+
+This is for straight connections intercepting with a curve.
+It requires a redefinition of |\PLACE@intercept@| to recognise
+that the intercept is with a curved connection.
+
+\DOCMODE(
+\def\PLACE@intercept@#1{%
+ \xy@@{\enter@{\pfromthep@\basefromthebase@}\begingroup}%
+ \xy@@ix@{#1}\xy@@{\plainxy@ \def\Creset@@{}%
+ \expandafter\POS\the\toks9\relax
+ \DNii@{\crvreset@}\ifx\nextii@\Creset@@ \edef\next@{\endgroup
+ \def\noexpand\xyinterceptpts@{\the\crvpts@}%
+ \X@c =\the\X@c \Y@c=\the\Y@c \X@p=\the\X@p \Y@p=\the\Y@p
+ \noexpand\CCintercept@@ }%
+ \else \edef\next@{\endgroup
+ \X@c =\the\X@c \Y@c=\the\Y@c \X@p=\the\X@p \Y@p=\the\Y@p
+ \noexpand\Cintercept@@ }%
+ \fi \next@ \leave@}%
+ \PLACE@@}
+
+\xydef@\CCintercept@@{\splineSintercept@}
+\xydef@\splineSintercept@{\enter@{\pfromthep@}\begingroup
+ \Creset@@ \edef\connect@pts{\cfromthec@ \pfromthep@}%
+ \xyinterceptpts@ \splinereset@ \connect@pts \splineintercept@
+ \edef\next@{\endgroup \cfromthec@ \DirectionfromtheDirection@ }%
+ \next@ \let\xyinterceptpts@=\empty \leave@}
+\DOCMODE)
+
+\TODO:
+If both connections are curves, only the line joining the end-points
+of the first connection is used. Find a way to do better than this.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+If the line does not separate the end-points then there may be no
+intersection with the curve. If there is one then either the line is
+tangential or necessarily there will also be at least one other intersection.
+A message $$|perhaps no curve intersection, or many.|$$
+is written to the log-file, but a search for an intersection will still be
+performed and a ``sensible'' place found on the curve.
+In the usual case of a single quadratic or cubic segment, the place nearest
+the line is found and the tangent direction is established.
+
+The following examples show this, and show how to get the place on the line
+nearest to the curve.
+
+\begin{code}
+\xy *+{A}="A";p+/r5pc/+(0,15)*+{B}="B",
+ ,p-<.5pc,2pc>*+{C}="C","A"+<6pc,-.5pc>
+ ,*+{D}="D","A",{\ar@/_25pt/"B"}
+ ,?!{"C";"D"**@{-}}*\dir{x}="E"
+ ,+/_2pc/="F";"E"**@{-},?!{"C";"D"}
+ ,*{\otimes}\endxy\qquad\xy
+ *+{A}="A";p+/r5pc/+(0,15)*+{B}="B",
+ ,p-<.5pc,2pc>*+{C}="C"
+ ,"A"+<7pc,.5pc>*+{D}="D","A"
+ ,{\ar@/_40pt/"B"},?!{"C";"D"**@{-}}
+ ,*{\otimes}\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The warning message, that no intersection may exist, always occurs inside
+a grouping so it can safely switch itself off for deeper levels.
+
+\DOCMODE(
+\xydef@\nointerceptwarning@{\let\nointerceptwarning@=\relax
+ \xywarning@{perhaps no curve intersection, or many. }}
+
+\xydef@\intercepthull@{\nointerceptwarning@
+ \expandafter\def\expandafter\prevnext@\expandafter{\next}%
+ \splinetestcvxhull@}
+\DOCMODE)
+
+When the line meets the convex hull of the current control points,
+then a closer point exists inside the current portion of the curve.
+We must ``decast'' to find it, after storing the closest value known
+so far, within |\prevhowclose@|.
+
+\DOCMODE(
+\xydef@\splinetestcvxhull@{\begingroup
+ \X@c=\L@c \Y@c=\U@c \splinetrace@{hull:}\xysidesofinterval@
+ \expandafter\ifx\next \expandafter\splineoutsidehull@@
+ \else \expandafter\splineinsidehull@\fi}
+
+\xydef@\splineinsidehull@{\edef\tmp@{\endgroup
+ \def\noexpand\howcvxclose@{\howclose@}%
+ \noexpand\interceptinsidehull@}\tmp@ }
+
+\xydef@\interceptinsidehull@{\edef\prevhowclose@{\howclose@}%
+ \splinedecast@@ }
+\DOCMODE)
+
+If the line does not cross into the convex hull, then we use
+the distance from the control points to determine whether or not
+there can be a closer point. The value of |\prevhowclose@|
+indicates the best so far, while |\howcvxclose@| temporarily
+holds the distance to the closest control point. When this is
+nearer then there will be a closer point on the curve.
+
+\DOCMODE(
+{\xdef\next{\the\maxdimen}}
+\xylet@\prevhowclose@=\next
+
+\xydef@\splineoutsidehull@{\edef\tmp@{\endgroup
+ \def\noexpand\howcvxclose@{\howclose@}%
+ \noexpand\interceptoutsidehull@}\tmp@}
+\xylet@\splineoutsidehull@@=\splineoutsidehull@
+
+%\xydef@\interceptoutsidehull@{\dimen@=\howcvxclose@ \relax
+% \ifdim\dimen@<\howclose@ \relax
+% \ifdim\howclose@<\prevhowclose@\relax \edef\prevhowclose@{\howclose@}\fi
+% \DN@{\begingroup\splinedecast@@ \endgroup}%
+% \else\ifdim\howclose@>\prevhowclose@ \relax \DN@{\splineHadvance@}%
+% \else \DN@{\splineHadvance@ }\fi\fi \next@ }
+\xydef@\interceptoutsidehull@{\dimen@=\howcvxclose@ \relax
+% \global\splineval@=\z@
+\splinetrace@{OUTSIDE HULL: \the\dimen@ : (\howclose@)(\prevhowclose@)}%
+ \let\splinedecast@=\splinedecast@@
+ \let\splinerec@\splineHnear@test
+ \let\splineadvance@\splineIadvance@@
+ \splinedecast@@ }
+
+\xydef@\splineHnear@test{%
+ \xysidesofhull@ \DN@{\splinedecast@}%
+ \ifdim\howclose@<\prevhowclose@\edef\howclose@{\prevhowclose@}\fi
+ \expandafter\if\this@-%
+ \expandafter\ifx\next\DN@{\splineclosest@}\fi
+ \else
+ \expandafter\ifx\next\DN@{\splineadvance@}\fi
+ \fi
+ {\splinefar@false \splinenear@\X@p\X@c\Y@p\Y@c
+ \ifsplinefar@ \aftergroup\next@
+ \else\aftergroup\splineclosest@
+\splinetrace@{too close: (\the\X@p,\the\Y@p)::(\the\X@c,\the\Y@c)}%
+ \fi}}
+\DOCMODE)
+
+For cubic segments it is necessary to look at both control-points
+off the curve and compare their distances; hence the use of
+|\prevhowcvxclose@|, initially set to |\maxdimen|.
+
+\DOCMODE(
+\xydef@\cubicoutsidehull@{\edef\tmp@{\endgroup
+ \def\noexpand\howcvxclose@{\howclose@}}\tmp@
+ \edef\prevhowcvxclose@{\howcvxclose@}\begingroup
+ \X@p=\R@c \Y@p=\D@c \splinetrace@{hullii:}\xysidesofinterval@
+ \expandafter\ifx\next \expandafter\cubicoutsidehull@i
+ \else \expandafter\cubicinsidehull@\fi}
+
+\xydef@\cubicinsidehull@{\edef\tmp@{\endgroup
+ \def\noexpand\howclose@{\howclose@}}\tmp@
+ \cubicoutsidehull@ii }
+
+\xydef@\cubicoutsidehull@i{\edef\tmp@{\endgroup
+ \def\noexpand\howcvxclose@{\howclose@}}\tmp@
+ \dimen@=\prevhowcvxclose@\relax
+ \ifdim\dimen@<\howcvxclose@ \relax
+ \edef\howcvxclose@{\the\dimen@}\expandafter\interceptoutsidehull@
+ \else \expandafter\cubicoutsidehull@ii\fi }
+
+\xydef@\cubicoutsidehull@ii{%
+ \def\splineadvance@{\splineadvance@@}%
+ \def\splinepoint\endgroup{\endgroup
+% \global\let\splinepoint=\splinepoint@
+ \global\let\splinepoint=\relax
+ \def\splineadvance@{\intercepthull@}}%
+ \splinedecast@@ }%
+\DOCMODE)
+
+This macro |\splineHadvance@| is used at the end of a |\splinedecast@|
+in order to pass information from out of a subsegment, to help decide
+whether there is any point in further searching.
+
+\DOCMODE(
+\xydef@\splineHadvance@{\futurelet\next@\splineHadvance@i}
+\xydef@\splineHadvance@i{\ifx\next@\endgroup
+ \expandafter\splineHadvance@x\else\expandafter\splineclosest@\fi}
+
+\xydef@\splineHadvance@x{\edef\tmp@{\endgroup
+ \def\noexpand\prevhowclose@{\prevhowclose@}%
+ \def\noexpand\prevnext@{\next}\def\noexpand\howcvxclose@{\howclose@}}%
+ \tmp@ \dimen@=\prevhowclose@ \relax
+ \ifdim\dimen@<\howclose@ \relax \DN@{\splineclosest@\begingroup}%
+ \else\ifdim\howcvxclose@=\dimen@\DN@{\splineclosest@\begingroup}%
+ \else\DN@{\splineadvance@@\begingroup}\fi\fi \next@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Miscellaneous features}
+%
+The command |\clearcurve| was originally provided to discard the curve
+information, and return to the graphics state before the curve was read,
+if this is ever found to be necessary. This will probably be removed.
+
+\DOCMODE(
+\xydef@\xyclearcrv@{\cv@end\cv@restore\loop@
+ \expandafter\let\csname cv@\number\crv@cnt@\endcsname\relax
+ \ifnum\crv@cnt@>0\advance\crv@cnt@\m@ne\repeat@
+ \let\cv@start=\relax \let\cv@end=\relax \let\cv@restore=\relax \POS}
+\xylet@\clearcurve=\xyclearcrv@
+\DOCMODE)
+
+\TODO:
+Define an |\extendcurve| as a <postcurve> which allows the curve
+to be continued smoothly past the endpoint $c$.
+
+A macro can be used within the modifier, to provide different labels
+at each control point. For example\dots
+
+\begin{code}
+\newcount\cptlabel\global\cptlabel=0
+\def\nextcptlabel{\global\advance\cptlabel 1 %
+ \number\cptlabel}
+\xy (0,0)*+{A}; (50,-10)*+{B}
+**\crv~Pc{~*{\nextcptlabel}(10,-10)
+ &(20,15)&(30,-15)&(40,15)} \endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Two control sequences are provided to access the control points.
+Firstly |\numcontrolpts| returns the number of them,
+while |\xycontrolpt|<num> sets $c$ to be the particular control point.
+Here <num> must be a single digit, grouped integer \eg\ |{-15}|
+or count register containing a numerical value.
+If larger than |\numcontrolpts| then $c$ becomes the end-point of the curve,
+while if zero it becomes the starting point.
+A negative value sets both $p$ and $c$ to be the starting point,
+whereas other values leave $p$ unchanged.
+
+\DOCMODE(
+\xylet@\numcontrolpts=\xynumctrlpts@
+
+\xydef@\xycontrolpt@#1{{%
+ \ifnum#1<\z@\aftergroup\cv@restore\aftergroup\cv@start
+ \else
+ \expandafter\count@\xycrvptsnum@\relax \advance\count@\@ne
+ \ifnum#1>\count@ \ifx\cv@end\relax
+ \expandafter\aftergroup\csname cv@\number#1\endcsname
+ \else\aftergroup\cv@end\fi
+ \else
+ \expandafter\ifx\csname cv@\number#1\endcsname\relax
+ \ifnum#1=\z@\aftergroup\cv@start\else\aftergroup\cv@end\fi
+ \else\expandafter\aftergroup\csname cv@\number#1\endcsname
+ \fi\fi\fi}}%
+\xylet@\xycontrolpt=\xycontrolpt@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Storing control point locations:}
+
+Upon starting to read the control points for a curve,
+first set the counter |\crv@cnt@| to be zero.
+Store the position of $p$ and $c$ and the current base in control sequences
+|\cv@start|, |\cv@end| and |\cv@restore| for later retrieval and to
+reinstate the current graphics state. |\cv@start| is a little more
+complicated in order to retain the existing value of $p$.
+
+\DOCMODE(
+\xydef@\startxycurve@@{\crv@cnt@=\z@
+ \edef\cv@start{\cfromthep@}%
+ \ifdim\zz@\R@c \ifdim\zz@\L@c \ifdim\zz@\D@c \ifdim\zz@\U@c
+ \Edge@c={\zeroEdge}\fi\fi\fi\fi
+ \edef\cv@end{\cfromthec@}%
+ \edef\cv@restore{\pfromthep@\basefromthebase@}}
+\xylet@\startxycurve@=\startxycurve@@
+
+\xylet@\cv@start=\relax
+\xylet@\cv@end=\relax
+\xylet@\cv@restore=\relax
+\xydef@\readxycurve@{\startxycurve@\xycrvmods@}
+\xylet@\readxycurve=\readxycurve@
+\DOCMODE)
+
+
+The position of each control point is stored as the expansion
+of a control sequence whose name encodes its place within the $<poslist>$.
+Expanding this control sequence sets $c$ to be the appropriate position.
+
+\DOCMODE(
+\xydef@\addtocrv@{\advance\crv@cnt@\@ne
+ \edef\tmp@{%
+ \expandafter\noexpand\csname cv@\number\crv@cnt@\endcsname}%
+ \expandafter\edef\tmp@{\cfromthec@}%
+ \edef\tmp@{\noexpand\addtocrvpts@{\noexpand\def
+ \expandafter\noexpand\tmp@{\X@c=\the\X@c \Y@c=\the\Y@c }}}\tmp@
+ \edef\xycrvptsnum@{\the\crv@cnt@}%
+}
+\DOCMODE)
+% use of |\xycrvptsnum@| here is not desirable, but it works.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Alternate curve styles:}
+
+\DOCMODE(
+\xydef@\xycrvdrop@{ {\zerodot}}
+\xydef@\xycrvconn@{}
+
+\xydef@\xyc@trlpts@{\def\xycrvdrop@{ \dir{x}}\def\xycrvconn@{}%
+ \afterCURVE{\savecrvobjects@\xyctrlpts@}\readxycurve@}
+\xydef@\xyc@trlpts@@{%
+ \afterCURVE{\savecrvobjects@\def\xycrvdrop@{ \dir{x}}%
+ \def\xycrvconn@{}\xyctrlpts@}\readxycurve@}
+\xydef@\xyc@vxhull@{\def\xycrvdrop@{ {}}%
+ \edef\xycrvconn@{ \noexpand\dir{\addDASH@{}}}%
+ \afterCURVE{\savecrvobjects@\xycvxhull@}\readxycurve@}
+\xydef@\xyc@vxhull@@{%
+ \afterCURVE{\savecrvobjects@\def\xycrvdrop@{ {}}%
+ \edef\xycrvconn@{ \noexpand\dir{\addDASH@{}}}\xycvxhull@}\readxycurve@}
+\xylet@\controlpts=\xyc@trlpts@
+\xylet@\convexhull=\xyc@vxhull@
+\xydef@\savecrvobjects@{\bgroup
+ \expandafter\toks@\expandafter{\xycrvdrop@}%
+ \expandafter\toks@ii\expandafter{\xycrvconn@}%
+ \edef\tmp@{\egroup\noexpand\def\noexpand\resetcrvobjects@{%
+ \noexpand\def\noexpand\xycrvdrop@{\the\toks@}%
+ \noexpand\def\noexpand\xycrvconn@{\the\toks@ii}%
+ }}\tmp@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+There is the potential to do many other things here, by using |\afterCURVE|,
+once the list of control points has been read.
+
+\DOCMODE(
+\xydef@\afterCURVE#1{\def\afterCURVE@{#1}}
+\xydef@\endxycurve@{\cv@end\savectrlptsnum@
+ \expandafter\def\csname params@\endcsname{\the\crvpts@}%
+ \cv@restore\afterCURVE@\POS}
+\xylet@\endcurve=\endxycurve@
+\DOCMODE)
+
+In fact this is essentially how |\controlpts| and |\convexhull|
+were interfaced before extensions were added to change styles.
+
+\begin{code}
+\def\controlpts{\afterCURVE{\xyctrlpts}%
+ \readxycurve}
+\def\convexhull{\afterCURVE{\xycvxhull}%
+ \readxycurve}
+\end{code}
+\displaycode
+
+\noindent
+The real work is done by |\xyctrlpts| and |\xycvxhull|.
+At the point when these macros are expanded the graphics state has the
+restored $p$ and $c$ to their original values,
+\ie\ the end-points of the curve.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{|\controlpts|:}
+
+This macro visits in order each of the control points dropping the requisite
+object. The connection style is not used and the direction does not change.
+For a loop-counter we use |\count@@@|.
+
+\DOCMODE(
+\xydef@\xyctrlpts@{\cv@end \cv@restore
+ \def\crvconnect@{\straitconnect@}%
+ \ifnum\crv@cnt@>\z@
+ \count@@@=\@ne \DN@{\loop@\xycontrolpt@{\count@@@}\relax
+ \expandafter\xycvxhulldrop@\xycrvdrop@
+ \ifnum\crv@cnt@>\count@@@\advance\count@@@\@ne\repeat@
+ \cv@end \cv@restore }%
+ \else\DN@{\relax}\fi \next@ }
+\xylet@\xyctrlpts=\xyctrlpts@
+\DOCMODE)
+
+The token list |\crvpts@| stores the following information:
+current scope ||, location of $p$ and $c$,
+number of control points |\crv@cnt@| and their locations.
+It does this by storing |\def|s for control sequence names,
+depending on the scope, which expand to this information.
+Thus by executing |\the\crvpts@| at the right level,
+the information is conveniently recovered via control sequences which
+do not conflict with anything else, and whose names can be reconstructed.
+
+\DOCMODE(
+\xydef@\addtocrvpts@#1{\crvpts@=\expandafter{\the\crvpts@#1}}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\savescope@{\crvpts@={}%
+ \edef\tmp@{\expandafter\noexpand\csname cv@0\endcsname}%
+ \edef\tmp@{\noexpand\addtocrvpts@{\noexpand\def
+ \expandafter\noexpand\tmp@{\X@c=\the\X@p \Y@c=\the\Y@p}}}%
+ \tmp@ }
+
+\xydef@\savectrlptsnum@{%
+ \advance\crv@cnt@\@ne \edef\tmp@{%
+ \expandafter\noexpand\csname cv@\number\crv@cnt@\endcsname}%
+ \edef\tmp@{\noexpand\addtocrvpts@{\noexpand\def
+ \expandafter\noexpand\tmp@{\X@c=\the\X@c \Y@c=\the\Y@c}}}\tmp@
+ \advance\crv@cnt@\m@ne
+ \edef\tmp@{\expandafter\noexpand\csname ptsnum@\endcsname}%
+ \edef\tmp@{\noexpand\addtocrvpts@{%
+ \noexpand\def\expandafter\noexpand\tmp@{\number\crv@cnt@}}}%
+ \tmp@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Convex Hull:}
+
+This macro visits in order each of the control points dropping the requisite
+object. With the previous as $p$ and the current one as $c$, a connection
+is set in the requisite style. For a loop-counter we use |\count@@@|.
+
+Use a group |{\expandafter\POS\xycrvconn@}| else the |\loop@| gets upset.
+This does not affect the size of the \Xy-picture, since the dropped objects
+are not similarly shrouded.
+
+Also used for the trivial case where there are no control points, hence
+a straight line between $p$ and $c$ is what is requested.
+
+\DOCMODE(
+\xydef@\xycvxhull@{\cv@end \cv@restore
+ \addtocrvpts@{\def\crvconnect@{\straitconnect@}}%
+ \def\crvconnect@{\straitconnect@}%
+ \ifnum\crv@cnt@>\z@
+ \count@@@=\@ne\relax \DN@{\loop@\xycontrolpt@{\count@@@}\relax
+ \expandafter\xycvxhulldrop@\xycrvdrop@
+ {\expandafter\connect\xycrvconn@{}}\pfromc@
+ \ifnum\crv@cnt@>\count@@@\relax \advance\count@@@\@ne\repeat@
+ \cv@end }%
+ \else
+ \ifx\empty\xycrvconn@
+ \edef\xycrvconn@{\noexpand!C\noexpand\dir{\addDASH@{}}}\fi
+ \DN@{\relax}\fi \next@
+ {{\expandafter\connect\xycrvconn@{}}}%
+ \cv@end \cv@restore }
+\xylet@\xycvxhull=\xycvxhull@
+
+\xydef@\xycvxhulldrop@#1#{\drop@{#1}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Spline constructions}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The control sequence |\xysplineparams@| provides a way to access a control
+sequence name that is unique to the current \Xy-pic scope.
+This control sequence will be used to store the parameters which determine
+the spline curve. Similarly |\xysplineedges@| will be used to store the
+parameter values and lengths (along the squine) to the locations where
+the spline crosses the edge of the objects at the ends $p$ and $c$.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\savespline@{%
+\splinetrace@{savespline@:}%
+% \edef\endspline@{\endgroup
+ \edef\endspline@{\endgroup
+ \savesplineparams@ \savesplinerefs@
+ \X@min=\the\X@min\relax \X@max=\the\X@max\relax
+ \Y@min=\the\Y@min\relax \Y@max=\the\Y@max\relax
+ \ifInvisible@\noexpand\Invisible@true
+ \else\noexpand\Invisible@false\fi
+ }\endspline@
+ \edef\tmp@{\noexpand\addtocrvpts@{\savesplineparams@}}\tmp@
+ \xycontrolpt@\z@ \cv@end }
+
+\xydef@\savesplineparams@{%
+ \noexpand\def\expandafter\noexpand\xysplineedges@{\xysplineedges@}}
+
+\xydef@\savesplinerefs@{%
+ \noexpand\def\noexpand\xysplineparams@{%
+ \expandafter\noexpand\xysplineparams@}%
+ \noexpand\def\noexpand\xysplineedges@{%
+ \expandafter\noexpand\xysplineedges@}%
+}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+One new box register is required, for the object used to actually
+set the curve, \dots
+
+\DOCMODE(
+\xynew@{box}\splinebox@
+\DOCMODE)
+
+\dots\ and 4 dimen registers ...
+
+\DOCMODE(
+\xynew@{dimen}\splineval@
+\DOCMODE)
+\dots\ which is for tracking the natural spline parametrization;
+
+\DOCMODE(
+\xynew@{dimen}\splinedepth@
+\DOCMODE)
+\dots\ which is for tracking he depth of the recursive algorithms;
+
+\DOCMODE(
+\xynew@{dimen}\splinetol@
+\DOCMODE)
+\dots\ which contains the tolerance for the spline,
+(this can probably be shifted to an ordinary macro);
+
+\DOCMODE(
+\xynew@{dimen}\splinelength@
+\DOCMODE)
+\dots\ which accumulates a measure of the length along a spline curve.
+(Currently this is not being used, as most things can be done
+satisfactorily using the spline parametrization only.)
+
+
+Some new conditionals are also required. These are for testing whether
+successive places on the squine are sufficiently close together,
+and whether the objects should be placed or not.
+
+\DOCMODE(
+\xynew@{if}\ifsplinefar@
+\xynew@{if}\ifsplineplot@ % to plot points or not
+\DOCMODE)
+
+Provide some tracing ability, for debugging.
+
+\DOCMODE(
+\xydef@\splinetracing{\let\splinetrace@=\W@}
+\xydef@\splineignore@#1{}
+\xylet@\splinetrace@=\splineignore@
+\DOCMODE)
+
+\medskip
+
+The parameters for the current section of the spline are stored indirectly
+in |\xysplineparams@|, while information concerning the places where the
+spline crosses the edges of objects at $p$ and $c$ is stored indirectly in
+|\xysplineedges|.
+A control sequence |\readsplineparams@| is used to extract this information.
+Each spline type must provide a |\getsplineparams@| which
+puts the information into easily usable form.
+
+\DOCMODE(
+\xydef@\readsplineparams@{%
+ \expandafter\expandafter\expandafter\getsplineparams@\xysplineparams@
+ \expandafter\expandafter\expandafter\getsplineedges@safe\xysplineedges@ @@}
+
+\xydef@\getsplineedges@safe#1@@{\DN@{#1}%
+ \ifx\next@\empty \DN@{\getsplineedges@.0pt;0.0pt,0.0pt;0.0pt,}%
+ \else \DN@{\getsplineedges@safe@#1@@}\fi \next@}
+
+\xydef@\getsplineedges@safe@#1;#2,#3@@{\DN@{#3}%
+\splinetrace@{getsplineedges@safe}%
+ \ifx\next@\empty \DN@{\getsplineedges@#1;#2,0.0pt;0.0pt,}%
+ \else \DN@{\getsplineedges@#1;#2,#3}\fi \next@}
+\DOCMODE)
+
+The edge locations are stored as $x.y$
+where $x+1$ = spline-segment number and
+$y$ or $1-y$ = parameter value of the start, resp. finish,
+in the segment $x+1$.
+
+\DOCMODE(
+\xydef@\getsplineedges@#1;#2,#3;#4,{%
+ \global\dimen@i=#1\global\dimen5=#2\relax
+ \dimen@=#3\multiply\dimen@\m@ne \advance\dimen@\splinelength@
+ \global\dimen3=\dimen@
+ \dimen@=#4\relax
+ \ifdim\dimen@>\p@ \xywarning@{edge out-of-range: \the\dimen@}%
+ \count@=\dimen@ \divide\count@\p@
+ \advance\dimen@-\count@\p@ \multiply\dimen@\m@ne
+ \advance\dimen@ \count@\p@ \advance\dimen@\p@
+\splinetrace@{\the\dimen@}%
+ \else
+ \multiply\dimen@\m@ne \advance\dimen@\p@
+ \fi
+ \global\dimen7=\dimen@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent Sometimes \TeX\ will run short of memory when many curves are
+used without a backend with special support for curves. In that case
+the following commands, that obey normal \TeX\ groupings, may be
+helpful:
+%
+\begin{defs1}
+|\SloppyCurves| \cr
+|\splinetolerance{|<dimen>|}| \cr
+\end{defs1}
+\noindent\unskip
+%
+allow adjustment of the tolerance used to typeset curves. The first sets
+tolerance to .8pt, after which |\splinetolerance{0pt}| resets to
+the original default of fine curves.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Some useful methods for accurate division by integers.
+
+\DOCMODE(
+\xydef@\dimen@half{%
+ \advance\dimen@ \ifdim\dimen@<\z@-\fi 1sp \divide\dimen@\tw@}
+
+\xydef@\halve@dimen#1{\dimen@=#1\relax \dimen@half #1=\dimen@}
+
+\xydef@\dimen@nth#1#2{\dimen@=#2\relax \dimen@ii=#1sp %
+ \advance\dimen@ \ifdim\dimen@<\z@-\fi.5\dimen@ii
+ \divide\dimen@ by#1\relax #2=\dimen@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Before constructing the curve we first examine the ``drop'' object,
+setting it in an |\xybox|. The size of this object determines the
+spacing of objects placed along the curve, via the {\em tolerance\/}
+of the spline. This determines the maximum separation of places at
+which objects will be dropped; \ie\ when two adjacent places would
+be separated by more than this amount, the spline algorithm
+constructs another place on the curve intermediate between these two.
+
+\noindent{\bf Note: } Alter the spline tolerance by adjusting the size
+of the ``drop'' object. In particular, a dotted line can be achieved by
+setting an empty object with non-zero size. If the size is zero then the
+default tolerance is used. Initially this is .4pt; it may be altered
+using |\splinetolerance|<dimen>, where <dimen> must be greater than
+zero, else the initial tolerance is reset.
+
+\DOCMODE(
+\xydef@\splinetolerance@#1{\dimen@=#1\relax
+ \ifdim\dimen@>\z@ \splinetol@=\dimen@
+ \else\splinetol@=.4\p@\fi}
+
+\xylet@\splinedefaulttol@=\relax
+
+\xydef@\splinetolerance#1{\splinetolerance@{#1}%
+ \edef\splinedefaulttol@{\splinetol@=\the\splinetol@}}
+
+\splinetolerance\z@
+
+\xydef@\SloppyCurves{\splinetolerance{.8\p@}}
+
+\xydef@\xylowtolerance@{\splinedefaulttol@
+ \ifdim\splinetol@<\p@ \divide\splinetol@\tw@ \fi}
+\DOCMODE)
+
+Similarly examine the ``connect'' object. If none has been specified
+then there is no need to calculate the tangent direction at each
+place along the curve. This saves on both time and memory requirement.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+"Procedure":
+(1)~If |\xycrvdrop@| is empty, define |\splinedrop@| to expand
+to |\copy\zerodotbox@|, thus creating a curve constructed from small dots.
+Otherwise (2a)~set the |\splinebox@| with the specified object and
+(2b)~use |\copy\splinebox@| as the expansion of |\splinedrop@|.
+(3)~Set |\splinetol@| to be $\sqrt2\times$ maximum of width and
+height+depth of the box.
+
+If |\xycrvconn@| is empty~(4)~then |\splineconn@| is set to |\relax|.
+(5)~Otherwise it is necessary to reset the direction at each
+place along the curve before dropping the object specified
+by |\xycrvconn@|.
+
+\DOCMODE(
+\xywarnifdefined\splinedrop@
+\xydef@\setstdsplinedrop@{%
+ \setbox\splinebox@=\hbox\bgroup
+ \setboxz@h{\expandafter\object\xycrvdrop@{}}%
+ \splinedefaulttol@ \dimen@=\wd\z@ \dimen@ii=\ht\z@ \advance\dimen@ii\dp\z@
+ \ifdim\dimen@ii>\dimen@ \dimen@=\dimen@ii \fi \dimen@=1.4142\dimen@
+ \ifdim\dimen@>\splinetol@ \splinetol@=\dimen@\else\dimen@=\splinetol@\fi
+ \dimen@=.5\wd\z@
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \kern-\dimen@ \Drop@@ \kern\dimen@
+ \edef\tmp@{\egroup \splinetol@=\the\splinetol@
+ \ifInvisible@\noexpand\Invisible@true
+ \else\noexpand\Invisible@false\fi}\tmp@
+ \edef\splinedefaulttol@{\splinetol@=\the\splinetol@}%
+ \def\splinedrop@{\copy\splinebox@\splineextra@@}}
+
+\xywarnifdefined\splineconn@
+\xydef@\stdsplineconn@{{\setsplinedir@ % %(5)
+ \setboxz@h\bgroup\expandafter\object\xycrvconn@{}%
+ \edef\tmp@{\egroup\L@c=\the\L@c \R@c=\the\R@c \D@c=\the\D@c \U@c=\the\U@c
+ \noexpand\def\noexpand\Drop@@}\expandafter\tmp@\expandafter{\Drop@@}%
+ \setboxz@h{\kern-\L@c \boxz@}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \Drop@@}}
+
+\xydef@\setcrvobjects@{\setstdsplinedrop@ \def\splineconn@{\stdsplineconn@}}
+\xylet@\splineextra@@=\relax
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\splinenear@#1#2#3#4{{\d@X=#1\advance\d@X-#2%
+ \ifdim\d@X<\z@ \d@X=-\d@X\fi
+ \ifdim\splinetol@<\d@X \aftergroup\splinefar@true
+ \else \d@Y=#3\advance\d@Y-#4\ifdim\d@Y<\z@ \d@Y=-\d@Y\fi
+ \ifdim\splinetol@<\d@Y\aftergroup\splinefar@true
+ \else \xydist@\d@X\d@Y
+ \ifdim\splinetol@<\dimen@ \aftergroup\splinefar@true
+ \else
+ \ifdim\dimen@<.1\splinetol@\aftergroup\splinetooclose@\fi
+ \fi\fi\fi}}
+
+\xydef@\splineadvance@@{\global\advance\splineval@\splinedepth@}
+\DOCMODE)
+
+This stops objects being placed too close together along the spline.
+It is necessary at the beginning of a segment with a non-zero edge.
+Otherwise, with a large |\splinetolerance@|, the accuracy of the
+place-finding mechanism results in being so deep in the tree that
+objects placed at every level on the way up would be much too close.
+
+\DOCMODE(
+\xydef@\splinetooclose@{\aftergroup\aftergroup\aftergroup\splinetooclose@@}
+\xydef@\splinetooclose@@{\def\splineplotpt@{\relax}}
+\DOCMODE)
+
+Each place along the curve is tested according to a |\splinetest@|.
+Normally this is for visibility according to the extent of the objects
+at the end-points of the curve.
+When an edge is crossed then the |\splinecontinue| routine is called
+to decide how the behaviour may change e.g. whether the recursion
+should continue or exit to the top of the existing tree.
+
+\DOCMODE(
+\xydef@\splinepoint@@{%
+\splinetrace@{P@:(\the\X@c,\the\Y@c)::\the\splineval@;\the\splinedepth@}%
+ {\splinetest@\ifsplineplot@\relax\else\aftergroup\splinecontinue\fi}}
+
+\xydef@\splinepoint@{%
+ {\splinetest@\ifsplineplot@\aftergroup\splinecontinue\fi}}
+\xylet@\splinepoint=\splinepoint@
+
+\xydef@\splinecontinue@{%
+ \global\let\splinepoint=\splinepoint@@
+ \global\let\splinecontinue=\splinecontinue@@}
+\xydef@\splinecontinue@@{%
+ \global\let\splinepoint=\splinepoint@
+ \global\let\splinecontinue=\relax}
+\xylet@\splinecontinue=\splinecontinue@
+
+\DOCMODE)
+
+Points where segments join lie at the top of the recursive tree.
+They are tested directly against the objects at the endpoints,
+in order to decide whether or not they are visible.
+
+\DOCMODE(
+\xydef@\splineknotpoint@{{\X@p=\X@c \Y@p=\Y@c \cv@start
+ \the\Edge@c\@ne \ifInside@\else\aftergroup\splineknotpoint@@\fi}}%
+\xydef@\splineknotpoint@@{{\X@p=\X@c \Y@p=\Y@c \cv@end
+ \the\Edge@c\@ne \ifInside@\else \aftergroup\splinepoint\fi}}%
+
+\xylet@\firstsplinepoint@=\splineknotpoint@
+\xylet@\lastsplinepoint@= \splineknotpoint@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This routine is used to find where the spline crosses
+the edges of the objects at $p$ and $c$.
+First (1)~ we set up the tests which will determine when
+the edge has been crossed. Then commence the scan.~(2)
+
+\DOCMODE(
+\xydef@\splined@@@{%
+\splinetrace@{finding end types}%
+\splinetrace@{bstartPLACE@:\bstartPLACE@; bendPLACE@:\bendPLACE@}%
+ \DN@{\splinescan@}\ifx\bstartPLACE@\empty
+ \ifx\bendPLACE@\relax\def\bendPLACE@{1}\fi
+ \else\ifx\bstartPLACE@\relax
+ \else\ifx\bstartPLACE@\undefined
+ \else
+ \DN@{\splinescanbreak@}\ifx\bendPLACE@\relax\def\bendPLACE@{1}\fi
+ \DNii@{0}\ifx\bstartPLACE@\nextii@
+ \DNii@{1}\ifx\bendPLACE@\nextii@\DN@{}%
+% \else\DNii@{0.0}\ifx\bendPLACE@\nextii@\DN@{}\fi
+ \fi\fi % use the saved values
+ \fi\fi\fi \next@ }% %(2)
+
+\xydef@\splineStarttest@{{\X@p=\X@c \Y@p=\Y@c \cv@start \the\Edge@c\@ne
+ \ifInside@\aftergroup\splineplot@false\else\aftergroup\splineplot@true\fi}}%
+\xydef@\splineEndtest@{{\X@p=\X@c \Y@p=\Y@c \cv@end \the\Edge@c\@ne
+ \ifInside@\aftergroup\splineplot@false\else\aftergroup\splineplot@true\fi}}%
+
+\xydef@\splineBreakStarttest@{{\X@p=\X@c \Y@p=\Y@c \cv@brstart \the\Edge@c\@ne
+ \ifInside@\aftergroup\splineplot@false\else\aftergroup\splineplot@true\fi}}%
+
+\xydef@\splineBreakEndtest@{{\X@p=\X@c \Y@p=\Y@c \cv@brend \the\Edge@c\@ne
+ \ifInside@\aftergroup\splineplot@false\else\aftergroup\splineplot@true\fi}}%
+% \ifInside@\aftergroup\splineplot@true\else\aftergroup\splineplot@false\fi}}%
+
+\xylet@\splineStarttest=\splineStarttest@
+\xylet@\splineEndtest=\splineEndtest@
+
+\xydef@\splineSlowStarttest{{\X@p=\X@c \Y@p=\Y@c \cv@start \the\Edge@c\@ne
+ \ifInside@\aftergroup\splineplot@maybe@@\else\aftergroup\splineplot@true\fi}}%
+\xydef@\splineSlowEndtest{{\X@p=\X@c \Y@p=\Y@c \cv@end \the\Edge@c\@ne
+ \ifInside@\aftergroup\splineplot@maybe@@\else\aftergroup\splineplot@true\fi}}%
+\xydef@\splineplot@maybe{\splineplot@false}%
+\xylet@\splineplot@maybe@@=\splineplot@maybe
+\DOCMODE)
+
+(3)~Start a new group and bind some macros appropriate
+to finding the starting edge.
+(4)~start the spline algorithm, using a small tolerance.
+(5)~Close the group, thus removing the bindings of~(3).
+(6)~Record the information, which has been stored globally.
+(7)~Do the same for the ending edge.
+(8)~Clear the global information.
+After this, set the curve as usual.~(9)
+
+\DOCMODE(
+\xydef@\splinescan@{\bgroup%
+ \expandafter\def\xysplineedges@{\z@;\z@,\z@;\z@,}%
+ \bgroup \cv@start
+ \expandafter\DN@\expandafter{\the\Edge@c}\DNii@{\zeroEdge}%
+ \ifx\next@\nextii@ \gdef\splineedges@{\z@;\z@,}%
+ \else\aftergroup\splinestartScan@\fi
+ \egroup \relax
+ \bgroup \cv@end
+ \expandafter\DN@\expandafter{\the\Edge@c}\DNii@{\zeroEdge}%
+ \ifx\next@\nextii@
+ \getcrvsegsnum@ \edef\segmentnum@{\the\count@}%
+ \splineval@=\z@ \splineRecordEndValue@
+ \else\aftergroup\splineendScan@\fi
+ \egroup \egroup
+ \expandafter\testsplineedges@\splineedges@;,@@%
+ \expandafter\edef\xysplineedges@{\splineedges@}% %(6)
+ \global\let\splineedges@=\relax % %(8)
+\splinetrace@{edge params: \xysplineedges@}}%
+
+\xydef@\testsplineedges@#1;#2,#3;#4,#5@@{%
+ \DN@{#5}\ifx\next@\empty
+ \DNii@{#4}\ifx\nextii@\empty
+ \xynoedgespline@{end}\def\splineedges@{#1;#2,\z@;\z@,}\fi
+ \DNii@{#2}\ifx\nextii@\empty
+ \xynoedgespline@{start}\def\splineedges@{\z@;\z@,\z@;\z@,}\fi
+ \fi }
+\xydef@\xynoedgespline@#1{\xywarning@{#1 edge of spline not found}}%
+
+\xydef@\splinestartScan@{\bgroup % %(3)
+\splinetrace@{scan for start}%
+ \global\let\splineadvance@=\splineadvance@@ %(3)
+ \let\spline@start=\splinefindStart@ %(3)
+ \let\spline@end=\spline@end@@ %(3)
+ \let\splinefinish@=\splinefinish@@
+ \let\splinewhich=\relax
+ \global\splinelength@=\z@
+% \let\splinerec@=\splineSrec@
+ \def\splinerec@{\let\splinerec@=\splineSrec@ \splinedecast@@}%
+ \edef\splineedges@{}%
+ \expandafter\let\xysplineedges@\relax
+% \bgroup
+ \xylowtolerance@ \splined@@
+ \ifx\splineedges@\empty\expandafter\splineslowScan@\fi
+ \ifx\splineedges@\relax\expandafter\splinenostart@\fi
+ \egroup }% %(4)
+
+\xydef@\splineslowScan@{%
+ \let\splineStarttest=\splineSlowStarttest
+ \let\splinescanStarttest=\relax
+ \def\splinerec@{\let\splinerec@=\splineSrec@ \splinedecast@@}%
+ \splined@@ }
+
+\xydef@\splineslowEnd@{%
+ \global\let\splineEndtest=\splineSlowEndtest
+ \let\splinescanEndtest=\relax
+ \def\splinerec@{\let\splinerec@=\splineErec@ \splinedecast@@}%
+ \splined@@ }
+
+\xydef@\splinenostart@{%
+ \def\segmentnum@{1}\splinelength@=\z@ \splineval@=\z@
+ \xynoedgespline@{start}\splineRecordValue@ }
+
+\xydef@\splineendScan@{\bgroup % %(3)<-----------
+ \bgroup % %(7)
+\splinetrace@{scan for end}%
+ \global\let\splineadvance@=\splineadvance@@
+ \let\spline@start=\splinefindEnd@
+ \let\spline@end=\spline@end@@
+ \let\splinefinish@=\splinefinish@@
+ \let\splinewhich=\relax
+ \global\splinelength@=\z@
+% \let\splinerec@=\splineErec@
+ \global\let\splineEndtest=\splineEndtest@
+ \def\splinerec@{\let\splinerec@=\splineErec@ \splinedecast@@}%
+ \expandafter\def\expandafter\prevedges@\expandafter{\splineedges@}%
+ \xylowtolerance@ \splined@@
+ \ifx\splineedges@\prevedges@\expandafter\splineslowScan@\fi
+ \egroup \egroup}
+
+\xydef@\splinescanbreak@{%
+\splinetrace@{SCANBREAK}%
+ \gdef\breakedges@{}%
+ \DN@{0}\ifx\next@\bstartPLACE@
+ \DN@{\bgroup \def\tmp@####1;####2,####3;####4,{%
+ \global\splineval@=####2\relax}%
+ \expandafter\expandafter\expandafter\tmp@\xysplineedges@
+ \def\segmentnum@{1}\splineRecordBreakValue@ \egroup}%
+ \else
+ \bgroup \cv@start
+ \expandafter\DN@\expandafter{\the\Edge@c}\DNii@{\zeroEdge}%
+ \ifx\next@\nextii@ \aftergroup\splinezerostart
+ \else\aftergroup\splinewidestart\fi
+ \egroup
+ \fi \next@
+ \DN@{1}\ifx\next@\bendPLACE@
+ \DN@{\bgroup \def\tmp@####1;####2,####3;####4,{%
+ \global\splineval@=####4\relax}%
+ \expandafter\expandafter\expandafter\tmp@\xysplineedges@
+%% \multiply\splineval@\m@ne \advance\splineval@\p@
+%% \def\segmentnum@{1}
+ \getcrvsegsnum@ \edef\segmentnum@{\the\count@}%
+ \global\multiply\splineval@\count@
+ \splineRecordEndBreakValue@ \egroup}%
+ \else
+ \bgroup \cv@end
+ \expandafter\DN@\expandafter{\the\Edge@c}\DNii@{\zeroEdge}%
+ \ifx\next@\nextii@ \aftergroup\splinezeroend
+ \else\aftergroup\splinewideend\fi
+ \egroup
+ \fi \next@
+ \expandafter\def\expandafter
+ \xybreakedges@\expandafter{\breakedges@}% %(6)
+ \global\let\breakedges@=\relax % %(8)
+\splinetrace@{break params: \xybreakedges@::\bstartPLACE@--\bendPLACE@}%
+ \expandafter\let\xysplineedges@\xybreakedges@ }
+
+\xydef@\getcrvsegsnum@{% sets \count@
+ \count@=\ptsnum@\relax \ifnum\count@>\@ne\advance\count@\m@ne\fi}
+
+\xydef@\splinezerostart{\DN@{\bgroup
+\splinetrace@{splinezerostart:}%
+ \dimen@=\bstartPLACE@\p@
+ \global\splineval@=\dimen@
+ \splineRecordBreakValue@ \egroup }}
+
+\xydef@\splinezeroend{\DN@{\bgroup
+\splinetrace@{splinezeroend:}%
+ \dimen@=\bendPLACE@\p@
+ \multiply\dimen@\m@ne \advance\dimen@\p@
+ \def\segmentnum@{0}\global\splineval@=\dimen@
+ \splineRecordEndBreakValue@ \egroup }}
+
+\xydef@\splinewidestart{\DN@{\bgroup
+ \splinetrace@{scan for start}%
+ \let\splinefbcontinue@=\breakstartcontinue@
+ \let\splinef@pt=\splinef@breakpt
+ \let\splinef@end=\break@start
+ \edef\tmp@{{\bstartPLACE@}}%
+ \expandafter\splinealong@@\tmp@\z@>\endgroup\egroup }}
+
+\xydef@\splinewideend{\DN@{\bgroup
+ \splinetrace@{scan for wide end}%
+ \let\splinefbcontinue@=\breakendcontinue@
+ \let\splinef@pt=\splinef@breakpt
+ \let\splinef@end=\break@end
+ \edef\tmp@{{\bendPLACE@}}%
+ \expandafter\splinealong@@\tmp@\z@<\endgroup\egroup }}
+
+
+\xydef@\splineSrec@{{%
+\splinetrace@{v=\the\splineval@ + d=\the\splinedepth@ :
+ (\the\X@p,\the\Y@p);(\the\X@c,\the\Y@c):Srec }%
+ \splineStarttest
+ \ifsplineplot@
+ \ifdim\splinedepth@<.0001\p@ \aftergroup\splinefinish@
+ \global\advance\splineval@ .5\splinedepth@
+ \else\aftergroup\splinedecast@@ \fi
+ \else \aftergroup\splineadvance@ \fi}}
+
+\xydef@\splinefindStart@@{\bgroup \bgroup
+ \expandafter\expandafter\expandafter\getsplineparams@\xysplineparams@
+ \global\let\splineadvance@=\splineadvance@@
+ \global\let\splinepoint=\relax
+ \let\splinegoal@=\splineRecordValue@ \global\dimen5=\z@
+ {\X@c=\X@p \Y@c=\Y@p \splinescanStarttest }%% first test initial point.
+}
+
+\xydef@\splinefindStart@{%
+ \expandafter\crv@cnt@\xycrvptsnum@\relax
+ \ifnum\crv@cnt@>\tw@
+ \crv@cnt@=\@ne \splineplot@false \splinesegment@{\crv@cnt@}%
+ {\splineStarttest %% test end of segment.
+ \ifsplineplot@\aftergroup\splineplot@true\fi}%
+ \ifsplineplot@ \else \searchforStartsegment@ \fi
+ \splinesegment@{\crv@cnt@}%
+\splinetrace@{start is in segment \segmentnum@}%
+ \else \splinesegment@\@ne \fi
+ \splineplot@false \splinefindStart@@
+}
+\DOCMODE)
+
+This finds the first spline segment whose endpoint is beyond the edge of
+the object.
+
+\DOCMODE(
+\xydef@\searchforStartsegment@{\splineplot@true\loop@
+ \advance\crv@cnt@\@ne
+ \expandafter\count@\xycrvptsnum@\relax
+ \ifnum\count@=\crv@cnt@\expandafter\splineplot@false
+ \else
+ \splinesegment@{\crv@cnt@}{\splineStarttest
+ \ifsplineplot@\aftergroup\splineplot@false
+ \else\aftergroup\splineplot@true\fi }%
+ \fi \ifsplineplot@\repeat@
+}
+\DOCMODE)
+
+Finding the end is similar, but the spline is searched in reverse order.
+
+\DOCMODE(
+\xydef@\splinefindEnd@@{\bgroup \bgroup
+ \expandafter\expandafter\expandafter\getsplineparams@\xysplineparams@
+\splinetrace@{params:\xysplineparams@}%
+ \splinereverse@@
+\splinetrace@{params:\xysplineparams@}%
+ \global\let\splineadvance@=\splineadvance@@
+ \global\let\splinepoint=\splinescanEndtest
+ \let\splinegoal@=\splineRecordEndValue@ \global\dimen5=\z@
+ {\X@c=\X@p \Y@c=\Y@p \splinescanEndtest }%% first test initial point.
+}
+
+\xydef@\splinereverse@@{\splinereverse@@@}
+\xydef@\splinereverse@@@{%
+ \def\postspline@{\d@X=-\d@X \d@Y=-\d@Y}%
+ \dimen@ii=\X@c \X@c=\X@p \X@p=\dimen@ii
+ \dimen@ii=\Y@c \Y@c=\Y@p \Y@p=\dimen@ii
+ \global\dimen5=-\dimen5\relax
+ \global\advance\dimen5\splinelength@ }
+\xydef@\postspline@{}
+
+\xydef@\splineErec@{{%
+ \dimen@=\splineval@ \advance\dimen@\splinedepth@ %
+\splinetrace@{ER (\the\X@p,\the\Y@p);(\the\X@c,\the\Y@c);;;
+\the\dimen@,\the\splinedepth@}%
+ \splineEndtest
+ \ifsplineplot@
+ \ifdim\splinedepth@<.0001\p@ \aftergroup\splinefinish@
+% \global\advance\splineval@ .5\splinedepth@
+ \else\aftergroup\splinedecast@@ \fi
+ \else \aftergroup\splineadvance@ \fi}}
+
+\xydef@\splinefindEnd@{%
+ \expandafter\crv@cnt@\xycrvptsnum@\relax
+ \ifnum\crv@cnt@>\tw@
+ \advance\crv@cnt@\m@ne
+ \splineplot@false \splinesegment@{\crv@cnt@}%
+ {\X@c=\X@p \Y@c=\Y@p \splineEndtest %% test end of segment.
+ \ifsplineplot@\aftergroup\splineplot@true\fi }%
+ \ifsplineplot@
+ \else \searchforEndsegment@ \fi
+ \splinesegment@{\crv@cnt@}%
+\splinetrace@{end is in segment: \segmentnum@ }%
+ \else \splinesegment@\@ne \fi
+ \splineplot@false\splinefindEnd@@
+}
+\xydef@\searchforEndsegment@{\splineplot@true\loop@
+ \advance\crv@cnt@\m@ne
+ \ifnum\crv@cnt@=\z@\expandafter\splineplot@false
+ \else
+ \splinesegment@{\crv@cnt@}{\X@c=\X@p \Y@c=\Y@p \splineEndtest
+ \ifsplineplot@\aftergroup\splineplot@false
+ \else\aftergroup\splineplot@true\fi}%
+ \fi \ifsplineplot@\repeat@
+}
+\DOCMODE)
+
+These are the tests, to determine when the edge-point has been found.
+
+\DOCMODE(
+\xydef@\splinescanStarttest{%
+\splinetrace@{SST (\the\X@c,\the\Y@c); \the\splinelength@, \the\splineval@}%
+ {\splineplot@false\splineStarttest
+ \ifsplineplot@\expandafter\splinefinish@\fi}}
+
+\xydef@\splinescanEndtest{%
+\splinetrace@{SET (\the\X@c,\the\Y@c); \the\splinelength@, \the\splineval@}%
+ {\splineplot@false\splineEndtest
+ \ifsplineplot@\expandafter\splinefinish@\fi}}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\splineBrec@{{%
+ \dimen@=\splineval@ \advance\dimen@\splinedepth@ %
+\splinetrace@{BR (\the\X@p,\the\Y@p);(\the\X@c,\the\Y@c);;;
+\the\dimen@,\the\splinedepth@}%
+ \splineEndtest
+ \ifsplineplot@ \aftergroup\splineadvance@ \else
+ \ifdim\splinedepth@<.0001\p@ \aftergroup\splinefinish@
+% \global\advance\splineval@ .5\splinedepth@
+ \else\aftergroup\splinedecast@@ \fi \fi}}
+
+\xydef@\splineBSrec@{{%
+\splinetrace@{SR (\the\X@p,\the\Y@p);(\the\X@c,\the\Y@c);;;
+\the\dimen@,\the\splinedepth@:SR}%
+ \splineStarttest
+ \ifsplineplot@
+ \ifdim\splinedepth@<.0001\p@ \aftergroup\splinefinish@
+ \global\advance\splineval@ .5\splinedepth@
+ \else \advance\splineval@\splinedepth@
+ \splinetest@ \advance\splineval@-\splinedepth@
+ \ifsplineplot@\aftergroup\splineadvance@
+ \else\aftergroup\splinedecast@@\fi
+ \fi
+ \else
+ \global\advance\splineval@\splinedepth@
+ \aftergroup\splinefinish@ \fi }}
+
+\xydef@\splineBErec@{{%
+ \dimen@=\splineval@ \advance\dimen@\splinedepth@ %
+\splinetrace@{BE (\the\X@p,\the\Y@p);(\the\X@c,\the\Y@c);;;
+ \the\dimen@,\the\splinedepth@}%
+ \splineEndtest
+ \ifsplineplot@
+ \ifdim\splinedepth@<.0001\p@ \aftergroup\splinefinish@
+ \global\advance\splineval@ .5\splinedepth@
+ \else \advance\splineval@\splinedepth@
+ \splinetest@ \advance\splineval@-\splinedepth@
+ \ifsplineplot@\aftergroup\splineadvance@
+ \else\aftergroup\splinedecast@@\fi
+ \fi
+ \else
+ \ifdim\splinedepth@<\p@ \global\advance\splineval@\splinedepth@ \fi
+ \aftergroup\splinefinish@ \fi }}
+
+\xydef@\splinef@breakpt#1{% gobbles |\splinecancel|
+ \ifdim\splineval@>\z@
+\splinetrace@{found: val=\the\splineval@;(\the\X@c,\the\Y@c)}%
+ \else
+\splinetrace@{found: val=\the\splineval@;(\the\X@p,\the\Y@p)}%
+ \fi \splinefbcontinue@ }
+
+\xydef@\splinef@pt@@{%
+ \ifdim\splineval@>\z@
+\splinetrace@{found: val=\the\splineval@;c:(\the\X@c,\the\Y@c)}%
+ \global\dimen@i=\X@c \global\dimen3=\Y@c
+ \else
+\splinetrace@{found: val=\the\splineval@;p:(\the\X@p,\the\Y@p)}%
+ \fi
+ \setsplinedir@ \global\dimen5=\d@X \global\dimen7=\d@Y
+ \global\splineval@=\splineval@
+ \aftergroup\splinefocus@ }
+
+\xydef@\findbreakwarning@#1{%
+ \xywarning@{#1 of break not found: bSTART=\bstartPLACE@, bEND=\bendPLACE@}%
+ \DN@{#1}\def\DNii@{start}\ifx\next@\nextii@\splineRecordBreakValue@
+ \else\splineRecordEndBreakValue@\fi\egroup}%
+
+\xydef@\breakstartcontinue@{\bgroup \cv@start
+%\xystatus@{SS}%
+ \expandafter\DN@\expandafter{\the\Edge@c}\DNii@{\zeroEdge}%
+ \ifx\next@\nextii@ \aftergroup\breakstartfound@
+ \else \aftergroup\breakstartcontinue@i\fi \egroup }%
+
+\xydef@\breakstartcontinue@i{%
+\splinetrace@{move to start edge, from (\the\X@c,\the\Y@c): val=\the\splineval@ }%
+% \global\let\splinetest@=\splineStarttest
+ \global\let\splineEndtest=\splineBreakStarttest@
+ \global\let\splinetest@=\splineBreakStarttest@
+% \global\let\splinerec@=\splineSrec@
+ \gdef\splinerec@{\global\let\splinerec@=\splineSrec@ \splinedecast@@}%
+ \global\let\splinepoint=\relax
+ \global\let\spline@end=\checkfoundSbreak@
+% \global\let\splinegoal@=\splineRecordBreakValue@
+ \global\let\splinegoal@=\splineRecordSBreakValue@
+ \global\let\splinefinish@=\splinefinish@@ }
+
+\xydef@\breakstartfound@{%
+\splinetrace@{found start edge, at (\the\X@c,\the\Y@c): val=\the\splineval@ }%
+ \global\let\splinetest@=\splineStarttest
+ \gdef\splinerec@{\splinegoal@ \global\let\splinerec@=\splinefinish@ }%
+ \global\let\splinepoint=\relax
+ \global\let\spline@end=\relax %\checkfoundSbreak@
+ \global\let\splinegoal@=\splineRecordBreakValue@
+ \global\let\splinefinish@=\splinefinish@@
+ }
+
+\xydef@\checkfoundSbreak@{%
+ \ifnum\xycrvptsnum@<\thr@@\DN@{\findbreakwarning@{start}}%
+ \else\DN@{\searchBreakSsegment@}\fi \next@ }%
+
+\xydef@\searchBreakSsegment@{%
+ \crv@cnt@=\segmentnum@ \DN@{}\count@=\crv@cnt@
+ \DNii@{}\ifnum\splineval@=\z@ \ifnum\crv@cnt@=\@ne
+ \ifnum\xycrvptsnum@=\@ne\count@=\z@\DNii@{\egroup}\fi
+ \else \DN@{\egroup}\fi
+ \else \ifnum\splineval@=\m@ne
+ \else \advance\crv@cnt@\@ne \fi \fi
+ \ifnum\crv@cnt@=\xycrvptsnum@\relax
+ \ifnum\xycrvptsnum@>\tw@ \DNii@{\egroup}\fi
+ \DN@{\expandafter\splineRecordBreakValue@\nextii@}%
+ \else
+ \DN@{\splinesegment@{\crv@cnt@}\splinesetparams@
+ \splined@@ \egroup}%
+ \fi \next@ }
+
+\xydef@\checkfoundEbreak@{%
+ \ifnum\xycrvptsnum@<\thr@@\DN@{\findbreakwarning@{end}}%
+ \else\DN@{\searchBreakEsegment@}\fi \next@ }%
+
+\xydef@\searchBreakEsegment@{%
+ \crv@cnt@=\segmentnum@ \DN@{}\count@=\crv@cnt@
+ \DNii@{}\ifnum\splineval@=\z@ \ifnum\crv@cnt@=\@ne
+ \ifnum\xycrvptsnum@=\@ne\count@=\z@\DNii@{\egroup}\fi
+ \else\DN@{\egroup}\fi
+ \else \advance\crv@cnt@\m@ne \fi
+ \ifnum\count@=\z@
+% \ifnum\crv@cnt@=\z@
+ \ifnum\xycrvptsnum@>\tw@ \splineval@=\m@ne\p@
+ \DNii@{\egroup}\fi
+ \DN@{\expandafter\splineRecordEndBreakValue@\nextii@}\else
+ \DN@{\splinesegment@{\crv@cnt@}\splinereverse@
+ \readsplineparams@ \splined@@ \egroup}%
+ \fi \next@ }
+
+\xydef@\break@start{\egroup \egroup
+\splinetrace@{scan for start}%
+ \global\let\splineadvance@=\splineadvance@@ %(3)
+ \let\spline@start=\splinefindBStart@ %(3)
+ \let\spline@end=\egroup
+ \let\splinefinish@=\splinefinish@@
+ \let\splinewhich=\relax
+ \global\let\splineadvance@=\splineadvance@@
+ \global\let\splinepoint=\relax
+ \let\splinegoal@=\splineRecordBreakValue@
+ \global\dimen5=\z@ \global\splinelength@=\z@
+ \let\splinerec@=\splineSrec@
+ \def\breakedges@{}%
+ \bgroup \bgroup \splined@@ }
+
+\xydef@\splinefindBStart@{\bgroup
+% \global\splineval@=\z@ \global\splinedepth@=.5\p@}
+ \global\splineval@=\z@ \splinedepth@=.5\p@}
+
+\xydef@\breakendcontinue@{\bgroup
+ \edef\tmp@{\X@p = \the\X@c \Y@p=\the\Y@c}\cv@end\tmp@ % <--- irrelevant ?
+ \expandafter\DN@\expandafter{\the\Edge@c}\DNii@{\zeroEdge}%
+%\xystatus@{EE}%
+ \ifx\next@\nextii@ \aftergroup\breakendfound@
+ \else\aftergroup\breakendcontinue@i\fi \egroup }%
+
+\xydef@\breakendcontinue@i{%
+\splinetrace@{move to end edge, from (\the\X@c,\the\Y@c): val=\the\splineval@ }%
+% \global\let\splinetest@=\splineEndtest
+ \global\let\splineEndtest=\splineBreakEndtest@
+ \global\let\splinetest@=\splineBreakEndtest@
+ \gdef\splinerec@{\global\let\splinerec@=\splineErec@\splinedecast@@}%
+ \global\let\splinepoint=\relax
+ \global\let\spline@end=\checkfoundEbreak@
+% \global\let\splinegoal@=\splineRecordEndBreakValue@
+ \global\let\splinegoal@=\splineRecordEBreakValue@
+ \global\let\splinefinish@=\splinefinish@@
+ \splinerec@ }
+
+\xydef@\splineRecordEBreakValue@{%\getcrvsegsnum@
+\splinetrace@{\the\count@\space segments, \the\splineval@}%
+% \ifnum\segmentnum@>\z@ \dimen@=\segmentnum@\p@ \else \dimen@=\p@\fi
+% \advance\dimen@-\splineval@\relax
+% \ifnum\count@>\@ne \divide\dimen@\count@\fi
+% \global\splineval@=\dimen@
+ \splineRecordEndBreakValue@ }
+
+\xydef@\splineRecordSBreakValue@{\getcrvsegsnum@
+ \dimen@=\splineval@
+ \advance\dimen@\segmentnum@\p@ \advance\dimen@-\p@
+ \dimen@nth\count@\dimen@
+ \global\splineval@=\dimen@ \def\segmentnum@{1}%
+ \splineRecordBreakValue@ }
+
+\xydef@\breakendfound@{%
+\splinetrace@{found end edge, at (\the\X@c,\the\Y@c): val=\the\splineval@ }%
+ \global\let\splinetest@=\splineEndtest
+ \gdef\splinerec@{\splinegoal@ \global\let\splinerec@=\splinefinish@}%
+ \global\let\splinepoint=\relax
+ \global\let\spline@end=\relax %\checkfoundEbreak@
+ \global\let\splinegoal@=\splineRecordEndBreakValue@
+ \global\let\splinefinish@=\splinefinish@@ }
+
+
+\xydef@\break@end{\egroup \egroup
+ \global\let\splineadvance@=\splineadvance@@
+ \let\spline@start=\splinefindBEnd@
+ \let\spline@end=\egroup
+ \let\splinefinish@=\splinefinish@@
+ \let\splinewhich=\relax
+ \global\let\splineadvance@=\splineadvance@@
+ \global\let\splinegoal@=\splineRecordEndBreakValue@
+ \global\splinelength@=\z@
+ \let\splinerec@=\splineErec@
+ \global\let\splineEndtest=\splineEndtest@
+ \bgroup \splined@@ }
+
+\xydef@\splinefindBEnd@{\bgroup\bgroup
+ \splinereverse@ \readsplineparams@
+ \global\splineval@=\z@ }
+\DOCMODE)
+
+This appends the new information to that currently stored in the control
+sequence referenced by |\xysplineparams@|. It is temporarily stored
+globally in |\splineparams@|, to be later transferred to
+(the c.s. referenced by) |\xysplineparams@| when at the appropriate
+level of groupingl.
+
+\DOCMODE(
+\xydef@\splineRecordValue@{%
+ \ifx\unknown\segmentnum@\relax
+ \else
+ \getcrvsegsnum@
+ \dimen@=\splineval@ \advance\dimen@ \segmentnum@\p@
+ \advance\dimen@-\p@ \dimen@nth\count@\dimen@
+ \global\splineval@=\dimen@
+ \fi
+ \xdef\splineedges@{\splineedges@\the\splinelength@;\the\splineval@,}%
+\splinetrace@{found edge: \splineedges@}}
+
+\xydef@\splineRecordEndValue@{%
+ \ifx\unknown\segmentnum@\relax
+ \else
+ \getcrvsegsnum@
+ \dimen@=\splineval@ \advance\dimen@ \count@\p@
+ \advance\dimen@-\segmentnum@\p@ \dimen@nth\count@\dimen@
+ \global\splineval@=\dimen@
+ \fi
+ \xdef\splineedges@{\splineedges@\the\splinelength@;\the\splineval@,}%
+\splinetrace@{found edge: \splineedges@}}
+
+\xydef@\splineRecordBreakValue@{%
+ \ifx\unknown\segmentnum@\relax
+ \else\expandafter\advance\expandafter\splineval@\segmentnum@\p@
+ \count@=\segmentnum@\relax
+ \ifnum\count@>0 \advance\splineval@-\p@ \fi\fi
+% \ifx\breakedges@\relax\relax\else\ifx\breakedges@\empty\else
+% \ifdim\splineval@<\p@\ifdim\splineval@>\z@
+% \expandafter\testbreakedges@\breakedges@ @%
+% \fi\fi\fi\fi
+ \xdef\breakedges@{\breakedges@\the\splinelength@;\the\splineval@,}%
+ \global\let\spline@end=\egroup
+\splinetrace@{found break edge: \breakedges@}}
+
+\xydef@\splineRecordEndBreakValue@{%
+ \ifx\unknown\segmentnum@\relax
+ \else\count@=\segmentnum@\relax \ifnum\count@=\z@
+ \else \getcrvsegsnum@
+ \count@@=\count@ \advance\count@@-\segmentnum@\relax
+ \dimen@=\splineval@ \advance\dimen@ \count@@\p@
+ \dimen@nth\count@\dimen@
+ \global\splineval@=\dimen@
+ \fi\fi
+% \multiply\splineval@\m@ne \advance\splineval@\p@ % <---------- !!!
+ \ifdim\splineval@<\z@ \relax\splineval@=\z@ \fi
+ \ifx\breakedges@\relax\relax\else\ifx\breakedges@\empty\else
+ \ifdim\splineval@<\p@\relax \ifdim\splineval@>\z@
+ \expandafter\testbreakedges@\breakedges@ @%
+ \fi\fi\fi\fi
+ \xdef\breakedges@{\breakedges@\the\splinelength@;\the\splineval@,}%
+ \global\let\spline@end=\egroup
+\splinetrace@{found break edge: \breakedges@}}
+
+\xydef@\testbreakedges@#1;#2,#3@{\bgroup \dimen@=#2\relax
+ \advance\dimen@\splineval@ \advance\dimen@-\p@
+\splinetrace@{testbreak: #1;#2,#3@ \the\splineval@::\the\dimen@}%
+ \DN@{\egroup}\ifdim\dimen@>\z@
+ \edef\next@{\egroup\def\noexpand\breakedges@{#1;1pt,#3}}%
+ \else\ifdim\zz@\dimen@
+ \edef\next@{\egroup\def\noexpand\breakedges@{#1;1pt,#3}}%
+ \fi \fi \next@ }
+
+\xydef@\splineRecordBreakEValue{%
+ \ifdim\splineval@>\z@
+ \splineval@=-\splineval@ \advance\splineval@\p@ \fi
+ \splineRecordBreakValue@ }%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Use the following distance approximation:
+
+$$
+dist = \cases{
+dX + .5 dY/dX dY & if $dY/dX dY \lt (\sqrt2-1)\times dX $\cr
+{3\sqrt2\over4} dX + {\sqrt2\over4} dY/dX dY
+& if $(\sqrt2-1)\times dX \lt dY/dX dY \lt dX $\cr
+}$$
+and similarly, interchanging $dY$ and $dX$ when $dY \gt dX$.
+
+$\sqrt2 \approx 1.41422$,\
+$(\sqrt2)/2 \approx 0.70711$,\
+$(\sqrt2)/4 \approx 0.353555$,\
+$3(\sqrt2)/4 \approx 1.060665$
+
+\DOCMODE(
+\xydef@\xydist@#1#2{\ifdim#1>#2\relax
+ \quotient@@\tmp@#2#1\expandafter\dimen@ii\tmp@#2\relax
+ \ifdim\dimen@ii>.41422#1\relax
+ \dimen@=1.060665#1\advance\dimen@ .353555\dimen@ii\relax
+ \else \dimen@=#1\advance\dimen@.5\dimen@ii\fi
+ \else
+ \quotient@@\tmp@#1#2\expandafter\dimen@ii\tmp@#1\relax
+ \ifdim\dimen@ii>.41422#2\relax
+ \dimen@=1.060665#2\advance\dimen@ .353555\dimen@ii\relax
+ \else \dimen@=#2\advance\dimen@.5\dimen@ii\fi
+ \fi}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\splineDadvance@{\splineadvance@@
+ \expandafter\splineDadvance@@\splineDadvance@@@}
+\xydef@\splineDadvance@@#1#2#3#4{%
+ {\d@X=#1\advance\d@X-#2\ifdim\d@X<\z@ \d@X=-\d@X\fi
+ \d@Y=#3\advance\d@Y-#4\ifdim\d@Y<\z@ \d@Y=-\d@Y\fi
+ \xydist@\d@X\d@Y
+ \global\advance\splinelength@\dimen@
+\splinetrace@{d=(\the\d@X,\the\d@Y): v=\the\splineval@: l=\the\splinelength@}%
+}}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\spline@end@{\lastsplinepoint@ \egroup \egroup
+ \ht\z@=\z@ \dp\z@=\z@ \wdz@=\z@ \boxz@}%
+\gdef\splinetest@{\splineplot@true}
+\xydef@\spline@end@@{\egroup \egroup}
+\DOCMODE)
+
+
+ ...value for |\splinerec@| for the fast find...
+
+\DOCMODE(
+\xydef@\splinefrec@{{%
+ \advance\splineval@\splinedepth@
+\splinetrace@{F:(\the\X@p,\the\Y@p);(\the\X@c,\the\Y@c);;
+\the\splineval@;\the\splinedepth@}%
+ \ifdim\dimen5=\splineval@ \aftergroup\splinefinishf@
+ \else \dimen@=\dimen5\advance\dimen@-\splineval@
+ \ifdim\dimen@<\z@ \dimen@=-\dimen@ \fi
+ \ifdim\dimen@<.0001\p@ \aftergroup\splinefinishf@
+ \else
+ \ifdim\dimen5<\splineval@\aftergroup\splinedecast@@
+ \else \aftergroup\splineadvance@
+ \fi\fi\fi}}
+
+\xydef@\splinefinishf@{\global\advance\splineval@\splinedepth@
+ \splinefinish@}%
+\DOCMODE)
+
+The macro |\spline@find#1#2| attempts to finds a specific point on a single
+spline segment.
+ |#1| is the parameter value, in the range [0,1] on that segment;
+ |#2| is a <dimen> denoting how much further to slide along the segment.
+It really only checks whether |#2| has a negative value before passing the
+information to |\spline@@find#1#2|, which does the actual search.
+
+If |#2| is negative then the spline segment is searched in the reverse direction,
+starting at its endpoint.
+This is done by reversing the order of the control points, hence the parameter
+value found as $x$ implies that we really want $1-x$ on the un-reversed segment.
+Similarly the resulting vaules for |\d@X| and |\d@Y| must be negated.
+The instructions to do this are loaded into a macro |\postfind@| which is expanded
+once the search has been completed.
+For an unreversed segment |\postfind@| expands to |{}|.
+
+\DOCMODE(
+\xydef@\spline@find#1#2#3{%
+\splinetrace@{spline@find #1 #2 #3}%
+ \readsplineparams@
+ \global\let\splinefinish@=\splinefinish@@
+ \global\let\splinegoal@=\splinef@pt
+ \global\let\splinepoint=\relax
+ \dimen@=#1\relax\dimen@ii=#2\relax
+ \ifdim\dimen@ii=\z@ \def\postfind@{}%
+ \else\def\postfind@{}%
+ \ifdim\dimen@ii<\z@ \splinereverse@
+ \readsplineparams@
+\splinetrace@{reverse orientation: (\the\X@p,\the\Y@p),(\the\X@c,\the\Y@c)}%
+ \dimen@=#1\relax\dimen@ii=#2\relax
+ \multiply\dimen@\m@ne \advance\dimen@\p@ \multiply\dimen@ii\m@ne
+ \def\postfind@{\d@X=-\the\d@X \d@Y=-\the\d@Y \noexpand\reversesplineval@}%
+ \fi\fi
+ \expandafter\splinetrace@\expandafter{\xysplineparams@}%
+ \edef\next@{\noexpand\spline@@find{\the\dimen@}{\the\dimen@ii}{#3}}%
+ \next@ }
+
+\xydef@\reversesplineval@{\splineval@=-\splineval@ \advance\splineval@\p@ }
+\DOCMODE)
+
+
+
+\DOCMODE(
+\xydef@\spline@@find#1#2#3{%
+\splinetrace@{spline@@find #1 #2 #3}%
+ \let\splinerec@=\splinefrec@
+ \global\let\splineadvance@=\splineadvance@@
+ \dimen5=#1\relax
+ \ifdim #2=\z@\relax
+ \ifdim #1=\z@\relax \bgroup
+ \let\splined@@=\spline@@knot
+ \global\splineval@=\m@ne\p@
+ \else\ifdim #1=\p@\relax \bgroup
+ \let\splined@@=\spline@@knot
+ \global\splineval@=\z@
+ \else
+ \global\splineval@=\z@
+ \global\let\splineadvance@=\splineadvance@@
+ \DN@{#3}\ifx\next@\empty \setsplinetest@\splineval@>{#1}{}%
+ {{\ifdim\splineval@=\dimen5\aftergroup\splineplot@false\fi}}%
+ \else\DNii@{>}\ifx\next@\nextii@
+ \setsplineundertest@\splineval@>{#1}{}{}%
+ \let\splinerec@=\splineBSrec@
+ \else\DNii@{<}\ifx\next@\nextii@
+ \setsplineundertest@\splineval@>{#1}{}{}%
+ \let\splinerec@=\splineBErec@
+ \else\xywarning@{unknown find-mode: #3}\fi\fi\fi
+ \fi\fi
+ \else
+ \global\splineval@=\z@
+ \def\splineslidetest@@{%
+ \setsplinetest@\splinelength@<{#2}{}{}}%
+ \let\splinefinish@=\splinefcontinue@
+ \fi
+ \let\spline@end=\splinef@end
+ \let\splinepoint@=\relax
+ \splinelength@=\z@
+ \def\spline@start{\bgroup\xylowtolerance@}%
+ \splined@@ }
+
+\xydef@\spline@@knot{%
+ \let\setsplinedir@=\setsplineknotdir@
+ \splinesetparams@\spline@start
+% \global\splinedepth@=\p@
+ \splinedepth@=\p@
+ \global\dimen@i=\X@p \global\dimen3=\Y@p
+ \splinefinishf@ \spline@end \egroup }
+
+\xydef@\splinefcontinue@{%
+\splinetrace@{sliding... from (\the\X@c,\the\Y@c): val=\the\splineval@ }%
+ \global\let\splinerec@=\splinerec@@
+ \global\splinelength@=\z@
+ \global\splineval@=\splineval@
+ \global\let\splinepoint=\splinefindtest@
+ \global\let\splinegoal@=\splinef@pt
+ \global\let\splineadvance@=\splineDadvance@
+ \global\let\splinefinish@=\splinefinish@@
+ \splineslidetest@@
+ }
+
+\xydef@\splinefindtest@{%
+\splinetrace@{SFT (\the\X@c,\the\Y@c); \the\splinelength@, \the\splineval@}%
+ {\splineplot@false\splinetest@
+ \ifsplineplot@\expandafter\splinefinishf@\fi}}
+
+\def\setsplineundertest@#1#2#3#4#5{%
+\splinetrace@{setsplineundertest@: #1,#2,#3,#4,#5,}%
+ \DNii@{\gdef\splinetest@}%
+ \DN@##1\next{\def\tmp@{{\splineplot@false
+ \ifdim#1#2##1\relax #4\else\splineplot@true#5\fi }}}%
+ \next@#3\relax\next
+ \expandafter\nextii@\tmp@ }
+
+\xydef@\splinef@end{\edef\tmp@{\egroup\splinelength@=\the\splinelength@}\tmp@}
+\xydef@\splinef@pt{%
+ \ifdim\splineval@>\z@
+\splinetrace@{found: val=\the\splineval@;c:(\the\X@c,\the\Y@c)}%
+ \global\dimen@i=\X@c \global\dimen3=\Y@c
+ \else
+\splinetrace@{found: val=\the\splineval@;p:(\the\X@p,\the\Y@p)}%
+ \fi
+ \setsplinedir@ \global\dimen5=\d@X \global\dimen7=\d@Y
+ \global\splineval@=\splineval@
+ \aftergroup\splinefocus@ }
+\DOCMODE)
+
+\DOCMODE(
+\def\setsplinetest@#1#2#3#4#5{%
+ \DNii@{\gdef\splinetest@}%
+ \DN@##1\next{\def\tmp@{{\splineplot@false \ifdim#1#2##1\relax
+ #4\else\splineplot@true#5\fi}}}%
+ \next@#3\relax\next
+ \expandafter\nextii@\tmp@ }%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\splinefocus@{%
+ \d@X=\dimen5\relax \d@Y=\dimen7\relax \setsplinedir@ }
+
+\xydef@\splinesegment@#1{}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+There are some extra hooks.
+
+\DOCMODE(
+\xydef@\xyprecurve@{}
+\xydef@\xypostcurve@{}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\splineset@{%
+\splinetrace@{splineset@:}%
+ \ifx\bstartPLACE@\empty %\splinetrace@{invisible curve}%
+ \DN@{\xyprecurve@
+ \edef\tmp@{\egroup \X@max=\the\X@max \X@min=\the\X@min
+ \Y@max=\the\Y@max \Y@min=\the\Y@min}\tmp@ \xypostcurve@ }%
+ \else
+ \DN@{\xyprecurve@ \xysplinespecialcases@
+ \edef\tmp@{\egroup \X@max=\the\X@max \X@min=\the\X@min
+ \Y@max=\the\Y@max \Y@min=\the\Y@min}\tmp@ \xypostcurve@ }%
+ \fi
+ \next@ }
+\DOCMODE)
+
+For the actual setting, provide hooks which will allow
+alternative back-ends to be used in the special cases.
+
+\DOCMODE(
+\xydef@\xysplinespecialcases@{%
+ \ifx\empty\xycrvdrop@
+ \ifx\empty\xycrvconn@ \DN@{\splinesolid@}%
+ \else \DN@{ \dir{-}}\ifx\next@\xycrvconn@ \DN@{\splinesolid@}%
+ \else \DN@{ \dir 2{-}}\ifx\next@\xycrvconn@ \DN@{\splinedoubled@}%
+ \else \DN@{ \dir{=}}\ifx\next@\xycrvconn@ \DN@{\splineribboned@}%
+ \else \DN@{ \dir {2.}}\ifx\next@\xycrvconn@ \DN@{\splinedoubled@}%
+ \else \DN@{ \dir 3{-}}\ifx\next@\xycrvconn@ \DN@{\splinetrebled@}%
+ \else \DN@{ \dir {3.}}\ifx\next@\xycrvconn@ \DN@{\splinetrebled@}%
+ \else \DN@{ \dir{--}}\ifx\next@\xycrvconn@ \DN@{\splinedashed@}%
+ \else \DN@{ \dir{.}}\ifx\next@\xycrvconn@ \DN@{\splinedotted@}%
+ \else \DN@{ \dir{:}}\ifx\next@\xycrvconn@ \DN@{\splinedbldotted@}%
+ \else \ifdim\splinetol@>\z@ \else \splinedefaulttol@ \fi
+ \DN@{\splineset@@}\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \else
+ \DN@{\splineset@@}%
+ \fi \ifInvisible@\DN@{}\fi \next@ }
+\DOCMODE)
+
+The special cases are handled just like the normal case except
+However the control sequence names provide a place for
+rebinding to accomodate alternative back-ends.
+
+\DOCMODE(
+\xydef@\splinesolid@{\setbox\splinebox@=\zerodot \def\xycrvdrop@{ }%
+ \def\xycrvconn@{}\splineset@@}
+
+\xydef@\splinedoubled@{\splinedefaulttol@\def\xycrvdrop@{ }\def\splinedrop@{}%
+ \def\xycrvconn@{!C\dir2{.}}\splineset@@}
+
+\xydef@\splineribboned@{\splinedefaulttol@\def\xycrvdrop@{ }\def\splinedrop@{}%
+ \def\xycrvconn@{!C\dir{:}}\splineset@@}
+
+\xydef@\splinetrebled@{\splinedefaulttol@\def\xycrvdrop@{ }\def\splinedrop@{}%
+ \def\xycrvconn@{!C\dir3{.}}\splineset@@}
+
+\xydef@\splinedashed@{\splinetol@=1.5pc \def\xycrvdrop@{ }%+=<10pt>[o]{}}%
+ \def\splinedrop@{}\edef\xycrvconn@{\noexpand!C\noexpand\dir{\addDASH@{}}}%
+ \splineset@@}
+
+\xydef@\splinedotted@{\setbox\splinebox@=\zerodot \def\xycrvdrop@{ }%
+ \splinetol@=1.5\jot \def\xycrvconn@{}\splineset@@}
+
+\xydef@\splinedbldotted@{\def\xycrvdrop@{ }\def\splinedrop@{}%
+ \splinetol@=1.5\jot \def\xycrvconn@{!C\dir{:}}\splineset@@}
+
+\DOCMODE)
+
+This establishes the test appropriate to actually setting
+the spline curve. Global definitions are used.
+This may not always be necessary!!
+
+\BUG: the |7.5pt| below should be the |\Step@@| method to be included.
+
+\DOCMODE(
+\xydef@\splineset@@{%
+ \readsplineparams@
+ \ifx\xycrvdrop@\empty \splinetol@=7.5\p@
+ \def\splinedefaulttol@{\splinetol@=7.5\p@}\def\splinedrop@{}%
+ \else\edef\splinedefaulttol@{\splinetol@=\the\splinetol@}\fi
+ \ifx\xycrvconn@\empty \def\splineconn@{}\fi
+\splinetrace@{set the curve: >\the\dimen5, <\the\dimen7}%
+ \global\let\splineadvance@=\splineadvance@@
+ \let\splinerec@=\splineTrec@
+ \def\splineStarttest{\splinetest@}%
+ \global\let\splinepoint=\relax %6
+ \let\spline@start=\spline@start@
+ \let\spline@end=\spline@end@ %5
+ \ifdim\dimen7=\p@
+ \gdef\splinecontinue{\splinesetting@
+ \global\let\splinetest@=\splineplot@true}%
+ \else
+ \ifdim\dimen7=\tw@\p@
+%% \ifdim\bendPLACE@\p@=\z@ \emptyspline@ \else
+ \ifdim\bendPLACE@\p@=\p@ %\emptyspline@
+ \fi %%\fi
+ \else
+ \xdef\splinecontinue{\noexpand\setsplinetest@
+ \splineval@>{\the\dimen7}{\noexpand\splinebreakcancel@}{}%
+ \noexpand\splinesetting@ }%
+ \fi\fi
+ \ifdim\dimen7>\z@ \DN@{\splinesetting@\splinecontinue}%
+ \ifdim\zz@{\dimen5}%
+ \else
+ \edef\next@{\noexpand\setsplinetest@
+ \splineval@<{\the\dimen5}{}%
+ {\noexpand\expandafter\noexpand\splinecontinue}%
+ \noexpand\splinesetting@ }%
+ \fi
+ \else\DN@{\dimen5=\p@}\fi % ifdim\dimen7=\z@
+ \next@
+%
+ \ifdim\dimen5=\p@\DN@{}\else\DN@{\splined@@}\fi \next@
+ }
+
+\xydef@\emptyspline@{\xywarning@{empty curve subsegment}%
+\splinetrace@{bstartPLACE@=\bstartPLACE@, bendPLACE@=\bendPLACE@,
+ empty segment}%
+ \gdef\splinecontinue{\splinesetting@
+ \global\let\splinetest@=\splineplot@false
+ \global\dimen5=\z@ }}
+\DOCMODE)
+
+|\splineTrec@| is the initial value for |\splinerec@| when a spline
+is being set. It descends the tree of places on the spline (1) until the
+required parameter value is found (2a) or is sufficiently close (2b).
+At this point call |\splinesetting@| and |\splinecontinue| to
+setup, and proceed with, the actual type-setting.
+
+\DOCMODE(
+\xydef@\splineTrec@{{%
+ \advance\splineval@\splinedepth@ % (1)
+ \ifdim\dimen5=\splineval@ % (2a)
+ \aftergroup\splinecontinue % (3)
+ \else \dimen@=\dimen5\advance\dimen@-\splineval@
+ \ifdim\dimen@<\z@ \dimen@=-\dimen@ \fi
+ \ifdim\dimen@<.001\p@ % possibly too high ? % (2b)
+ \aftergroup\splinecontinue % (3)
+ \else
+ \ifdim\dimen5<\splineval@\aftergroup\splinedecast@@ % (1)
+ \else \aftergroup\splineadvance@ % (1)
+ \fi\fi\fi}}
+\DOCMODE)
+
+Setting the curve uses the current |\splinerec@@| and
+sets |\splinepoint| to |\splineplotpt@| to cause objects to be typeset.
+This must be done via a |\gdef| rather than a |\global\let|
+since it is sometimes necessary to omit the object when it would
+be too close, see |\splinetooclose@|.
+
+\DOCMODE(
+%\xydef@\splinesetting@{\xyFN@\splinesetting@@}
+\xydef@\splinesetting@{\splinesetting@@}
+
+\xydef@\splinesetting@@{%
+\splinetrace@{splinesetting@@:}%
+ \ifdim\splinedepth@=\z@ \splinedepth@=\p@ \fi
+ \ifdim\splinedepth@=\p@
+ \def\splinerec@{\global\let\splinerec@=\splinerec@@\splinedecast@@}%
+ \else \global\let\splinerec@=\splinerec@@ \fi
+ \gdef\splinepoint{\splineplotpt@}}
+\DOCMODE)
+
+This handles, for each point of the curve,
+whether to place an <object> or horizontal glue.
+
+\DOCMODE(
+\xydef@\splineplotpt@{{\global\advance\dimen@i-\X@c
+ \splinetest@ \DN@{\splineglue@}\ifsplineplot@
+% \splineStarttest@ \ifsplineplot@
+% \splineEndtest@ \ifsplineplot@
+ \DN@{\dosplineplotpt@}%
+% \fi\fi
+ \fi \next@ \global\dimen@i=\X@c \global\dimen3=\Y@c }}
+
+\xydef@\splineglue@{\hglue-\dimen@i
+\splinetrace@{N:(\the\X@c,\the\Y@c);;\the\dimen@i;\the\dimen3%
+ ,\the\splinelength@,\the\splineval@,\the\splinedepth@}}
+
+\xydef@\dosplineplotpt@{\ifdim\dimen@i<\z@
+ \raise\Y@c\hbox to-\dimen@i{\hfill\splinedrop@}%
+ \else \kern-\dimen@i\raise\Y@c\hbox{\splinedrop@}\fi
+ \ifx\splineconn@\relax\else\raise\Y@c\hbox{%
+ \setboxz@h{\splineconn@}\Drop@@}\fi
+\splinetrace@{P:(\the\X@c,\the\Y@c);;\the\dimen@i;\the\dimen3
+ ,\the\splinelength@,\the\splineval@,\the\splinedepth@}}
+\DOCMODE)
+
+These handle the ``cleaning up'' after a point on the curve has been located.
+
+\DOCMODE(
+\xydef@\splinefinish@@{\postspline@ \splinegoal@ \splinecancel@ }
+
+\xydef@\splinecancel@{%
+ \global\let\splinerec@=\relax
+ \global\let\splinepoint=\relax
+ \global\let\splinecontinue=\relax
+% \global\let\splinedecast@@=\relax
+ \global\let\splinedecast@=\relax
+ }
+
+\xydef@\splinebreakcancel@{\bsplinecancel@ \splinecancel@}
+\xydef@\bsplinecancel@{\gdef\lastbspline@{\leave@\leave@}%
+ \global\let\middlebspline@=\lastbspline@ }
+
+\xydef@\splinegoal@{\ifdim\splineval@>\z@
+ \global\dimen@i=\X@c \global\dimen3=\Y@c \fi
+ \global\splineval@=\splineval@ \global\splinelength@=\splinelength@
+% \setsplineTangent@ }
+ \splinesetdir@ }
+
+\xylet@\splinefinish@\splinefinish@@
+\xylet@\splinewhich\splineDwhich@
+
+\xydef@\squinewhich@{%
+ \ifdim\dimen5>\squinelength % \X@c=\L@c \Y@c=\D@c
+ \d@X=\X@c \d@Y=\Y@c \advance\d@X-\L@c \advance\d@Y-\U@c
+ \advance\squineval-\squinedepth
+ \else \X@c=\X@p \Y@c=\Y@p \advance\squineval-\squinedepth
+ \d@X=\L@c \d@Y=\U@c \advance\d@X-\X@p \advance\d@Y-\Y@p \fi
+ \d@X=-\d@X \d@Y=-\d@Y %%% hack which works.
+ \squinefinish}
+\xydef@\squineDwhich@{%
+ \ifdim\dimen5>\squinelength % \X@c=\L@c \Y@c=\D@c
+ \d@X=\X@c \d@Y=\Y@c \advance\d@X-\L@c \advance\d@Y-\U@c
+ \else \X@c=\X@p \Y@c=\Y@p \advance\squineval-\squinedepth
+ \d@X=\L@c \d@Y=\U@c \advance\d@X-\X@p \advance\d@Y-\Y@p \fi
+ \d@X=-\d@X \d@Y=-\d@Y %%% hack which works.
+ \squinefinish}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection{B\'ezier quadratic splines --- squines}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xyquadbezier@{%
+ \global\let\splinerec@=\relax
+ \addtocrvpts@{\def\crvconnect@{\squineconnect@}}%
+ \xyquadmethods@ \let\splinesegment@=\squinesegment@
+ \begingroup\setcrvobjects@ \xysplineparams@ \splined@@@
+ \bgroup \setupsquine@ \squined@ \splineset@ \savespline@ }
+
+\xydef@\xyquadmethods@{%
+ \def\crvconnect@{\squineconnect@}%
+ \def\splinereverse@@{\splinereverse@@@}%
+ \let\getsplineparams@=\getsquineparams@
+ \let\spline@start@=\squine@start@
+ \let\splinedecast@@=\squinedecast@
+ \let\splinerec@@=\squinerec@
+ \let\splined@@=\squined@@
+ \let\splineIpt@@=\squineIpt@
+ \let\splineIadvance@@=\squineIadvance@
+ \let\splineinfo@=\squineinfo@
+ \let\setsplinedir@=\setsquinedir@
+ \let\splinetestcvxhull@=\squinetestcvxhull@
+ \let\setsplineknotdir@=\setsquineknotdir@
+ \let\splinereverse@=\squinereverse@
+ \let\splineDadvance@@@=\squineDadvance@@@
+ \let\splinesetparams@=\squinesetparams@
+ \let\splineplot@maybe@@=\squineplot@maybe
+}
+
+\xydef@\squineconnect@{\splineconnect@ \crvconnect@@
+ \let\splinesegment@=\squinesegment@ }%
+
+\xydef@\squinesegment@#1{\xyquadmethods@ \def\segmentnum@{1}%
+ \setupsquine@ \squined@ }
+
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Use the registers |\A@| and |\B@| to store the coordinates of the
+single control point. The whole curve lies within the convex
+polygon with vertices at $p$, $(p+a)/2$, $(c+a)/2$ and $c$
+where $a$ denotes the control point. Set |\X@max|, |\X@min|, |\Y@max|
+and |\Y@min| to be the extremes of the coordinates of these 4 points.
+There may not actually be any point on the curve achieving these
+extremes, but certainly we get pretty close.
+
+\DOCMODE(
+\xydef@\setupsquine@{%
+ \xycontrolpt@\z@ \X@p=\X@c \Y@p=\Y@c
+ \xycontrolpt@\@ne \A@=\X@c \B@=\Y@c
+ \xycontrolpt@\tw@
+ \ifdim \A@>\X@max
+ \dimen@=\X@p\advance\dimen@\A@ \dimen@half
+ \ifdim \dimen@>\X@max \X@max=\dimen@ \fi
+ \dimen@=\X@c\advance\dimen@\A@ \dimen@half
+ \ifdim \dimen@>\X@max \X@max=\dimen@ \fi
+ \else \ifdim \A@<\X@min
+ \dimen@=\X@p\advance\dimen@\A@ \dimen@half
+ \ifdim \dimen@<\X@min \X@min=\dimen@ \fi
+ \dimen@=\X@c\advance\dimen@\A@ \dimen@half
+ \ifdim \dimen@>\X@min \X@min=\dimen@ \fi
+ \fi\fi
+ \ifdim \B@>\Y@max
+ \dimen@=\Y@p\advance\dimen@\B@ \dimen@half
+ \ifdim \dimen@>\Y@max \Y@max=\dimen@ \fi
+ \dimen@=\Y@c\advance\dimen@\B@ \dimen@half
+ \ifdim \dimen@>\Y@max \Y@max=\dimen@ \fi
+ \else \ifdim \B@<\Y@min
+ \dimen@=\Y@p\advance\dimen@\B@ \dimen@half
+ \ifdim \dimen@<\Y@min \Y@min=\dimen@ \fi
+ \dimen@=\Y@c\advance\dimen@\B@ \dimen@half
+ \ifdim \dimen@>\Y@min \Y@min=\dimen@ \fi
+ \fi\fi }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The algorithm used for computing coordinates of points on quadratic
+B\'ezier splines is essentially that used by D. E. Knuth in
+|picmac.tex|\cite{picmac} (aka |gpxmac.tex|).
+It is a recursive de Casteljau algorithm of the ``divide and conquer'' type.
+(In Knuth's macros these types of curves were
+given the name ``squines''. This explains some of the control
+sequence names used here.)
+
+The differences from Knuth's algorithm are simply to allow
+more of the available information to be used at points along the spline.
+In particular the tangent direction can be calculated and tests can be
+performed to decide when to break out of the algorithm, rather than
+letting it run its full course.
+
+\DOCMODE(
+\xydef@\squinedecast@{\halve@dimen\splinedepth@ %\divide\splinedepth@\tw@
+ \R@c=\L@c \advance\L@c\X@p \halve@dimen\L@c %\divide\L@c\tw@
+ \advance\R@c\X@c \halve@dimen\R@c %\divide\R@c\tw@
+ \A@=\L@c \advance\A@\R@c \halve@dimen\A@ %\divide\A@\tw@
+ \D@c=\U@c \advance\U@c\Y@p \halve@dimen\U@c %\divide\U@c\tw@
+ \advance\D@c\Y@c \halve@dimen\D@c %\divide\D@c\tw@
+ \B@=\U@c \advance\B@\D@c \halve@dimen\B@ %\divide\B@\tw@
+ \begingroup \X@c=\A@ \Y@c=\B@ \splinerec@ \endgroup
+ \begingroup \X@c=\A@ \Y@c=\B@ \splinepoint \endgroup
+ \X@p=\A@ \L@c=\R@c \Y@p=\B@ \U@c=\D@c \splinerec@}
+
+\xydef@\squinerec@{{\splinefar@false \splinenear@\X@p\X@c\Y@p\Y@c
+ \ifsplinefar@ \aftergroup\squinedecast@
+ \else \aftergroup\splineadvance@ \fi}}
+
+\xydef@\squineDadvance@@@{\X@p\L@c\Y@p\D@c}
+
+\xydef@\squineplot@maybe{{\X@p=\L@c \Y@p=\U@c \cv@start \the\Edge@c\@ne
+ \ifInside@\aftergroup\splineplot@false\else\aftergroup\splineplot@true\fi}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The tangent direction is computed from the displacement to the ``recursive''
+control point.
+
+\DOCMODE(
+\xydef@\setsquinedir@{%
+ \d@X=\X@c \advance\d@X-\L@c \d@Y=\Y@c \advance\d@Y-\U@c
+ \dimen@=\ifdim\d@X<\z@-\fi\d@X \ifdim\dimen@<.02\p@
+ \dimen@=\ifdim\d@Y<\z@-\fi\d@Y \ifdim\dimen@<.02\p@
+ \d@X=\X@c \advance\d@X-\X@p \d@Y=\Y@c \advance\d@Y-\Y@p \fi\fi
+ \ifdim\X@c=\X@p \ifdim\Y@c=\Y@p
+ \d@X=\L@c \advance\d@X-\X@p \d@Y=\U@c \advance\d@Y-\Y@p \fi\fi
+ \setupDirection@ii }
+
+\xydef@\setsquineknotdir@{%
+ \ifdim\zz@\splineval@ \expandafter \setsquinezerodir@
+ \else\expandafter \setsquinedir@ \fi }
+
+\xydef@\setsquinezerodir@{%
+ \d@X=\L@c \advance\d@X-\X@p \d@Y=\U@c \advance\d@Y-\Y@p
+ \ifdim\zz@\d@X \ifdim\zz@\d@Y
+ \d@X=\X@c \advance\d@X-\X@p \d@Y=\Y@c \advance\d@Y-\Y@p
+ \fi\fi \setupDirection@ii }
+\DOCMODE)
+
+We need a way to access the information in |\splineparams|.
+
+\DOCMODE(
+\xydef@\getsquineparams@#1,#2,#3,#4,#5,#6,#7,{%
+ \splinelength@=#1\relax\X@p=#2\relax\Y@p=#3\relax
+ \A@=#4\relax\B@=#5\relax\X@c=#6\relax\Y@c=#7\relax
+}
+\xydef@\squineinfo@{%
+\expandafter\removePT@\the\X@c\space
+\expandafter\removePT@\the\Y@c\space
+\expandafter\removePT@\the\A@\space
+\expandafter\removePT@\the\B@\space
+\expandafter\removePT@\the\X@p\space
+\expandafter\removePT@\the\Y@p\space
+\expandafter\removePT@\the\dimen5\space\space
+\expandafter\removePT@\the\dimen7\space
+ }%
+\xydef@\squinereverse@{\readsplineparams@
+ \expandafter\edef\xysplineparams@{\the\splinelength@,%
+ \the\X@c,\the\Y@c,\the\A@,\the\B@,\the\X@p,\the\Y@p,}}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Start the picture by (1)~setting a box, as usual.
+(2)~Initialize global variables; these must be global since they are
+used to store information which must be preserved outside the grouping
+which is vital to the recursive nature of the algorithm.
+(3)~Move horizontally to the starting point at $p$.
+(4)~Begin by handling the starting point; \ie\ decide whether it is to be
+plotted or not.
+
+\DOCMODE(
+\xydef@\squine@start@{\setboxz@h\bgroup % %(1)
+ \global\splinelength@=\z@ \global\dimen@i=\z@ \global\dimen3=\z@ % %(2)
+ \kern\X@p % %(3)
+ {\squinesetparams@ \X@c=\X@p \Y@c=\Y@p \firstsplinepoint@ % %(4)
+ }\bgroup }
+
+\xydef@\squinesetparams@{%
+ \global\dimen@i=\X@p \global\dimen3=\Y@p
+ \L@c=\A@ \U@c=\B@ \R@c=\L@c \D@c=\U@c }%
+
+\xydef@\squined@{%
+ \expandafter\edef\xysplineparams@{%
+ \the\z@,\the\X@p,\the\Y@p,\the\A@,\the\B@,\the\X@c,\the\Y@c,}}
+
+\xydef@\squined@@{%
+% \global\splinedepth@=\p@
+ \splinedepth@=\p@
+ \global\splineval@=\z@
+ \global\dimen@i=\X@p \global\dimen3=\Y@p
+ \spline@start
+ \ifx\splinerec@\relax \let\splinerec@=\squinerec@\fi
+ \L@c=\A@ \U@c=\B@ \R@c=\L@c \D@c=\U@c
+ \splinerec@ \spline@end }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection{B\'ezier cubic splines}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xycubicbezier@{%
+ \addtocrvpts@{\def\crvconnect@{\cubicconnect@}}%
+ \xycubicmethods@ \let\splinesegment@=\cubicsegment@
+ \begingroup \setcrvobjects@ \xysplineparams@ \splined@@@
+ \bgroup \setupcubic@ \cubiced@ \splineset@ \savespline@ }
+
+\xydef@\xycubicmethods@{%
+ \def\crvconnect@{\cubicconnect@}%
+ \def\splinereverse@@{\cubicreverse@@}%
+ \let\getsplineparams@=\getcubicparams@
+ \let\spline@start@=\cubic@start@
+ \let\splinedecast@@=\cubicdecast@
+ \let\splinerec@@=\cubicrec@
+ \let\splined@@=\cubiced@@
+ \let\splineIpt@@=\cubicIpt@
+ \let\splineIadvance@@=\cubicIadvance@
+ \let\splineoutsidehull@@=\cubicoutsidehull@
+ \let\splinetestcvxhull@=\cubictestcvxhull@
+ \let\splineinfo@=\cubicinfo@
+ \let\setsplinedir@=\setcubicdir@
+ \let\setsplineknotdir@=\setcubicknotdir@
+ \let\splinereverse@=\cubicreverse@
+ \let\splineDadvance@@@=\cubicDadvance@@@
+ \let\splinesetparams@=\cubicsetparams@
+ \let\splineplot@maybe@@=\cubicplot@maybe
+ }
+
+\xydef@\cubicconnect@{\splineconnect@ \crvconnect@@
+ \let\splinesegment@=\cubicsegment@ }%
+
+\xydef@\cubicsegment@#1{\xycubicmethods@ \def\segmentnum@{1}%
+ \setupcubic@ \cubiced@ }
+
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Use the registers |\A@|, |\B@|, |\dimen3| and |\dimen5| to store coordinates
+of the two control points, denoted $l$ and $r$ say. The whole curve lies
+within the convex polygon $p$, $(p+l)/2$, $(c+r)/2$ and $c$ where the vertices are
+not necessarily in this order. Set |\X@max|, |\X@min|, |\Y@max|
+and |\Y@min| to be the extremes of the coordinates of these 4 points.
+There may not actually be any point on the curve achieving these
+extremes, but certainly we get pretty close.
+
+\DOCMODE(
+\xydef@\setupcubic@{%
+ \xycontrolpt@\z@ \X@p=\X@c \Y@p=\Y@c
+ \xycontrolpt@\@ne \A@=\X@c \B@=\Y@c
+ \xycontrolpt@\tw@ \global\dimen3=\X@c \global\dimen5=\Y@c
+ \xycontrolpt@\thr@@
+ \adjustmaxmin@ }
+
+\xydef@\adjustmaxmin@{%
+ \ifdim \A@>\X@max \dimen@=\A@ \advance\dimen@\X@p \dimen@half
+ \ifdim\dimen@>\X@max \X@max=\dimen@ \fi \else
+ \ifdim \A@<\X@min \dimen@=\A@ \advance\dimen@\X@p \dimen@half
+ \ifdim\dimen@<\X@min \X@min=\dimen@ \fi \fi\fi
+ \ifdim \B@>\Y@max \dimen@=\B@ \advance\dimen@\Y@p \dimen@half
+ \ifdim\dimen@>\Y@max \Y@max=\dimen@ \fi \else
+ \ifdim \B@<\Y@min \dimen@=\B@ \advance\dimen@\Y@p \dimen@half
+ \ifdim\dimen@<\Y@min \Y@min=\dimen@ \fi \fi\fi
+%
+ \ifdim \dimen3>\X@max \dimen@=\dimen3\advance\dimen@\X@c \dimen@half
+ \ifdim\dimen@>\X@max \X@max=\dimen@ \fi \else
+ \ifdim \dimen3<\X@min \dimen@=\dimen3\advance\dimen@\X@c \dimen@half
+ \ifdim\dimen@<\X@min \X@min=\dimen@ \fi \fi\fi
+ \ifdim \dimen5>\Y@max \dimen@=\dimen5\advance\dimen@\Y@c \dimen@half
+ \ifdim\dimen@>\Y@max \Y@max=\dimen@ \fi \else
+ \ifdim \dimen5<\Y@min \dimen@=\dimen5\advance\dimen@\Y@c \dimen@half
+ \ifdim\dimen@<\Y@min \Y@min=\dimen@ \fi \fi\fi
+%
+ \dimen@=\A@ \advance\dimen@\dimen3 \dimen@half
+ \ifdim\dimen@>\X@max \X@max=\dimen@
+ \else \ifdim\dimen@<\X@min \X@min=\dimen@ \fi\fi
+ \dimen@=\B@ \advance\dimen@\dimen5 \dimen@half
+ \ifdim\dimen@>\Y@max \Y@max=\dimen@
+ \else \ifdim\dimen@<\Y@min \Y@min=\dimen@ \fi\fi
+}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The recursive algorithm for cubic B\'ezier splines is similar to the
+quadratic one. Now there are two ``recursive'' control points to be
+calculated upon each subdivision.
+
+On the $p$-side:
+\begin{eqnarray*}
+p_p &=& p \\
+l_p &=& (p+l)/2 \\
+r_p &=& (p+2l+r)/4 \\
+c_p &=& (p+3l+3r+c)/8 \\
+\end{eqnarray*}
+while on the $c$-side
+\begin{eqnarray*}
+p_c &=& (p+3l+3r+c)/8 \\
+l_c &=& (l+2r+c)/4 \\
+r_c &=& (r+c)/2 \\
+c_c &=& c \\
+\end{eqnarray*}
+Notice that $c_p=p_c$ and that the tangents match there.
+
+\DOCMODE(
+\xydef@\cubicdecast@{\halve@dimen\splinedepth@ %\divide\splinedepth@\tw@
+ \A@=\L@c \advance\A@\R@c \halve@dimen\A@ %\divide\A@\tw@
+ \advance\R@c\X@c \halve@dimen\R@c %\divide\R@c\tw@
+ \B@=\U@c \advance\B@\D@c \halve@dimen\B@ %\divide\B@\tw@
+ \advance\D@c\Y@c \halve@dimen\D@c %\divide\D@c\tw@
+ \advance\L@c\X@p \halve@dimen\L@c %\divide\L@c\tw@
+ \advance\U@c\Y@p \halve@dimen\U@c %\divide\U@c\tw@
+ \begingroup
+ \X@c=\R@c \advance\X@c\L@c \halve@dimen\X@c %\divide\X@c\tw@
+ \advance\X@c\A@ \halve@dimen\X@c %\divide\X@c\tw@
+ \Y@c=\D@c \advance\Y@c\U@c \halve@dimen\Y@c %\divide\Y@c\tw@
+ \advance\Y@c\B@ \halve@dimen\Y@c %\divide\Y@c\tw@
+ \R@c=\L@c \advance\R@c\A@ \halve@dimen\R@c %\divide\R@c\tw@
+ \D@c=\U@c \advance\D@c\B@ \halve@dimen\D@c %\divide\D@c\tw@
+ \bgroup \splinerec@
+ \egroup \splinepoint \endgroup
+ \X@p=\L@c \advance\X@p\R@c \halve@dimen\X@p %\divide\X@p\tw@
+ \advance\X@p\A@ \halve@dimen\X@p %\divide\X@p\tw@
+ \L@c=\R@c \advance\L@c\A@ \halve@dimen\L@c %\divide\L@c\tw@
+ \Y@p=\U@c \advance\Y@p\D@c \halve@dimen\Y@p %\divide\Y@p\tw@
+ \advance\Y@p\B@ \halve@dimen\Y@p %\divide\Y@p\tw@
+ \U@c=\D@c \advance\U@c\B@ \halve@dimen\U@c %\divide\U@c\tw@
+ \splinerec@ }
+
+\xydef@\cubicrec@{{\splinefar@false \splinenear@\X@p\X@c\Y@p\Y@c
+ \ifsplinefar@ \aftergroup\cubicdecast@
+ \else \aftergroup\splineadvance@ \fi}}
+
+\xydef@\cubicDadvance@@@{\X@p\X@c\Y@p\Y@c}
+
+\xydef@\cubicplot@maybe{{\X@p=\L@c \Y@p=\U@c \cv@start \the\Edge@c\@ne
+ \ifInside@\aftergroup\cubicplot@maybeii\else\aftergroup\splineplot@true\fi}}
+\xydef@\cubicplot@maybeii{{\X@p=\R@c \Y@p=\D@c \cv@start \the\Edge@c\@ne
+ \ifInside@\aftergroup\splineplot@false\else\aftergroup\splineplot@true\fi}}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\cubiced@@{%
+% \global\splinedepth@=\p@
+ \splinedepth@=\p@
+ \global\splineval@=\z@
+ \spline@start
+ \global\dimen@i=\X@p \global\dimen3=\Y@p
+ \splinerec@ \spline@end }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The tangent direction is computed from the displacement to the ``recursive''
+control point.
+
+\DOCMODE(
+\xydef@\setcubicdir@{%
+ \ifdim\splinedepth@<.001\p@\DN@{\cubiccoarsedir@}%
+ \else\DN@{\cubicfinedir@}\fi \next@ }
+
+\xydef@\cubicfinedir@{%
+ \d@X=\X@c \advance\d@X-\R@c \d@Y=\Y@c \advance\d@Y-\D@c
+ \ifdim\zz@\d@X \ifdim\zz@\d@Y
+ \d@X=\X@c \advance\d@X-\L@c \d@Y=\Y@c \advance\d@Y-\U@c
+ \ifdim\zz@\d@X \ifdim\zz@\d@Y
+ \d@X=\X@c \advance\d@X-\X@p \d@Y=\Y@c \advance\d@Y-\Y@p
+ \fi\fi \fi\fi
+% \ifdim\X@c=\X@p \ifdim\Y@c=\Y@p
+% \d@X=\L@c \d@Y=\U@c \advance\d@X-\X@p \advance\d@Y-\Y@p
+% \ifdim\d@X=\z@ \ifdim\d@Y=\z@
+% \d@X=\R@c \d@Y=\D@c \advance\d@X-\X@p \advance\d@Y-\Y@p
+% \fi\fi
+% \fi\fi
+ \setupDirection@ii
+\splinetrace@{dir:(\the\d@X,\the\d@Y),\the\Direction; depth:\the\splinedepth@}%
+}
+
+\xydef@\cubiccoarsedir@{%
+ \d@X=\X@c \advance\d@X-\X@p \d@Y=\Y@c \advance\d@Y-\Y@p \setupDirection@ii
+ \global\dimen5=\d@X \global\dimen7=\d@Y
+\splinetrace@{dir:(\the\d@X,\the\d@Y),\the\Direction; depth:\the\splinedepth@}%
+}
+
+\xydef@\setcubicknotdir@{%
+ \ifdim\zz@\splineval@ \DN@{\setcubiczerodir@}%
+ \else \DN@{\cubicfinedir@}\fi \next@ }
+
+\xydef@\setcubiczerodir@{%
+ \d@X=\L@c \advance\d@X-\X@p \d@Y=\U@c \advance\d@Y-\Y@p
+ \ifdim\zz@\d@X \ifdim\zz@\d@Y
+ \d@X=\R@c \advance\d@X-\X@p \d@Y=\D@c \advance\d@Y-\Y@p
+ \ifdim\zz@\d@X \ifdim\zz@\d@Y
+ \d@X=\X@c \advance\d@X-\X@p \d@Y=\Y@c \advance\d@Y-\Y@p
+ \fi\fi \fi\fi \setupDirection@ii }
+\DOCMODE)
+
+We need a way to access the information in |\splineparams|.
+
+\DOCMODE(
+\xydef@\getcubicparams@#1,#2,#3,#4,#5,#6,#7,#8,#9,{%
+ \splinelength@=#1\relax\X@p=#2\relax\Y@p=#3\relax\L@c=#4\relax
+ \U@c=#5\relax\R@c=#6\relax\D@c=#7\relax\X@c=#8\relax\Y@c=#9\relax
+}%
+\xydef@\cubicinfo@{%
+\expandafter\removePT@\the\X@p\space
+\expandafter\removePT@\the\Y@p\space
+\expandafter\removePT@\the\L@c\space
+\expandafter\removePT@\the\U@c\space
+\expandafter\removePT@\the\R@c\space
+\expandafter\removePT@\the\D@c\space
+\expandafter\removePT@\the\X@c\space
+\expandafter\removePT@\the\Y@c\space
+\expandafter\removePT@\the\dimen5\space\space
+\expandafter\removePT@\the\dimen7\space
+ }%
+\xydef@\cubicreverse@{\readsplineparams@
+ \expandafter\edef\xysplineparams@{\the\splinelength@,%
+ \the\X@c,\the\Y@c,\the\R@c,\the\D@c,\the\L@c,\the\U@c,\the\X@p,\the\Y@p,}}%
+\xydef@\cubicreverse@@{%
+ \splinereverse@@@
+ \dimen@ii=\L@c \L@c=\R@c \R@c=\dimen@ii
+ \dimen@ii=\U@c \U@c=\D@c \D@c=\dimen@ii }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Start the picture by (1)~setting a box, as usual.
+(2)~Initialize global variables; these must be global since they are
+used to store information which must be preserved outside the grouping
+which is vital to the recursive nature of the algorithm.
+(3)~Move horizontally to the starting point at $p$.
+(4)~Begin by handling the starting point; \ie\ decide whether it is to be
+plotted or not.
+
+\DOCMODE(
+\xydef@\cubic@start@{\setboxz@h\bgroup % %(1)
+ \global\splinelength@=\z@ \global\dimen@i=\z@ \global\dimen3=\z@ % %(2)
+ \kern\X@p % %(3)
+ {\cubicsetparams@ \X@c=\X@p \Y@c=\Y@p \R@c=\X@c \D@c=\Y@c
+ \firstsplinepoint@ }\bgroup
+} % %(4)
+
+\xydef@\cubicsetparams@{%
+ \expandafter\expandafter\expandafter\getsplineparams@\xysplineparams@
+ \global\dimen@i=\X@p \global\dimen3=\Y@p }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\cubiced@{%
+ \expandafter\edef\xysplineparams@{\the\z@,\the\X@p,\the\Y@p
+ ,\the\A@,\the\B@,\the\dimen3,\the\dimen5,\the\X@c,\the\Y@c,}%
+ }%
+\DOCMODE)
+
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection{B-splines}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The cases of 3 and 4 control points have some special simplifying features.
+
+\DOCMODE(
+\xydef@\xybspline@iii{%
+ \addtocrvpts@{\def\crvconnect@{\bsplineiiiconnect@}}%
+ \def\crvconnect@{\bsplineiiiconnect@}\xybsplinemethods@
+ \let\splinesegment@=\bsplinesegment@iii
+ \begingroup\setcrvobjects@ \dobspline@ \savespline@ }
+\xydef@\bsplineiiiconnect@{\splineconnect@ \crvconnect@@
+ \let\splinesegment@=\bsplinesegment@iii }%
+
+\xydef@\xybspline@iv{%
+ \addtocrvpts@{\def\crvconnect@{\bsplineivconnect@}}%
+ \def\crvconnect@{\bsplineivconnect@}\xybsplinemethods@
+ \let\splinesegment@=\bsplinesegment@iv
+ \begingroup\setcrvobjects@ \dobspline@ \savespline@ }
+\xydef@\bsplineivconnect@{\splineconnect@ \crvconnect@@
+ \let\splinesegment@=\bsplinesegment@iv }%
+\DOCMODE)
+
+Now for the general case of $\ge5$ control points.
+
+\DOCMODE(
+\xydef@\xybspline@{%
+\splinetrace@{B-spline with \numcontrolpts\space control points.}%
+ \addtocrvpts@{\def\crvconnect@{\bsplineconnect@}}%
+ \def\crvconnect@{\bsplineconnect@}\xybsplinemethods@
+ \let\splinesegment@=\bsplinesegment@
+ \begingroup\setcrvobjects@
+ \dobspline@ \savespline@ }
+
+\xydef@\xybsplinemethods@{%
+ \def\splinereverse@@{\cubicreverse@@}%
+ \let\getsplineparams@=\getbsplineparams@
+ \let\spline@start@=\cubic@start@
+ \let\splinedecast@@=\cubicdecast@
+ \let\splinerec@@=\cubicrec@
+% \let\splined@@=\cubiced@@
+ \let\splineIpt@@=\cubicIpt@
+ \let\splineIadvance@@=\cubicIadvance@
+ \let\splined@@=\bsplined@@
+ \let\splineinfo@=\cubicinfo@
+ \let\setsplinedir@=\setcubicdir@
+ \let\setsplineknotdir@=\setcubicknotdir@
+ \let\splinereverse@=\cubicreverse@
+ \let\splineDadvance@@@=\cubicDadvance@@@
+ \let\splinesetparams@=\cubicsetparams@
+ \global\let\lastbspline@=\lastbspline@@
+ \global\let\middlebspline@=\middlebspline@@
+}
+\xydef@\bsplined@@{%
+% \global\splinedepth@=\p@
+ \splinedepth@=\p@
+ \global\splineval@=\z@
+ \spline@start
+ \global\dimen@i=\X@p \global\dimen3=\Y@p
+ \splinerec@ \spline@end }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\bsplineconnect@{\splineconnect@ \crvconnect@@
+ \let\splinesegment@=\bsplinesegment@ }%
+
+\xydef@\getbsplineparams@{\getcubicparams@}
+
+\xydef@\dobspline@{\xysplineparams@ \scanbspline@ \firstbspline@ }%
+\DOCMODE)
+
+ Registers |\dimen3| and |\dimen5| are used globally, since the
+ standard local registers are already used.
+
+\DOCMODE(
+\xydef@\firstbspline@{%
+ \enter@{\pfromthep@ \cfromthec@}\enter@{\cfromthec@}\bgroup
+ \def\segmentnum@{1}\xycontrolpt@\z@ \X@p=\X@c \Y@p=\Y@c
+\splinetrace@{0: \the\X@p, \the\Y@p}%
+ \xycontrolpt@\@ne \A@=\X@c \B@=\Y@c
+\splinetrace@{1: \the\X@c, \the\Y@c}%
+ \xycontrolpt@\tw@
+\splinetrace@{2: \the\X@c, \the\Y@c}%
+ \dimen@=\X@c \advance\dimen@\A@ \dimen@half
+ \global\dimen3=\dimen@
+ \dimen@=\Y@c \advance\dimen@\B@ \dimen@half
+ \global\dimen5=\dimen@
+ \xycontrolpt@{3}%
+\splinetrace@{3: \the\X@c, \the\Y@c}%
+ \expandafter\count@\xycrvcnt@\relax %%% very important to |\relax|
+ \ifnum\count@=3\relax
+ \advance\X@c-\A@ \dimen@nth4\X@c % \divide\X@c by4
+ \advance\X@c\dimen3\relax
+ \advance\Y@c-\B@ \dimen@nth4\Y@c % \divide\Y@c by4
+ \advance\Y@c\dimen5\relax
+ \enter@{\X@p=\the\X@c \Y@p=\the\Y@c \crv@cnt@=\@ne\relax
+ \noexpand\lastbspline@ }%
+ \else
+ \advance\X@c 7\dimen3 \advance\X@c-2\A@
+ \dimen@nth6\X@c % \divide\X@c by6\relax
+ \advance\Y@c 7\dimen5 \advance\Y@c-2\B@
+ \dimen@nth6\Y@c % \divide\Y@c by6\relax
+ \enter@{\X@p=\the\X@c \Y@p=\the\Y@c \crv@cnt@=\@ne\relax
+ \noexpand\middlebspline@ }%
+ \fi \adjustmaxmin@ \czeroEdge@
+ \bsplined@ \splineset@ \leave@ }
+
+\xydef@\lastbspline@@{\bgroup
+ \advance\crv@cnt@\@ne \edef\segmentnum@{\the\crv@cnt@}%
+\splinetrace@{<: \the\X@p, \the\Y@p}%
+ \advance\crv@cnt@\@ne \xycontrolpt@{\crv@cnt@}%
+ \global\dimen3=\X@c \global\dimen5=\Y@c
+\splinetrace@{\the\crv@cnt@: \the\X@c, \the\Y@c}%
+ \advance\crv@cnt@\m@ne \xycontrolpt@{\crv@cnt@}%
+\splinetrace@{\the\crv@cnt@: \the\X@c, \the\Y@c}%
+ \A@=\X@c \advance\A@\dimen3 \halve@dimen\A@ % \divide\A@\tw@
+ \B@=\Y@c \advance\B@\dimen5 \halve@dimen\B@ % \divide\B@\tw@
+ \adjustmaxmin@ \leave@ \relax \cv@end % <---------------
+\splinetrace@{>: \the\X@c, \the\Y@c}%
+ \bsplined@ \splineset@ \leave@ }%
+\xylet@\lastbspline@=\lastbspline@@
+
+\xydef@\middlebspline@@{%
+ \advance\crv@cnt@\@ne \edef\segmentnum@{\the\crv@cnt@}%
+\splinetrace@{<: \the\X@p, \the\Y@p}%
+ \bgroup
+ \xycontrolpt@{\crv@cnt@}\A@=2\X@c \B@=2\Y@c
+\splinetrace@{\the\crv@cnt@: \the\X@c, \the\Y@c}%
+ \advance\crv@cnt@\@ne \xycontrolpt@{\crv@cnt@}%
+\splinetrace@{\the\crv@cnt@: \the\X@c, \the\Y@c}%
+ \advance\A@\X@c \dimen@nth3\A@ % \divide\A@ by3
+ \advance\B@\Y@c \dimen@nth3\B@ % \divide\B@ by3\relax
+ \advance\X@c\A@ \halve@dimen\X@c % \divide\X@c\tw@
+ \advance\Y@c\B@ \halve@dimen\Y@c % \divide\Y@c\tw@
+ \global\dimen3=\X@c \global\dimen5=\Y@c
+ \advance\crv@cnt@\@ne \xycontrolpt@{\crv@cnt@}%
+\splinetrace@{\the\crv@cnt@: \the\X@c, \the\Y@c}%
+ \expandafter\count@\xycrvcnt@\relax
+ \ifnum\crv@cnt@<\count@\relax
+ \advance\X@c 7\dimen3\advance\X@c-2\A@
+ \dimen@nth6\X@c % \divide\X@c by6\relax
+ \advance\Y@c 7\dimen5\advance\Y@c-2\B@
+ \dimen@nth6\Y@c % \divide\Y@c by6\relax
+ \enter@{\X@p=\the\X@c \Y@p=\the\Y@c \crv@cnt@=\segmentnum@\relax
+ \noexpand\middlebspline@}%
+ \else
+ \advance\X@c-\A@ \dimen@nth4\X@c % \divide\X@c by4
+ \advance\X@c \dimen3\relax
+ \advance\Y@c-\B@ \dimen@nth4\Y@c % \divide\Y@c by4
+ \advance\Y@c \dimen5\relax
+ \enter@{\X@p=\the\X@c \Y@p=\the\Y@c \noexpand\lastbspline@}%
+ \fi \adjustmaxmin@
+ \bsplined@ \splineset@ \leave@ }
+\xylet@\middlebspline@=\middlebspline@@
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\scanbspline@{\splined@@@}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\bsplined@{\cubiced@
+ \expandafter\ifx\xysplineedges@\relax\relax\DN@{}%
+ \else\DN@{\adjustbsplineedges@}\fi \next@ }
+
+\xydef@\adjust@forsegments@{\getcrvsegsnum@
+ \ifnum\count@>\@ne
+\splinetrace@{adjust for \the\count@\space segments:
+ \the\dimen5, \the\dimen7}%
+ \multiply\dimen5 by \count@\relax \dimen@=\segmentnum@\p@
+ \ifnum\dimen5>\dimen@ \relax\dimen5=\p@
+ \else \advance\dimen5-\segmentnum@\p@ \advance\dimen5 by\p@ \fi
+ \ifnum\dimen5<\z@ \relax\dimen5=\z@\relax\fi
+ \multiply\dimen7 by \count@\relax
+ \dimen@=\segmentnum@\p@ %\advance\dimen@-\segmentnum@\p@
+ \ifnum\dimen7<\dimen@ \advance\dimen@-\p@
+ \ifnum\dimen7>\dimen@ \advance\dimen7-\dimen@
+ \else \dimen7=\z@ \fi
+ \else \dimen7=\p@ \fi
+\splinetrace@{adjusted for \the\count@\space segments:
+ \the\dimen5, \the\dimen7}%
+ \fi}
+
+\xydef@\adjustbsplineedges@{\bgroup % dimen5 and dimen7 are NOT global here
+\splinetrace@{** adjusting edges **}%
+ \readsplineparams@ \adjust@forsegments@
+% \count@@=\dimen7\divide\count@@\p@
+% \advance\dimen7-\count@@\p@ \advance\count@@\@ne
+% \count@=\dimen5\divide\count@\p@
+% \advance\dimen5-\count@\p@ \advance\count@\@ne
+\splinetrace@{params:\xysplineparams@}%
+\splinetrace@{segment \segmentnum@:<\the\dimen5,\the\dimen7>:\xysplineedges@}%
+% \expandafter\ifnum\segmentnum@=\count@
+% \else
+% \expandafter\ifnum\segmentnum@<\count@\dimen5=\p@
+% \else\dimen5=\z@ \fi\fi
+% \expandafter\ifnum\segmentnum@=\count@@
+ \multiply\dimen7by\m@ne \advance\dimen7by\p@
+% \else
+% \expandafter\ifnum\segmentnum@>\count@@\dimen5=\p@\dimen7=\p@
+% \else\dimen7=\z@ \fi\fi
+ \expandafter\edef\xysplineedges@{%
+ \noexpand\z@;\the\dimen5,\noexpand\z@;\the\dimen7,}%
+ \edef\tmp@{\egroup
+ \noexpand\def\expandafter\noexpand\xysplineedges@{\xysplineedges@}}%
+ \tmp@ }
+\DOCMODE)
+
+These macros select the correct B\'ezier control points for each
+segment of the spline. This is needed for finding places on the
+constructed curves.
+
+In general there are 5 types of segment: first, second, middle,
+penultimate, final. The conversion from B-spline to B\'ezier is
+slightly different for each type.
+For middle segments the B\'ezier control points are determined
+in the following way:
+\begin{eqnarray*}
+X_{B_i}^{(1)} &=& {1\over3}\left( 2X^{(i)} + X^{(i+1)}\right)\\
+X_{B_i}^{(2)} &=& {1\over3}\left( X^{(i)} + 2X^{(i+1)}\right)\\
+X_{B_i}^{(0)} &=&
+{1\over6}\left( X^{(i-1)} + 4X^{(i)} + X^{(i+1)}\right)\\
+&=& {1\over6}\left( X^{(i-1)} + 7X_{B_i}^{(1)} - 2X_{B_i}^{(2)}\right)\\
+X_{B_i}^{(3)} &=&
+{1\over6}\left( X^{(i)} + 4X^{(i+1)} + X^{(i+2)}\right)\\
+&=& {1\over6}\left( X^{(i+2)} + 7X_{B_i}^{(2)} - 2X_{B_i}^{(1)}\right)\\
+\end{eqnarray*}
+
+\DOCMODE(
+\xydef@\bsegment@@ii@iii{%
+ \xycontrolpt@{\count@@}\global\dimen3=\X@c \global\dimen5=\Y@c
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \advance\count@@\@ne \xycontrolpt@{\count@@}\A@=\X@c \B@=\Y@c
+ \advance\A@ by2\dimen3 \dimen@nth3\A@ % \divide\A@ by3\relax
+ \advance\B@ by2\dimen5 \dimen@nth3\B@ % \divide\B@ by3\relax
+ \dimen@=\dimen3 \advance\dimen@ by2\X@c
+ \dimen@nth3\dimen@ % \divide\dimen@\thr@@
+ \global\dimen3=\dimen@
+ \dimen@=\dimen5 \advance\dimen@ by2\Y@c
+ \dimen@nth3\dimen@ % \divide\dimen@\thr@@
+ \global\dimen5=\dimen@
+\splinetrace@{<: \the\dimen3, \the\dimen5}%
+\splinetrace@{>: \the\A@, \the\B@}%
+ \advance\count@@\m@ne }
+
+\xydef@\bsegment@@i{\bgroup
+ \advance\count@@\m@ne \xycontrolpt@{\count@@}%
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \edef\tmp@{\egroup \X@p=\the\X@c \Y@p=\the\Y@c}\tmp@
+ \advance\X@p-2\dimen3\advance\X@p by7\A@
+ \dimen@nth6\X@p % \divide\X@p by6\relax
+ \advance\Y@p-2\dimen5\advance\Y@p by7\B@
+ \dimen@nth6\Y@p % \divide\Y@p by6\relax
+}
+
+\xydef@\bsegment@@iv{%
+ \advance\count@@\tw@ \xycontrolpt@{\count@@}%
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \advance\X@c by7\dimen3\advance\X@c-2\A@
+ \dimen@nth6\X@c % \divide\X@c by6\relax
+ \advance\Y@c by7\dimen5\advance\Y@c-2\B@
+ \dimen@nth6\Y@c % \divide\Y@c by6\relax
+\splinetrace@{>>: \the\X@c, \the\Y@c }%
+}
+\DOCMODE)
+
+For the second segment the expression for $X_{B_2}^{(0)}$ is different.
+Similarly the expression for $X_{B_{n-1}}^{(3)}$ is altered for the
+penultimate segment.
+
+\begin{eqnarray*}
+X_{B_2}^{(0)} &=&
+{1\over4}\left( X^{(1)} + 4X_{B_2}^{(1)} - X_{B_2}^{(2)}\right)\\
+X_{B_{n-1}}^{(3)} &=&
+{1\over4}\left( X^{(3)} + 4X_{B_{n-1}}^{(2)} - X_{B_{n-1}}^{(1)}\right)\\
+\end{eqnarray*}
+
+\DOCMODE(
+\xydef@\bsegment@@ii@i{\bgroup
+ \advance\count@@\m@ne \xycontrolpt@{\count@@}%
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \edef\tmp@{\egroup \X@p=\the\X@c \Y@p=\the\Y@c}\tmp@
+ \advance\X@p-\dimen3\advance\X@p by4\A@
+ \dimen@nth4\X@p % \divide\X@p by4\relax
+ \advance\Y@p-\dimen5\advance\Y@p by4\B@
+ \dimen@nth4\Y@p % \divide\Y@p by4\relax
+\splinetrace@{<<: \the\X@p, \the\Y@p}%
+}
+\xydef@\bsegment@@y@iv{%
+ \advance\count@@\tw@ \xycontrolpt@{\count@@}%
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \advance\X@c by4\dimen3\advance\X@c-\A@
+ \dimen@nth4\X@c % \divide\X@c by4\relax
+ \advance\Y@c by4\dimen5\advance\Y@c-\B@
+ \dimen@nth4\Y@c % \divide\Y@c by4\relax
+}
+\DOCMODE)
+
+For the first segment the first three B\'ezier control points are always
+determined in the same way:
+\begin{eqnarray*}
+X_{B_1}^{(0)} = X^{(0)} & X_{B_1}^{(1)} = X^{(1)}
+ & X_{B_1}^{(2)} = {1\over2}(X_{B_1}^{(1)}+X^{(2)})\\
+\hbox{3+~segments}&
+ & X_{B_1}^{(3)} = {1\over6}(7X_{B_1}^{(2)} - 2X_{B_1}^{(1)} + X^{(3)})\\
+\hbox{~2~segments}&
+ & X_{B_1}^{(3)} = {1\over4}(4X_{B_1}^{(2)} - X_{B_1}^{(1)} + X^{(3)})\\
+\end{eqnarray*}
+
+
+\DOCMODE(
+\xydef@\bsegment@i{%
+ \xycontrolpt@\z@ \X@p=\the\X@c \Y@p=\the\Y@c
+% \ifx\cv@start\relax
+% \bgroup\csname cv@0\endcsname
+% \edef\tmp@{\egroup \X@p=\the\X@c \Y@p=\the\Y@c}\tmp@
+% \else\xycontrolpt@\z@ \X@p=\the\X@c \Y@p=\the\Y@c\fi
+\splinetrace@{0: \the\X@p \the\Y@p}%
+ \xycontrolpt@\@ne
+\splinetrace@{1: \the\X@c, \the\Y@c}\A@=\X@c \B@=\Y@c
+ \xycontrolpt@\tw@
+ \dimen@=\X@c \advance\dimen@\A@ \dimen@half
+ \global\dimen3=\dimen@
+\splinetrace@{2: \the\X@c, \the\Y@c}%
+ \dimen@=\Y@c \advance\dimen@\B@ \dimen@half
+ \global\dimen5=\dimen@ }
+
+\xydef@\bsegment@i@iv{%
+ \xycontrolpt@{3}%
+\splinetrace@{3: \the\X@c, \the\Y@c}%
+ \advance\X@c by7\dimen3\advance\X@c-2\A@
+ \dimen@nth6\X@c % \divide\X@c by6\relax
+ \advance\Y@c by7\dimen5\advance\Y@c-2\B@
+ \dimen@nth6\Y@c % \divide\Y@c by6\relax
+ }
+\DOCMODE)
+
+The last segment is determined symmetrically from the final four
+control points:
+\begin{eqnarray*}
+X_{B_n}^{(3)} = X^{(n+2)} & X_{B_n}^{(2)} = X^{(n+1)}
+ & X_{B_n}^{(1)} = {1\over2}(X_{B_n}^{(2)}+X^{(n)})\\
+\hbox{3+~segments}&
+ & X_{B_n}^{(0)} = {1\over6}(X^{(n-1)}-2X_{B_n}^{(2)}+7X_{B_n}^{(1)})\\
+\hbox{~2~segments}&
+ & X_{B_n}^{(0)} = {1\over4}(X^{(1)}-X_{B_n}^{(2)}+4X_{B_n}^{(1)})\\
+\end{eqnarray*}
+
+\DOCMODE(
+\xydef@\bsegment@z{%
+ \expandafter\count@@\xycrvptsnum@ \advance\count@@\@ne
+ \xycontrolpt@{\the\count@@}\relax
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \advance\count@@\m@ne
+ \bgroup
+ \xycontrolpt@{\the\count@@}%
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \global\dimen3=\X@c \global\dimen5=\Y@c
+ \advance\count@@\m@ne \xycontrolpt@{\the\count@@}%
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \A@=\X@c \advance\A@\dimen3 \halve@dimen\A@ % \divide\A@\tw@
+ \B@=\Y@c \advance\B@\dimen5 \halve@dimen\B@ % \divide\B@\tw@
+ \edef\tmp@{\egroup \A@=\the\A@ \B@=\the\B@ \count@@=\the\count@@}%
+ \tmp@ }
+
+\xydef@\bsegment@z@i{%
+ \expandafter\count@@\xycrvptsnum@\relax\advance\count@@-\tw@
+ \bgroup
+ \xycontrolpt@{\count@@}\X@p=\the\X@c \Y@p=\the\Y@c
+\splinetrace@{\the\count@@: \the\X@c, \the\Y@c}%
+ \advance\X@p by7\A@ \advance\X@p-2\dimen3 \dimen@nth6\X@p
+ \advance\Y@p by7\B@ \advance\Y@p-2\dimen5 \dimen@nth6\Y@p
+ \edef\tmp@{\egroup \X@p=\the\X@p \Y@p=\the\Y@p}%
+ \tmp@ }
+\DOCMODE)
+
+This is the switching-yard.
+
+\DOCMODE(
+\xydef@\bsplinesegment@#1{\xybsplinemethods@
+ \count@@=#1\relax
+ \ifnum\count@@=\@ne % first segment
+ \bsegment@i \bsegment@i@iv
+ \else\ifnum\count@@=\tw@ % second segment
+ \bsegment@@ii@iii \bsegment@@ii@i \bsegment@@iv
+% \else\expandafter\count@\xycrvcnt@\advance\count@\m@ne
+ \else\expandafter\count@\xycrvptsnum@\advance\count@\m@ne
+ \ifnum\count@@=\count@ % last segment
+ \bsegment@z \bsegment@z@i
+ \else\advance\count@\m@ne
+ \ifnum\count@@=\count@ % penult. segment
+ \bsegment@@ii@iii \bsegment@@i \bsegment@@y@iv
+ \else % middle segments
+ \bsegment@@ii@iii \bsegment@@i \bsegment@@iv
+ \fi\fi\fi\fi
+ \expandafter\def\expandafter\segmentnum@\expandafter{\number#1}%
+ \bsplined@ }
+\DOCMODE)
+
+Here are the differences for 3 control points.
+
+\DOCMODE(
+\xydef@\bsplinesegment@iii#1{\xybsplinemethods@
+\splinetrace@{2 segments; \number#1}%
+ \count@@=#1\relax
+ \ifnum\count@@=\@ne \bsegment@i
+ \xycontrolpt@{3}%
+\splinetrace@{3: \the\X@c, \the\Y@c}%
+ \advance\X@c 4\dimen3\advance\X@c-\A@
+ \dimen@nth4\X@c % \divide\X@c by4\relax
+ \advance\Y@c 4\dimen5\advance\Y@c-\B@
+ \dimen@nth4\Y@c % \divide\Y@c by4\relax
+ \else\ifnum\count@@=\tw@ \bsegment@z
+ \bgroup\xycontrolpt@{\@ne}%
+\splinetrace@{1: \the\X@c, \the\Y@c}%
+ \edef\tmp@{\egroup \X@p=\the\X@c \Y@p=\the\Y@c}\tmp@
+ \advance\X@p 4\A@ \advance\X@p-\dimen3 %
+ \dimen@nth4\X@p % \divide\X@p by4\relax
+ \advance\Y@p 4\B@ \advance\Y@p-\dimen5 %
+ \dimen@nth4\Y@p % \divide\Y@p by4\relax
+ \fi\fi
+ \expandafter\def\expandafter\segmentnum@\expandafter{\number#1}%
+ \bsplined@ }
+\DOCMODE)
+
+Here are the differences for 4 control points.
+
+\DOCMODE(
+\xydef@\bsplinesegment@iv#1{\xybsplinemethods@
+\splinetrace@{3 segments; \number#1}%
+ \count@@=#1\relax
+ \ifnum\count@@=\@ne \bsegment@i \bsegment@i@iv
+ \else\ifnum\count@@=\tw@
+ \bsegment@@ii@iii \bsegment@@ii@i \bsegment@@y@iv
+ \else\ifnum\count@@=3\relax
+ \bsegment@z \bsegment@z@i %\xycontrolpt@{5}%
+ \fi\fi\fi
+ \expandafter\def\expandafter\segmentnum@\expandafter{\number#1}%
+ \bsplined@ }
+\DOCMODE)
+
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Circles and Ellipses}
+??=[circles+ellipses]
+
+\noindent Here we describe the means to a specify circles of arbitrary
+radius, drawn with arbitrary line styles. When large-sized objects are
+used they are regularly spaced around the circle. Similarly ellipses
+may be specified, but only those having major/minor axes aligned in
+the standard directions; spacing of objects is no longer regular, but
+is bunched toward the narrower ends.
+
+Such a circle or ellipse is specified using\dots
+\begin{defs1}
+|\xycircle|<vector>|{|<style>|}|
+\end{defs1}
+\noindent
+where the components of the <vector> determine the lengths of the axis
+for the ellipse; thus giving a circle when equal.
+The <style> can be any <conn>, as in ??g[xyarrow.doc:f.arrow] that works
+with curved arrows---many do. Alternatively <style> can be any <object>,
+which will be placed equally-spaced about the circle at a separation
+to snugly fit the <object>s.
+If <empty> then a solid circle or ellipse is drawn.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\TODO: Recognize special <style>s; e.g. |.| for dotted with |\zerodot|,
+|=| for a doubled circle --- alter the radius, draw two circles;
+|:| for double dotted (perhaps use |\doubled@|, |\tripled@|);
+|>| and |<| for chevrons;
+any others?
+
+To use any of these special symbols as the <object> for <style> then
+enclose it within extra braces, \eg~|\xycircle<20pt>{{>}}|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The curves are not truly circular or elliptical, but are approximations
+given by cubic B\'ezier segments. Hence the |xycurve| feature must be loaded.
+
+\DOCMODE(
+\message{circles,}
+\DOCMODE)
+
+The circles are constructed from four B\'ezier cubic curves, one for each
+quadrant of the circle or circle. To do this it is sufficient to establish
+the control points for each cubic segment. This is straightforward, using
+the following ``magic number'', given a square basis such that the desired
+circle is the unit circle, or rectangular basis for which the ``unit circle''
+is the desired circle.
+
+\DOCMODE(
+\xydef@\Circmagic@@{0.5517847}
+\xylet@\Circmagic=\Circmagic@@
+\xydef@\twoPi@{6.2831852}
+\xydef@\fullPi@{3.1415926}
+\xydef@\halfPi@{1.5707963}
+\DOCMODE)
+
+This is the magic number, exactly given by
+${1\over12}\bigl(\sqrt{385}-13\bigr)$,
+that helps construct the B\'ezier cubic curve
+that best approximates a quadrant of a circle.
+It does so with remarkable accuracy,
+differing by at most .5\% of the radius at any angle;
+the average deviation along the whole quadrant being less than .13\%.
+The basic <object> defined here is |\circle|.
+
+\DOCMODE(
+\xynew@{dimen}\L@
+
+\xydef@\xycircle#1#{\hbox\bgroup\afterVECTORorEMPTY{%
+ \xy@@{\R@=\X@c \L@=\Y@c}\xycircle@}{\xy@@{\R@=\R@c \L@=\L@c}\xycircle@}#1@}
+
+\xydef@\xycircle@#1@#2{%
+ \DN@{#1}\ifx\next@\empty\def\onlyQuad@{}\else \count@=#1\relax
+ \ifnum\count@<5 \advance\count@-3\relax
+ \ifnum\count@<\z@ \advance\count@ 4\relax\fi \edef\onlyQuad@{\the\count@}%
+ \else\xyerror@{illegal circle <radius>: must be <vector> or <empty>}{}\fi
+ \fi \xy@@{\def\circleSTYLE@{#2}}\def\circleSTYLE@{#2}\xycircle@i}
+
+\xydef@\xycircle@i{\hbox{\vbox{\vskip\L@
+ \hbox to2\R@{\hfill \buildcircle@ \hfill}\vskip\L@ }}%
+ \L@c=\R@ \R@c=\R@ \D@c=\L@ \U@c=\L@ \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@\relax}\Edge@c={\circleEdge}%
+ \OBJECT@x}
+
+\xydef@\adjustMinMaxcirc@#1#2{%
+ \dimen@=\X@c \advance\dimen@#1\relax\ifdim\dimen@>\X@max \X@max=\dimen@\fi
+ \dimen@=\X@c \advance\dimen@-#1\relax\ifdim\dimen@<\X@min \X@min=\dimen@\fi
+ \dimen@=\Y@c \advance\dimen@#2\relax\ifdim\dimen@>\Y@max \Y@max=\dimen@\fi
+ \dimen@=\Y@c \advance\dimen@-#2\relax\ifdim\dimen@<\Y@min \Y@min=\dimen@\fi
+}
+
+%\xydef@\buildcircle@{\save@
+%% \cubicCircleControls@@
+% \ifx\circleSTYLE@\empty\DN@{\solidcircle@{}}%
+% \else \expandafter\DN@\expandafter{\addDASH@{}}\relax
+% \ifx\next@\circleSTYLE@ \DN@{%
+% \expandafter\addDASH@\expandafter{\expandafter{\addDASH@{}}}}%
+% \else\DN@{\circledobjects@}\fi\fi\next@ \leave@}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\cubicCircleControls@@{\X@origin=\z@ \Y@origin=\z@
+ \X@xbase=\R@ \Y@xbase=\z@ \X@ybase=\z@ \Y@ybase=\L@
+ \vfromcartesian@@1,0@\czeroEdge@\idfromc@{0@c}%
+ \vfromcartesian@@0,1@\czeroEdge@\idfromc@{1@c}%
+ \vfromcartesian@@-1,0@\czeroEdge@\idfromc@{2@c}%
+ \vfromcartesian@@0,-1@\czeroEdge@\idfromc@{3@c}%
+ \vfromcartesian@@1,\Circmagic@@ @\czeroEdge@\idfromc@{1@m}%
+ \vfromcartesian@@\Circmagic@@,1@\czeroEdge@\idfromc@{2@m}%
+ \vfromcartesian@@-\Circmagic@@,1@\czeroEdge@\idfromc@{3@m}%
+ \vfromcartesian@@-1,\Circmagic@@ @\czeroEdge@\idfromc@{4@m}%
+ \vfromcartesian@@-1,-\Circmagic@@ @\czeroEdge@\idfromc@{5@m}%
+ \vfromcartesian@@-\Circmagic@@,-1@\czeroEdge@\idfromc@{6@m}%
+ \vfromcartesian@@\Circmagic@@,-1@\czeroEdge@\idfromc@{7@m}%
+ \vfromcartesian@@1,-\Circmagic@@ @\czeroEdge@\idfromc@{8@m}%
+ }
+
+\xydef@\doCircleQuadrant@@#1#2{\save@ \ifcase#2\relax
+ \doCircleQuadrant@@@{0@c}{1@m}{2@m}{1@c}{#1}\or
+ \doCircleQuadrant@@@{1@c}{3@m}{4@m}{2@c}{#1}\or
+ \doCircleQuadrant@@@{2@c}{5@m}{6@m}{3@c}{#1}\or
+ \doCircleQuadrant@@@{3@c}{7@m}{8@m}{0@c}{#1}\or
+ \doCircleQuadrant@@@{0@c}{1@m}{2@m}{1@c}{#1}\or
+ \doCircleQuadrant@@@{1@c}{3@m}{4@m}{2@c}{#1}\or
+ \doCircleQuadrant@@@{2@c}{5@m}{6@m}{3@c}{#1}\or
+ \doCircleQuadrant@@@{3@c}{7@m}{8@m}{0@c}{#1}\fi \leave@ }
+
+\xydef@\doCircleQuadrant@@@#1#2#3#4#5{%
+ \cfromid@{#1}\pfromc@\senter@
+ \cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}%
+ \let\bstartPLACE@=\empty \connect@\crvs{#5}\relax\sinit@\sleave@
+ \resetbreaks@}
+\DOCMODE)
+
+The hook |\dosolidcircle@@| is provided so that back-ends may
+provide an alternative method to draw the circles/ellipses.
+Note that the token following |\solidcircle@| will be a group
+representing the <style> to be used.
+
+\DOCMODE(
+\xydef@\dosolidcircle@#1{%
+ \cubicCircleControls@@
+ \doCircleQuadrant@@{#1}1 \relax\Clast@@
+ \doCircleQuadrant@@{#1}2 \relax\Clast@@
+ \doCircleQuadrant@@{#1}3 \relax\Clast@@
+ \doCircleQuadrant@@{#1}4 \relax\Clast@@}%
+
+\xydef@\solidcircle@{\dosolidcircle@@}
+\xylet@\dosolidcircle@@=\dosolidcircle@
+\DOCMODE)
+
+This places objects equally spaced around a circle,
+according to angular position.
+
+\BUG: objects are not equally spaced around ellipses constructed this way.
+To get regular spacing around ellipses, in terms or arc-length say,
+is much more difficult, both theoretically and practically.
+
+\TODO: the size of the resulting <object> does not take into account
+the size of the <object> dropped around the circle.
+
+\DOCMODE(
+\xydef@\circledobjects@{\cubicCircleControls@@
+ \setboxz@h{\expandafter\object\circleSTYLE@{}}%
+ \ifdim\L@>\R@ \dimen@ii=\ht\z@ \advance\dimen@ii \dp\z@
+ \ifdim\zz@\dimen@ii \dimen@ii=\wdz@\fi
+ \else \dimen@ii=\wdz@
+ \ifdim\zz@\dimen@ii \dimen@ii=\ht\z@ \advance\dimen@ii \dp\z@\fi
+ \fi \ifdim\zz@\dimen@ii \dimen@ii=2\jot\fi
+ \expandafter\dimen@\ifdim\L@>\R@ \twoPi@\L@\else \twoPi@\R@\fi
+ \advance\dimen@.5\dimen@ii
+ \count@@=\dimen@ \count@=\dimen@ii \divide\count@@\count@
+ \edef\numobjects{\the\count@@}\dimen@=4\p@
+ \dimen@nth\numobjects\dimen@ % \divide\dimen@\numobjects\relax
+ \edef\circleseparation@{\expandafter\removePT@\the\dimen@}%
+ \edef\circleplace@{-\circleseparation@}\placeQuadrants@}%
+
+\xydef@\placeQuadrants@{\DN@{\placeAllQuadrants@}%
+ \ifx\onlyQuad@\undefined\else\ifx\onlyQuad@\empty\else
+ \DN@{\expandafter\placeCircQuadrant@\expandafter{\onlyQuad@}}%
+ \fi\fi \next@ }%
+%\def\placeQuadrants@{\placeAllQuadrants@}
+
+\xydef@\placeAllQuadrants@{%
+ \placeCircQuadrant@{1}%
+ \advance\dimen@-\p@\advance\dimen@-\circleseparation@\p@
+ \edef\circleplace@{\expandafter\removePT@\the\dimen@}%
+ \placeCircQuadrant@{2}%
+ \advance\dimen@-\p@\advance\dimen@-\circleseparation@\p@
+ \edef\circleplace@{\expandafter\removePT@\the\dimen@}%
+ \placeCircQuadrant@{3}%
+ \advance\dimen@-\p@\advance\dimen@-\circleseparation@\p@
+ \edef\circleplace@{\expandafter\removePT@\the\dimen@}%
+ \placeCircQuadrant@{4}}
+
+\xydef@\placeCircQuadrant@#1{%
+ \let\bstartPLACE@=\relax \doCircleQuadrant@@{}#1%
+ \loop@
+ \expandafter\dimen@\circleplace@\p@
+ \advance\dimen@\circleseparation@\p@
+ \edef\circleplace@{\expandafter\removePT@\the\dimen@}%
+ \ifdim\dimen@<\p@ \placeCircObject@
+ \repeat@ }
+
+\xydef@\placeCircObject@{\begingroup
+ \crvconnect@@ \Creset@@ \Invisible@false
+ \expandafter\splinealong@\expandafter{\circleplace@}%
+ \expandafter\drop\circleSTYLE@{}\endgroup }
+
+\xydef@\buildcircle@{\save@
+% \cubicCircleControls@@
+ \DNii@{\circledobjects@}%
+ \ifx\circleSTYLE@\empty\DNii@{\solidcircle@{}}%
+ \else \expandafter\DN@\expandafter{\addDASH@{}}\relax
+ \ifx\next@\circleSTYLE@ \DNii@{\solidcircle@{}}%
+ \else \expandafter\DN@\expandafter{\addEQ@{}}%
+ \ifx\next@\circleSTYLE@
+ \expandafter\circletemplate@\expandafter{\addEQ@{}}{}%
+ \else \expandafter\DN@\expandafter{\addDASH@ 2}%
+ \ifx\next@\circleSTYLE@ \DNii@{\doublecircle@{}}%
+ \else \expandafter\DN@\expandafter{\addDASH@ 3}%
+ \ifx\next@\circleSTYLE@ \DNii@{\triplecircle@{}}%
+ \else \expandafter\expandafter\expandafter\DN@\expandafter\expandafter
+ \expandafter{\expandafter\addDASH@\addDASH@{}}%
+ \ifx\next@\circleSTYLE@ \DNii@{\dashedcircle@{}}%
+ \else \expandafter\expandafter\expandafter\DN@\expandafter\expandafter
+ \expandafter{\expandafter\addEQ@\addEQ@{}}%
+ \ifx\next@\circleSTYLE@ \expandafter\expandafter\expandafter
+ \circletemplate@\expandafter\expandafter\expandafter{%
+ \expandafter\addEQ@\addEQ@{}}2%
+ \else \expandafter\expandafter\expandafter\DN@\expandafter\expandafter
+ \expandafter{\expandafter\addEQ@\addEQ@2}%
+ \ifx\next@\circleSTYLE@ \expandafter\expandafter\expandafter
+ \circletemplate@\expandafter\expandafter\expandafter{%
+ \expandafter\addEQ@\addEQ@{}}2%
+ \else \expandafter\expandafter\expandafter\DN@\expandafter\expandafter
+ \expandafter{\expandafter\addEQ@\addEQ@3}%
+ \ifx\next@\circleSTYLE@ \expandafter\expandafter\expandafter
+ \circletemplate@\expandafter\expandafter\expandafter{%
+ \expandafter\addEQ@\addEQ@{}}3%
+ \else \expandafter\DN@\expandafter{\addDOT@{}}\relax
+ \ifx\next@\circleSTYLE@ \DNii@{\dottedcircle@{}}%
+ \else \expandafter\DN@\expandafter{\addDOT@2}\relax
+ \ifx\next@\circleSTYLE@ \DNii@{\dbldottedcircle@{}}%
+ \else \expandafter\DN@\expandafter{\addDOT@3}\relax
+ \ifx\next@\circleSTYLE@ \DNii@{\trpldottedcircle@{}}%
+ \else \DN@{:}\relax
+ \ifx\next@\circleSTYLE@ \DNii@{\dbldottedcircle@{}}%
+% \else\DN@{\circledobjects@}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \nextii@ \leave@}
+
+\xydef@\circletemplate@#1#2{\def\circleSTYLE@{\dir#2{#1}}}
+\xydef@\doublecircle@#1{%
+ \advance\R@-\p@ \advance\L@-\p@ \solidcircle@{}%
+ \advance\R@ 2\p@ \advance\L@ 2\p@ \solidcircle@{}}
+\xydef@\triplecircle@#1{%
+ \advance\R@-2\p@ \advance\L@-2\p@ \solidcircle@{}%
+ \advance\R@ 2\p@ \advance\L@ 2\p@ \solidcircle@{}%
+ \advance\R@ 2\p@ \advance\L@ 2\p@ \solidcircle@{}}
+
+%\xydef@\dashedcircle@#1{\expandafter\expandafter\expandafter
+% \circletemplate@\expandafter\expandafter\expandafter{%
+% \expandafter\addDASH@\addDASH@{}}{}\circledobjects@ }%
+
+\xydef@\dottedcircle@#1{%
+ \expandafter\def\expandafter\circleSTYLE@\expandafter{%
+% \expandafter{\addDOT@{}}}%
+ \zerodot@i}%
+ \circledobjects@}
+
+\xydef@\dashedcircle@#1{%
+ \expandafter\def\expandafter\circleSTYLE@\expandafter{\zerodash@i}%
+ \circledobjects@}
+
+\xydef@\dbldottedcircle@#1{%
+ \advance\R@-\p@ \advance\L@-\p@ \dottedcircle@{}%
+ \advance\R@ 2\p@ \advance\L@ 2\p@ \dottedcircle@{}}
+\xydef@\trpldottedcircle@{%
+ \advance\R@-2\p@ \advance\L@-2\p@ \dottedcircle@{}%
+ \advance\R@ 2\p@ \advance\L@ 2\p@ \dottedcircle@{}%
+ \advance\R@ 2\p@ \advance\L@ 2\p@ \dottedcircle@{}}
+
+{\xyuncatcodes \gdef\next{=<.75\jot>{\zerodot}}}
+\xylet@\zerodot@i=\next
+
+{\dimen0=2\xydashl@ \xyuncatcodes
+\expandafter\gdef\expandafter\next\expandafter{\expandafter
+ =\expandafter<\the\dimen0 >_\dir{|}}}
+\xylet@\zerodash@i=\next
+
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{code}
+\xy 0;/r5pc/:*\dir{*}
+ ;p+(.5,-.5)*\dir{*}="c"
+,**\dir{-},*+!UL{c},"c"
+,*\xycircle(1,.4){++\dir{<}}
+,*\xycircle(1,1){++\dir{>}}
+,*\xycircle<15pt,10pt>{}
+;*\xycircle<10pt>{{.}}
+\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+{\xyuncatcodes\gdef\next{--}}
+\xylet@\dashcorntemp@@=\next
+{\xyuncatcodes\gdef\next{.}}
+\xylet@\dotcorntemp@@=\next
+
+\xydef@\dotcorner@#1{%
+ \expandafter\circleCorner@\expandafter{\dotcorntemp@@}{#1}}%
+\xydef@\dashcorner@#1{%
+ \expandafter\circleCorner@\expandafter{\dashcorntemp@@}{#1}}
+
+\xydef@\circleCorner@#1#2{\setboxz@h\bgroup
+ \edef\next{#2\relax\R@=\the\R@\relax\L@=\R@ }%
+ \expandafter\xycircle@\next @{#1}%
+ \ifcase#2\or \setboxz@h{\lower\R@\boxz@\kern\X@c}%
+ \or \setboxz@h{\kern-\R@\lower\R@\boxz@\kern\R@\kern\X@c}%
+ \or \setboxz@h{\kern-\R@\lower\R@\boxz@\kern\R@\kern\X@c}%
+ \or \setboxz@h{\lower\R@\boxz@\kern\X@c}\fi
+ \wdz@=\R@ \ht\z@=\R@ \dp\z@=\R@ \boxz@
+ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Quadratic Splines}
+??=[quadsplines]
+
+Quadratic B\'ezier splines, as distinct from cubic B\'ezier splines,
+are constructed from parabolic arcs, using `control points' to determine
+the tangents where successive arcs are joined.
+
+Various implementations of such curves exist.
+The one adopted here is consistent with the |xfig| drawing utility and
+\TPIC\ implementations. These have the property of beginning and ending
+with straight segments, half the length to the corresponding adjacent
+control-point. Furthermore the midpoint between successive control-points
+lies on the spline, with the line joining the control-points being tangent
+there.
+
+Such curves are specified, either as a <decor> or as an <object>,
+using\dots
+\begin{defs1}
+|\qspline{|<style>|}|
+\end{defs1}
+\noindent
+where the start and end of the curve are at $p$ and $c$ respectively.
+The control-points are taken from the current stack, see~??g[xy.doc:stack].
+If this stack is empty then a straight line is constructed.
+
+The following example compares the quadratic spline with the gentler
+curving B-spline having the same control points, using |\crvs|.
+%
+\begin{code}
+\xy /r1.5pc/:,+<5pc,3pc>*+{P};p
+@(,+(2,2)*{+}@+, +(2,-2)*{+}@+
+,+(2,2)*{+}@+, +(2,0)*+{C}="C"
+,*\qspline{},"C",**\crvs{.}
+,@i @)\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+If the current stack is empty, simply pass everything to |\crvs@|, as if
+the request originated from a |\crvs| or |\ar|. Otherwise we must build up
+the segments of the spline.
+
+\DOCMODE(
+\xydef@\qspline{\hbox\bgroup\crvresetbreaks@ \xy@spline@}
+
+\xydef@\xy@spline@#1#{\if\sempty@ \DN@{\crvs@{}\resetbreaks@}%
+ \else\DN@{\xy@spline@i{#1}}\fi \next@ }%
+\DOCMODE)
+
+The |#1| parameter to |\xy@spline@i| is to allow
+alternative implementations; currently it is ignored.
+When |#1| is indeed empty,
+
+\DOCMODE(
+\xydef@\xy@spline@i#1#2{\def\splineSTYLE@{#2}%
+ \DN@{\xy@spline@ii}\DNii@{#1}%
+ \ifx\nextii@\empty\DN@{\xy@spline@ii@@}\fi \next@ }
+
+\xydef@\xy@spline@ii{\save@ \cfromp@\idfromc@{@p}%
+ \enter@\cplusthec@ \count@@=\s@top\advance\count@@\m@ne
+ \cfroms@{\count@@}\leave@
+ \halve@dimen\X@c % \divide\X@c\tw@
+ \halve@dimen\Y@c % \divide\Y@c\tw@
+ \czeroEdge@ \idfromc@{@c}%
+ \expandafter\doSplineStraight@\expandafter{\splineSTYLE@}%
+ \count@=\@ne \edef\next@{\the\count@}%
+ \ifx\next@\s@top\DN@{\xy@spline@iv}\else\DN@{\xy@spline@iii}\fi
+ \next@ }
+\xylet@\xy@spline@ii@@=\xy@spline@ii
+
+\xydef@\xy@spline@iii{\crv@cnt@=\s@top
+ \loop \advance\crv@cnt@\m@ne \xy@spline@g \ifnum\crv@cnt@>\@ne\repeat
+ \xy@spline@iv}
+
+\xydef@\xy@spline@g{\cfromid@{@c}\idfromc@{@p}%
+ \count@@=\crv@cnt@\cfroms@{\count@@}\idfromc@{@m}%
+ \enter@\cplusthec@ \count@@=\crv@cnt@ \advance\count@@\m@ne
+ \cfroms@{\count@@}\leave@
+ \halve@dimen\X@c % \divide\X@c\tw@
+ \halve@dimen\Y@c % \divide\Y@c\tw@
+ \czeroEdge@\idfromc@{@c}%
+ \expandafter\doSplineSegment@\expandafter{\splineSTYLE@}}
+
+\xydef@\xy@spline@iv{\cfromid@{@c}\idfromc@{@p}%
+ \cfroms@{\z@}\idfromc@{@m}\leave@ \save@
+ \enter@\cplusthec@ \cfromid@{@m}\leave@
+ \halve@dimen\X@c % \divide\X@c\tw@
+ \halve@dimen\Y@c % \divide\Y@c\tw@
+ \czeroEdge@\idfromc@{@c}%
+ \expandafter\doSplineSegment@\expandafter{\splineSTYLE@}%
+ \xy@spline@v }
+
+\xydef@\xy@spline@v{\cfromid@{@c}\idfromc@{@p}%
+ \leave@ \save@ \idfromc@{@c}%
+ \expandafter\doSplineStraight@\expandafter{\splineSTYLE@}%
+ \xy@spline@x }
+
+\xydef@\xy@spline@x{\leave@
+ \def\Drop@@{\splineDrop@ \resetbreaks@}%
+ \def\Connect@@{\straight@\relax\splineConnect@ \resetbreaks@}%
+ \OBJECT@x}
+
+\xydef@\splineDrop@{\ifInvisible@\setboxz@h{}%
+ \else\setboxz@h{\kern-\the\X@c\raise-\the\Y@c\hbox{\styledboxz@}}\fi
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@ }
+
+\xydef@\splineConnect@{%
+ \ifInvisible@\else\box\lastobjectbox@\fi }%
+\DOCMODE)
+
+The initial and final points in a segment are stored as |@p| and |@c|
+respectively. Where needed, the control is in |@m|.
+
+\DOCMODE(
+\xydef@\doSplineStraight@#1{\begingroup \sinit@
+ \cfromid@{@p}\pfromc@\cfromid@{@c}%
+ \connect@\crvs{#1}\relax\sleave@\endgroup }
+
+\xydef@\doSplineSegment@#1{\begingroup \sinit@
+ \cfromid@{@p}\pfromc@\senter@\cfromid@{@m}\spushc@\cfromid@{@c}%
+ \connect@\crvs{#1}\relax\sinit@\sleave@\endgroup }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xycurve.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 09:01:45 ross
+% major revisions for the new BREAK methods
+% spline edge-finding is more robust
+% spline-breaks fully implemented
+% intersections of curve with straight connections implemented
+% improved tracings
+% adjusted methods for styles
+%
+% Revision 3.2 1995/09/19 18:20:20 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/05 07:58:43 ross
+% Ready for v3 release?
+%
+% Revision 2.12 1994/10/25 03:01:14 ross
+% Final 3beta release [bug fixes & AMS-LaTeX fitting].
+%
+% Revision 2.12 1994/09/05 08:22:11 ross
+% incorporates some speed-ups, extra documentation
+%
+% Revision 2.11 1994/07/05 09:27:52 ross
+% Minor fixes; use 2.11 kernel stack code.
+%
+% Revision 2.9 1994/06/09 14:50:54 ross
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 10:36:40 ross
+% Second 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 ross
+% Last internal 3alpha and pre-2.7 release.
+%
+% NEW for version 2.7 inspired by Knuth's picmac.tex.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xydoc.back b/Master/texmf-dist/source/generic/xypic/xydoc.back
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xydoc.back
@@ -0,0 +1 @@
+
diff --git a/Master/texmf-dist/source/generic/xypic/xydoc.bib b/Master/texmf-dist/source/generic/xypic/xydoc.bib
new file mode 100644
index 00000000000..ca8bbaac87b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xydoc.bib
@@ -0,0 +1,764 @@
+% $Id: xydoc.bib,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+%
+% BibTeX References for the Xy-pic documentation.
+%
+% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+% See the companion README and INSTALL files for further information.
+% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose at ens-lyon.fr>
+%
+% The Xy-pic package is free software; you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by the
+% Free Software Foundation; either version 2 of the License, or (at your
+% option) any later version.
+%
+% The Xy-pic package is distributed in the hope that it will be useful, but
+% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+% for more details.
+%
+% You should have received a copy of the GNU General Public License along
+% with this package; if not, write to the Free Software Foundation, Inc.,
+% 675 Mass Ave, Cambridge, MA 02139, USA.
+%
+% CONTENTS:
+% Journals, publishers, and institutions.
+% Special TeX definitions.
+% My TeX production.
+% Other TeX related references, sorted by author.
+% Other references, sorted by author.
+% Log.
+%
+% NOTE: uses the abbreviations \TeX, \MF, \LaTeX, \AMS, \PiCTeX, and \Xy.
+
+@Preamble{"\label{BIBLIOGRAPHY}"}
+
+%
+% JOURNALS, PUBLISHERS, AND INSTITUTIONS.
+
+% Journals given in BibTeX standard styles:
+@string{cacm = "Communications of the ACM"}
+@string{sicomp = "SIAM Journal on Computing"}
+@string{tcs = "Theoretical Computer Science"}
+
+@string{jfp = "Journal of Functional Programming"}
+@string{lasc = "{LISP} and Symbolic Computation"}
+@string{spe = "Software Practice and Experience"}
+
+% Publishers...
+@string{A-W = "Addison-Wesley"}
+@string{N-H = "North-Holland"}
+@string{P-H = "Prentice-Hall"}
+@string{S-V = "Springer-Verlag"}
+@string{LNCS = "{LNCS}"}
+
+% Organizations...
+@string{ACM = "Association for Computing Machinery"}
+@string{AMS = "American Mathematical Society"}
+@string{DIKU = "{DIKU}, University of Copenhagen"}
+
+%
+% Xy-pic (most recent first).
+
+% Start of v3 as `published' from DIKU on the form required for
+% registration with PUF and ANL...
+
+% Kit.
+@Misc{RM95:Xy-pic,
+ author = "Kristoffer H. Rose and Ross R. Moore",
+ title = "{\Xy}-pic, version 3",
+ month = jun,
+ year = 1995,
+ howpublished = "computer software kit",
+ note = "includes
+ User's Guide~\cite{R95:Xy-picUG}, and
+ Reference Manual~\cite{RM95:Xy-picRM}"
+}
+
+% 1.
+@Manual{R95:Xy-picUG,
+ author = {Kristoffer H. Rose},
+ YEAR = {1995},
+ TITLE = {{\Xy}-pic User's Guide},
+ organization = {{DIKU}, University of Copenhagen},
+ address = {Universitetsparken 1, DK--2100 K{\o}benhavn {\O}},
+ month = jun,
+ edition = {3.0},
+ keywords = {diagram, picture, graph, arrow, curve, commutative diagram},
+ summary = {{\Xy}-pic is a package for typesetting graphs and
+ diagrams using Knuth's \TeX\ typesetting system.
+ \Xy-pic works with most of the many formats
+ available, \eg, plain \TeX, \LaTeX, \AMS-\LaTeX, and
+ \AMS-\TeX. Several styles of input for various
+ diagram types are supported; they all share a
+ mnemonic notation based on the logical composition
+ of visual components used},
+ supersedes = {D-200},
+ SEMNO = {D-237},
+ PUF = {---},
+ ID = {Man}
+}
+
+% 2.
+@Manual{RM95:Xy-picRM,
+ author = {Kristoffer H. Rose and Ross R. Moore},
+ YEAR = {1995},
+ TITLE = {{\Xy}-pic Reference Manual},
+ organization = {{DIKU}, University of Copenhagen},
+ address = {Universitetsparken 1, DK--2100 K{\o}benhavn {\O}},
+ month = jun,
+ edition = {3.0},
+ keywords = {diagram, picture, graph, arrow, curve, commutative diagram},
+ summary = {{\Xy}-pic is a package for typesetting graphs and
+ diagrams. It is structured as several modules, each
+ defining a custom notation for a particular kind of
+ graphical object or structure. Example objects are
+ arrows, curves, frames, and colouring/rotation on
+ drivers that support it; these can be organised in
+ matrix, directed graph, path, polygon, knot, and
+ 2-cell structure. Xy-pic works with most formats,
+ including LaTeX, AMS-LaTeX, AMS-TeX, and plain TeX,
+ and has been used to typeset complicated diagrams
+ from many application areas including category
+ theory, automata theory, algebra, neural networks,
+ and database theory},
+ supersedes = {D-201},
+ SEMNO = {D-238},
+ PUF = {---},
+ ID = {Man}
+}
+
+% 3.
+@Misc{RM95:Xy-picCSTC,
+ author = "Kristoffer H. Rose and Ross R. Moore",
+ title = "{\Xy}-pic Complete Sources with {\TeX}\-nical Commentary",
+ month = jun,
+ year = 1995,
+ howpublished = "not yet available"
+}
+
+% 4.
+@Misc{R95:Xy-picUnix,
+ author = "Kristoffer H. Rose",
+ title = "{\Xy}-pic Unix Distribution",
+ month = jun,
+ year = 1995,
+ howpublished = "computer software"
+}
+
+% 5.
+@Misc{M95:Xy-picMac,
+ author = "Ross R. Moore",
+ title = "{\Xy}-pic Macintosh Distribution",
+ month = jun,
+ year = 1995,
+ howpublished = "computer software"
+}
+
+% 6.
+@Misc{M95:Xy-picMacFonts,
+ author = "Ross R. Moore",
+ title = "{\Xy}-pic fonts, for Macintosh",
+ month = jun,
+ year = 1995,
+ howpublished = "computer software"
+}
+
+% 7.
+@Misc{M95:Xy-macXFonts,
+ author = "Ross R. Moore",
+ title = "{\Xy}-pic extra font sizes, for Macintosh",
+ month = jun,
+ year = 1995,
+ howpublished = "computer software"
+}
+
+% End of v3.
+
+
+@Misc{Xy-picHP,
+ author = "Kristoffer H. Rose",
+ title = "The {\Xy}-pic Home Page",
+ howpublished = "\url{http://www.ens-lyon.fr/\~{}krisrose/Xy-pic.html}"
+}
+
+
+% Start of v2.12 as registered with Australian National Library:
+
+% Kit.
+@Misc{RM94:Xy-pic,
+ author = "Kristoffer H. Rose and Ross R. Moore",
+ title = "{\Xy}-pic, version 2.12",
+ month = oct,
+ year = 1994,
+ howpublished = "computer software kit: ISBN 1 86408 117 1",
+ note = "includes software, User's Guide and Reference
+ Manual"
+}
+
+% 1.
+@TechReport{R94:Xy-picUGII,
+ author = "Kristoffer H. Rose and Ross R. Moore",
+ title = "{\Xy}-pic User's Guide and Installation Instructions",
+ institution = "MPCE, Macquarie University",
+ year = 1994,
+ month = oct,
+ type = "Mathematics Report",
+ number = "94--148 (revised), ISBN 1 86408 125 2",
+ address = "NSW 2109, Australia"
+}
+
+% 2.
+@TechReport{RM94:Xy-picRM,
+ title = "{\Xy}-pic Reference Manual",
+ author = "Kristoffer H. Rose and Ross R. Moore",
+ institution = "MPCE, Macquarie University",
+ year = 1994,
+ month = oct,
+ type = "Mathematics Report",
+ number = "94--155, ISBN 1 86408 133 3",
+ address = "NSW 2109, Australia",
+ note = "Available with URL {ftp:/\kern-1pt/ftp.brics.dk\slash
+ Staff\slash krisrose\slash TeX\slash xyrefer.ps}"
+}
+
+% 3.
+@Misc{RM94:Xy-picCSTC,
+ author = "Kristoffer H. Rose and Ross R. Moore",
+ title = "{\Xy}-pic Complete Sources with {\TeX}\-nical Commentary",
+ year = 1994,
+ month = oct,
+ howpublished = "ISBN 1 86408 141 4"
+}
+
+% 4.
+@Misc{R94:Xy-picUnix,
+ author = "Kristoffer H. Rose",
+ title = "{\Xy}-pic Unix Distribution",
+ year = 1994,
+ month = oct,
+ howpublished = "computer software: ISBN 1 86408 149 X",
+ note = "Available with URL {ftp:/\kern-1pt/ftp.diku.dk\slash diku\slash
+ users\slash kris\slash TeX\slash xy212run.tar.gz}"
+}
+
+% 5.
+@Misc{M94:Xy-picMac,
+ author = "Ross R. Moore",
+ title = "{\Xy}-pic Macintosh Distribution",
+ year = 1994,
+ month = oct,
+ howpublished = "computer software: ISBN 1 86408 157 0",
+ note = "Available with URL {ftp:/\kern-1pt/ftp.diku.dk\slash
+ diku\slash users\slash kris\slash TeX\slash
+ xy212mac.sit.hqx}"
+}
+
+% 6.
+@Misc{M94:Xy-picMacFonts,
+ author = "Ross R. Moore",
+ title = "{\Xy}-pic fonts, for Macintosh",
+ year = 1994,
+ month = oct,
+ howpublished = "computer software: ISBN 1 86408 165 1",
+ note = "Available with URL {ftp:/\kern-1pt/ftp.diku.dk\slash
+ diku\slash users\slash kris\slash TeX\slash
+ xy212mac.sit.hqx}"
+}
+
+% 7.
+@Misc{M94:Xy-macXFonts,
+ author = "Ross R. Moore",
+ title = "{\Xy}-pic extra font sizes, for Macintosh",
+ year = 1994,
+ month = oct,
+ howpublished = "computer software: ISBN 1 86408 173 2",
+ note = "Available with URL {ftp:/\kern-1pt/ftp.diku.dk\slash
+ diku\slash users\slash kris\slash TeX\slash
+ xymacxf.sit.hqx}"
+}
+
+% End of v2.12 as registered with Australian National Library...
+
+@TechReport{R94:Xy-picUG,
+ author = "Kristoffer H. Rose",
+ title = "{\Xy}-pic User's Guide",
+ institution = "MPCE, Macquarie University",
+ year = 1994,
+ type = "Mathematics Report",
+ number = "94--148",
+ address = "NSW 2109, Australia",
+ month = jun,
+ note = "For version 2.10+. Latest version available with
+ URL {\tt ftp:/\kern-1pt/ftp.diku.dk\slash diku\slash
+ users\slash kris\slash TeX\slash xy\slash xyguide.ps}"
+}
+
+@TechReport{RM94:Xy-picRM-old,
+ title = "{\Xy}-pic Reference Manual",
+ author = "Kristoffer H. Rose and Ross R. Moore",
+ institution = "MPCE, Macquarie University",
+ year = 1994,
+ month = jun,
+ type = "Mathematics Report",
+ number = "94--155",
+ address = "NSW 2109, Australia",
+ note = "For version 2.10+. Latest version available with
+ URL {ftp:/\kern-1pt/ftp.diku.dk\slash diku\slash
+ users\slash kris\slash TeX\slash xyrefer.ps}"
+}
+
+@Manual{M94:TypesettingNNX,
+ title = "Typesetting Neural Nets using {\Xy}-pic",
+ author = "Ross R. Moore",
+ year = 1994,
+ note = "Available through~\cite{Xy-picHP}"
+}
+
+@Misc{R94:Xy-picNCD,
+ author = "Kristoffer H. Rose",
+ title = "{\Xy}-pic and Notation for Categorical Diagrams",
+ howpublished = "Invited talk at ECCT-94",
+ year = 1994,
+ month = jul,
+ note = "Available through~\cite{Xy-picHP}"
+}
+
+@InProceedings{R92:HowTPDAT,
+ author = "Kristoffer H. Rose",
+ title = "How to Typeset Pretty Diagram Arrows with
+ {\TeX}---Design Decisions used in {\Xy}-pic",
+ pages = "183-190",
+ booktitle = "{Euro\TeX~'92}---Proceedings of the 7th European
+ {\TeX} Conference",
+ year = 1992,
+ editor = "Ji{\v{r}}{\'\i} Zlatu{\v{s}}ka",
+ organization = "Czechoslovak {\TeX} Users Group",
+ address = "Prague, Czechoslovakia",
+ month = sep
+}
+
+% Kit.
+@Misc{R92:Xy-pic,
+ author = "Kristoffer H. Rose",
+ title = "{\Xy}-pic, version 2.6",
+ year = 1992,
+ howpublished = "computer software kit",
+ note = "includes User's Manual~\cite{R92:TypesettingDXUM}"
+}
+
+@InProceedings{R92:TypesettingDXUM,
+ author = "Kristoffer H. Rose",
+ title = "Typesetting Diagrams with {\Xy}-pic: User's Manual",
+ pages = "273-292",
+ booktitle = "{Euro\TeX~'92}---Proceedings of the 7th European
+ {\TeX} Conference",
+ year = 1992,
+ editor = "Ji{\v{r}}{\'\i} Zlatu{\v{s}}ka",
+ organization = "Czechoslovak {\TeX} Users Group",
+ address = "Prague, Czechoslovakia",
+ month = sep
+}
+
+@Misc{R92:ExercisesX,
+ author = "Kristoffer H. Rose",
+ title = "Exercises in {\Xy}-pic",
+ howpublished = "Handout at tutorial given at {Euro\TeX~'92}",
+ year = 1992,
+ month = sep,
+ note = "Available by anonymous ftp in {\tt ftp.diku.dk:
+ /diku\slash users\slash kris\slash TeX\slash
+ Obsolete\slash xypicex.ps.Z}"
+}
+
+@Misc{R92:xypic.doc,
+ author = "Kristoffer H. Rose",
+ title = "{\Xy}-pic Macros: Technical Documentation",
+ howpublished = "{\tt xypic.doc} of the {\Xy}-pic version 2.6 release",
+ year = 1992,
+ month = oct
+}
+
+@TechReport{H91:Xy-picTGDT,
+ author = "Kristoffer H. Holm",
+ title = "{\Xy}-pic: Typesetting Graphs and Diagrams with {\TeX}",
+ institution = DIKU,
+ year = 1991,
+ type = "Student report",
+ number = "91--7--10",
+ address = "Universitets\-parken 1, {DK}-2100 K\o{}ben\-havn \O",
+ month = jul,
+ note = "Obsolete"
+}
+
+@Misc{R91:xy.doc,
+ author = "Kristoffer H. Rose",
+ title = "{\Xy}-pic Macros: Technical Documentation",
+ howpublished = "{\tt xy.doc} of the $\beta$-release of the
+ {\Xy}-pic package",
+ year = 1991,
+ month = nov,
+ note = "Obsolete"
+}
+
+@Unpublished{HD90:DrawingGD,
+ author = "Kristoffer H. Holm and Hans Dybkj\ae{}r",
+ title = "Drawing Graphs and Diagrams",
+ note = "Documents the obsolete {\tt graphs} macros",
+ year = 1990,
+ month = sep
+}
+
+%
+% TeX RELATED REFERENCES, SORTED BY AUTHOR.
+
+@Manual{AMS95:AMS-LaTeX,
+ title = "{\AMS}-{\LaTeX} Version 1.2 User's Guide",
+ organization = "American Mathematical Society",
+ edition = "1.2b",
+ year = 1995,
+ month = jan
+}
+
+@Manual{AMS94:AMS-LaTeX,
+ title = "{\AMS}-{\LaTeX} Version 1.2 User's Guide",
+ organization = "American Mathematical Society",
+ edition = "1.2",
+ year = 1994,
+ month = oct
+}
+
+@Manual{AMS91:AMS-LaTeX,
+ title = "{\AMS}-{\LaTeX} Version 1.1 User's Guide",
+ organization = "American Mathematical Society",
+ edition = "1.1",
+ year = 1991
+}
+
+@Manual{B:DiagramM,
+ title = "The Diagram Macros",
+ author = "Michael Barr",
+ note = "Available by anonymous ftp from {\tt
+ triples.math.mcgill.ca:\-/pub/texmacros/diagdoc.tex}"
+}
+
+@Manual{B:UsersGD3,
+ title = "User's Guide for Diagram 3",
+ author = "Francis Borceux",
+ address = "{L}ouvain-la-{N}euve",
+ note = "Available from the author, borceux@agel.ucl.ac.be"
+}
+
+@Manual{B94:ExpandedPT,
+ title = "Expanded plain {\TeX}",
+ author = "Karl Berry",
+ edition = "version 2.6",
+ year = 1994,
+ month = may,
+ note = "Available for anonymous ftp from CTAN in {\tt
+ macros\slash eplain\slash doc}."
+}
+
+@Book{GMS94:LaTeXC,
+ author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
+ title = "The {\LaTeX} Companion",
+ publisher = A-W,
+ year = 1994
+}
+
+@article{HO87:TypesettingCSFTFT,
+ author = "Roswitha T. Haas and Kevin C. O'Kane",
+ title = "Typesetting Chemical Structure Formulas with the Text
+ Formatter \TeX/\LaTeX",
+journal = "Computers \& Chemistry",
+ year = 1987,
+ volume = 11,
+ number = 4,
+ pages = "251-271"
+}
+
+@Article{K82:PIC-LTG,
+ author = "Brian W. Kernighan",
+ title = "{PIC}---A Language for Typesetting Graphics",
+ journal = spe,
+ year = 1982,
+ volume = 12,
+ number = 1,
+ pages = "1-21"
+}
+
+@Manual{KC:eqn,
+ title = "Typesetting Mathematics -- User's Guide",
+ author = "B. W. Kernighan and L. L. Cherry",
+ organization = "Bell labs"
+}
+
+@TechReport{K91:PIC-GLT,
+ author = "Brian W. Kernighan",
+ title = "{PIC}---A Graphics Language for Typesetting",
+ institution = "{AT\&T} Bell Laboratories",
+ year = 1991,
+ type = "Computing Science Technical Report",
+ number = 116,
+ address = "Murray Hill, New Jersey 07974",
+ month = may
+}
+
+@Book{K84:TeXbook,
+ author = "Donald E. Knuth",
+ title = "The {\TeX}book",
+ publisher = A-W,
+ year = 1984
+}
+
+@Book{K86:ComputerMT,
+ author = "Donald E. Knuth",
+ title = "Computer Modern Typefaces",
+ publisher = A-W,
+ year = 1986,
+ volume = "A",
+ series = "Computers \& Typesetting"
+}
+
+@Book{K86:MFbook,
+ author = "Donald E. Knuth",
+ title = "The {\MF}book",
+ publisher = A-W,
+ year = 1986
+}
+
+@Manual{K88:EEPIC,
+ title = "{EEPIC} -- Extensions to epic and {\LaTeX} Picture
+ Environment 1.1",
+ author = "Conrad Kwok",
+ organization = "Dept. of Electrical Engineering and Computer
+ Science, University of California, Davis",
+ year = 1988,
+ month = feb
+}
+
+@Book{L86:LaTeX,
+ author = "Leslie Lamport",
+ title = "{\LaTeX}---A Document Preparation System",
+ publisher = A-W,
+ year = 1986
+}
+
+@Book{L94:LaTeX,
+ author = "Leslie Lamport",
+ title = "{\LaTeX}---A Document Preparation System",
+ publisher = A-W,
+ year = 1994,
+ edition = "2nd"
+}
+
+@Misc{L88:latex.tex,
+ author = "Leslie Lamport",
+ title = "{\LaTeX} Version 2.09",
+ howpublished = "{\tt latex.tex} of {\LaTeX} distribution",
+ year = 1988,
+ month = aug
+}
+
+@Manual{L88:FeynmanLRGFD,
+ title = "A {\LaTeX} Routine for Generating feynman Diagrams",
+ author = "Michael Levine",
+ edition = "1.0",
+ year = 1988,
+ month = oct,
+ OPTnote = "{CTAN} {\tt macros/\-latex/\-contrib\slash \-feynman}"
+}
+
+@Article{N60:ReportALA60,
+ author = "P. Naur and others",
+ title = "Report on the Algorithmic Language {ALGOL} 60",
+ journal = cacm,
+ year = 1960,
+ volume = 3,
+ pages = "299-314"
+}
+
+@Manual{O79:NROFF/TROFFUM,
+ title = "{NROFF/TROFF} User's Manual",
+ author = "J. F. Osanna",
+ organization = "Bell Laboratories",
+ address = "Murray Hill, N.J.",
+ year = 1979
+}
+
+@TechReport{P86:EnhancementsPEL,
+ author = "Sunil Podar",
+ title = "Enhancements to the Picture Environment of {\LaTeX}",
+ institution = "Dept. of Computer Science, S.U.N.Y. at Stony Brook",
+ year = 1986,
+ number = "86-17",
+ month = jul
+}
+
+@Manual{ps,
+ title = "PostScript Language Reference Manual",
+ organization = "Adobe Systems Incorporated",
+ edition = "second",
+ year = 1990
+}
+
+@Manual{R87:UsersMDM,
+ title = "User's Manual for Diagram Macros",
+ author = "John Reynolds",
+ year = 1987,
+ month = dec,
+ note = "Available by anonymous ftp from {\tt e.ergo.cs.cmu.edu}"
+}
+
+@Manual{dvips,
+ title = "{DVIPS}: A {\TeX} Driver",
+ author = "Tomas Rokicki",
+ note = "Distributed with the dvips program found on CTAN archives"
+}
+
+@Manual{textures,
+ title = "Textures User's Guide",
+ organization = "Blue Sky Research",
+ address = "Portland, Oregon",
+ year = 1988,
+ month = dec
+}
+
+@Book{S82:JoyT,
+ author = "Michael D. Spivak",
+ title = "The Joy of {\TeX}---A Gourmet Guide to Typesetting
+ with the {\AMS-\TeX} Macro Package",
+ publisher = A-W,
+ year = 1982
+}
+
+@Book{S90:JoyT,
+ author = "Michael D. Spivak",
+ title = "The Joy of {\TeX}---A Gourmet Guide to Typesetting
+ with the {\AMS-\TeX} Macro Package",
+ edition = "second",
+ publisher = AMS,
+ year = 1990
+}
+
+@Misc{TWG-TDS,
+ key = "TWG-TDS-0.98",
+ author = "TUG Working Group TWG-TDS",
+ title = "A Directory Structure for {\TeX} Files version 0.98",
+ howpublished = "URL",
+ year = 1995,
+ month = may,
+ note = "Available with URL {ftp:/\kern-1pt\slash
+ jasper.ora.com\slash pub\slash twg-tds/}"
+}
+
+@Manual{T93:OzTeXUG,
+ title = "{\OzTeX} User's Guide",
+ author = "Andrew Trevorrow",
+ address = "19 Abbot Lane, North Adelaide 5006, Australia",
+ edition = "1.6",
+ year = 1993,
+ month = jul
+}
+
+@Manual{T90:CommutativeDT,
+ title = "Commutative Diagrams in {\TeX}",
+ author = "Paul Taylor",
+ organization = "Department of Computing, Imperial College",
+ address = "180 Queens Gate, London SW7 2BZ",
+ year = 1990,
+ month = jul
+}
+
+@Manual{T93:CommutativeDTV4,
+ title = "Commutative Diagrams in {\TeX} (version 4)",
+ author = "Paul Taylor",
+ organization = "Department of Computing, Imperial College",
+ address = "180 Queens Gate, London SW7 2BZ",
+ year = 1993,
+ month = jan
+}
+
+@Manual{W86:PiCTeXM,
+ title = "The {\PiCTeX} Manual",
+ author = "Michael J. Wichura",
+ organization = "University of Washington",
+ year = 1987
+}
+
+@Misc{W87:pictex.tex,
+ author = "Michael J. Wichura",
+ title = "{\PiCTeX}, Version 1.1",
+ howpublished = "{\tt pictex.tex} of {\PiCTeX} distribution",
+ year = 1987,
+ month = sep
+}
+
+% $Log: xydoc.bib,v $
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.4 1997/05/28 13:02:24 krisrose
+% Fixed missing breaks bug.
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/06 02:56:02 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% Name changed from xypicman.bib to xydoc.bib.
+%
+% Revision 2.6.1.1 1992/07/01 07:08:24 kris
+% Send to EuroTeX '92...
+%
+% Revision 2.6 1992/06/24 01:23:34 kris
+% Unchanged from xy.bib v.2.5.
+%
+% Revision 2.1 1992/01/02 14:54:07 kris
+% Release version.
+%
+% Revision 1.4 1991/11/27 06:44:34 kris
+% Fits \beta-test on DIKU.
+%
+% Revision 1.3 1991/08/23 01:05:45 kris
+% Tidied up; fits report.tex[1.28].
+%
+% Revision 1.2 1991/08/05 04:02:12 kris
+% As used in student report 91-7-10.
+%
+% Revision 1.1 91/07/23 14:49:06 kris
+% Fits report.tex[1.5].
diff --git a/Master/texmf-dist/source/generic/xypic/xydoc.sty b/Master/texmf-dist/source/generic/xypic/xydoc.sty
new file mode 100644
index 00000000000..0d5bb0c7a69
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xydoc.sty
@@ -0,0 +1,1270 @@
+%% $Id: xydoc.sty,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Style for Xy-pic documentation under LaTeX.
+%% Copyright (c) 1993-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Since the documentation files may have Danish ISO Characters...
+
+\input{latin1.sty}
+
+% We use two and three columns (see with \INDEX command)...
+
+\RequirePackage{multicol}
+
+% ACTIVE CHARACTERS: "<|? are active (set before loading Xy-pic to make the
+% parsing work)...and redefine LaTeX \dospecials at the same time but do NOT
+% tell it to redefine ? because we want to use that in code!
+
+\catcode`\"=\active
+\let"=\relax
+\catcode`\<=\active
+\let<=\relax
+\catcode`\|=\active
+\let|=\relax
+\catcode`\?=\active
+\let?=\relax
+
+\def\dospecials{%
+ \do\ \do\\\do\{\do\}\do\$\do\&\do\#\do\^\do\_\do\%\do\~\do\"\do\<\do\|}
+
+%\catcode9=10
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% LOAD Xy-pic...
+
+\makeatother
+
+\input xy
+\xyoption{all}
+\xyoption{knot}
+\xyoption{2cell}
+\xyoption{poly}
+\xyoption{web}
+\xyoption{arc}
+\input xydoc.back
+\CompileMatrices
+\UseCrayolaColors
+
+\xycatcodes \catcode`\"=12 \catcode`\<=12 \catcode`\|=12 \catcode`\?=12
+\def\next{\RequirePackage[draft,dvips]{graphics}} % hack :-)
+
+\ifx\xydvipsloaded\undefined
+ \ifx\xytexturesloaded\undefined
+ \else\def\next{\RequirePackage[textures]{graphics}}\fi
+\else\def\next{\RequirePackage[dvips]{graphics}}\fi
+\next
+
+\xycatcodes \catcode`\"=\active \catcode`\<=\active \catcode`\|=\active
+ \catcode`\?=\active
+\xyuncatcodes\makeatletter % be paranoid
+
+\def\PStest#1#2{\ifx\empty\whichPSspecials@#1\else#2\fi}
+\def\PStype{\dvitype@\unskip}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% TIME OF DAY
+
+\count@=\time \divide\count@ by 60\relax
+\count@@=\count@ \multiply\count@@ by -60 \advance\count@@ by \time
+\edef\now{\number\count@:\ifnum 10>\count@@ 0\fi \number\count@@}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% LOGOS: METAFONT logo uses the logo10 font; AMS logo uses the math
+% italic font; and others just use the default fonts.
+
+\font\logofont=logo10
+\def\MF{{\logofont META}\-{\logofont FONT}}
+\def\AMS{{\the\textfont2 A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}
+\def\PiCTeX{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\kern-.11em\TeX}
+\def\LaTeXe{{\LaTeX\kern.15em$2_{\textstyle\varepsilon}$}}
+\def\OzTeX{{O\kern-.03em z\kern-.15em\TeX}}
+\def\Textures{{\sc Textures}}
+\def\dvips{{\sc dvips}}
+\def\TPIC{{\sc tpic}}
+\def\xdvi{{\sc xdvi}}
+\def\dvitops{{\sc dvitops}}
+
+%...and PS, unix, and BNF with footnote inserted at the first use...
+
+\newif\ifPSuntold \PSuntoldtrue
+\def\PS{\protect\PS@}
+\def\PS@{{\sc Post\-Script}\xyFN@\PS@i}
+\def\PS@i{\let\next@=\PS@ii
+ \ifx.\next \else\ifx,\next \else\ifx:\next \else\ifx;\next \else\ifx!\next
+ \else\ifx?\next \else \let\next@=\PS@iii \fi\fi\fi\fi\fi\fi \next@}
+\def\PS@ii#1{#1\PS@iii}
+\def\PS@iii{%
+ \ifPSuntold \global\PSuntoldfalse
+ \footnote{{\sc Post\-Script} is a registered Trademark of Adobe,
+ Inc.~\cite{ps}.}%
+ \fi}
+
+\newif\ifunixuntold \unixuntoldtrue
+\def\unix{\protect\unix@}
+\def\unix@{{\sc unix}\xyFN@\unix@i}
+\def\unix@i{\let\next@=\unix@ii
+ \ifx.\next \else\ifx,\next \else\ifx:\next \else\ifx;\next \else\ifx!\next
+ \else\ifx?\next \else \let\next@=\unix@iii \fi\fi\fi\fi\fi\fi \next@}
+\def\unix@ii#1{#1\unix@iii}
+\def\unix@iii{%
+ \ifunixuntold \global\unixuntoldfalse
+ \footnote{{\sc Unix} is a trademark of Bell Labs.}%
+ \fi}
+
+\newif\ifBNFuntold \BNFuntoldtrue
+\def\BNF{{\footnotesize BNF}%
+ \ifBNFuntold \global\BNFuntoldfalse
+ \footnote{{\footnotesize BNF} is the notation for ``meta-linguistic
+ formulae'' first used by \cite{N60:ReportALA60} to describe the
+ syntax of the Algol programming language. We use it with the
+ conventions of the \TeX\-book~\cite{K84:TeXbook}: `\iss' is read ``is
+ defined to be'', `\orr' is read ``or'', and `<empty>' denotes
+ ``nothing''; furthermore, `<id>' denotes anything that expands into a
+ sequence of \TeX\ character tokens, `<dimen>' and `<factor>' denote
+ decimal numbers with, respective without, a dimension unit (like {\tt
+ pt} and {\tt mm}), <number> denotes possibly signed integers, and
+ <text> denotes \TeX\ text to be typeset in the
+ appropriate mode. We have chosen to annotate the syntax with brief
+ explanations of the `action' associated with each rule; here
+ `$\from$' should be read `is copied from'.}%
+ \fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% `OTHER' CHARACTERS: miscellaneous characters of category `other' ... it is
+% essential that space is done last!
+
+\begingroup
+ \catcode`\"=12 \gdef\dq{"}
+ \catcode`\<=12 \gdef\otherless{<}
+ \catcode`\>=12 \gdef\othergreater{>}
+ \catcode`\|=12 \gdef\otherbar{|}
+ \catcode`\@=12 \gdef\otherat{@}
+ \catcode`\|=0 \catcode`\<=1 \catcode`\>=2
+ |catcode`|\=12 |gdef|otherescape<\>
+ |catcode`|{=12 |gdef|otherbgroup<{>
+ |catcode`|}=12 |gdef|otheregroup<}>
+ |catcode`|$=12 |gdef|othermath<$>
+ |catcode`|&=12 |gdef|otherand<&>
+ |catcode`|#=12 |gdef|otherparameter<#>
+ |catcode`|^=12 |gdef|othersuper<^>
+ |catcode`|_=12 |gdef|othersub<_>
+ |catcode`|%=12 |gdef|othercomment<%>
+ |catcode`| =12|gdef|otherspace< >|endgroup
+
+\def\ordinarybars{\catcode`\|=12}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% ABBREVIATIONS:
+
+\def\ie{{\it i}.{\it e}.} \def\Eg{{\it E}.{\it g}.}
+\def\eg{{\it e}.{\it g}.} \def\Ie{{\it I}.{\it e}.}
+\def\cf{{\it cf}.} \def\Cf{{\it Cf}.}
+\def\aka{{\it aka\/}}
+\def\etc{{\it etc}.}
+
+% LOCAL DEFINITIONS...
+%
+% \RSN, \TODO, and \DRAFT used wherever something is NOT FINISHED.
+%
+\def\RSN{Real Soon Now}
+\def\TODO#1{{\bf To Do#1}}
+\def\BUG#1{{\bf Bug#1}}
+\def\NOTE#1{{\bf Note#1}}
+\def\HACK#1{{\bf Hack#1}}
+\def\REMARK#1{{\bf Remark#1}}
+\def\DRAFT#1{\framebox{\it Draft #1}\vrule width0pt height 2em depth 1em\relax}
+
+\def\smiley{\hbox{\rlap{$\bigcirc$}\kern1.3\p@$\scriptstyle\ddot\smile$}}
+\def\frowny{\hbox{\rlap{$\bigcirc$}\kern1.3\p@$\scriptstyle\ddot\frown$}}
+\def\half{{\slashedfrac12}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% HTML generation stuff.
+
+\RequirePackage{html}
+
+\let\DEF=\def
+\let\IMG=\relax
+\newenvironment{IMAGE}{}{}
+\newenvironment{CENTER}{}{\noindent\unskip\ignorespaces}
+
+%% Pretty hyperlinks :-)
+
+{\makeatletter
+ \catcode`\~=\active \catcode`\/=\active \catcode`\_=\active
+ \gdef\setupurl@{%
+ \catcode`\~=\active \def~{\ensuremath{\sim}}%
+ \catcode`\&=12 %
+ \catcode`\_=\active \def_{\ensuremath{\sb-}}%
+ \catcode`\/=\active \def/{\futurelet\next\urlslash@}}
+ \gdef\url{\begingroup $\langle$\nobreak\textsc{url}:
+ \setupurl@\futurelet\next\url@}
+ \gdef\url@#1{\emph{#1}\nobreak$\rangle$\endgroup}
+ \gdef\urlslash@{\ifx /\next \def\next@/{\string/\kern-.2em\string/}%
+ \else \def\next@{\slash}\fi \next@}
+ \gdef\newurl#1#{\begingroup\setupurl@\newurl@{#1}}
+ \gdef\newurl@#1#2{\gdef#1{\url{#2}}\endgroup}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% EMPHASISING:
+
+\def"#1"{{\relax \ifmmode \mathchoice
+ {\hbox{\normalsize\it\relax#1\/}}%
+ {\hbox{\normalsize\it\relax#1\/}}%
+ {\hbox{\scriptsize\it\relax#1\/}}%
+ {\hbox{\scriptsize\it\relax#1\/}}%
+ \else\it#1\/\fi}}
+
+% Special `Notes' enumeration.
+
+\newcounter{note}
+\def\thenote{\thesection\alph{note}}
+\newif\ifnotes@
+
+\def\notescontd{\ifnotes@ \@toodeep \fi \notes@true
+ \subsubsection*{Notes}\nobreak\list{\thenote.}%
+ {\leftmargin=1.5pc \labelwidth=1pc \labelsep=.5pc
+ \usecounter{note}%
+ \def\makelabel##1{\thenote.\hss}}%
+ \expandafter\c@note\notescount@@}
+\def\endnotescontd{\xdef\notescount@@{\the\c@note}\endlist}
+
+\def\notes{\xdef\notescount@@{0}\notescontd}
+\let\note=\item
+\let\endnotes=\endnotescontd
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% DOCUMENT CLASSIFICATION...
+
+% Some options may prefer a ``\BIBLIOGRAPHY'' different from xydoc.bib in
+% plain style!
+
+\def\BIBLIOGRAPHY{%
+ \bibliographystyle{plain}
+ \bibliography{xydoc}
+ \addtocontents{toc}{%
+ \protect\contentsline{section}{References}{\protect\pageref{BIBLIOGRAPHY}}}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% GENERIC MATH:
+
+\mathchardef\lt=\dq 313C
+\mathchardef\gt=\dq 313E
+\mathchardef\from=\dq 3220
+\mathcode`\*=\dq 2202
+\def\abs#1{\left\vert#1\right\vert}
+\def\sgn{\hbox{sgn}}
+\def\floor#1{\left\lfloor#1\right\rfloor}
+\def\ceil#1{\left\lceil#1\right\rceil}
+\def\Det#1{\left\otherbar
+ {\arraycolsep=.2em \begin{array}{cc}#1\end{array}}\right\otherbar}
+
+% Some LaTeXs don't have this:
+\newbox\Boxbox@
+\setbox\Boxbox@=\hbox{\vrule height 5pt depth 0pt width .4pt %
+ \rlap{\vrule height 5pt depth -4.6pt width 4.2pt}%
+ \vrule height .4pt depth 0pt width 4.2pt %
+ \vrule height 5pt depth 0pt width .4pt}
+\def\Box{\relax\ifmmode\expandafter\vcenter\fi{\copy\Boxbox@}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% BNF:
+
+{\setboxz@h{$^{\hbox{\small0}}$}%
+ \xdef\histrut{\hbox{\vrule height\the\ht0 depth\the\dp0 width\z@}}}
+
+\def<#1>{\relax\ifmmode\histrut\expandafter\textrm\fi
+ {\rm$\langle${\ignorespaces#1}$\rangle$}}
+\def\iss{\relax
+ \ifmmode\histrut\expandafter\mathrel\fi{\hbox{$\longrightarrow$}}}
+\def\orr{\relax\ifmmode\histrut\expandafter\mathrel\fi{\hbox{$~\vert~$}}}
+
+\def\star{\hbox{*}}
+\def\plus{\ensuremath{^+}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% SHOULD USE \parbox...
+
+\leftmargin=0pt % LaTeX hack...
+
+\newenvironment{syntax}%
+{$$\tabskip=.5em plus1fil \dimen@=\hsize \advance\dimen@-\leftmargin
+ \halign to\dimen@\bgroup
+ \strut##\unskip\hfil&\hfil##\hfil
+ &##\hfil&\hsize=.5\hsize\vtop{\noindent##}\hfil\cr
+ \noalign{\nobreak\hrule\nobreak\smallskip}%
+ \multispan{3}Syntax\hfil &Action \cr
+ \noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}}%
+{\crcr\noalign{\nobreak\smallskip\nobreak\hrule\nobreak}\egroup$$%
+ \ignorespaces}
+
+\def\topofdefs{\hrule\nobreak\smallskip}
+\def\bottomofdefs{\nobreak\smallskip\nobreak\hrule\nobreak}
+
+\newenvironment{defs}%
+{$$\tabskip=.5em plus1fil \dimen@=\hsize \advance\dimen@-\leftmargin
+ \halign to\dimen@\bgroup \strut##\unskip\hfil
+ \tabskip=.5em&\hsize=.5\hsize\vtop{\noindent##}\hfil
+ \tabskip=.5em plus1fil\cr
+ \noalign{\topofdefs}}%
+{\crcr\noalign{\bottomofdefs}\egroup$$\ignorespaces}
+
+\newenvironment{defs1}%
+{$$\tabskip=.5em plus1fil \dimen@=\hsize \advance\dimen@-\leftmargin
+ \halign to\dimen@\bgroup \strut##\unskip\hfil\cr
+ \noalign{\topofdefs}}%
+{\crcr\noalign{\bottomofdefs}\egroup$$\ignorespaces}
+
+\newenvironment{unformatteddefs}%
+{\vspace{\bigskipamount}\topofdefs}%
+{\bottomofdefs\vspace{\bigskipamount}\ignorespaces}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% INLINE VERBATIM: use |...| with || in ... for a single |. Almost not
+% ``fragile'' in the LaTeX sense: the ... must be a balanced token list when
+% ``moving'' and control sequences get an extra space except at the end...
+
+\newcount\barnest@
+
+\def|{\leavevmode\hbox\bgroup \global\barnest@=\z@
+ \tt \let\do\@makeother\dospecials \frenchspacing
+ \xyFN@\bar@}
+
+\def\cs#1{\texttt{\otherescape#1}}
+
+% Hack: we need to cater for both ordinary spaces (\space@) and space `other'
+% tokens (\otherspace)...all become simple spaces.
+
+\def\bar@{\ifx |\next \let\next@=\bar@x
+ \else\expandafter\ifx\otherbar\next \let\next@=\bar@x
+ \else\ifx \space@\next \expandafter\DN@\space{\space@\xyFN@\bar@}%
+ \else\expandafter\ifx \otherspace\next
+ \expandafter\DN@\otherspace{\space@\xyFN@\bar@}%
+ \else
+ \ifx \bgroup\next \global\advance\barnest@\@ne \fi
+ \ifx \egroup\next \global\advance\barnest@\m@ne \fi
+ \DN@{\expandafter\bar@@\string}%
+ \fi\fi\fi\fi \next@}
+\def\bar@@#1{#1\xyFN@\bar@}
+
+\def\bar@x#1{\egroup
+ \ifnum\z@=\barnest@\else \W@{Warning: Unbalanced \string|TEXT\string| where
+ \string{\string}-count is \the\barnest@}\fi
+ \xyFN@\rebar@}
+
+\def\rebar@{\ifx |\next \hbox{\tt\char124}\fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% INLINE AND DISPLAYED TeX CODE:
+
+\newwrite\thecode@
+
+% Making the chunk is the most work...it goes into a temporary file that
+% lives while the chunk lives.
+
+\newenvironment{code}{%
+ \begingroup \aftergroup\endcode@
+ \immediate\openout\thecode@=\jobname.tmp %
+ \let\do\@makeother\dospecials \endlinechar=10 \futurelet\next\code@}{}
+\def\endcode@{\immediate\closeout\thecode@}
+
+% \code@* is the where the dirty work is done: it is called for each line in
+% the code chunk under construction and will finish it if that line contains
+% *exactly* "\end{code}".
+
+{\lccode`\0=`\\\lccode`\[=`\{\lccode`\]=`\}\lowercase{%
+ \expandafter\gdef\expandafter\code@\space{\code@i}
+ \gdef\code@i#1^^J{\code@ii#10end[code]\code@@}
+ \gdef\code@ii#10end[code]#2\code@@{\def\1{#1}\def\2{#2}%
+ \ifx\2\empty \immediate\write\thecode@{\codeof\1}\let\next@=\code@i
+ \else \def\next@{\oldcodes@\endgroup\end{code}}%
+ \fi \next@}}}
+
+\def\oldcodes@{\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\#=6 %
+ \catcode`\%=14\relax}
+
+% Setting the code is just reading it...
+
+\def\gdocode{\expandafter\@@input\jobname.tmp \ifhmode\unskip\fi}
+
+\newcount\frozeninputlineno % hack to keep right file/lineno...
+
+\ifx\inputlineno\undefined
+ \def\docode{\unskip{\gdocode}}
+\else
+\def\docode{\unskip{\frozeninputlineno=\inputlineno
+ \let\@@inputlineno=\inputlineno
+ \def\inputlineno{\frozeninputlineno:\the\@@inputlineno}%
+ \gdocode}}
+\fi
+
+% Showing the code is just putting TeX in verbatim mode before reading.
+
+\def\thecode{{\catcode``=13 \@noligs \let\do\@makeother \dospecials
+ \catcode`\ =10 \let\par\space\obeylines \frenchspacing \tt
+ \input\jobname.tmp \unskip}}
+
+\def\displaycode{{\inputdoc.{\jobname.tmp}}%
+ \ignorespaces}
+
+% Writing the code to a(nother) file is a simple combination of \code and
+% \showcode.
+
+\def\writecode#1{{\let\do\@makeother\dospecials \endlinechar=10 %
+ \def\next@{\immediate\write#1}\expandafter\writecode@\@@input\jobname.tmp }}
+
+\def\writecode@{\futurelet\next\writecode@i}
+\def\writecode@i{\ifx\next\egroup\else \expandafter\writecode@ii \fi}
+\def\writecode@ii#1^^J{\def\1{#1}\next@{\codeof\1}\futurelet\next\writecode@}
+
+\def\writecodecode#1{%
+ \immediate\write#1{\string\begin\string{code\string}}%
+ \writecode#1%
+ \immediate\write#1{\string\end\string{code\string}}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% EXERCISES & ANSWERS: accumulated as subsubsections on .ans file...
+
+\newif\ifExercises \Exercisesfalse
+\newwrite\answ@
+
+\AtBeginDocument{%
+ \immediate\openout\answ@=\jobname.ans
+ \immediate\write\answ@{\othercomment\space\jobname.ans: \today, \now.}
+}
+
+\def\exerciseprefix{}
+\newcount\exercisenumber \exercisenumber=0
+\def\restartexercises#1{\edef\exerciseprefix{#1}\exercisenumber=0 }
+
+\newenvironment{exercise}{\global\Exercisestrue
+ \global\advance\exercisenumber by 1 %
+ \edef\@currentlabel{\the\exercisenumber}%
+ \edef\next@{\noexpand\label{Exercise-\exerciseprefix\the\exercisenumber}}%
+ \next@
+ \paragraph*{Exercise~\exerciseprefix\the\exercisenumber:}\begingroup
+ \def\IW@##1{\immediate\write\answ@{##1}}\IW@{}%
+ \IW@{\otherescape xyuncatcodes}%
+ \IW@{\otherescape paragraph*{Answer to exercise
+ \exerciseprefix\the\exercisenumber\space
+ (p.\string\pageref{Exercise-\exerciseprefix\the\exercisenumber}):}%
+ \string\label{Answer-\exerciseprefix\the\exercisenumber}}%
+ \IW@{\othercomment}}%
+ {\IW@{}\endgroup}
+
+\def\answertext#1{{\DN@{#1}\DNii@##1:->##2<-:{{\IW@{##2}}}%
+ \expandafter\nextii@\meaning\next@<-:}}
+
+\def\answercode{\writecodecode\answ@}
+\def\answerdisplaycode{\answertext\displaycode}
+
+\def\Answers{\ifExercises \Exercisesfalse \global\count1=\z@
+ \def\next{\immediate\closeout\answ@ \input\jobname.ans}%
+ \expandafter\next\fi}
+
+\def\ANSWERS{\ifExercises
+ \section{Answers to all exercises}
+ \Answers
+ \immediate\openout\answ@=\jobname.ans
+ \immediate\write\answ@{\othercomment\space\jobname.ans: \today, \now.}
+\fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% PRINTING MACRO FILES AS DOCUMENTATION
+
+% \inputdoc <type> {<file>} will read <file>.doc, extracting either
+
+% * a verbatim input file with line numbers if <type> is 0 (ignoring \DOCMODE
+% commands in the file),
+% * the reference manual body if <type> is the character 1, or
+% * the TeXnical documentation body if <type> is the character 2.
+
+% For the second and third types to work, <file>.doc must have the structure
+
+% <header>
+% \DOCMODE<mode>
+% <stuff>
+% \DOCMODE<mode>
+% <stuff>
+% :
+% :
+% \DOCMODE3
+% <stuff>
+
+% where each <mode> can be either of the characters
+
+% 0 to designate that the following <stuff> should be ignored,
+
+% 1 to designate that the following <stuff> is TeX source material to
+% be included only in the reference manual,
+
+% 2 to designate that the following <stuff> is TeX source material to
+% be included only in the TeXnical documentation,
+
+% 3 to designate that the following <stuff> is TeX source material to
+% be included in the reference manual and the TeXnical document,
+
+% . for unnumbered program file listing
+% : for numbered program file listing
+
+% ! for stuff in the same mode as the context
+
+% ( to designate that the following <stuff> is code that is included in
+% <file>.tex that should also be typeset verbatim in the TeXnical document,
+% or
+
+% ) to designate that the following <stuff> is of the same kind as the
+% <stuff> preceeding the most recent \DOCMODE).
+
+% Furthermore, the command \DOCHEADER is available after the first \DOCMODE2
+% command to insert the <header> verbatim. The last command must be
+% \DOCMODE3 in order to ensure that the end of the file is seen by both
+% document types!
+
+% Finally the reference PREFIX is set to the file name so that `global'
+% references across files are possible...
+
+% The <file>.tex to be distributed should include the <header> and all
+% <stuff> between \DOCMODE( and \DOCMODE).
+
+\let\thedocmode@=0
+
+% Default is for reference documentation...
+
+\let\originalxyprovide=\xyprovide
+\let\originalcurrentxydriver=\currentxydriver
+
+\def\specialxyprovide#1#2#3#4#5#6{%
+ \let\xyprovide=\originalxyprovide
+ \edef\OPROPER{#2}\edef\OVERSION{#3}%
+ \def\OAUTHOR{#4}\def\OAUTHOREMAIL{#5}\def\OAUTHORADDRESS{#6}%
+ \def\next{#1}\edef\xyoption@@{\codeof\next}%
+ \expandafter\section\expandafter{\OPREFIX\OPROPER}??g=[#1]%
+ \subsubsection*{\noindent\rlap{\small\bf
+ Vers. \OVERSION\ by~\OAUTHOR\ <\OAUTHOREMAIL>}\LOADAS{#1}}%
+ \DN@##1##2##3##4##5##6##7.{\CompilePrefix{xy##1##2##3##4##5##6}}%
+ \next@#1-000.%
+ \xyprovide{#1}{#2}{#3}{#4}{#5}{#6}}
+
+\def\specialxysubprovide#1#2#3#4#5#6{%
+ \let\xyprovide=\originalxyprovide
+ \edef\OPROPER{#2}\edef\OVERSION{#3}%
+ \def\OAUTHOR{#4}\def\OAUTHOREMAIL{#5}\def\OAUTHORADDRESS{#6}%
+ \def\next{#1}\edef\xyoption@@{\codeof\next}%
+ \expandafter\subsection\expandafter{\OPREFIX\OPROPER}??g=[#1]%
+ \subsubsection*{\noindent\rlap{\small\bf
+ Vers. \OVERSION\ by~\OAUTHOR\ <\OAUTHOREMAIL>}\LOADAS{#1}}%
+ \DN@##1##2##3##4##5##6##7.{\CompilePrefix{xy##1##2##3##4##5##6}}%
+ \next@#1-000.%
+ \xyprovide{#1}{#2}{#3}{#4}{#5}{#6}}
+
+\def\OSECTION#1{\let\xyprovide=\specialxyprovide
+ \def\OPREFIX{}%
+ \def\LOADAS##1{\\*Load as: {\tt\string\xyoption\string{##1\string}}}%
+ \input{#1}\runxywith@ \inputdoc!{#1}}
+
+\def\DSECTION#1{\let\xyprovide=\specialxysubprovide
+ \def\OPREFIX{}%
+ \def\LOADAS##1{\\*Load as: {\tt\string\xyoption\string{##1\string}}}%
+ \let\orignewdriver=\newdriver \let\origxyaddsupport=\xyaddsupport
+ \def\newdriver##1{\orignewdriver{##1}\xyendinput}%
+ \def\xyaddsupport##1##2{\expandafter\xyadddriversupport@\expandafter{%
+ \xyoption@@}{##1}{\ignorespaces}}%
+ \input{#1}%
+ \let\newdriver=\orignewdriver \let\xyaddsupport=\origxyaddsupport
+ \inputdoc!{#1}}
+
+\def\SQUEEZE{}
+
+\def\defaultdocmode@{\docmode@}
+
+% \inputdoc MODE {FILE} loads FILE in docmode MODE. ! means `current'.
+
+\gdef\inputdoc#1#2{%
+ \mayshrinktt@true
+ \if#1!\relax \let\DocMode@=\defaultdocmode@
+ \else\if#10\relax \numbercode@true \let\DocMode@=\docmode@@@
+ \else\if#11\relax \let\DocMode@=\docmode@
+ \else\if#12\relax \let\DocMode@=\docmode@@
+ \else\if#1:\relax \mayshrinktt@false\numbercode@true \let\DocMode@=\docmode@@@
+ \else\if#1.\relax \mayshrinktt@false\numbercode@false\let\DocMode@=\docmode@@@
+ \else\xyerror@{panic...unknown DOCMODE \string?!\string?}{}%
+ \fi\fi\fi\fi\fi\fi
+ {\questprefix{#2}\expandafter\let\csname DOCMODE\endcsname=\DocMode@
+ \endlinechar=`\^^J%
+ \def\next@{\csname DOCMODE\endcsname @}\expandafter\next@\@@input#2 }%
+ \ifmayshrinktt@\medbreak\fi}
+
+\let\^^J=\ % such that `\ ' works at end of line!
+
+% First variant is for the reference manual: ignore everything except lines
+% with MODE 1 or 3.
+
+\let\lastdocmode@=0
+
+\def\docmode@#1{%
+ \ifx#11\let\next@=\relax \let\lastdocmode@=1\relax
+ \else\ifx#12\let\next@=\docs@ \let\lastdocmode@=2\relax
+ \else\ifx#13\let\next@=\relax \let\lastdocmode@=3\relax
+ \else\ifx#1@\let\next@=\docs@
+ \else\ifx#1(\let\next@=\docs@
+ \else\ifx#1)\DN@{\docmode@\lastdocmode@}%
+ \else\let\next@=\docs@ \let\lastdocmode@=0\relax
+ \fi\fi\fi\fi\fi\fi \next@}
+
+% Second variant is for the technical docs: typeset everything normally
+% except areas with MODE ( that are typeset verbatim, areas with MODE 0,
+% and 1 which are ignored, and areas with MODE @ which are stuffed into a
+% file (used for the \DOCHEADER feature):
+
+\def\docmode@@#1{%
+ \ifx#11\let\next@=\docs@ \let\lastdocmode@=1\relax
+ \else\ifx#12\let\next@=\relax \let\lastdocmode@=2\relax
+ \else\ifx#13\let\next@=\relax \let\lastdocmode@=3\relax
+ \else\ifx#1@\let\next@=\docc@
+ \else\ifx#1(\let\next@=\docv@
+ \else\ifx#1)\DN@{\docmode@@\lastdocmode@}%
+ \else\let\next@=\docs@ \let\lastdocmode@=0\relax
+ \fi\fi\fi\fi\fi\fi \next@}
+
+% Third is for verbatim...
+
+\def\docmode@@@#1{\docv@}
+
+% Here are the three interpretation macros: first one that skips...
+
+\def\docs@{%
+ \begingroup\skipspecials@ \let\docm@=\docm@i \let\docecho@=\relax
+ \def\docfinish@{\global\let\thedocmode@=\next
+ \endgroup \xyuncatcodes \csname DOCMODE\endcsname\thedocmode@}%
+ \docm@}
+
+% ..then the one that typesets verbatim: it needs a special hack to be able
+% to recognize the end of files when using \inputdoc0...
+
+\newif\ifnumbercode@ % number lines!
+\def\lineno@{\ifx\inputlineno\undefined\else\the\inputlineno\fi}
+
+\def\docv@{%
+ \par\vspace{1ex}\begingroup \skipspecials@
+ \def\docm@{\xyFN@\docvm@}%
+ \def\docvm@{\ifx\next\egroup \DN@{\endgroup\par\vspace{1ex}}%
+ \else \let\next@\docm@i \fi \next@}%
+ \parfillskip\@flushglue \parskip\z@ \def\par{}\obeylines\tt
+ \catcode``=13 \@noligs \let\do\@makeother\dospecials
+%
+ \catcode`\%=13 %make % act as ?...
+%
+ \frenchspacing\@vobeyspaces \activateTABandFF@
+ \def\docecho@{\ifx\next\empty\vspace{1ex}\else
+ \hbox{%
+ \ifnumbercode@\hbox to 1.5pc{\tinyrm\lineno@\hss}%
+ \else\hbox to\leftmargin{\hss}\fi
+ \setbox0=\hbox\bgroup\next\egroup\box0}\fi}%
+ \def\docfinish@{\global\let\thedocmode@=\next \endgroup
+ \xyuncatcodes \par\vspace{1ex}\csname DOCMODE\endcsname\thedocmode@}%
+ \docm@}
+
+\def\tinyrm{\tiny\rm}
+
+% ...with some trickery to get TABs interpreted right:
+
+\newdimen\tabw@
+
+\def\activeTAB@{\egroup \dimen@=\wdz@
+ \divide\dimen@\tabw@ \multiply\dimen@\tabw@ \advance\dimen@\tabw@
+ \wdz@=\dimen@ \boxz@ \setboxz@h\bgroup}%
+
+\def\activeFF@{\egroup
+ \dimen@=\hsize \advance\dimen@-\wdz@ \advance\dimen@-2pc %
+ \boxz@ \raise.7ex\hbox to\dimen@{\hrulefill}\setboxz@h\bgroup}
+
+% They are activated by \activateTABandFF@ that also picks a \tt font size
+% that will allow 77 characters = 9.7 tabstops per line propvided the
+% conditional mayshrinktt@ is true...
+
+\newif\ifmayshrinktt@
+
+{\catcode`\^^I=\active \catcode`\^^L=\active \let^^L=\par
+ \gdef\activateTABandFF@{\setboxz@h{00000000}\tabw@=\wdz@ \dimen@=\hsize
+ \ifnumbercode@ \advance\dimen@-1.5pc \fi
+ \ifmayshrinktt@
+ \ifdim 9.7\tabw@>\dimen@\small\tt\setboxz@h{00000000}\tabw@=\wdz@\fi
+ \ifdim 9.7\tabw@>\dimen@\footnotesize\tt\setboxz@h{00000000}\tabw@=\wdz@\fi
+ \fi
+ \catcode`\^^I=\active \let^^I=\activeTAB@
+ \catcode`\^^L=\active \let^^L=\activeFF@ }}
+
+% ...and finally one that makes code out of the block:
+
+\def\docc@{%
+ \par\begingroup \skipspecials@ \let\docm@=\docm@i
+ \def\par{}\obeylines \catcode``=13 \@noligs \let\do\@makeother \dospecials
+ \@vobeyspaces \immediate\openout\thecode@=\jobname.tmp %
+ \def\docecho@{{\immediate\write\thecode@{\codeof\next}}}%
+ \def\docfinish@{\immediate\closeout\thecode@ \global\let\thedocmode@=\next
+ \endgroup\xyuncatcodes \csname DOCMODE\endcsname\thedocmode@}%
+ \docm@}
+
+\def\DOCHEADER{%
+ \numbercode@true \inputdoc0{\jobname.tmp}}
+
+% Sic.
+
+\let\W=\W@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% CROSS REFERENCES AND INDEXING AND SUCH
+
+% Use ?? as a cross reference code -- even in verbatim (because ? is excluded
+% from \dospecials in the header):
+
+% ?? <codes> [ <id> ]
+
+% will create a reference and/or label and/or index entry and possibly even
+% typeset <id>---what is done depends on <codes> that should be a sequence of
+% characters selected from the following:
+
+% ! typeset <id>
+% - do nothing*
+
+% : set PREFIX to <id> and do \mylabel{PREFIX:}*
+% = as \mylabel{PREFIX:<id>}*
+
+% ? as \myref{PREFIX:<id>}*
+% ^ \myref{PREFIX:<id>} lifted as superscript*
+% _ \myref{PREFIX:<id>} in \tinyrm font*
+% g global: set PREFIX to null temporarily
+
+% p as \mypageref{PREFIX:<id>}*
+
+% w as \index{<id>} for words
+% c as \index{\string<id>} for control sequences
+% C as \index{[\string<id>]} for modifiers etc
+
+% * as \mylinelabel{<id>}
+
+% If none of the <codes> letters was a *ed one then a \myref{PREFIX:<id>} is
+% added automatically (so ??[<id>] gives a simple reference).
+
+% NOTE: Use VERY PRIVATE names for *everything* because ??s may occur
+% *everywhere* !! Also before loading \Xy-pic because we need to bind ?.
+
+\def?{\relax\let\questchar@=\otherquest@ \futurelet\questnext@\quest@}
+\newif\ifquestdone@
+
+{\catcode`\%=\active
+ \gdef%{\let\questchar@=\otherpercent@ \futurelet\questnext@\quest@}}
+
+{\catcode`\?=12 \catcode`\%=12 \gdef\otherquest@{?}\gdef\otherpercent@{%}}
+
+\def\quest@{\ifx ?\questnext@ \def\questnext@?{\quest@@}%
+ \else \let\questnext@=\questchar@ \fi \questnext@}
+
+\def\quest@@#1[#2]{\relax\questdone@false
+ \let\questref@=\myref \let\questpageref@=\mypageref
+ \let\questecho@@=\relax \def\doquest@##1{{##1{#2}}}\quest@@@#1@}
+
+\def\quest@@@#1{\relax
+ \ifx @#1\def\questnext@{\ifquestdone@\else \doquest@\questref@ \fi}%
+ \else\ifx !#1\def\questnext@{\doquest@\questecho@@ \quest@@@}%
+ \else\ifx -#1\def\questnext@{\questdone@true \quest@@@}%
+ \else\ifx :#1\def\questnext@{\doquest@\questprefix \questdone@true \quest@@@}%
+ \else\ifx =#1\def\questnext@{\doquest@\mylabel \questdone@true \quest@@@}%
+ \else\ifx ?#1\def\questnext@{\doquest@\questref@ \questdone@true \quest@@@}%
+ \else\ifx g#1\def\questnext@{%
+ \let\questref@=\globalref \let\questpageref@=\globalpageref \quest@@@}%
+ \else\ifx ^#1\def\questnext@{\doquest@\liftedref@ \questdone@true \quest@@@}%
+ \else\ifx _#1\def\questnext@{\doquest@\mylineref \questdone@true \quest@@@}%
+ \else\ifx p#1\def\questnext@{\doquest@\questpageref@ \questdone@true
+ \quest@@@}%
+ \else\ifx w#1\def\questnext@{\doquest@\index \questdone@true \quest@@@}%
+ \else\ifx c#1\def\questnext@{\doquest@{\index code}\questdone@true
+ \let\questecho@@=\codeecho@ \quest@@@}%
+ \else\ifx C#1\def\questnext@{\doquest@{\index Code}\questdone@true
+ \let\questecho@@=\Codeecho@ \quest@@@}%
+ \else\ifx *#1\def\questnext@{\doquest@\mylinelabel \questdone@true \quest@@@}%
+ \else \def\questnext@##1{\xyerror@{\string?\string?\string##1 undefined}}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \questnext@}
+
+\def\liftedref@#1{$^{\hbox{\small\questref@{#1}}}$}
+
+\def\questprefix#1{\def\questprefix@@{#1}}
+\def\questprefix@@{}
+
+\def\codeecho@#1{\relax
+ \ifmmode\expandafter\hbox\fi{\DN@{#1}\tt\codeof\next@\unskip}}
+
+\def\Codeecho@#1{\relax
+ \ifmmode\expandafter\hbox\fi{\DN@{#1}\tt[\codeof\next@\unskip]}}
+
+% REPLACEMENT for LaTeX cross reference macros...using \codeof...
+
+\def\mylabel#1{\@bsphack \if@filesw {%
+ \expandafter\DN@\expandafter{\questprefix@@:#1}\let\thepage\relax
+ \def\protect{\noexpand\noexpand\noexpand}%
+\xdef\@gtempa{\write\@auxout{\string
+ \newlabel{\codeof\next@}{{\@currentlabel}{\thepage}}}}}\@gtempa
+ \if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack}
+
+\def\mylinelabel#1{\@bsphack \if@filesw {%
+ \expandafter\DN@\expandafter{\questprefix@@:#1}\let\thepage\relax
+ \def\protect{\noexpand\noexpand\noexpand}%
+\xdef\@gtempa{\write\@auxout{\string
+ \newlabel{\codeof\next@}{{l.\thelineno@}{\thepage}}}}}\@gtempa
+ \if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack}
+
+%Was:
+%\def\label#1{\@bsphack\if@filesw {\let\thepage\relax
+% \def\protect{\noexpand\noexpand\noexpand}%
+%\xdef\@gtempa{\write\@auxout{\string
+% \newlabel{#1}{{\@currentlabel}{\thepage}}}}}\@gtempa
+% \if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack}
+
+\def\myref#1{\expandafter\globalref\expandafter{\questprefix@@:#1}}
+
+\def\mylineref#1{\hbox{\tinyrm\questref@{#1}}}
+
+\def\globalref#1{\DN@{#1}%
+ \edef\next@{\codeof\next@}%
+ \@ifundefined{r@\next@}{{\bf \string?\string?}%
+ \@warning{Reference `\next@' on page \thepage\space undefined}}%
+ {\edef\@tempa{\@nameuse{r@\next@}}\expandafter
+ \@car\@tempa \@nil\null}}
+
+%Was:
+%\def\ref#1{\@ifundefined{r@#1}{{\bf ??}\@warning
+% {Reference `#1' on page \thepage \space
+% undefined}}{\edef\@tempa{\@nameuse{r@#1}}\expandafter
+% \@car\@tempa \@nil\null}}
+
+\def\mypageref#1{\expandafter\globalpageref\expandafter{\questprefix@@:#1}}
+
+\def\globalpageref#1{\DN@{#1}%
+ \edef\next@{\codeof\next@}%
+ \@ifundefined{r@\next@}{{\bf \string?\string?}%
+ \@warning{Reference `\next@' on page \thepage\space undefined}}%
+ {\edef\@tempa{\@nameuse{r@\next@}}\expandafter
+ \@cdr\@tempa \@nil\null}}
+
+%Was:
+%\def\pageref#1{\@ifundefined{r@#1}{{\bf ??}\@warning
+% {Reference `#1' on page \thepage \space
+% undefined}}{\edef\@tempa{\@nameuse{r@#1}}\expandafter
+% \@cdr\@tempa\@nil\null}}
+
+% \newlabel *is* redefined because LaTeX plays tricks with it at
+% \end{document}.
+
+\def\newlabel#1#2{\DN@{#1}\edef\next@{\codeof\next@}%
+% \@ifundefined{r@\next@}{}{\@warning{Label `#1' multiply defined}}%
+ \global\@namedef{r@\next@}{#2}}
+
+% Was:
+%\def\newlabel#1#2{\@ifundefined{r@#1}{}{\@warning{Label `#1' multiply
+% defined}}\global\@namedef{r@#1}{#2}}
+
+\def\@testdef #1#2#3{\DN@{#2}\edef\next@{\codeof\next@}%
+ \def\@tempa{#3}\expandafter \ifx \csname #1@\next@\endcsname
+ \@tempa \else \@tempswatrue \fi}
+
+% Was:
+%\def\@testdef #1#2#3{\def\@tempa{#3}\expandafter \ifx \csname #1@#2\endcsname
+% \@tempa \else \@tempswatrue \fi}
+
+% Here is our variant \index command: It is a hack...
+
+%Dummy eats pre-{} argument
+\def\index#1#{\@bsphack\begingroup \@sanitize\@index}
+
+%Real stuff uses pre-{} argument
+\def\@wrindex#1#{\csname @wrindex@#1\endcsname}
+
+\def\@wrindex@#1{\let\thepage\relax
+ \DNii@{#1}\edef\nextii@{\codeof\nextii@}\DN@{}%
+ \expandafter\futurelet\expandafter\next\expandafter\quoteidxentry@\nextii@ @%
+ \expandafter\futurelet\expandafter\next\expandafter\@wrindex@beautify\next@\@wrindex@beautify
+ \edef\next@{\codeof\next@}%
+ \edef\@tempa{\write\@indexfile{%
+% \string\indexentry{\expandafter\shavebackslash@\next@
+% \string @\next@}{\thepage}}}%
+ \string\indexentry{\expandafter\shavebackslash@\next@}{\thepage}}}%
+ \expandafter\endgroup\@tempa
+ \if@nobreak \ifvmode\nobreak\fi\fi \@esphack}
+
+\def\@wrindex@code#1{\let\thepage\relax
+ \DNii@{#1}\edef\nextii@{\codeof\nextii@}\DN@{}%
+ \expandafter\futurelet\expandafter\next\expandafter\quoteidxentry@\nextii@ @%
+ \edef\@tempa{\write\@indexfile{%
+ \string\indexentry{\expandafter\shavebackslash@\next@
+ \string @\string{\string}\string\verb\string"\string"\next@\string"\string"}{\thepage}}}%
+ \expandafter\endgroup\@tempa
+ \if@nobreak \ifvmode\nobreak\fi\fi \@esphack}
+
+\def\@wrindex@Code#1{\let\thepage\relax
+ \DNii@{[#1]}\edef\nextii@{\codeof\nextii@}\DN@{}%
+ \expandafter\futurelet\expandafter\next\expandafter\quoteidxentry@\nextii@ @%
+ \edef\@tempa{\write\@indexfile{%
+ \string\indexentry{\expandafter\shavebackslash@\next@
+ \string @\string{\string}\string\verb\string"\string"\next@\string"\string"}{\thepage}}}%
+ \expandafter\endgroup\@tempa
+ \if@nobreak \ifvmode\nobreak\fi\fi \@esphack}
+
+\def\filelinedef#1#2{\def\theindexfile{#1}\def\theindexline{#2}}
+
+\def\@wrindex@def#1{%
+ \DNii@{#1}\edef\nextii@{\codeof\nextii@}\DN@{}%
+ \expandafter\futurelet\expandafter\next\expandafter\quoteidxentry@\nextii@ @%
+ \edef\@tempa{\write\@indexfile{%
+ \string\indexentry{\expandafter\shavebackslash@\next@
+ \string @\string{\string}\string\verb\string"\string"\next@\string"\string"%
+ \string |seexyfile{\codeof\theindexfile}{\codeof\theindexline}}{\thepage}}}%
+ \expandafter\endgroup\@tempa
+ \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
+
+\expandafter\let\csname @wrindex@ def\endcsname=\@wrindex@def
+
+\def\shavebackslash@#1{\expandafter\ifx\otherescape#1\else#1\fi}
+
+\def\quoteidxentry@#1{\DNii@{\futurelet\next\quoteidxentry@}%
+ \ifx !#1\edef\next@{\next@\dq#1}%
+ \else\expandafter\ifx\otherat#1\edef\next@{\next@\dq#1}%
+ \else\expandafter\ifx\dq#1\edef\next@{\next@\dq#1}%
+ \else\expandafter\ifx\otherbar#1\edef\next@{\next@\dq#1}%
+ \else\expandafter\ifx\otherescape#1\edef\next@{\next@#1}%
+ \DNii@{\futurelet\next\quoteidxentry@escape}%
+ \else\ifx\space@\next\edef\next@{\next@\space}%
+ \DNii@{\futurelet\next\quoteidxentry@#1}%
+ \else\ifx#1@\let\nextii@=\relax
+ \else \edef\next@{\next@#1}\fi\fi\fi\fi\fi\fi\fi \nextii@}
+
+\def\quoteidxentry@escape#1{\DNii@{\futurelet\next\quoteidxentry@}%
+ \expandafter\ifx\otherbgroup#1\edef\next@{\next@\otherbgroup}%
+ \else\expandafter\ifx\otheregroup#1\edef\next@{\next@\otheregroup}%
+ \else\ifx\space@\next\edef\next@{\next@\space}%
+ \DNii@{\futurelet\next\quoteidxentry@#1}%
+ \else \DNii@{\quoteidxentry@#1}\fi\fi\fi \nextii@}
+
+{\catcode`\$=12 \catcode`\<=12 \catcode`\"=12
+ \gdef\@wrindex@beautify{%
+ \ifx $\next \let\next\@wrindex@extractdollar %$
+ \else\ifx <\next \let\next\@wrindex@extractsyntax
+ \else\ifx "\next \let\next\@wrindex@extractemph
+ \else \let\next\@wrindex@literal \fi\fi\fi \next}
+
+ \gdef\@wrindex@extractdollar$#1$#2\@wrindex@beautify{%
+ \def\next{#2}\ifx\next\empty \DN@{#1@$#1$}\fi}
+
+ \gdef\@wrindex@extractsyntax<#1>#2\@wrindex@beautify{%
+ \def\next{#2}\ifx\next\empty \DN@{#1@<#1>}\fi}
+
+ \gdef\@wrindex@extractemph""#1""#2\@wrindex@beautify{%
+ \def\next{#2}\ifx\next\empty \DN@{#1@\emph{#1}}\fi}}
+
+\def\@wrindex@literal#1\@wrindex@beautify{\DN@{#1@#1}}
+
+% Document format is two columns...
+
+\let\SAVEDmaketitle=\maketitle
+\def\maketitle{\begin{multicols}{2}[\SAVEDmaketitle]%
+ \renewenvironment{quotation}{\endgraf\noindent\ignorespaces}{\endgraf}%
+ \renewenvironment{figure}[1][]{\center\leavevmode}{\endcenter}%
+}
+
+% ...until the index where it changes to three columns!
+
+\def\INDEX{%
+ \end{multicols}
+ \let\PREINDEXtheindex=\theindex \let\PREINDEXendtheindex=\endtheindex
+ \renewenvironment{theindex}%
+ {\let\twocolumn=\beginmulticolsindex \let\onecolumn=\relax
+ \PREINDEXtheindex \addcontentsline{toc}{section}{Index}}%
+ {\PREINDEXendtheindex}
+ \xyinputorelse@@{\jobname.ind}{(no index yet)}%
+ \let\theindex=\PREINDEXtheindex \let\endtheindex=\PREINDEXendtheindex}
+
+\def\beginmulticolsindex[#1]{%
+ \global\let\PRETWOtheindex=\theindex
+ \global\let\PRETWOendtheindex=\endtheindex
+ \renewenvironment{theindex}{}{\aftergroup\finishmulticols}%
+ \begin{multicols}{3}[#1]\begin{theindex}}%
+
+\def\finishmulticols{\end{multicols}%
+ \global\let\theindex=\PRETWOtheindex
+ \global\let\endtheindex=\PRETWOendtheindex
+ \end{theindex}}
+
+\def\indexspace{\vspace{1ex}}
+\def\seexyfile#1#2#3{{\tt#1}:{\tinyrm#2}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Set page size to A4...with sligthly wider text when two columns
+
+\setlength{\oddsidemargin}{-1cm}
+\setlength{\evensidemargin}{-1cm}
+\setlength{\textwidth}{17cm}
+
+\setlength{\columnsep}{2pc}
+
+\setlength{\topmargin}{-1.4cm}
+\setlength{\headheight}{0.7cm}
+\setlength{\headsep}{0.7cm}
+\setlength{\textheight}{23.7cm}
+%\setlength{\footheight}{0.7cm}
+\setlength{\footskip}{1.1cm}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tracing auxiliary
+
+\def\notracingall{\tracingonline\z@\tracingcommands\z@\tracingstats\z@
+ \tracingpages\z@\tracingoutput\z@\tracinglostchars\z@
+ \tracingmacros\z@\tracingparagraphs\z@\tracingrestores\z@
+ \showboxbreadth5 \showboxdepth5}
+
+% Show bad boxes as plain TeX!
+
+\hbadness=1000
+
+% Show memory use!
+
+\tracingstats=1
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% RCS date...
+
+\def\printdate#1{\edef\next@{#1}\expandafter\printdate@\next@ @}
+\def\printdate@#1/#2/#3@{%
+ \ifcase#2\or January\or February\or March\or April\or
+ May\or June\or July\or August\or September\or October\or November\or
+ December\fi\space
+ \eatzero@#3, \ifnum100>#1\relax19\fi#1}
+\def\eatzero@#1{\ifx0#1\else#1\fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Font tables...from the standard testfont.tex:
+
+\newcount\m
+\newcount\n
+\newcount\p
+\newdimen\dim@
+\newif\ifskipping
+
+{\xycatcodes
+
+\gdef\fontfigure#1{%
+ \begin{figure}[tp]
+ {\font\testfont=#1 \testfont \fonttable}
+ \caption{Font table for \protect\texttt{#1}.}
+ \label{f.#1}
+ \end{figure}}
+
+\global\chardef\other=12
+\catcode`\"=\other
+
+\global\font\eighttt = cmtt8
+
+\gdef\twodigits#1{\ifnum #1<10 0\fi \number#1}
+
+\gdef\setbaselineskip{\setbox0=\hbox{\n=0
+\loop\char\n \ifnum \n<255 \advance\n 1 \repeat}
+\baselineskip=6pt \advance\baselineskip\ht0 \advance\baselineskip\dp0 }
+
+\gdef\setchar#1{{\escapechar-1\message{\string#1 character = }%
+ \def\do##1{\catcode`##1=\other}\dospecials
+ \read-1 to\next
+ \expandafter\finsetchar\next\next#1}}
+\gdef\finsetchar#1#2\next#3{\global\chardef#3=`#1
+ \ifnum #3=`\# \global\chardef#3=#2 \fi}
+\gdef\promptthree{\setchar\background
+ \setchar\starting \setchar\ending}
+
+\gdef\oct#1{\hbox{\rm\'{}\kern-.2em\it#1\/\kern.05em}} % octal constant
+\gdef\hex#1{\hbox{\rm\H{}\tt#1}} % hexadecimal constant
+\gdef\setdigs#1"#2{\gdef\h{#2}% \h=hex prefix; \0\1=corresponding octal
+ \m=\n \divide\m by 64 \xdef\0{\the\m}%
+ \multiply\m by-64 \advance\m by\n \divide\m by 8 \xdef\1{\the\m}}
+\gdef\testrow{\setbox0=\hbox{\penalty 1\def\\{\char"\h}%
+ \\0\\1\\2\\3\\4\\5\\6\\7\\8\\9\\A\\B\\C\\D\\E\\F%
+ \global\p=\lastpenalty}} % \p=1 if none of the characters exist
+\gdef\oddline{\cr
+ \noalign{\nointerlineskip}
+ \multispan{19}\hrulefill&
+ \setbox0=\hbox{\lower 2.3pt\hbox{\hex{\h x}}}\smash{\box0}\cr
+ \noalign{\nointerlineskip}}
+\gdef\evenline{\loop\skippingfalse
+ \ifnum\n<256 \m=\n \divide\m 16 \chardef\next=\m
+ \expandafter\setdigs\meaning\next \testrow
+ \ifnum\p=1 \skippingtrue \fi\fi
+ \ifskipping \global\advance\n 16 \repeat
+ \ifnum\n=256 \let\next=\endchart\else\let\next=\morechart\fi
+ \next}
+\gdef\morechart{\cr\noalign{\hrule\penalty5000}
+ \chartline \oddline \m=\1 \advance\m 1 \xdef\1{\the\m}
+ \chartline \evenline}
+\gdef\chartline{&\oct{\0\1x}&&\Ch@&&\Ch@&&\Ch@&&\Ch@&&\Ch@&&\Ch@&&\Ch@&&\Ch@&&}
+\gdef\chartstrut{\lower4.5pt\vbox to14pt{}}
+\gdef\fonttable{$$\global\n=0
+ \halign to\hsize\bgroup
+ \chartstrut##\tabskip0pt plus10pt&
+ &\hfil##\hfil&\vrule##\cr
+ \lower6.5pt\null
+ &&&\oct0&&\oct1&&\oct2&&\oct3&&\oct4&&\oct5&&\oct6&&\oct7&\evenline}
+\gdef\endchart{\cr\noalign{\hrule}
+ \raise11.5pt\null&&&\hex 8&&\hex 9&&\hex A&&\hex B&
+ &\hex C&&\hex D&&\hex E&&\hex F&\cr\egroup$$\par}
+\gdef\Ch@{\setbox0=\hbox{\char\n}%
+ \ifdim\ht0>7.5pt\reposition
+ \else\ifdim\dp0>2.5pt\reposition\fi\fi
+ \box0\global\advance\n 1 }
+\gdef\reposition{\setbox0=\vbox{\kern2pt\box0}\dim@=\dp0
+ \advance\dim@ 2pt \dp0=\dim@}
+\gdef\centerlargechars{
+ \def\reposition{\setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% END OF DEFINITIONS
+
+\endinput
+
+$Log: xydoc.sty,v $
+Revision 3.7 1999/02/16 15:12:50 krisrose
+Interim release (Y&Y fonts now free).
+
+Revision 3.6 1998/03/06 01:28:05 krisrose
+Releasing (with Y&Y fonts).
+
+Revision 3.5 1997/05/29 22:46:43 krisrose
+Fixed "missing breaks" and tidied up documentation!
+
+Revision 3.4 1997/05/18 01:14:25 krisrose
+Essential bugfixes.
+
+Revision 3.3 1996/12/19 03:31:56 krisrose
+Maintenance release
+
+Revision 3.2 1995/09/19 18:22:27 kris
+Bug fix release.
+
+Revision 3.1 1995/09/05 20:31:32 kris
+Releasing!
+
+Revision 3.0 1995/07/07 20:14:21 kris
+Major release w/new User's Guide!
+
+Revision 2.14 1995/07/06 02:56:02 kris
+Buglets...
+
+Revision 2.13 1995/07/04 15:11:17 kris
+Ready to release v3?
+
+Revision 2.12 1994/10/25 11:34:25 kris
+Interim release just before v3 [works with AMS-LaTeX 1.2]...
+
+Revision 2.11 1994/07/05 10:37:32 kris
+Third 3beta release [bug fixes].
+Experimental graph feature included (for ECCT-94 presentation).
+
+Revision 2.10 1994/06/15 12:55:07 kris
+Second 3beta release: bug fixes.
+
+Revision 2.9 1994/06/09 14:59:19 kris
+Release 3beta.
+
+Revision 2.8.3.8 1994/05/05 06:13:13 kris
+Compilation works and is documented.
+Matrix object outline bug fixed.
+
+Revision 2.8.3.7 1994/05/04 08:16:25 kris
+Also has option depedency list now.
+
+Revision 2.8.3.6 1994/05/04 07:14:13 kris
+Compiling matrices work :-) :-) !!
+
+Revision 2.8.3.5 1994/05/04 03:51:05 kris
+Efficient queueing *and* compilation of matrices *almost* there :-) !!
+
+Revision 2.8.3.4 1994/05/03 12:42:52 kris
+Compiling of matrices soon to follow :-) ...
+
+Revision 2.8.3.3 1994/05/03 11:01:35 kris
+Compiling to file finished in kernel...
+
+Revision 2.8.3.2 1994/05/03 07:37:06 kris
+Fiddling for 2.9...
+
+Revision 2.8.3.1 1994/04/19 08:15:02 kris
+Going on holiday...
+
+Revision 2.8.1.2 1994/04/13 11:44:13 kris
+PostScript update patch and various fixes...
+
+Revision 2.8 1994/04/08 04:30:00 kris
+Second (bug fix) 3alpha release.
+
+Revision 2.7.2.4 1994/03/28 10:58:05 kris
+Curve bugs fixed [Ross].
+Edge logic overhauled...still shaky?
+PostScript added and maybe working!
+
+Revision 2.7.2.3 1994/03/28 04:07:38 kris
+Holiday is over :-)
+
+Revision 2.7.2.2 1994/03/13 07:54:52 kris
+Bug fixes and @@ `map over stack'.
+
+Revision 2.7.2.1 1994/03/11 11:47:11 kris
+Documentation prettyfied.
+Stacks added.
+
+Revision 2.7.1.1 1994/03/10 05:26:53 kris
+Date format fixed.
+
+Revision 2.7 1994/03/08 02:06:01 kris
+Release 3alpha.
+
+Revision 2.6.9.1 1994/03/07 04:22:46 kris
+Last internal 3alpha and pre-2.7 release.
+
+NEW for Xy-pic version 2.7.
diff --git a/Master/texmf-dist/source/generic/xypic/xydocps.doc b/Master/texmf-dist/source/generic/xypic/xydocps.doc
new file mode 100644
index 00000000000..10d8ef21835
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xydocps.doc
@@ -0,0 +1,34 @@
+%% $Id: xydocps.doc,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+%%
+%% Xy-pic ``PostScript Dictionary creation'' template file.
+%% Copyright (c) 1993-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+
+\input xy
+\xyoption{ps}
+\xyoption{dvips}
+\xyoption{color}
+\xyoption{line}
+\xyoption{rotate}
+
+\xyReloadDrivers
+\dumpPSdict{xyREPLACEWITHSHORTVERSIONdict.pro}
+
+\bye
diff --git a/Master/texmf-dist/source/generic/xypic/xydummy.doc b/Master/texmf-dist/source/generic/xypic/xydummy.doc
new file mode 100644
index 00000000000..d6f644f8d87
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xydummy.doc
@@ -0,0 +1,97 @@
+%% $Id: xydummy.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+%%
+%% Xy-pic ``Dummy'' option.
+%% Copyright (c) 1993-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{dummy}{Dummy option}{\stripRCS$Revision: 3.3 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This option is provided as a template for new options, it provides
+ neither features nor extensions but it does count how many times it
+ is requested.
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Even though the option does nothing it still has a standard \Xy-pic
+ header:
+
+\DOCHEADER
+
+ Next follows two declarations that are used to count the number of
+ invocations:
+
+\DOCMODE(
+\xynew@{count}\xydummyrequires@@
+\DOCMODE)
+
+ This is used by the option to output a message every time it is
+ loaded with |\xyoption| or |\xyrequire|:
+
+\DOCMODE(
+\xyeveryrequest{dummy}{\global\advance\xydummyrequires@@\@ne
+ \W@{The `dummy' option was used \the\xydummyrequires@@\space times!}}
+\DOCMODE)
+
+ (|\W@| is an \Xy-pic primitive that outputs its argument.)
+
+ Then the option ends:
+
+\DOCMODE(
+\xyendinput
+\DOCMODE)
+
+ Finally |xydummy.doc| is maintained using RCS and thus contains the
+ following revision log:
+
+\DOCMODE(
+% $Log: xydummy.doc,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% NEW file to go in version 2.7!
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xydvidrv.doc b/Master/texmf-dist/source/generic/xypic/xydvidrv.doc
new file mode 100644
index 00000000000..de533801865
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xydvidrv.doc
@@ -0,0 +1,98 @@
+%% $Id: xydvidrv.doc,v 3.3 1996/12/18 09:12:40 ross Exp $
+%%
+%% Xy-pic ``dvidrv-driver'' option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{dvidrv}{dvidrv driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This driver provides support for the ``emtex'' |\special| commands, when
+using one of the standard dvi-drivers: |dvidot|, |dvihplj|, |dvimsp|,
+|dviscr| or |dvivik|, that come with Eberhard Mattes' em-\TeX\ distribution.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\paragraph*{Driver installation}
+\DOCMODE(
+\xydef@\dvidrv@@#1{\dvimessage@{dvidrv}{#1}}
+
+\newdriver{%
+ \xyaddsupport{emtex}\dvidrvEmTeX@@
+ \xyaddsupport{line}\dvidrvLine@@
+}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Supported |\special| effects are...
+%
+\begin{itemize}
+
+\item em-\TeX\ line-drawing |\special|s.
+\DOCMODE(
+\xydef@\dvidrvEmTeX@@{\dvidrvEmTeX@}%
+\xydef@\dvidrvEmTeX@{\setupxyEMTeX@}%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item variable line-widths % and poly-lines.
+\DOCMODE(
+\xydef@\dvidrvLine@@{\dvidrvLine@}%
+\xydef@\dvidrvLine@{\xywithoption{emtex}{\installEMline@}}%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{itemize}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xydvidrv.doc,v $
+% Revision 3.3 1996/12/18 09:12:40 ross
+% no changes
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+%
+% NEW for version 3.1
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xydvips.doc b/Master/texmf-dist/source/generic/xypic/xydvips.doc
new file mode 100644
index 00000000000..fa08fa7b7f2
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xydvips.doc
@@ -0,0 +1,329 @@
+%% $Id: xydvips.doc,v 3.3 1996/12/18 09:13:14 ross Exp $
+%%
+%% Xy-pic ``dvips-driver'' option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{dvips}{DVIPS driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This driver provides support for "all extensions" when using the \dvips\
+driver by Tomas Rokicki~\cite{dvips}. It has been tested with dvips
+version~5.55a and dvipsk version~5.58f.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\paragraph*{Driver installation}
+\DOCMODE(
+\xydef@\dvips@@#1{\dvimessage@{dvips}{#1}}
+
+\newdriver{%
+ \xyaddsupport{color}\dvipsColor@@
+ \xyaddsupport{crayon}\dvipsCrayola@@
+ \xyaddsupport{ps}\dvipsPS@@
+ \xyaddsupport{rotate}\dvipsRotate@@
+ \xyaddsupport{line}\dvipsLine@@
+ \xyaddsupport{frame}\dvipsFrames@@
+ \xyaddsupport{tile}\dvipsTiles@@
+ \xyaddsupport{tpic}\dvipsTPIC@
+ \xyaddsupport{emtex}\dvipsEM@
+ \xyaddsupport{cmtip}\relax
+}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Supported |\special| effects are...
+%
+\begin{itemize}
+
+\item colour, using direct color specials and \PS.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+DVIPS uses the colour-stack method, due to Tomas Rokicki.
+
+\DOCMODE(
+\xydef@\dvips@Color@{\dvipsPStypes@
+ \let\xylocalColor@=\xystackcolor@
+ \let\xycolor@push\xycolor@push@@
+ \def\xycolor@{\xycolor@@}\let\xycolorwarning@=\relax
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}\installPScolor@ }%
+ \else\DN@{}\fi \next@
+ \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi
+ \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\dvipsCrayola@{}}%
+ \else \DN@{\xystandardcolors@}\fi \next@
+ \let\dvipsColor@@=\relax
+ \let\UnloadColor@@=\NoDVIPScolor@
+ }%
+
+\xydef@\dvipsColor@@{\dvips@Color@}
+
+\xydef@\NoDVIPScolor@{%
+ \def\xycolor@{\xycolor@@}%
+ \let\xycolor@@=\xyNoColor@
+ \let\xylocalColor@=\xyNoColor@@
+ \let\xycolorwarning@=\xycolorwarning@@
+ \let\dvipsColor@@=\dvips@Color@
+ \let\UnloadColor@@=\UnloadColor@
+ }
+\DOCMODE)
+
+If neither support file |colordvi.tex| nor |colordvi.sty| can be found,
+then the normal colour support will not be available. However the colour
+support for the \PS\ back-end can still be used.
+
+\DOCMODE(
+\xydef@\NoDVIPScolordvi@{\xywarning@{%
+ Neither colordvi.tex nor colordvi.sty could be found.}%
+ \xyBEcolorcheck@}%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item crayon colours.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The 68 colours that |dvips| recognizes by name are not loaded unless the
+|crayon| option has been requested.
+
+\DOCMODE(
+\xydef@\dvipsCrayola@@{\dvipsColor@@\dvipsCrayola@}
+
+\xydef@\dvipsCrayola@{%
+ \let\prevxycolor@=\newxycolor@
+ \def\newxyDVIPScolor@##1##2##3{\prevxycolor@{##1}{}{##1}}%
+ \let\newxycolor@=\newxyDVIPScolor@ \dvipsInclude@{color.pro}%
+% \xyinputorelse@{colordvi.tex}%
+% {\NoDVIPScolordvi@\let\newxycolor@=\prevxycolor@}%
+ \installCrayolaColors@
+ \let\newxycolor@=\prevxycolor@ }%
+\DOCMODE)
+
+Although any order of loading options: |ps|, |dvips|, |color| and |crayon|
+produces the desired result visually, the \PS\ code can be different
+with different loading order. The most easily readable is obtained when
+|crayon| is requested last.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \PS\ back-end.
+\DOCMODE(
+\xydef@\dvipsPS@@{\dvipsPS@}
+
+\xydef@\dvipsPS@unload{\UnloadPS@
+ \let\UnloadPS@@=\UnloadPS@
+ \let\dvipsPS@@=\dvipsPS@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+|dvips| has three kinds of \PS\ |\special| which can be used.
+These may be used with various features other than just the \PS\ backend.
+
+\DOCMODE(
+\xydef@\dvipsPStypes@{%
+ \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \ifx\PSspecial@@\dvipsSpecial@\else
+ \let\PSspecial@@=\dvipsSpecial@
+ \let\PSmacro@@=\dvipsMacro@
+ \let\PSdict@@=\dvipsDict@
+ \let\PSspecialdict@@=\dvipsDict@
+ \let\PSraw@@=\dvipsRaw@
+ \let\PSinclude@@=\dvipsInclude@
+ \let\xyPSobeylines@@=\obeyDVIPSlines@
+ \let\xyPScurrpt@@=\dvipsCurrpt@@
+ \dvips@@{PostScript}%
+ \fi
+% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \XYpredict@ }
+
+\xywarnifdefined\dvipsSpecial@
+\xywarnifdefined\dvipsMacro@
+\xywarnifdefined\dvipsDict@
+\xywarnifdefined\dvipsInclude@
+\xywarnifdefined\dvipsRaw@
+{\catcode`\"=11 \catcode`\!=11 \catcode`\:=11
+ \gdef\dvipsSpecial@#1{\special{ps:: SDict begin #1 end}}
+ \gdef\dvipsMacro@#1{\firstPS@@\special{" {#1}xy}}
+% \gdef\dvipsDict@#1{\special{! mark{#1}stopped cleartomark}}
+ \gdef\dvipsDict@#1{\special{! #1}}
+ \gdef\dvipsInclude@#1{\special{header=#1}}
+ \gdef\dvipsRaw@#1{\special{ps: SDict begin #1 end}}
+
+\catcode`\^^M=\active %
+ \gdef\next{\catcode`\^^M=\active \let^^M=\space }}%
+\xylet@\obeyDVIPSlines@=\next
+\DOCMODE)
+
+All the \PS\ definitions passed to |dvips| by reading the
+dictionary file are stored in a \PS\ dictionary which it defines,
+called |SDict|. This must be the current dictionary whenever an \Xy-ps
+command is to be executed.
+This will be the case whenever the |\special{" |{\it commands}|}| or
+|\special{! |{\it commands}|}| forms are used, but not when the
+|\special{ps:: |{\it commands}|}| form is used.
+Thus the |\dvipsSpecial@| macro includes code to open |SDict| and
+close it when finished; so also does the |\dvipsRaw@| type, since this
+is used with \Xy-pic\ \PS\ operators whose definitions have been placed
+within |SDict|.
+
+The |currentpoint| is defined for the ``raw'' specials.
+
+\DOCMODE(
+\xydef@\dvipsCurrpt@{\let\xyPScurrpt@@=\dvipsCurrpt@@}%
+\xydef@\dvipsCurrpt@@{\PSraw@@{xyp}}
+\DOCMODE)
+
+The \PS\ operator called |xyp| is defined in |xyps-ps| for storing the
+location read from |currentpoint|.
+
+\medskip
+
+This installs the \PS\ backend.
+
+\DOCMODE(
+\xydef@\dvipsPS@{\dvipsPStypes@
+ \let\dvipsPS@@=\PSspecials@true
+ \let\UnloadPS@@=\dvipsPS@unload
+ \let\installxyps@@=\relax \installxyps@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item rotated/scaled diagrams and text, using \PS.
+\DOCMODE(
+\xydef@\dvipsRotate@@{\dvipsRotate@}
+
+\xydef@\dvipsRotate@{\dvipsPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
+ \dvipsCurrpt@ \dvipsRotScale@ \installPSrotscale@ }%
+ \else\DN@{\xydriverfail@{rotations are}UnloadRotate@\relax}\fi
+ \next@ }
+
+\xydef@\dvipsRotScale@{%
+ \def\xyrot@start(##1){{xyct ##1\space xyrs }}%
+ \def\xyrot@end{}%
+ \def\xyscale@start(##1,##2){{xyct ##1\space##2\space xyss }}%
+ \def\xyscale@end{}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item variable line-widths and poly-lines, using \PS.
+\DOCMODE(
+\xydef@\dvipsLine@@{\dvipsLine@}
+
+\xydef@\dvipsLine@{\dvipsPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
+ \else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item extra frames and fills, using \PS.
+\DOCMODE(
+\xydef@\dvipsFrames@@{\dvipsFrames@}
+
+\xydef@\dvipsFrames@{\dvipsPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
+ \else\DN@{\xydriverfail@{frames are}\UnloadFrames@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item patterns and tiles, using \PS.
+\DOCMODE(
+\xydef@\dvipsTiles@@{\dvipsTiles@}
+
+\xydef@\dvipsTiles@{\dvipsPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@ }%
+ \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \TPIC\ drawing commands.
+\DOCMODE(
+\xydef@\dvipsTPIC@@{\dvipsTPIC@}
+\xydef@\dvipsTPIC@{\setupxyTPIC@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item em-\TeX\ drawing commands.
+\DOCMODE(
+\xydef@\dvipsEM@@{\dvipsEM@}
+\xydef@\dvipsEM@{\setupxyEMTeX@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{itemize}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xydvips.doc,v $
+% Revision 3.3 1996/12/18 09:13:14 ross
+% minor improvements to file-loading commands
+%
+% Revision 3.2 1995/09/19 18:20:20 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xydvitops.doc b/Master/texmf-dist/source/generic/xypic/xydvitops.doc
new file mode 100644
index 00000000000..c6e0c0a6423
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xydvitops.doc
@@ -0,0 +1,346 @@
+%% $Id: xydvitops.doc,v 3.3 1996/12/18 09:14:36 ross Exp $
+%%
+%% Xy-pic ``DVITOPS-driver'' option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{dvitops}{DVITOPS driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\DVITOPS{{\sc dvitops}}
+This file provides support for the \DVITOPS\ driver by James
+Clark. As of September 1995, it has not been fully tested.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE(
+\xydef@\dvitops@@#1{\dvimessage@{DVITOPS}{#1}}
+
+\newdriver{%
+ \xyaddsupport{color}\dvitopsColor@@
+ \xyaddsupport{crayon}\dvitopsCrayon@@
+ \xyaddsupport{ps}\dvitopsPS@@
+ \xyaddsupport{rotate}\dvitopsRotate@@
+ \xyaddsupport{line}\dvitopsLine@@
+ \xyaddsupport{frame}\dvitopsFrames@@
+ \xyaddsupport{tile}\dvitopsTiles@@
+% \xyaddsupport{tpic}\dvitopsTPIC@@
+ \xyaddsupport{cmtip}\relax
+}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Supported |\special| effects are...
+%
+\begin{itemize}
+
+\item colour, using direct color specials for |gray|, |rgb| and |hsb| colour
+ models; and \PS\ colour within diagrams;
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DVITOPS\ has a method for using colours locally, however it only colours
+``regions'', which cannot be nested. To use this within \Xy-pic\
+diagrams would be just asking for trouble.
+
+\DOCMODE(
+\xydef@\dvitopsColor@@{\dvitops@Color@}
+
+\xydef@\dvitops@Color@{\dvitopsPStypes@
+ \let\xylocalColor@=\xyDVITOPScolor@
+ \let\xycolor@push\xycolor@push@@
+ \def\xycolor@{\xycolor@@}\let\xycolorwarning@=\relax
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}\xycatcodes
+ \installPScolor@ }\else\DN@{}\fi \next@
+ \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi
+ \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\dvitopsCrayon@{}}%
+ \else\let\next@=\xystandardcolors@
+ \fi \next@
+ \let\dvitops@Color@@=\relax
+ \let\UnloadColor@@=\NoDVITOPScolor@
+ }%
+
+\xydef@\NoDVITOPScolor@{%
+ \def\xycolor@{\xycolor@@}%
+ \let\xycolor@@=\xyNoColor@
+ \let\xylocalColor@=\xyNoColor@@
+ \let\xycolorwarning@=\xycolorwarning@@
+ \let\dvitops@Color@@=\dvitops@Color@
+ }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xyDVITOPScolor@{\bgroup \DN@##1##2{\egroup}%
+ \ifInvisible@\else\ifHidden@\else\DNii@{\no@@}\ifx\nextii@\Connect@@
+ \else\DN@{\xyDVITOPScolor@i}\fi\fi\fi \next@ }
+
+\xydef@\xyDVITOPScolor@i#1#2{\checkXyStyle@
+ \DN@{#2}\ifx\next@\empty
+ \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{#1}}}%
+ \else\DNii@{gray}\ifx\next@\nextii@
+ \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{gray}{#1}}}%
+ \else\DNii@{rgb}\ifx\next@\nextii@
+ \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{rgbcolor}{#1}}}%
+ \else\DNii@{hsb}\ifx\next@\nextii@
+ \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{hsbcolor}{#1}}}%
+ \else \DN@{\xywarning@{DVITOPS cannot support color: #2 #1}}%
+ \fi\fi\fi\fi
+ \toks@={\egroup \let\xy@style@=\relax \def\Drop@@}%
+ \expandafter\tmp@\expandafter{\Drop@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\next@}\def\Connect@@}%
+ \expandafter\tmp@\expandafter{\Connect@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\next@}}%
+ \the\toks@ }%
+
+\xydef@\xycolor@begin{\dvitopsBegin@{color}}
+\xydef@\xycolor@end{\dvitopsEnd@{color}\dvitopsColor@x}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item crayon colours.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The 68 colours are those that |dvips| recognizes by name,
+thanks to Tomas Rokicki.
+
+\DOCMODE(
+\xydef@\dvitopsCrayon@@{\dvitopsColor@@\dvitopsCrayon@}
+\xydef@\dvitopsCrayon@{\installCrayolaColors@}%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \PS\ back-end.
+\DOCMODE(
+\xydef@\dvitopsPS@@{\dvipsPS@}
+
+\xydef@\dvitopsPS@unload{\UnloadPS@
+ \let\UnloadPS@@=\UnloadPS@
+ \let\dvitopsPS@@=\dvitopsPS@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DVITOPS\ has two kinds of |\special| which can be used; `inline' and
+`prolog' for including header files. Also there are the `begin' and `end'
+types for defining regions.
+
+\DOCMODE(
+\xydef@\dvitopsPStypes@{%
+ \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \ifx\PSspecial@@\dvitopsSpecial@\else
+ \let\PSspecial@@=\dvitopsSpecial@
+ \let\PSmacro@@=\dvitopsMacro@
+ \let\PSdict@@=\dvitopsDict@
+ \let\PSspecialdict@@=\dvitopsDict@
+ \let\PSraw@@=\dvitopsRaw@
+ \let\PSinclude@@=\dvitopsInclude@
+ \let\xyPSobeylines@@=\obeyDVIPSlines@
+ \let\xyPScurrpt@@=\dvitopsCurrpt@@
+ \dvitops@@{PostScript}%
+ \fi
+% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \XYpredict@ }
+
+\xywarnifdefined\dvitopsSpecial@
+\xywarnifdefined\dvitopsMacro@
+\xywarnifdefined\dvitopsDict@
+\xywarnifdefined\dvitopsInclude@
+\xywarnifdefined\dvitopsRaw@
+\xywarnifdefined\dvitopsOrigin@
+\xywarnifdefined\dvitopsBegin@
+\xywarnifdefined\dvitopsEnd@
+\xywarnifdefined\dvitopsRotate@x
+\xywarnifdefined\dvitopsTransform@x
+\xywarnifdefined\dvitopsColor@x
+{\catcode`\:=11
+ \gdef\dvitopsSpecial@#1{\special{dvitops: inline #1}}
+ \gdef\dvitopsMacro@#1{\special{dvitops: inline {#1}xy}}
+ \gdef\dvitopsDict@#1{\special{dvitops: inline #1}}
+ \gdef\dvitopsInclude@#1{\special{dvitops: prolog #1}}
+ \gdef\dvitopsRaw@#1{\special{dvitops: inline #1}}
+%
+ \gdef\dvitopsOrigin@#1{\special{dvitops: origin #1}}
+ \gdef\dvitopsBegin@#1{\special{dvitops: begin #1}}
+ \gdef\dvitopsEnd@#1{\special{dvitops: end #1}}
+ \gdef\dvitopsRotate@x#1{\special{dvitops: rotate #1}}
+ \gdef\dvitopsTransform@x#1{\special{dvitops: transform #1}}
+ \gdef\dvitopsColor@x#1#2{\special{dvitops: #1 color #2}}
+}
+
+\catcode`\^^M=\active %
+ \gdef\next{\catcode`\^^M=\active \let^^M=\space }}%
+\xylet@\obeyDVIPSlines@=\next
+\DOCMODE)
+
+Rotations and transformations use a different mechanism, so |\xyPScurrpt@@|
+can be set to |\relax|.
+
+\DOCMODE(
+\xydef@\dvitopsCurrpt@{\global\let\xyPScurrpt@@=\relax}%
+\DOCMODE)
+
+\medskip
+
+This installs the \PS\ backend.
+
+\DOCMODE(
+\xydef@\dvitopsPS@{\dvitopsPStypes@
+ \let\installxyps@@=\relax \installxyps@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item rotated/scaled diagrams and text, using \DVITOPS\ specials;
+ however these may not be nested.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\dvitopsRotate@@{\dvitopsRotate@}
+
+\xydef@\dvitopsRotate@{\dvitopsPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty
+ \DN@{\xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
+ \installDVITOPSrotate@ }%
+ \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
+ \next@ }
+
+\xydef@\dvitopsRotScale@{%
+ \def\xyrot@start{\dvitopsBegin@{rot}\dvitopsOrigin@{rot}}%
+ \def\xyrot@end(##1){\dvitopsEnd@{rot}\dvitopsRotate@x{##1}}%
+ \def\xyscale@start{\dvitopsBegin@{scal}\dvitopsOrigin@{scal}}%
+ \def\xyscale@end(##1,##2){%
+ \dvitopsEnd@{scal}\dvitopsTransform@x{##1 0 ##2 0}}%
+ }
+
+\xydef@\installDVITOPSrotate@{\installPSstyle@
+ \let\xyRotate@@=\dvitopsRotate@
+ \let\doSpecialRotate@@=\dvitopsSpecialRotate@
+ \let\xyscale@@=\dvitopsScale@
+ \dvitopsCurrpt@
+ \dvitopsRotScale@ \xyPSshapes@true }
+
+\xydef@\UnloadDVITOPSrotate@{\UnloadRotate@\relax}
+\DOCMODE)
+
+\DOCMODE(
+ \xydef@\dvitopsRotate@#1{\xyPSsplitPS@
+ {\dvitopsBegin@{rot}\dvitopsOrigin@{rot}}%
+ {\dvitopsEnd@{rot}\dvitopsRotate@x{#1}}}%
+
+ \xydef@\dvitopsScale@#1#2{\xyPSsplitPS@
+ {\dvitopsBegin@{scal}\dvitopsOrigin@{scal}}%
+ {\dvitopsEnd@{scal}\dvitopsTransform@x{#1 0 #2 0}}}
+
+ \xydef@\dvitopsSpecialRotate@#1@@{\dvitopsRotate@{#1}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item variable line-widths and poly-lines, using \PS.
+\DOCMODE(
+\xydef@\dvitopsLine@@{\dvitopsLine@}
+
+\xydef@\dvitopsLine@{\dvitopsPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
+ \else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item extra frames and fills, using \PS.
+\DOCMODE(
+\xydef@\dvitopsFrames@@{\dvitopsFrames@}
+
+\xydef@\dvitopsFrames@{\dvitopsPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
+ \else\DN@{\xydriverfail@{frames are}\UnloadFrames@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item patterns and tiles, using \PS\
+\DOCMODE(
+\xydef@\dvitopsTiles@{\dvitopsPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@ }%
+ \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \TPIC\ drawing commands.
+\DOCMODE(
+\xydef@\dvitopsTPIC@@{\dvitopsTPIC@}
+
+\xydef@\dvitopsTPIC@{\setupxyTPIC@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{itemize}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xydvitops.doc,v $
+% Revision 3.3 1996/12/18 09:14:36 ross
+% minor improvements to file-loading commands
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyemtex.doc b/Master/texmf-dist/source/generic/xypic/xyemtex.doc
new file mode 100644
index 00000000000..ce17198297f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyemtex.doc
@@ -0,0 +1,243 @@
+%% $Id: xyemtex.doc,v 3.3 1996/12/18 09:18:00 ross Exp $
+%%
+%% Xy-pic ``em-TeX'' back-end extension.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{emtex}{em-TeX backend}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Eberhard Matte's {em-\TeX} implementation provides a suite of |\special|
+commands to facilitate the drawing of lines, both on-screen and with various
+printing devices. This `back-end' extension allows the lines in \Xy-pic
+diagrams to be drawn using these methods.
+
+Note that this extension does not have to be used with {em-\TeX}. Better
+results may be obtained using the \PS\ back-end and \dvips\ <driver>, since
+a version of \dvips\ is available for em-\TeX. However, in particular for
+screen previewing purposes, it may be convenient to use this back-end.
+Furthermore note that \dvips\ is capable of supporting em-\TeX |\special|s.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+Once loaded using |\xyoption{emtex}|, with an appropriate <driver> also
+specified either already or subsequently, the following commands are
+available to turn the em-\TeX\ backend off/on.
+%
+\begin{defs}
+|\NoEMspecials| & turns off em-\TeX\ specials.\kern-50pt\cr
+|\UseEMspecials| & reinstates em-\TeX\ specials.\kern-30pt
+\end{defs}
+
+\DOCMODE(
+\xynew@{if}\ifEMspecials@
+\xydef@\UseEMspecials{\EMspecials@true}
+\xydef@\NoEMspecials{\EMspecials@false}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The |\special|s}
+
+\DOCMODE(
+\xydef@\xyemtex@lineto{\xyEM@special{lineto}}
+\xydef@\xyemtex@moveto{\xyEM@special{moveto}}
+\xydef@\xyemtex@line#1{\xyEM@special{line #1}}
+\xydef@\xyemtex@point#1{\xyEM@special{point #1}}
+\xydef@\xyemtex@pen#1{\addtostyletoks@{\xyEM@special{linewidth #1}}}
+\DOCMODE)
+
+These place the actual |\special|s and allow tracing:
+
+\DOCMODE(
+{\catcode`:=12 \gdef\next#1{\special{em:#1}}}
+\xylet@\xyEM@special=\next
+
+{\catcode`:=12 \gdef\next#1{%
+ \W@{EM:#1 (\the\X@p,\the\Y@p),(\the\X@c,\the\Y@c)}\special{em:#1}}}
+\xylet@\xyEM@noisy=\next
+
+\xydef@\NoisyEMTeX{\let\xyEM@special=\xyEM@noisy}
+\DOCMODE)
+
+Currently these are not used by \Xy-pic.
+
+\DOCMODE(
+%\xydef@\xyemtex@message#1{\xyEM@special{message #1}}
+%\xydef@\xyemtex@graph#1{\xyEM@special{graph #1}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{re-bindings}
+
+This is similar to the mechanism used by the \PS\ back-end to rebind
+``hooks'' to incorporate a switch according to the current value of
+|\ifEMspecials@|.
+
+\DOCMODE(
+\xydef@\EMalternative@#1#2{%
+\expandafter\global\expandafter\let\csname origxy#2@\endcsname=#1%
+ \xdef#1{\noexpand\ifEMspecials@
+ \noexpand\expandafter\expandafter\noexpand\csname xyemtex@#2@\endcsname
+ \noexpand\else
+ \noexpand\expandafter\expandafter\noexpand\csname origxy#2@\endcsname
+ \noexpand\fi}}%
+\DOCMODE)
+
+Allow only one instance of |\setupxyEM@|; thereafter simply do
+|\reloadxyEM@| to turn on anything that has been turned off.
+
+\DOCMODE(
+\xydef@\setupxyEMTeX@{\xywarning@{using em-TeX specials}%
+ \EMalternative@{\solid@}{solid}%
+% \EMalternative@{\point@}{point}%
+ \EMalternative@{\splinesolid@}{splinesolid}%
+ \let\setupxyEM@=\reloadxyEM@
+ \activateEM@ }
+
+\xydef@\xyunloadEM@{\xywarning@{EM specials turned off}%
+% \xywithoption{curve}{\xysetup@@\uninstallEMcurves@ }%
+ \xywithoption{line}{\xysetup@@\uninstallEMline@ }%
+% \xywithoption{frame}{\xysetup@@\uninstallEMframes@ }%
+ \EMspecials@false
+ \let\setupxyEM@=\reloadxyEM@ }
+
+\xydef@\activateEM@{%
+ \xywithoption{line}{\xysetup@@\installEMline@}%
+% \xywithoption{curve}{\xysetup@@\installEMcurves@}%
+% \xywithoption{frame}{\xysetup@@\installEMframes@}%
+ \EMspecials@true }
+
+\xydef@\reloadxyEM@{\xywarning@{EM specials back on}\activateEM@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{straight lines}
+
+\DOCMODE(
+\xydef@\xyemtex@solid@{%
+ \ifInvisible@ \let\next@=\no@@
+ \else \DN@{\xyEMstraight@}\fi
+ \next@ }
+
+\xydef@\xyEMstraight@{\setupDirection@
+ \edef\Creset@@{\cfromthec@ \pfromthep@ \DirectionfromtheDirection@}%
+ \DN@##1##2{\def\checkoverlap@@{%
+ \ifdim##1\X@p>##1\X@c \let\next@=\relax \fi
+ \ifdim##2\Y@p>##2\Y@c \let\next@=\relax \fi}}%
+ \edef\nextii@{{\sd@X}{\sd@Y}}\expandafter\next@\nextii@
+ \noCshavep@@ \edef\Cshavep@@{\pfromthep@ \noexpand\resetDirection@}%
+ \noCshavec@@ \edef\Cshavec@@{\cfromthec@ \noexpand\resetDirection@}%
+ \ifHidden@\else
+ \ifdim\Y@c>\Y@max \Y@max=\Y@c \fi \ifdim\Y@p>\Y@max \Y@max=\Y@p \fi
+ \ifdim\Y@c<\Y@min \Y@min=\Y@c \fi \ifdim\Y@p<\Y@min \Y@min=\Y@p \fi
+ \ifdim\X@c>\X@max \X@max=\X@c \fi \ifdim\X@p>\X@max \X@max=\X@p \fi
+ \ifdim\X@c<\X@min \X@min=\X@c \fi \ifdim\X@p<\X@min \X@min=\X@p \fi \fi
+ \ifInvisible@\let\next@=\relax \else
+ \DN@{%
+ \setboxz@h{\kern\X@p \raise\Y@p\hbox{\xyemtex@moveto}}%
+ \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ %
+ \setboxz@h{\boxz@ \kern\X@c \raise\Y@c\hbox{\xyemtex@lineto}}%
+ \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ {\Drop@@}}%
+ \fi
+ \checkoverlap@@
+ \ifdim\d@X=\z@ \ifdim\d@Y=\z@ \DN@{\relax}\fi\fi \next@
+ \def\Cslidep@@{\noCslidep@@}\def\Cslidec@@{\noCslidec@@}%
+ \def\Calong@@{\noCalong@@}\Creset@@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{spline curves}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+Of the curves defined in the |xycurve| extension, only solid spline curves
+are supported. This is done by treating the spline as a polygon (poly-line)
+with many segments.
+
+\DOCMODE(
+\xydef@\xyemtex@splinesolid@{\setbox\splinebox@=\copy\voidb@x
+ \multiply\splinetol@\thr@@
+ \gdef\splineextra@@{\xyemtex@moveto\gdef\splineextra@@{\xyemtex@lineto}}%
+ \def\xycrvdrop@{ }\def\xycrvconn@{}\splineset@@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{line width}
+
+\DOCMODE(
+\xydef@\xyEMlinewidth@#1{\dimen@=#1\relax\edef\next@{\the\dimen@}}
+
+\xydef@\installEMline@{%
+ \let\xylinewidth@@=\xylinewidth@
+ \let\xylineSpecial@@=\xyemtex@pen
+ \let\transxyline@@=\xyEMlinewidth@ }
+
+\xydef@\uninstallEMline@{\UnloadLine@\relax}%
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\UseEMlinewidth{\installEMline@}%
+\xydef@\NoEMlinewidth{\uninstallEMline@}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyemtex.doc,v $
+% Revision 3.3 1996/12/18 09:18:00 ross
+% fixed bug affecting line-widths
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyframe.doc b/Master/texmf-dist/source/generic/xypic/xyframe.doc
new file mode 100644
index 00000000000..7387f91163f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyframe.doc
@@ -0,0 +1,1213 @@
+%% $Id: xyframe.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Frames and Brackets'' extension.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{frame}{Frame and Bracket extension}{\stripRCS$Revision: 3.7 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The |frame| extension provides a variety of ways to puts frames in
+ \Xy-pictures.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The frames are \Xy-pic <object>s on the form
+%
+\begin{defs1}
+ ??c![\frm]|{| <frame> |}| \cr
+\end{defs1}
+\noindent\unskip
+%
+ to be used in <pos>itions: Dropping a frame with
+ |*|\dots|\frm{|<frame>|}| will frame the~$c$ object; connecting with
+ |**|\dots |\frm{|\dots<frame>|}| will frame the result of $c|.|p$.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{\Xy-pic interface}
+
+ The frames are integrated in \Xy-pic as <object>s as follows. They
+ generate a dummy object, then define the |\Drop@@| action to place
+ the requested frame. The |\Connect@@| operation is defined to place
+ the requested frame around the current "and" the previous object
+ (using the |\cmerge@| command of the kernel).
+
+\DOCMODE(
+\xydef@\frm{\hbox{}\dimen@=\L@c \advance\dimen@\R@c \wdz@=\dimen@
+ \ht\z@=\U@c \dp\z@=\D@c \dimen@=\U@c \advance\dimen@\D@c
+% \ifdim\wdz@=\z@ \def\Leftness@{0}\else \quotient@\Leftness@\L@c\wdz@ \fi
+% \ifdim\dimen@=\z@ \def\Upness@{0}\else \quotient@\Upness@\U@c\dimen@ \fi
+ \ifdim\wdz@=\z@ \def\Leftness@{.5}\else \quotient@\Leftness@\L@c\wdz@ \fi
+ \ifdim\dimen@=\z@ \def\Upness@{.5}\else \quotient@\Upness@\U@c\dimen@ \fi
+ \expandafter\Edge@c\expandafter{\prevEdge@@}\let\frmradius@@=\z@
+ \def\Drop@@{}%
+ \def\Connect@@{\xy@@{\save@\cmerge@\Y@p\X@p\D@p\U@p\L@p\R@p\Drop@@}\restore}%
+ \xyFN@\frm@i}
+
+\xylet@\frmradius@@=\z@
+
+\xydef@\frm@i{%
+ \addLT@\ifx\next \addGT@{\addLT@\DN@##1}{\def\frmradius@@{##1}\xyFN@\frm@i}%
+ \else \DN@##1##{\frm@{##1}}\fi \next@}
+\DOCMODE)
+
+ The main command is |\frm@| which looks up if a custom control
+ sequence is available for the requested frame or whether the generic
+ `curve along the edge' code should be invoked.
+
+\DOCMODE(
+\xydef@\frm@#1#2{\DNii@{frm#1{#2}}%
+ \expandafter\let\expandafter\next@\csname\codeof\nextii@\endcsname
+ \ifx\next@\relax \DNii@{frm{#2}}%
+ \expandafter\let\expandafter\next@\csname\codeof\nextii@\endcsname
+ \ifx\next@\relax \let\next@=\frm@generic \fi\fi \next@}
+
+\xydef@\frm@generic{\xyerror@{No generic frames yet!}{}}
+\DOCMODE)
+
+ This extra command is used to define |\Drop@@| for each frame such
+ that |\frmradius@@| is available.
+
+\DOCMODE(
+\xydef@\frmDrop@#1{%
+ \ifx\frmradius@@\z@ \addtoDrop@@{\let\frmradius@@=\z@ #1}%
+ \else \expandafter\addtoDrop@@\expandafter{%
+ \expandafter\def\expandafter\frmradius@@\expandafter{\frmradius@@}#1}\fi}
+
+\xydef@\EdgefromtheEdge@{%
+ \U@c=\the\U@c \D@c=\the\D@c \L@c=\the\L@c \R@c=\the\R@c
+ \Edge@c={\expandafter\noexpand\the\Edge@c}}
+\xydef@\prevEdgefromtheEdge@{%
+ \U@c=\the\U@c \D@c=\the\D@c \L@c=\the\L@c \R@c=\the\R@c
+ \noexpand\def\noexpand\prevEdge@@{\expandafter\noexpand\the\Edge@c}}
+
+\xydef@\addtoDrop@@#1{%
+ \expandafter\def\expandafter\Drop@@\expandafter{\Drop@@#1}}
+\xydef@\addbeforeDrop@@#1{\DNii@{#1}%
+ \expandafter\DN@\expandafter{\expandafter\nextii@\Drop@@}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\Drop@@
+ \expandafter\expandafter\expandafter{\next@}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Below we distinguish between `ordinary' frames, `brackets' and
+ `fills'; last we present how some frames can be added to other
+ objects using object modifier <shape>s.
+
+\begin{figure*}[p]
+\vfill
+$$
+%
+ \newcount\R \newcount\C
+ \def\n{\advance\R1 \C0 \POS(\R,\C)}
+ \def\F#1#2#3{\advance\C1 \def\1{#1}\def\3{#3}%
+ \POS(\R,\C)*+\txt{Framed with\\\tt\string\frm\codeof\1\\frame%
+ \ifx\3\empty\else ??^[#3]\relax\fi}*\frm#1*\frm{#2}}
+%
+\R0 \C0 \xy
+ %
+ \POS 0;<0cm,-1.7cm>:<3.2cm,0cm>:: \relax
+ \F{{}}{}{dummy} \F{{.}}{}{rect} \F{<44pt>{.}}{}{rect}
+ %
+ \n\F{{-}}.{rect}="top"\F{<8pt>{-}}.{rect} \F{<44pt>{-}}.{rect}
+ \n\F{{=}}.{rect} \F{<8pt>{=}}.{rect} \F{<44pt>{=}}.{rect}
+ \n\F{{--}}.{rect} \F{{o-}}.{rect} \F{<44pt>{--}}.{rect}
+ \n\F{{,}}.{shade} \F{<5pt>{,}}.{shade} \F{{-,}}.{shade}
+ \n\F{{o}}.{circ} \F{<8pt>{o}}.{circ} \F{{.o}}.{circ}
+ \n\F{{oo}}.{circ} \F{<8pt>{oo}}.{circ} \F{{-o}}.{circ}
+ \n\F{{e}}.{ellip} \F{<20pt,8pt>{e}}.{ellip} \F{{.e}}.{ellip}
+ \n\F{{ee}}.{ellip} \F{<20pt,8pt>{ee}}.{ellip} \F{{-e}}.{ellip}="bot"
+ %
+% \n\POS+(0,1)*=<20pt,10pt>{}="5,0"*\frm{*}!CR!<\jot,0pt>
+% *!L{\leftarrow\txt{Framed with {\tt\string\frm\string{*\string}}
+% frame \dots\ should only be used\\for relatively small (and probably
+% empty) objects}}
+ %
+ \POS"top"."bot"!CL!<-2\jot,0pt>*\frm{\{}
+ *++!R\txt<2cm>{These are over\-layed with the
+ {\tt\string\frm\string{.\string}} frame
+ above to show the way they are centered
+ on the object}
+\endxy
+$$
+\caption{Plain \protect<frame>s.}
+??=[f.frm]
+%\vspace{3ex}
+\vfill
+$$
+%
+ \newcount\R \newcount\C
+ \def\n{\advance\R1 \C0 \POS(\R,\C)}
+ \def\F#1#2#3{\advance\C1 \def\1{#1}\def\3{#3}%
+ \POS(\R,\C)*+\txt{Framed with\\\tt\string\frm\codeof\1\\frame%
+ \ifx\3\empty\else ??^[#3]\relax\fi}*\frm#1*\frm{#2}}
+%
+\R0 \C0 \xy
+ %
+ \POS 0;<0cm,-1.7cm>:<3.2cm,0cm>:: \relax
+ \n\F{{_\}}}.{braces} \F{{^\}}}.{braces} \F{{\{}}.{braces} \F{{\}}}.{braces}
+ \n\F{{_)}}.{paren} \F{{^)}}.{paren} \F{{(}}.{paren} \F{{)}}.{paren}
+ %
+\endxy
+$$
+\caption{Bracket \protect<frame>s.}
+??=[f.bfrm]
+\vfill
+\end{figure*}
+
+
+\subsection{Frames}
+??=[frames]
+
+ Figure~??[f.frm] shows the possible frames and the applicable
+ <modifier>s with reference to the notes below.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notes}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[dummy]
+
+ The |\frm{}| frame is a dummy useful for not putting a frame on
+ something, \eg, in macros that take a <frame> argument.
+
+\DOCMODE(
+\xydefcsname@{frm{}}{}
+\xyletcsnamecsname@{frm[]{}}{frm{}}
+\xyletcsnamecsname@{frm[o]{}}{frm{}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[rect]
+
+ "Rectangular" frames include |\frm{.}|, |\frm{-}|, |\frm{=}|,
+ |\frm{--}|, |\frm{==}|, and |\frm{o-}|. They all make rectangular
+ frames that essentially trace the border of a rectangle-shaped
+ object.
+
+ The <frame>s |\frm{-}| and |\frm{=}| allow an optional "corner
+ radius" that rounds the corners of the frame with quarter circles of
+ the specified radius. This is not allowed for the other frames---the
+ |\frm{o-}| frame always gives rounded corners of the same size as the
+ used dashes (when |\xydashfont| is the default one then these are
+ |5pt| in radius).
+
+\begin{exercise}
+%
+ How do you think the author typeset the following?
+%
+\begin{code}
+\xy
+ (0,0) *++={A} *\frm{o} ;
+ (10,7) *++={B} *\frm{o} **\frm{.}
+\endxy
+\end{code}
+$$\docode$$
+%
+\answertext{Here is how:}
+\answercode
+\answertext\displaycode
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The commands still hack away with rules and stuff\dots
+
+ |\frm{.}| just fills the edges of the object rectangle border with
+ dots using dots as in dotted connections in the kernel.
+
+\DOCMODE(
+\xydefcsname@{frm{.}}{\frmDrop@{\let\zerocorner=\framezerodot@@
+ \let\framehfill=\frm@doth@@ \let\framevfill=\frm@dotv@@
+ \framed@@{\frmradius@@}}}
+
+\xyletcsnamecsname@{frm[]{.}}{frm{.}}
+
+\xydef@\frm@doth@@{\setboxz@h{\kern5\B@\framezerodot@@\kern5\B@}\ht\z@=\B@
+ \dp\z@=\B@\kern5\B@\xleaders\boxz@\hss\kern5\B@}
+\xydef@\frm@dotv@@{\setboxz@h to2\B@{\hss\framezerodot@@\hss}\ht\z@=5\B@
+ \dp\z@=5\B@\kern5\B@\xleaders\boxz@\vss\kern5\B@}
+
+\xyletcsnamecsname@{frm{..}}{frm{.}}
+
+\xylet@\framezerodot@@=\zerodot
+\DOCMODE)
+
+ The |\frm|<variant>|{-}| and |\frm|<variant>|{=}| set a single/double
+ frame that just surrounds the current object; if a <radius> is given
+ then it should be a |<|<dimen>|>| where the <dimen> will be used for
+ the corner radius.
+
+ The commands for |\frm{-}| and |\frm{=}| are quite similar in that
+ they just call |\framed@| one or two times, respectively, with the
+ corner radius and $L,R,D,U$ extents reflecting the size of the frame.
+ |\framed@| then sets the horizontal and vertical fill commands to
+ generate rules of the right length, then calls |\framed@@| where the
+ real work is done.
+
+\DOCMODE(
+\xydefcsname@{frm{-}}{\frmDrop@{\framed@\frmradius@@}}
+\xyletcsnamecsname@{frm[]{-}}{frm{-}}
+
+\xydef@\framed@{\let\zerocorner=\framezerodot@@
+ \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@ \framed@@}
+
+\xylet@\framesetthick@=\relax
+
+\xydef@\frm@solidh@@{\framesetthick@\leaders\hrule height\B@ depth\B@\hfill}
+\xydef@\frm@solidv@@{\framesetthick@\leaders\vrule width2\B@\vfill}
+
+\xydefcsname@{frm{=}}{\frmDrop@{\framed@\frmradius@@
+ {\advance\L@c-2\p@ \advance\R@c-2\p@ \advance\U@c-2\p@ \advance\D@c-2\p@
+ \dimen@=\frmradius@@
+ \ifdim\dimen@>2\p@ \advance\dimen@-2\p@ \else \dimen@=\z@\fi
+ \framed@\dimen@}}}
+
+\xyletcsnamecsname@{frm[]{=}}{frm{=}}
+\DOCMODE)
+
+ When the line extension is also loaded then we use the line thickness
+ for frames:
+
+\DOCMODE(
+\xydef@\framesetthick@line{\B@=.5\xylinethick@}
+
+\xydef@\frm@thickc@@{\hbox{\framesetthick@line
+ \vrule height.5\B@ depth.5\B@ width\B@}}
+
+\xywithoption{line}{%
+ \let\framezerodot@@\frm@thickc@@ \let\framesetthick@=\framesetthick@line}
+\DOCMODE)
+
+ |\framed@@| is where we build a box with the sides of the frame
+ displaced appropriately. \TODO{Generalise this to handle any
+ directional!}
+
+\DOCMODE(
+% Procedure:
+% %0 setup hrulefill and vrulefill as apropriate...
+% %1 Lower R to be less than half of both (U+D) and (L+R).
+% %2 Start vbox at (X-L,Y-D) except center overshoot.
+% %3 Generate corner CO4 at R; w[\A@] := -1/2 width(corner);
+% r[\B@] := 1/2 rulewidth; h[\dimen@ii] := U+D+2w;
+% %4 Row 1: hbox to W{kern w CO4 hrulefill CO3 kern w}.
+% %5 Row 2: hbox to W{kern-r vbox to h{vrulefill}
+% hfill vbox to h{vrulefill} kern-r}.
+% %6 Row 3: hbox to W{kern w CO1 hrulefill CO2 kern w}.
+
+\xydef@\framed@@#1{\setboxz@h{\R@=#1\relax
+ \dimen@=\L@c \advance\dimen@\R@c \dimen@ii=\U@c \advance\dimen@ii\D@c %1
+ \ifdim.5\dimen@<\R@ \R@=.5\dimen@ \fi
+ \ifdim.5\dimen@ii<\R@ \R@=.5\dimen@ii \fi
+ \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c %2
+ \ifdim\R@<\p@\else \cirrestrict@@ \fi
+ \dimen@=2\R@ \advance\dimen@-\L@c \advance\dimen@-\R@c
+ \ifdim\dimen@>\z@ \advance\A@-.5\dimen@ \fi
+ \dimen@=2\R@ \advance\dimen@-\U@c \advance\dimen@-\D@c
+ \ifdim\dimen@>\z@ \advance\B@-.5\dimen@ \fi
+ \kern\A@ \raise\B@\vbox to \dimen@ii{\framed@body@@}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
+
+\xydef@\framed@body@{%
+ \advance\dimen@ii.22\p@ \advance\dimen@-.2\p@
+ \setboxz@h{\corn@@4\R@}\A@=-.5\wdz@ \B@=.5\xydashw@ %3
+ \dimen@=\L@c \advance\dimen@\R@c \advance\dimen@-.2\p@
+ \setboxz@h to\dimen@{\kern\A@ \boxz@ \framehfill\corn@@3\R@\kern\A@}%4
+ \advance\dimen@ii-\dp\z@ \kern-\ht\z@ \nointerlineskip\boxz@
+ \dimen@=\L@c \advance\dimen@\R@c \advance\dimen@-.2\p@
+ \setboxz@h to\dimen@{\kern\A@\corn@@1\R@\framehfill\corn@@2\R@\kern\A@}%6
+ \advance\dimen@ii-\ht\z@
+ \dimen@=\L@c \advance\dimen@\R@c \advance\dimen@.2\p@
+ \nointerlineskip\hbox to\dimen@{% %5
+ \setbox\z@=\vbox to\dimen@ii{\framevfill}\kern-.5\wdz@\copy\z@
+ \hss \copy\z@\kern-.5\wdz@ }%
+ \nointerlineskip\boxz@ \vss \kern\z@}
+
+\xylet@\framed@body@@=\framed@body@
+
+\xylet@\zerocorner=\framezerodot@@
+
+\xydef@\solidcorner@#1#2{\hbox\bgroup \R@=#2\relax
+ \ifdim\R@<\p@ \zerocorner
+ \else \cirrestrict@@ \multiply\count@8 %
+ \setboxz@h{\corn@x@@{#1}}\dimen@=\wdz@
+ \ifcase#1\or \ht\z@=\z@ \kern\dimen@ \raise\dimen@\boxz@
+ \or \ht\z@=\z@ \raise\dimen@\boxz@ \kern\dimen@
+ \or \dp\z@=\z@ \lower\dimen@\boxz@ \kern\dimen@
+ \or \dp\z@=\z@ \kern\dimen@ \lower\dimen@\boxz@ \fi
+ \vrule height\dimen@ depth\dimen@ width\z@\fi
+ \edef\tmp@{\egroup \U@c=\the\dimen@}\tmp@ \D@c=\U@c \L@c=\U@c \R@c=\U@c
+ \Edge@c={\circleEdge}\ignorespaces}
+
+\xydef@\corn@x@#1{\ifcase#1\or
+ \circhar@@\z@ \circhar@@\@ne\or\circhar@@\tw@ \circhar@@3\or
+ \circhar@@5\circhar@@4\or\circhar@@7\circhar@@6\fi}
+
+\xylet@\corn@x@@=\corn@x@
+
+\xydef@\corn@@{\DN@{\solidcorner@}%
+ \ifx\framehfill\frm@doth@@ \DN@{\let\cirrestrict@@=\relax
+ \let\corn@x@@=\dotcorner@@ \let\zerodot=\framezerodot@@
+ \solidcorner@ }%
+ \else\ifx\framehfill\frm@dashh@@ \DN@{\let\cirrestrict@@=\relax
+ \let\corn@x@@=\dashcorner@@ \let\zerodot=\framezerodot@@
+ \solidcorner@ }%
+ \fi\fi \next@}
+
+\xydef@\dotcorner@@#1{\zerocorner}
+\xydef@\dashcorner@@#1{\zerocorner}
+
+\xywithoption{curve}{%
+ \let\dotcorner@@=\dotcorner@ \let\dashcorner@@=\dashcorner@}
+\DOCMODE)
+
+ The dashed frames `dash' with the dash used for dashed lines.
+
+\DOCMODE(
+\xydefcsname@{frm{--}}{%
+ \frmDrop@{\let\zerocorner=\framezerodot@@
+ \let\framehfill=\frm@dashh@@ \let\framevfill=\frm@dashv@@
+ \framed@@\frmradius@@}}
+
+\xyletcsnamecsname@{frm[]{--}}{frm{--}}
+
+\xydef@\frm@dashh@@{\setboxz@h{\dashhfillchar}%
+ \ht\z@=\B@ \dp\z@=\B@ \wdz@=2\xydashl@
+ \copy\z@ \xleaders\copy\z@\hss \boxz@\kern-\xydashl@}
+\xydef@\frm@dashv@@{\setboxz@h to2\B@{\hss\dashvfillchar\hss}\ht\z@=\z@
+ \dp\z@=2\xydashl@ \nointerlineskip\copy\z@ \xleaders\copy\z@\vss
+ \nointerlineskip\boxz@\kern-\xydashl@}%
+
+\xydef@\dashhfillchar{{\rDirection@\xydashl@ \line@@}}
+\xydef@\dashvfillchar{{\dDirection@\xydashl@ \line@@}}
+\DOCMODE)
+
+\BUG: Setting the corner-radius to less than 10pt has no effect when
+ using |\frm{o-}|; instead a default size of |.8\xydashl@| is used.
+
+\DOCMODE(
+\xydefcsname@{frm{o-}}{%
+ \ifdim\frmradius@@<2\xydashl@\relax \dimen@=.8\xydashl@
+ \expandafter\def\expandafter\frmradius@@\expandafter{\the\dimen@}\fi
+ \frmDrop@{\let\zerocorner=\framezerodot@@
+ \let\framehfill=\frm@rddashh@@ \let\framevfill=\frm@rddashv@@
+ \framed@@\frmradius@@}}%
+
+\xydef@\frm@rddashh@@{\setboxz@h{\kern\xydashl@\dashhfillchar}%
+ \ht\z@=\B@ \dp\z@=\B@ \copy\z@ \xleaders\copy\z@\hss \boxz@ \kern\xydashl@}
+\xydef@\frm@rddashv@@{\ifdim\dimen@ii<2\xydashl@\else
+ \setbox\z@=\vbox to2\xydashl@{\hbox to2\B@{\hss\dashvfillchar\hss}\vss}%
+ \kern\xydashl@ \copy\z@ \xleaders\copy\z@\vss
+ {\ifdim\dimen@ii<2\xydashl@\else\aftergroup\boxz@\fi}\fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[shade]
+
+ The frame |\frm{,}| puts a shade, built from rules, into the picture
+ beneath the (assumed rectangular) object, thereby giving the illusion
+ of `lifting' it; |\frm<|<dimen>|>{,}| makes this shade <dimen> deep.
+
+ |\frm{-,}| combines a |\frm{-}| with a |\frm{,}|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ A black rule is just that, a shade is two rules placed under and left
+ of the rectangular object outline.
+
+\DOCMODE(
+\xydefcsname@{frm{,}}{%
+ \ifx\frmradius@@\z@ \shaded@{1.2\p@}\else \shaded@\frmradius@@ \fi}
+
+\xydef@\shaded@#1{\frmDrop@{\R@=#1\relax
+ {\advance\X@c\R@ \advance\Y@c-\D@c \U@c=\z@ \D@c=\R@ \blacked@}%
+ {\advance\X@c\R@c \advance\Y@c-\R@ \L@c=\z@ \R@c=\R@ \blacked@}}}
+
+\xydefcsname@{frm{-,}}{\addtoDrop@@{\drop\frm{-}\drop\frm{,}}}
+
+\xydef@\blacked@{\setboxz@h{%
+ \A@=\X@c \advance\A@-\L@c \dimen@=\L@c \advance\dimen@\R@c
+ \B@=\Y@c \advance\B@-\D@c \dimen@ii=\Y@c \advance\dimen@ii\U@c
+ \advance\A@-.5\xydashw@
+ % \advance\B@-\xydashw@ \advance\dimen@ii-.5\xydashw@
+ \kern\A@ \blacked@@ }%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
+
+\xydef@\bblacked@{\setboxz@h{%
+ \dimen@=\L@c \advance\dimen@\R@c \B@=-\D@c \dimen@ii=\U@c
+ \kern-\L@c \blacked@@ \kern-\dimen@ \kern\L@c}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
+
+\xydef@\blacked@@{\vrule width\dimen@ depth-\B@ height\dimen@ii}
+\DOCMODE)
+
+The |\blacked| option is subsumed within a more general |\filled|; see below.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[circ]
+
+ Circles done with |\frm{o}| have radius as $(R+L)/2$ and with
+ |\frm<|<dimen>|>{o}| have radius as the <dimen>; |\frm{oo}| makes a
+ double circle with the outermost circle being the same as that of
+ |\frm{o}|.
+
+\begin{exercise}
+ What is the difference between |*\cir{}| and |*\frm{o}|?
+\answertext{The |*\cir{}| operation changes $c$ to be round whereas
+ |*\frm{o}| does not change $c$ at all.}
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydefcsname@{frm{o}}{%
+ \ifx\frmradius@@\z@
+ \frmDrop@{\dimen@=.5\L@c \advance\dimen@.5\R@c
+ \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@
+ \circled@\dimen@}%
+ \else
+ \frmDrop@{\let\framehfill=\frm@solidh@@
+ \let\framevfill=\frm@solidv@@ \circled@\frmradius@@}%
+ \fi}
+
+\xydefcsname@{frm{oo}}{%
+ \ifx\frmradius@@\z@
+ \frmDrop@{\dimen@=.5\L@c \advance\dimen@.5\R@c
+ \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@
+ {\circled@\dimen@}\advance\dimen@-2.1\p@ \circled@\dimen@}%
+ \else
+ \frmDrop@{\dimen@=\frmradius@@
+ \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@
+ {\circled@\dimen@}\advance\dimen@-2.1\p@ \circled@\dimen@}%
+ \fi}
+
+\xydef@\circled@#1{\setboxz@h\bgroup \R@=#1\relax
+ \setboxz@h{\vbox{\circled@x@@}}%
+ \A@=\X@c \advance\A@-.5\wd\z@
+ \B@=\Y@c \advance\B@-.5\ht\z@ \advance\B@.5\dp\z@ \advance\B@.2\p@
+ \edef\tmp@{\egroup\dimen@=\the\wdz@}%
+ \kern\A@ \raise\B@\boxz@
+ \tmp@ \divide\dimen@4 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
+
+\xydef@\circled@x@{\hbox{\corn@@4\R@ \corn@@3\R@}%
+ \nointerlineskip\hbox{\corn@@1\R@ \corn@@2\R@}}
+\xylet@\circled@x@@=\circled@x@
+\DOCMODE)
+
+The code here is repetitive and could be improved.
+The only purpose of |\let\framehfill=\frm@dashh@@| etc. is to serve
+as a marker for the required style: solid/dashed/dotted.
+
+\DOCMODE(
+\xydefcsname@{frm{.o}}{%
+ \ifx\frmradius@@\z@ \frmDrop@{\let\framehfill=\frm@doth@@
+ \dimen@=.5\L@c \advance\dimen@.5\R@c \circled@\dimen@}%
+ \else
+ \frmDrop@{\let\framehfill=\frm@doth@@ \circled@\frmradius@@}%
+ \fi}
+
+\xydefcsname@{frm{-o}}{%
+ \ifx\frmradius@@\z@ \frmDrop@{\let\framehfill=\frm@dashh@@
+ \dimen@=.5\L@c \advance\dimen@.5\R@c \circled@\dimen@}%
+ \else
+ \frmDrop@{\let\framehfill=\frm@dashh@@ \circled@\frmradius@@}%
+ \fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[ellip]
+
+ Ellipses specified using |\frm{e}| have axis lengths $(R+L)/2$ and
+ $(U+D)/2$, while those with |\frm<|<dimen,dimen>|>{e}| use the given
+ lengths for the axes. |\frm{ee}| makes a double ellipse with outermost
+ ellipse being the same as that of |\frm{e}|.
+
+ Without special support to render the ellipses, either via a <driver>
+ or using the |arc| feature, the ellipse will be drawn as a circle of
+ radius approximately the average of the major and minor axes.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydefcsname@{frm{e}}{\ellipse@whichfrm@\ellipsesolidframed@}%
+\xydefcsname@{frm{.e}}{\ellipse@whichfrm@\ellipsedotframed@}%
+\xydefcsname@{frm{-e}}{\ellipse@whichfrm@\ellipsedashframed@}%
+
+\xydefcsname@{frm{ee}}{\ellipse@whichdblfrm@\ellipsesolidframed@}%
+\xydefcsname@{frm2{.e}}{\ellipse@whichdblfrm@\ellipsedotframed@}%
+\xydefcsname@{frm2{-e}}{\ellipse@whichdblfrm@\ellipsedashframed@}%
+
+\xyletcsnamecsname@{frm[o]{-}}{frm{e}}
+\xyletcsnamecsname@{frm[o]{=}}{frm{ee}}
+\xyletcsnamecsname@{frm[o]{.}}{frm{.e}}
+\xyletcsnamecsname@{frm[o]{--}}{frm{-e}}
+
+\xydef@\ellipse@whichfrm@#1{%
+ \ifx\frmradius@@\z@
+ \frmDrop@{#1\dimen@=.5\L@c \advance\dimen@.5\R@c
+ \dimen@ii=.5\U@c \advance\dimen@ii.5\D@c
+ \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}\next@ }%
+ \else
+ \frmDrop@{#1\expandafter\ellipsed@i@\frmradius@@,,@@}%
+ \fi}
+
+\xydef@\ellipse@whichdblfrm@#1{%
+ \ifx\frmradius@@\z@
+ \frmDrop@{#1\dimen@=.5\L@c \advance\dimen@.5\R@c
+ \dimen@ii=.5\U@c \advance\dimen@ii.5\D@c
+ \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@ii}}\next@ }%
+ \else
+ \frmDrop@{#1\expandafter\ellipsed@ei@\frmradius@@,,@@}%
+ \fi}
+
+\xydef@\ellipsed@i@#1,#2,#3@@{\DNii@{,}\DN@{#3}%
+ \ifx\next@\nextii@
+ \dimen@=#1\relax \dimen@ii=#2\relax
+ \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}%
+ \else \ifx\next@\empty \DN@{#2}%
+ \ifx\next@\empty \DN@{#1}%
+ \dimen@=.5\L@c \advance\dimen@.5\R@c
+ \dimen@ii=.5\U@c \advance\dimen@ii.5\D@c
+ \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}%
+ \else \dimen@=#1\relax
+ \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}%
+ \fi
+ \else\xywarning@{ignoring extra tokens in elliptical frame: #3 }%
+ \dimen@=#1\relax \dimen@ii=#2\relax
+ \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}%
+ \fi\fi \next@ }
+
+\xydef@\ellipsed@ei@#1,#2,#3@@{\DNii@{,}\DN@{#3}%
+ \ifx\next@\nextii@
+ \dimen@=#1\relax \dimen@ii=#2\relax
+ \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@ii}}%
+ \else \ifx\next@\empty \DN@{#2}%
+ \ifx\next@\empty \DN@{#1}%
+ \dimen@=.5\L@c \advance\dimen@.5\R@c
+ \dimen@ii=.5\U@c \advance\dimen@ii.5\D@c
+ \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@ii}}%
+ \else
+ \dimen@=#1\relax
+ \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@}}%
+ \fi
+ \else\xywarning@{ignoring extra tokens in elliptical frame: #3 }%
+ \dimen@=#1\relax \dimen@ii=#2\relax
+ \edef\next@{\noexpand\ellipsed@e@{\the\dimen@}{\the\dimen@ii}}%
+ \fi\fi \next@ }
+
+\xydef@\ellipsed@e@#1#2{%
+ \dimen@=#1\relax \dimen@ii=#2\relax
+ \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}\next@
+ \dimen@=#1\relax \dimen@ii=#2\relax
+ \ifdim\dimen@>2\p@ \advance\dimen@-2\p@ \else \dimen@=\z@\fi
+ \ifdim\dimen@ii>2\p@ \advance\dimen@ii-2\p@ \else \dimen@ii=\z@\fi
+ \edef\next@{\noexpand\ellipsed@{\the\dimen@}{\the\dimen@ii}}\next@ }%
+
+\xydef@\ellipsed@#1#2{\setboxz@h\bgroup \relax
+ \setboxz@h{\vbox{\ellipsed@x@@{#1}{#2}}}%
+ \A@=\X@c \advance\A@-.5\wd\z@
+ \B@=\Y@c \advance\B@-.5\ht\z@ \advance\B@.5\dp\z@ \advance\B@.2\p@
+ \edef\tmp@{\egroup\dimen@=\the\wdz@}%
+ \kern\A@ \raise\B@\boxz@
+ \tmp@ \divide\dimen@4 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
+
+\xydef@\ellipsed@i#1#2{{\R@c=#1\relax\L@c=\R@c
+ \U@c=#2\relax\D@c=\U@c \ellipsed@{#1}{#2}}}
+
+\xydef@\ellipsed@x@#1#2{\R@=#1\relax\advance\R@#2\relax
+ \divide\R@\tw@ \circled@x@@ }
+\xylet@\ellipsed@x@@=\ellipsed@x@
+
+\xydef@\ellipsesolidframed@{%
+ \let\framehfill=\frm@solidh@@ \let\framevfill=\frm@solidv@@}
+\xydef@\ellipsedotframed@{%
+ \let\framehfill=\frm@doth@@ \let\framevfill=\frm@dotv@@}
+\xydef@\ellipsedashframed@{%
+ \let\framehfill=\frm@dashh@@ \let\framevfill=\frm@dashv@@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+ \TODO: Allow <frame variant>s like those used for directionals, \ie,
+ |\frm2{-}| should be the same as |\frm{=}|. Add |\frm{o,}| and more
+ brackets.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Brackets}
+??=[brackets]
+
+ The possible brackets are shown in figure~??[f.bfrm] with notes
+ below.
+
+\begin{notescontd}
+
+\note??=[braces]
+
+ "Braces" are just the standard plain \TeX\ large braces inserted
+ correctly in \Xy-pic pictures with the `nib' aligned with the
+ reference point of the object they brace.
+
+\begin{exercise}
+%
+ How do you think the author typeset the following?
+%
+\begin{code}
+\xy
+ (0,0) *+++{A} ;
+ (10,7) *+++{B} **\frm{.}
+ **\frm{^\}} ; **\frm{_\}}
+\endxy
+\end{code}
+$$\docode$$
+%
+\answertext{Here is how:}
+\answercode
+\answertext\displaycode
+\answertext{The trick in the last line is to ensure that the reference point
+ of the merged object to be braced is the right one in each case.}
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ They just use the pieces of plain \TeX\ brace delimiters at |\Bigg|
+ size and those of |\overbrace| and |\underbrace|.
+
+\DOCMODE(
+\xydefcsname@{frm{\{}}{\addtoDrop@@{\lbraced}}
+\xydefcsname@{frm{\}}}{\addtoDrop@@{\rbraced}}
+
+\xydefcsname@{frm{^\}}}{\addtoDrop@@{\ubraced}}
+\xydefcsname@{frm{_\}}}{\addtoDrop@@{\dbraced}}
+\DOCMODE)
+
+ The horizontal ones mimick the plain \TeX\ ones quite closely:
+
+\DOCMODE(
+\xydef@\dbraced{\xy@@{\setboxz@h{%
+ \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
+ \setboxz@h{$\m@th\bracelu$}\dimen@=2\wdz@ \advance\B@-.5\ht\z@
+ \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
+ \ifdim\L@c<\dimen@ \advance\A@-\dimen@ \advance\A@\L@c \L@c=\dimen@ \fi
+ \advance\A@-.25pt %
+ \kern\A@\raise\B@\hbox{%
+ \hbox to\L@c{$\m@th\bracelu\leaders\vrule\hfil\bracerd$}%
+ \kern.5pt %
+ \hbox to\R@c{$\m@th\braceld\leaders\vrule\hfil\braceru$}}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+
+\xydef@\ubraced{\xy@@{\setboxz@h{%
+ \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@\U@c
+ \setboxz@h{$\m@th\bracelu$}\dimen@=2\wdz@
+ \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
+ \ifdim\L@c<\dimen@ \advance\A@-\dimen@ \advance\A@\L@c \L@c=\dimen@ \fi
+ \advance\A@-.25pt %
+ \kern\A@\raise\B@\hbox{%
+ \hbox to\L@c{$\m@th\braceld\leaders\vrule\hfil\braceru$}%
+ \kern.5pt %
+ \hbox to\R@c{$\m@th\bracelu\leaders\vrule\hfil\bracerd$}}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+\DOCMODE)
+
+ The inserted extra |.5pt| at |(1)| is the authours
+ responsibility\dots
+
+ The vertical ones repeat the above for the vertical brace extension
+ characters:
+
+\DOCMODE(
+{\catcode`\"=12 %
+ \global\mathchardef\braceur="338 %
+ \global\mathchardef\braceul="339 %
+ \global\mathchardef\bracedr="33A %
+ \global\mathchardef\bracedl="33B %
+ \global\mathchardef\bracecl="33C %
+ \global\mathchardef\bracecr="33D %
+ \global\mathchardef\bracec="33E }
+
+\xydef@\lbraced{\xy@@{\setboxz@h{%
+ \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
+ \setboxz@h{$\m@th\bracecl$}\dimen@ii=\dp\z@ \advance\A@-.5\wdz@
+ \setboxz@h{$\m@th\bracec$}\dimen@=\dp\z@
+ \ifdim\U@c<.5\dimen@ \U@c=.5\dimen@ \fi
+ \ifdim\D@c<.5\dimen@ \advance\B@-.5\dimen@ \advance\B@\D@c \D@c=.5\dimen@ \fi
+ \advance\U@c.6\p@ \advance\D@c.6\p@ \advance\B@-.6\p@
+ \kern\A@\raise\B@\vbox{\vbox to\U@c{%
+ \nointerlineskip\hbox{$\m@th\braceur$}%
+ \kern-.61\dimen@ \cleaders\copy\z@\vfil \kern-.4\dimen@
+ \nointerlineskip\hbox{$\m@th\bracecl$}\kern-.5\dimen@ii}%
+ \nointerlineskip\vbox to\D@c{\kern.5\dimen@ii
+ \kern-.4\dimen@ \cleaders\copy\z@\vfil \kern-.61\dimen@
+ \nointerlineskip\hbox{$\m@th\bracedr$}\kern\z@}}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+
+\xydef@\rbraced{\xy@@{\setboxz@h{%
+ \A@=\X@c \advance\A@\R@c \B@=\Y@c \advance\B@-\D@c
+ \setboxz@h{$\m@th\bracecr$}\dimen@ii=\dp\z@ \advance\A@-.5\wdz@
+ \setboxz@h{$\m@th\bracec$}\dimen@=\dp\z@
+ \ifdim\U@c<.5\dimen@ \U@c=.5\dimen@ \fi
+ \ifdim\D@c<.5\dimen@ \advance\B@-.5\dimen@ \advance\B@\D@c \D@c=.5\dimen@ \fi
+ \advance\U@c.6\p@ \advance\D@c.6\p@ \advance\B@-.6\p@
+ \kern\A@\raise\B@\vbox{\vbox to\U@c{%
+ \nointerlineskip\hbox{$\m@th\braceul$}%
+ \kern-.61\dimen@ \cleaders\copy\z@\vfil \kern-.4\dimen@
+ \nointerlineskip\hbox{$\m@th\bracecr$}\kern-.5\dimen@ii}%
+ \nointerlineskip\vbox to\D@c{\kern.5\dimen@ii
+ \kern-.4\dimen@ \cleaders\copy\z@\vfil \kern-.61\dimen@
+ \nointerlineskip\hbox{$\m@th\bracedl$}\kern\z@}}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+\DOCMODE)
+
+ An \emph{ad hoc} correction to compensate for the `undershoot' of
+ top/bottom segments is added at |(1)|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[paren]
+
+ "Parenthesis" are like braces except they have no nib and thus do not
+ depend on where the reference point of $c$ is.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydefcsname@{frm{(}}{\addtoDrop@@{\lparenthesized}}
+\xydefcsname@{frm{)}}{\addtoDrop@@{\rparenthesized}}
+
+\xydefcsname@{frm{^)}}{\addtoDrop@@{\uparenthesized}}
+\xydefcsname@{frm{_)}}{\addtoDrop@@{\dparenthesized}}
+\DOCMODE)
+
+ The horizontal ones repeat the braces only without a nib:
+
+\DOCMODE(
+\xydef@\dparenthesized{\xy@@{\setboxz@h{%
+ \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
+ \setboxz@h{$\m@th\bracelu$}\dimen@=2\wdz@ \advance\B@-.5\ht\z@
+ \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
+ \ifdim\L@c<\dimen@ \advance\A@-\dimen@ \advance\A@\L@c \L@c=\dimen@ \fi
+ \dimen@=\L@c \advance\dimen@\R@c
+ \kern\A@\raise\B@\hbox to\dimen@{%
+ $\m@th\bracelu\leaders\vrule\hfil\braceru$}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+
+\xydef@\uparenthesized{\xy@@{\setboxz@h{%
+ \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@\U@c
+ \setboxz@h{$\m@th\bracelu$}\dimen@=2\wdz@
+ \ifdim\R@c<\dimen@ \R@c=\dimen@ \fi
+ \ifdim\L@c<\dimen@ \advance\A@-\dimen@ \advance\A@\L@c \L@c=\dimen@ \fi
+ \dimen@=\L@c \advance\dimen@\R@c
+ \kern\A@\raise\B@\hbox to\dimen@{%
+ $\m@th\braceld\leaders\vrule\hfil\bracerd$}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+\DOCMODE)
+
+ The vertical ones are very like braces including the ad hoc
+ correction.
+
+\DOCMODE(
+\xydef@\lparenthesized{\xy@@{\setboxz@h{%
+ \A@=\X@c \advance\A@-\L@c \B@=\Y@c \advance\B@-\D@c
+ \setboxz@h{$\m@th\bracecr$}\dimen@ii=\dp\z@ \advance\A@-.5\wdz@
+ \setboxz@h{$\m@th\bracec$}\dimen@=\dp\z@
+ \ifdim\U@c<.5\dimen@ \U@c=.5\dimen@ \fi
+ \ifdim\D@c<.5\dimen@ \advance\B@-.5\dimen@ \advance\B@\D@c \D@c=.5\dimen@ \fi
+ \advance\U@c.6\p@ \advance\D@c.6\p@ \advance\B@-.6\p@
+ \dimen@ii\U@c \advance\dimen@ii\D@c
+ \kern\A@\raise\B@\vbox to \dimen@ii{%
+ \nointerlineskip\hbox{$\m@th\braceur$}%
+ \kern-.61\dimen@ \cleaders\copy\z@\vfil \kern-.61\dimen@
+ \nointerlineskip\hbox{$\m@th\bracedr$}\kern\z@}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+
+\xydef@\rparenthesized{\xy@@{\setboxz@h{%
+ \A@=\X@c \advance\A@\R@c \B@=\Y@c \advance\B@-\D@c
+ \setboxz@h{$\m@th\bracecr$}\dimen@ii=\dp\z@ \advance\A@-.5\wdz@
+ \setboxz@h{$\m@th\bracec$}\dimen@=\dp\z@
+ \ifdim\U@c<.5\dimen@ \U@c=.5\dimen@ \fi
+ \ifdim\D@c<.5\dimen@ \advance\B@-.5\dimen@ \advance\B@\D@c \D@c=.5\dimen@ \fi
+ \advance\U@c.6\p@ \advance\D@c.6\p@ \advance\B@-.6\p@
+ \dimen@ii\U@c \advance\dimen@ii\D@c
+ \kern\A@\raise\B@\vbox to \dimen@ii{%
+ \nointerlineskip\hbox{$\m@th\braceul$}%
+ \kern-.61\dimen@ \cleaders\copy\z@\vfil \kern-.61\dimen@
+ \nointerlineskip\hbox{$\m@th\bracedl$}\kern\z@}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notescontd}
+
+ \BUG: The brackets above require that the computer modern |cmex| font
+ is loaded in \TeX\ font position~3.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Filled regions}
+
+ In addition to the above there is a special frame that ``fills'' the
+ inside of the current object with ink: ??c![\frm{*}] and
+ ??c![\frm{**}]; the latter is intended for \emph{emphasizing\/} and
+ thus ``strokes'' the outline, using the thinnest black line available
+ on the printer or output device; furthermore it moits the actual
+ filling in case this would obscure further text typeset on top.
+ Some alteration to the shape is possible, using |*\frm<dimen>{*}|.
+ Hence rectangular, oval, circular and elliptical shapes can be
+ specified for filling.
+ The following examples illustrate this in each case:
+%
+\begin{center}
+\def\X[#1]#2{\relax\xy*=<2em>{}*=<3em,1.4em>[#1][F.]{}#2\endxy}%
+\begin{tabular}{cccc}
+\hline
+ \strut<object> & |\frm{*}| & |\frm{**}| & |\frm<6pt>{*}| \\
+\hline
+ \X[]{} & \X[]{*\frm{*}} & \X[]{*\frm{**}} & \X[]{*\frm<6pt>{*}} \\
+ \X[o]{} & \X[o]{*\frm{*}} & \X[o]{*\frm{**}} & \X[o]{*\frm<6pt>{*}} \\
+\hline
+\end{tabular}
+\end{center}
+%
+ However, filling non-rectangular shapes will result in a rectangle
+ unless a driver is used that supports arbitrary filling. With some
+ drivers the above fills will thus all be identical, as rectangular.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+When the previous <object> has |\rectangleEdge| then the shape is either
+oval or rectangular, depending on whether a <dimen> has been specified,
+using the <dimen> as radius for the corners, but not exceeding half the
+shorter side-length.
+
+When the current <object> has |\circleEdge| then the region is elliptical,
+using the extents |R+L| and |U+D| as the major/minor axes, or circular
+if a <dimen> is specified. The <dimen> will become the radius after reducing
+to a maximum of half the longest side of the enclosing rectangle.
+With |\zeroEdge| presume rectangular, or circular if a <dimen> is supplied.
+
+The default for |\frm{**}| is to just make a plain frame.
+
+\DOCMODE(
+\xydefcsname@{frm{*}}{%
+ \expandafter\frmDrop@\expandafter{%
+ \expandafter\def\expandafter\prevEdge@@\expandafter{\prevEdge@@}%
+ \frame@fill@@\frmradius@@}}
+
+\xydefcsname@{frm{**}}{%
+ \expandafter\frmDrop@\expandafter{%
+ \expandafter\def\expandafter\prevEdge@@\expandafter{\prevEdge@@}%
+ \frame@emph@@\frmradius@@}}
+
+\xydef@\frame@fill@#1{\filled@{#1}\empty}
+\xydef@\frame@emph@#1{\framed@\frmradius@@}
+
+\xylet@\frame@fill@@=\frame@fill@
+\xylet@\frame@emph@@=\frame@emph@
+
+\xydef@\filled@#1{\R@=#1\relax
+ \expandafter\DNii@\expandafter{\prevEdge@@}%
+ \DN@{\rectangleEdge}\ifx\next@\prevEdge@@
+ \ifdim\R@=\z@ \DN@{\filled@Rectangle@}%
+ \else \DN@{\filled@Oval@}\fi
+ \else \DN@{\circleEdge}\ifx\next@\prevEdge@@
+ \ifdim\R@=\z@ \DN@{\filled@Ellipse@}%
+ \else \DN@{\restR@max\filled@Circle@}\fi
+ \else
+ \ifdim\R@=\z@ \DN@{\filled@Rectangle@}%
+ \else \DN@{\filled@Circle@}\fi
+ \fi\fi \next@}
+
+\xydef@\restR@max{%
+ \dimen@=\L@c\advance\dimen@\R@c
+ \dimen@ii=\U@c \advance\dimen@ii\D@c
+ \ifdim\dimen@ii>\dimen@ \dimen@=\dimen@ii\fi
+ \ifdim\dimen@>\z@ \divide\dimen@\tw@
+ \ifdim\R@>\dimen@\R@=\dimen@\fi\fi }
+\DOCMODE)
+
+The default implementation uses only |\bblacked@|, in all cases.
+The distinction between |\frm{*}| and |\frm{**}| can be ignored.
+
+\DOCMODE(
+\xylet@\filledRectangle@@=\bblacked@
+\xylet@\filledCircle@@=\bblacked@
+\xylet@\filledEllipse@@=\bblacked@
+\xylet@\filledOval@@=\bblacked@
+\DOCMODE)
+
+Alternative implementations may use these, in which the parameter |#1|
+is the contents of a |\vbox| filling to the height, depth and width
+of the region to be filled.
+
+\DOCMODE(
+\xydef@\filled@Region@#1#2{\setboxz@h\bgroup
+ \setboxz@h{\vbox{#1#2\empty}}%
+ \A@=\X@c \advance\A@-.5\wd\z@
+ \B@=\Y@c \advance\B@-.5\ht\z@ \advance\B@.5\dp\z@
+ \edef\tmp@{\egroup\dimen@=\the\wdz@}%
+ \kern\A@ \raise\B@\boxz@ \kern-\A@
+ \tmp@ \divide\dimen@\tw@ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \styledboxz@}
+
+\xydef@\filled@Rectangle@{\filled@Region@\filledRectangle@@}
+\xydef@\filled@Oval@{\filled@Region@\filledOval@@}
+\xydef@\filled@Circle@{\filled@Region@\filledCircle@@}
+\xydef@\filled@Ellipse@{\filled@Region@\filledEllipse@@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Framing as object modifier}
+??=[modifier]
+%
+ In addition, frames may be accessed using the special |[F|<frame>|]|
+ object modifier <shape>s that will add the desired <frame> to the
+ current object. The frame appropriate to the edge of the object
+ will be chosen (presently either rectangular or elliptical).
+
+ If shape modifiers need to be applied to the <frame> alone then they
+ can be included using |:| as separator. Thus |[F-:red]| will make a
+ red frame (provided the color extension is active, of course).
+ Additionally the variant of frames using |<|<dimen>|>| can be
+ accessed by specifying |[|\dots|:<|<dimen>|>]|.
+
+\DOCMODE(
+\xydefcsname@{shape [F...]}#1{\xyFN@\Fshape@#1:@}
+
+\xylet@\whichframe@@=\empty
+\xylet@\whichoptions@@=\empty
+
+\xydef@\Fshape@#1:{\def\whichframe@@{{#1}}%
+ \DN@{{}}\ifx\whichframe@@\next@ \def\whichframe@@{{-}}\fi
+ \expandafter\DN@\expandafter{\the\Edge@c}\DNii@{\circleEdge}\ifx\next@\nextii@
+ \DN@##1{\def\whichframe@@{[o]##1}}%
+ \expandafter\next@\expandafter{\whichframe@@}\fi
+ \let\whichoptions@@=\empty \xyFN@\Fshape@i}
+
+\xydef@\Fshape@i{%
+ \ifx @\next \let\next@=\Fshape@x
+ \else\addLT@\ifx\next \let\next@=\Fshape@iii
+ \else \let\next@=\Fshape@ii \fi\fi \next@}
+
+\xydef@\Fshape@ii#1:{%
+ \expandafter\def\expandafter\whichoptions@@\expandafter{\whichoptions@@[#1]}%
+ \xyFN@\Fshape@i}
+
+\xydef@\Fshape@iii#1:{\DN@##1{\def\whichframe@@{#1##1}}%
+ \expandafter\next@\expandafter{\whichframe@@}\xyFN@\Fshape@i}
+
+\xydef@\Fshape@x @{%
+ \edef\next@##1{\noexpand\addbeforeDrop@@{{\EdgefromtheEdge@##1}}}%
+ \DNii@##1##2{\next@{\saveframestyles@{\setbox\z@=\object##2\frm##1%
+ \xypre@Style@@\Drop@@\xypost@Style@@\restoreframestyles@}}}%
+ \expandafter\expandafter\expandafter\nextii@
+ \expandafter\expandafter\expandafter{%
+ \expandafter\whichframe@@\expandafter}\expandafter{\whichoptions@@}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The following are used to ensure that the current styles, after
+ typesetting, are those of the <object>, rather than the <frame>.
+
+\DOCMODE(
+\xydef@\saveframestyles@{%
+ \edef\afterframe@preStyle@{\preXY@style@}%
+ \edef\afterframe@postStyle@{\postXY@style@}}
+
+\xydef@\restoreframestyles@{%
+ \xdef\preXY@style@{\afterframe@preStyle@}\def\afterframe@preStyle@{}%
+ \xdef\postXY@style@{\afterframe@postStyle@}\def\afterframe@postStyle@{}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Here are some simple examples using this feature.
+%
+\begin{code}
+\xy *+<1.5pt>[F**:white]++[F**:red]
+\txt{text with background}
+,+!D+/d1pc/,*++[F**:black][white]
+\txt\bf{bold white on black}\endxy
+\end{code}
+$$\docode$$
+\displaycode
+Notice that when multiple frame-modifiers are used, the frames
+are actually placed in reverse order, so that earlier ones
+are printed on top of later ones.
+
+ \TODO: The frame option is not quite complete yet: some new frames
+ and several new brackets should be added.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Using curves for frames}
+??=[curved frames]
+%
+ If the curve option is loaded, then circular and elliptical frames of
+ arbitrary radius can be constructed, by specifying |\UseCurvedFrames|.
+ This can be negated by |\UseFontFrames|. Both of these commands obey
+ normal \TeX\ grouping. Furthermore, dotted and dashed frames now have
+ a regular spacing of their constituent objects. The usual warnings
+ about memory requirements for large numbers of curves apply here also.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Use the |\xycircle| setup in |xycurve.doc| to implement circular
+and elliptical frames.
+
+\DOCMODE(
+\xydef@\xycircleframe@x@{\L@=\R@ \xycircleframe@x@i}%
+\xydef@\xyellipseframe@x@#1#2{\R@=#1\relax \L@=#2\relax \xycircleframe@x@i}
+
+\xydef@\xycircleframe@x@i{%
+ \ifx\framehfill\frm@solidh@@\def\circleSTYLE@{}%
+ \else\ifx\framehfill\frm@doth@@
+ \expandafter\def\expandafter\circleSTYLE@\expandafter{\addDOT@{}}%
+ \else\ifx\framehfill\frm@dashh@@
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter
+ \expandafter\circleSTYLE@\expandafter\expandafter\expandafter
+ {\expandafter\addDASH@\addDASH@{}}%
+ \fi\fi\fi \xycircleframe@x@x }
+
+\xydef@\xycircleframe@x@x{\hbox{\vbox{\vskip\L@
+ \hbox to2\R@{\hfill \buildcircle@ \hfill}\vskip\L@ }}}
+
+\xydef@\UseCurveFrames@{%
+ \let\circled@x@@=\xycircleframe@x@
+ \let\ellipsed@x@@=\xyellipseframe@x@ }
+\def\UseCurveFrames{\xywithoption{curve}{\UseCurveframes@}}%
+
+\xydef@\UseFontFrames@{%
+ \let\circled@x@@=\circled@x@
+ \let\ellipsed@x@@=\ellipsed@x@ }
+\xylet@\UseFontFrames=\UseFontFrames@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Finally, the frame extension is added to the <driver> system:
+
+\DOCMODE(
+\xydef@\UnloadFrames@{%
+ \let\framed@body@@=\framed@body@
+ \let\circled@x@@=\circled@x@
+ \let\ellipsed@x@@=\ellipsed@x@
+ \let\frame@fill@@=\frame@fill@
+ \let\frame@emph@@=\frame@emph@
+ \let\filledRectangle@@=\bblacked@
+ \let\filledCircle@@=\bblacked@
+ \let\filledEllipse@@=\bblacked@
+ \let\filledOval@@=\bblacked@
+}
+
+\xyaddunsupport{frame}\UnloadFrames@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection*{End \& log}
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyframe.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/05 22:11:03 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% NEW for version 2.7 based on frame code in xypic.doc 2.6.1.1.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs how we are formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% TeX-parse-self:nil
+% LaTeX-indent-level:1
+% TeX-brace-indent-level:1
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xygraph.doc b/Master/texmf-dist/source/generic/xypic/xygraph.doc
new file mode 100644
index 00000000000..718d12a2182
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xygraph.doc
@@ -0,0 +1,710 @@
+%% $Id: xygraph.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Graph Combinator feature'' option.
+%% Copyright (c) 1994-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{graph}{Graph feature}{\stripRCS$Revision: 3.7 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This option implements `\Xy-graph', a special "combinatoric drawing
+ language" suitable for diagrams like flow charts, directed graphs,
+ and various forms of trees. The base of the language is reminiscent
+ of the PIC~\cite{K82:PIC-LTG} language because it uses a notion of
+ the `current location' and is based on `moves'. But the central
+ construction is a `map' combinator that is borrowed from functional
+ programming.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ \Xy-graph makes use of facilities of the `arrow' feature option of
+ \S??g[:arrow], which is therefore required.
+
+\DOCMODE(
+\xyrequire{arrow}\xycatcodes
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Figure~??[f.graph] summarises the syntax of a <graph> with notes
+ below. A <graph> can appear either in an \Xy-picture (as <decor>) or
+ ``stand-alone''.\footnote{In fact \LaTeX\ users can use a |graph|
+ environment.} \NOTE: If you use ??c![\xygraph]|{|\dots|}| inside
+ constructions where |&| is significant (like plain \TeX's
+ ??c![\halign] or \LaTeX's ??c![array] environment) then make sure to
+ add an extra level of braces around it.
+
+\begin{figure*}[tb]
+\begin{syntax}
+%
+ \multispan{3}{{\tt\string\xygraph\string{<graph>\string}}\hfil}
+ & typeset <graph>
+\cr
+\noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+%
+ ??w![<graph>]
+ &\iss & <step>\star
+ & interpret <step>s in sequence
+\cr
+\noalign{\smallskip}
+ ??w![<step>]
+ &\iss & <node>
+ & ??!^[move] to the <node>
+\cr
+ &\orr & |-|<arrow> <node> <labels>
+ & ??!^[draw] line to <node>, with <labels>
+\cr
+ &\orr & |:|<arrow> <node> <labels>
+ & ??!^[draw] <arrow> to <node>, with <labels>
+\cr
+ &\orr & |(| <list> |)|
+ & ??!^[map] current node over <list>
+\cr
+\noalign{\smallskip}
+%
+ ??w![<node>]
+ &\iss & |[| <move> |]|
+ & new node <move>d relative to current
+\cr
+ &\orr & |&| \orr\ |\\|
+ & new node in ??!^[next column/row]
+\cr
+ &\orr & |"|<id>|"|
+ & previously ??!^[saved] node
+\cr
+ &\orr & |?|
+ & currently ??!^[mapped] node
+\cr
+ &\orr & <node> <it>
+ & <node> with <it> ??!^[typeset and saved] there
+\cr
+ &\orr & <node> |=| |"|<id>|"|
+ & <node> ??!^[saved] as |"|<id>|"|
+\cr
+ &\orr & <node> |!| <escape>
+ & augment node with material in another mode
+\cr
+\noalign{\smallskip}
+%
+ ??w![<move>]
+ &\iss & <hop>\star\
+ & ??!^[<hop>s] (|dulr|) from current node
+\cr
+ &\orr & <hop>\star\ <place> <move>
+ & do ??!^[<hop>s] but use its <place> and <move> again
+\cr
+\noalign{\smallskip}
+%
+ ??w![<list>]
+ &\iss & <graph> |,| <list> \orr\ <graph>
+ & ??!^[list of subgraphs]
+\cr
+\noalign{\smallskip}
+%
+ ??w![<escape>]
+ &\iss & |{| <pos> <decor> |}|
+ & ??!^[perform <pos> <decor>]
+\cr
+ &\orr & |M| <matrix>
+ & ??!^[insert <matrix>]
+\cr
+ &\orr & |P| <polygon>
+ & ??!^[insert <polygon>]
+\cr
+ &\orr & |E| <ellipse>
+ & ??!^[insert <ellipse>]
+\cr
+ &\orr & |~| <setup>
+ & ??!^[setup parameters]
+\cr
+\end{syntax}
+\caption{\protect<graph>s}??=[f.graph]
+\end{figure*}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Parsing:}
+
+ The parser does almost everything that this feature does because it
+ is all implemented directly on top of other constructions, notably
+ the kernel stack and the <arrow> construction.
+
+ The graph state always has the current value of |?| both as the
+ stacktop and in the special <id> |"?NODE"|.
+
+\DOCMODE(
+\xydef@\xygraph#1{\relax\graph#1\endgraph}
+
+\xydef@\graph{\if\inxy@ \DN@{\xy@@{\nter@{}}}%
+ \else \DN@{\xy \xy@\xy{\nter@\endxy}}\fi \next@
+ \xy@\xygraph{\senter@ \idfromc@{?NODE}\spushc@
+ \expandafter\let\expandafter\next@\csname Q@graphbase\endcsname
+ \ifx\next@\relax \setbase@\z@\z@{3pc}\z@
+ \else \expandafter\next@ \fi}%
+ \GRAPH[]}
+
+\xydef@\endgraph{\ignorespaces}
+
+\xydef@\GRAPH{\xyFN@\GRAPH@}
+
+\xydef@\GRAPH@{%
+%
+%\W@{GRAPH: next=\meaning\next}%
+%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\GRAPH@}%
+ \else\ifx :\next \DN@:{\xy@:{}\expandafter\GRAPHar@\GRAPHeveryarrow@@}%
+ \else\addDASH@\ifx\next
+ \addDASH@\DN@{\xy@-{}\expandafter\GRAPHar@\GRAPHeveryline@@}%
+ \else\ifx (\next
+ \DN@({\xy@({\spushid@{?NODE}\idfromc@{?NODE}}\xyFN@\GRAPH@}%
+ \else\ifx ,\next
+ \DN@,{\xy@,{\cfromid@{?NODE}}\xyFN@\GRAPH@}%
+ \else\ifx )\next
+ \DN@){\xy@){\cfromid@{?NODE}%
+ \tests@\z@{\idfroms@{?NODE}\z@ \spop@}{\xyerror@{) without (}{}}}%
+ \xyFN@\GRAPH@}%
+ % HACK: ONLY POP WHEN NONEMPTY...WHY EVER NONEMPTY?
+ \else\ifx \endgraph\next \DN@{\xy@@{\tests@\z@\spop@\sleave@\leave@}}%
+ \else\ifx \end\next \DN@{\xy@@{\tests@\z@\spop@\sleave@\leave@}}%
+ \else\ifx ~\next
+ \DN@~{\xy@@{\enter@\cfromthec@}\afterNODE{\leave@ \xyFN@\GRAPH@}!}%
+ \else \DN@{\afterNODE{\xyFN@\GRAPH@}}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xylet@\GRAPHsaved@PATHafterPOS=\PATHafterPOS
+\xylet@\GRAPHsaved@afterar@@=\afterar@@
+
+\xydef@\GRAPHar@{%
+ \let\PATHafterPOS=\afterNODE \let\afterar@@=\GRAPHafterar@ \ar}
+
+\xydef@\GRAPHafterar@{%
+ \let\PATHafterPOS=\GRAPHsaved@PATHafterPOS
+ \let\afterar@@=\GRAPHsaved@afterar@@
+ \xy@@{\cfromid@{}}\xyFN@\GRAPH@}
+
+\xylet@\afterNODE@@=\empty
+
+\xydef@\afterNODE#1{\xy@@{\enter@\pfromthep@}%
+ \DN@##1{\def\afterNODE@@{\xy@@\leave@ \def\afterNODE@@{##1}#1}}%
+ \expandafter\next@\expandafter{\afterNODE@@}%
+ \xyFN@\NODE@}
+
+\xylet@\theMOVE@@=\relax
+
+\xydef@\NODE@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\NODE@}%
+ \else\ifx [\next \DN@[##1]{\xy@{[##1]}{}%
+ \def\theMOVE@@{[##1]}\xyFN@\MOVE@##1]}%
+ \else\ifx "\next \DN@ "##1"{%
+ \xy@{"##1"}{\cfromid@{##1}}\def\theMOVE@@{"##1"}\xyFN@\NODE@i}%
+ \else\ifx ?\next \DN@ ?{%
+ \xy@?{\cfromid@{?NODE}}\def\theMOVE@@{?}\xyFN@\NODE@i}%
+ \else\ifx !\next \def\theMOVE@@{[]}\let\next@=\NODE@i
+ \else \testAND@\iffalse
+ \DN@##1{\xy@{}{\pfromc@ \advance\X@c\X@xbase \advance\Y@c\Y@xbase
+ \czeroEdge@}\jumpMOVE@ \xyFN@\NODE@i}%
+ \else\ifx \\\next
+ \DN@\\{\xy@\\{\pfromc@ \advance\X@c\X@xbase \advance\Y@c\Y@xbase
+ \R@c=\X@ybase \U@c=\Y@ybase \intersect@
+ \advance\X@c-\X@ybase \advance\Y@c-\Y@ybase
+ \czeroEdge@}\def\theMOVE@@{\\}\xyFN@\NODE@i}%
+ \else \xyerror@{Illegal <node>: \string`\meaning\next\string' unexpected}{}%
+ \fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\jumpMOVE@@{&}
+\xydef@\jumpMOVE@{\let\theMOVE@@=\jumpMOVE@@}
+
+\xydef@\MOVE@{\xy@@{\count@=\z@ \count@@=\z@}%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\MOVE@}%
+ \else\ifcat A\noexpand\next \let\next@=\MOVE@letter
+ \else \let\next@=\MOVE@x \fi\fi \next@}
+
+\xydef@\MOVE@letter{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\MOVE@letter}%
+ \else\ifx u\next \DN@ u{\xy@@{\advance\count@\@ne}\xyFN@\MOVE@letter}%
+ \else\ifx d\next \DN@ d{\xy@@{\advance\count@\m@ne}\xyFN@\MOVE@letter}%
+ \else\ifx l\next \DN@ l{\xy@@{\advance\count@@\m@ne}\xyFN@\MOVE@letter}%
+ \else\ifx r\next \DN@ r{\xy@@{\advance\count@@\@ne}\xyFN@\MOVE@letter}%
+ \else \let\next@=\MOVE@x \fi\fi\fi\fi\fi \next@}
+
+\xydef@\MOVE@x{%[[
+ \ifx ]\next \DN@ ]{\MOVE@hop \xyFN@\NODE@i}%
+ \else\ifx (\next \DN@{\MOVE@hop \xyFN@\MOVE@place}%)
+ \else\ifx !\next \DN@{\MOVE@hop \xyFN@\MOVE@place}%
+ \else\ifx /\next \DN@{\MOVE@hop \xyFN@\MOVE@place}%
+ \else\addLT@\ifx\next \DN@{\MOVE@hop \xyFN@\MOVE@place}%
+ \else\addGT@\ifx\next \DN@{\MOVE@hop \xyFN@\MOVE@place}%
+ \else\addDASH@\ifx\next \addDASH@\DN@{\xyerror@{- not implemented yet}{}}%
+ \else \xyerror@{illegal <move>: \codeof\theMOVE@@}{}\let\next@=\NODE@i
+ \fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\MOVE@hop{\xy@@{\pfromc@ \czeroEdge@
+ \edef\next@{\the\count@@,\the\count@ @}\expandafter\vfromcartesian@@\next@
+ \advance\X@c-\X@origin \advance\Y@c-\Y@origin
+ \advance\X@c\X@p \advance\Y@c\Y@p}}
+
+\xydef@\MOVE@place{\xy@@\no@@ \afterPLACE{\xyFN@\MOVE@}}
+
+\xydef@\NODE@i{\let\next@=\NODE@x
+%
+%\W@{NODE@i: next=\meaning\next}%
+%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\NODE@i}%
+ \else\addEQ@\ifx \next
+ \addEQ@\DN@"##1"{\xy@{="##1"}{\idfromc@{##1}}\xyFN@\NODE@i}%
+ \else\ifx !\next \DN@!{\xyFN@\NODE@escape}%
+ \else\ifx :\next
+ \else\addDASH@\ifx\next
+ \else\ifx (\next
+ \else\ifx ,\next
+ \else\ifx )\next
+ \else\ifx ~\next
+ \else\ifx [\next
+ \else\ifx "\next
+ \else\ifx ?\next
+%
+ \else\ifx ^\next
+ \else\ifx _\next
+ \else\ifx |\next
+ \else\addLQ@\ifx\next
+ \else\addRQ@\ifx\next
+%
+ \else \testAND@ \iffalse
+ \else\ifx \\\next
+%
+ \else\ifx \endgraph\next
+ \else\ifx \end\next
+%
+ \else \let\next@=\NODE@it
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\NODE@x{\xy@@{\idfromc@{}}\afterNODE@@}
+
+\xydef@\NODE@it{\let\PATHlabelit@@=\NODEit@ \PATHit@}
+
+{\xyuncatcodes \gdef\next{+}}
+\xylet@\GRAPHnodemodifiers@@=\next
+
+\xydef@\NODEit@#1{%
+ \DN@{#1}\ifx\next@\empty
+ \DN@{\expandafter\NODEit@i\expandafter{\GRAPHnodemodifiers@@}}%
+ \else \DN@{\NODEit@i{#1}}\fi \next@}
+
+\def\NODEit@i#1#2{\xy@{*#1{#2}}{\drop@{#1}{#2}}%
+ \DN@{\addEQ@\ifx\next\else \xy@@{\idfromc@{#2}}\fi \NODE@i}%
+ \xyFN@\next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{notes}
+%
+\note??=[move]
+%
+ A "move" is to establish a new "current node".
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[draw]
+%
+ To "draw" something is simply to draw a line or the specified <arrow>
+ from the current node to the specified target node. The target then
+ becomes the current node. All the features of arrows as described
+ in~\S??g[:arrow] can be used, in particular arrows can be labelled and
+ segmented, but with the change that <path-pos> means <node> as
+ explained in note~\S??g[xyarrow.doc:segment].
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[map]??=[mapped]??=[list of subgraphs]
+%
+ To "map over a list" is simply to save the current node and then
+ interpret the <list> with the following convention:
+%
+\begin{itemize}
+\item Start each element of the list with the current node as saved and $p$
+ as the previous list element, and
+\item let the |?| <node> refer to the saved current node explicitly.
+\end{itemize}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[next column/row]
+%
+ The |&| and |\\| special moves are included to make it simple to enter
+ `matrix-like' things as graphs -- note that they will not be
+ automatically aligned, however, for that you should use the |!M|
+ escape.
+
+ |&| is the same as |[r]| and |\\| is the same as
+ |[r]!{y+(0,-1)-(0,0)}| which uses a kernel escape to moves to the
+ first column in the next row (where the first column is on the
+ $y$-axis of the current coordinate system).
+
+ \NOTE: If you use the form |*{|\dots|}| for nodes then you don't
+ have to change them if you decide to use an \Xy-matrix.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[typeset and saved]??=[saved]
+%
+ Typeset <it> and make it the current node. Also saves <it> for later
+ reference using |"|<id>|"|: if <it> is a simple letter, or digit,
+ then just as |"|<it>|"|; if <it> is of the form
+ |{|"text"|}| or |*|\dots|{|"text"|}| then as |"|"text"|"|.
+
+ With the |=| addition it is possible to save explicitly in case
+ several nodes have the same text or a node has a text that it is
+ impractical to use for reference. In fact using the form
+ <it>|="|<id>|"| will "only" save the node as |"|<id>|"| and "not" as
+ |"|<it>|"|! As a special convenience |""| (thus the empty <id>)
+ always refers to the last completed node, so adding |=""| after a
+ node merely means it should "not" be saved under its proper name.
+
+\begin{exercise}
+ How did the author typeset this?
+%
+\begin{code}
+\xygraph{
+ []A="A1" :@/^/ [r]A
+ :@/^/ [r]A
+ :@/^/ "A1" }
+\end{code}
+$$\docode$$
+%
+\answercode
+\answertext{The first $A$ was named to allow reference from the last:
+ \displaycode}
+\end{exercise}
+
+\note??=[<hop>s]
+%
+ Moving by a series of "hops" is simply moving in a grid as the
+ sequence of |dulr| (for down/up/left/right) indicates. The grid is a
+ standard cartesian coordinate system with 3pc unit unless the current
+ base is redefined using |[]!{|\dots|}| with an appropriate <pos>ition
+ containing |:| and |::| as described in note~??g[xy.doc:base].
+
+ \TODO: Describe the use of <move>s with <place>s in detail \dots\ in
+ particular (1)~`until perpendicular to \dots' and (2)~`until
+ intercepts with \dots' can be coded\dots
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[perform <pos> <decor>]
+%
+ This `escapes' into the \Xy-pic kernel language and interprets the
+ <pos> <decor>. The current node is then set to the resulting $c$
+ object and the grid from the resulting "base".
+
+ The effect of the <pos> <decor> can be completely hidden from
+ \Xy-graph by entering it as |{\save| <pos> <decor> |\restore}|.
+
+\DOCMODE(
+\xydef@\NODE@escape{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\NODE@escape}%
+ \else\ifcat A\noexpand\next \DN@##1{\rungraphescape@{##1}}%
+ \else\ifcat !\noexpand\next \DN@##1{\rungraphescape@{##1}}%
+ \else\ifx \bgroup\next \DN@##1{\xy@{!{##1}}{}\POS##1\relax \xyFN@\NODE@i}%
+ \else\ifx ~\next \let\next@=\graphsetup@
+ \else \DN@{\xyerror@{Unknown graph <escape>}{}\xyFN@\NODE@i}%
+ \fi\fi\fi\fi\fi \next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[insert <matrix>]
+%
+ It is possible to insert a <matrix> in a graph provided the `matrix'
+ option described in~\S??g[:matrix] has been loaded: it overwrites the
+ node with the result of |\xymatrix|<matrix>. Afterwards the graph
+ grid is set as the top left `square' of the matrix, \ie, with |[d]|
+ and |[r]| adjusted as they work in the top left entry.
+
+ \BUG: |[dr]| immediately after the matrix will work as expected, \eg,
+ make the center of |"2,2"| the current node, but others might not, \eg,
+ |[rr]| will not necessarily place the current node on top of |"1,3"|.
+
+\DOCMODE(
+\xydefcsname@{graph !M}#1#{\NODE@matrix{#1}}
+
+\xydef@\NODE@matrix#1#2{\xyerror@{matrix feature not loaded}{}\xyFN@\GRAPH@}
+
+\xydef@\NODE@matrix@#1#2{\xy@{!M#1{#2}}{}%
+ \def\everyentry@{\GRAPHeveryentry}%
+ \xymatrix#1{#2}%
+ \let\everyentry@=\empty \insertmatrixingraph@ \xyFN@\NODE@i}
+
+\xydef@\GRAPHeveryentry{\def\:{\ar}\def\="##1"{\xy@@{\idfromc@{##1}}}}
+
+\xywithoption{matrix}{\let\NODE@matrix=\NODE@matrix@}
+
+\xydef@\insertmatrixingraph@{%
+ \xy@@{\enter@{\cfromthec@ \pfromthep@}%
+ \expandafter\let\expandafter\next@\csname Q@1,1\endcsname
+ \ifx\next@\relax\else
+ \next@ \swap@
+ \expandafter\let\expandafter\next@\csname Q@1,2\endcsname
+ \ifx\next@\relax\else \next@ \setbase@\X@p\Y@p\X@c\Y@c
+ \expandafter\let\expandafter\next@\csname Q@2,1\endcsname
+ \ifx\next@\relax\else
+ \next@ \setbase@@{-\X@c}{-\Y@c}\fi\fi\fi
+ \leave@}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[insert <polygon>]??=[insert <ellipse>]
+%
+ It is possible to insert a <polygon> or an <ellipse> in a graph
+ provided the |poly| option described in~\S??g[:poly] or the |arc|
+ option described in~\S??g[:arc] has been loaded, respectively:
+ it will have $c$ as the current node, $p$ as the previous one, and
+ the the current base has the <hop>s |[r]| and |[u]| as base vectors.
+
+ \NOTE: lattices, knots, \etc, can also be used but no special syntax
+ is useful since the |!{|\dots|}| syntax is adequate.
+
+\DOCMODE(
+\xydefcsname@{graph !P}#1#{\NODE@poly{#1}}
+\xydef@\NODE@poly#1#2{\xyerror@{poly(gon) feature not loaded}{}\xyFN@\GRAPH@}
+\xydef@\NODE@poly@#1#2{\xy@{!P#1{#2}}{}\xypoly@#1{#2}\xyFN@\NODE@i}
+\xywithoption{poly}{\let\NODE@poly=\NODE@poly@}
+
+\xydefcsname@{graph !E}#1#{\NODE@arc{#1}!}
+\xydef@\NODE@arc#1#2{\xyerror@{(ellipse+)arc feature not loaded}{}%
+ \xyFN@\GRAPH@}
+\xydef@\NODE@arc@#1#2{\xy@{!E#1{#2}}{}\ellipse#1{#2}\xyFN@\NODE@i}
+\xywithoption{arc}{\let\NODE@arc=\NODE@arc@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[setup parameters]
+%
+ This allows setting of some parameters of the graph: |!~|<setup>
+ should be one of the following:
+%
+\begin{defs}
+%
+ |!~:{| <arrow> |}| & include with every |:| arrow \cr
+ |!~-{| <arrow> |}| & include with every |-| line \cr
+ |!~*{| <modifiers> |}| & include with every non-|*| node \cr
+ |!~|<letter>|{| <graph> |}| & define new graph escape |!|<letter>
+%
+\end{defs}
+\noindent\unskip
+%
+ These are destructive: the previous value is lost; the default is
+ established by the sequence |!~:{}| |!~-{@{-}}| |!~*{+}| making |:|
+ create simple arrows, |-| plain lines, and formatting default nodes
+ in math mode with the default objectmargin.
+
+\DOCMODE(
+\xylet@\GRAPHeveryarrow@@=\empty
+
+{\xyuncatcodes \gdef\next{@{-}}}
+\xylet@\GRAPHeveryline@@=\next
+
+\xydef@\graphsetup@~{\xyFN@\graphsetup@i}
+
+\xydef@\graphsetup@i{%
+ \ifx :\next \DN@:##1{\def\GRAPHeveryarrow@@{##1}\xyFN@\NODE@i}%
+ \else\addDASH@\ifx\next
+ \addDASH@\DN@##1{\def\GRAPHeveryline@@{##1}\xyFN@\NODE@i}%
+ \else\ifx *\next \DN@*##1{\def\GRAPHnodemodifiers@@{##1}\xyFN@\NODE@i}%
+ \else\ifcat A\next \DN@##1##2{\newgraphescape{##1}{##2}\xyFN@\NODE@i}%
+ \else \DN@{\xyerror@{illegal graph setup \codeof\next@}{}\xyFN@\NODE@i}%
+ \fi\fi\fi\fi \next@}
+\DOCMODE)
+
+ The last possibility is also available as a command
+%
+\begin{defs1}
+%
+ ??c![\newgraphescape]|{|<letter>|}{|<graph>|}| \cr
+%
+\end{defs1}
+\noindent\unskip
+%
+ that makes the specified escape generate the <graph> as a macro; with
+ it it is possible to pass arguments to the <graph> using the standard
+ \TeX\ |\def| method: The declaration code
+%
+\begin{code}
+\newgraphescape{i}#1#2{
+ []!{+0="o#2"*=<10pt>{};p!#1**{},"o#2"
+ -/4pt/*!E\cir<2pt>{}
+ +0;p-/:a(-30)24pt/**\dir{-}="X2"
+ ;p-/:a(-60)24pt/="X1"**\dir{-}
+ ;?(.5),="i#2",
+ p-/:a(-60)24pt/**\dir{-},
+ "o#2"."i#2"."X1"."X2"}}
+\end{code}
+{\gdocode}%
+\displaycode\noindent
+%
+ is (rather complicated kernel code) that makes the node escape
+ |!i|$dn$ typeset an `inverter' oriented with the $d$ corner as the
+ output with input named |"i|$n$|"| and output named |"o|$n$|"| such
+ that the graph
+%
+\begin{code}
+\xygraph{ []!iR1 ("i1"[l]x - "i1") - [r]z }
+\end{code}
+\displaycode\noindent
+%
+ will typeset
+$$
+\docode
+$$
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The ??c![\newgraphescape]<letter> declaration defines a macro with
+ name |\graph !|<letter>. It is slightly complicated by the fact that
+ we accept \LaTeX-style |[n]| arguments (when using \LaTeX, that
+ is~\smiley). Thus an internal macro named |\G!|<letter> is defined
+ using the appropriate command definition primitve; this is in turn
+ invoked by |\graph !|<letter> after activating the <graph> parser.
+
+\DOCMODE(
+\xydef@\newgraphescape#1{%
+ \expandafter\let\expandafter\next\csname graph !#1\endcsname
+ \ifx\next\relax\else \expandafter\let\csname G!#1\endcsname=\undefined
+ \xywarning@{Redefining graph <escape> !#1}\fi
+ \expandafter\gdef\csname graph !#1\endcsname{%
+ \expandafter\let\expandafter\next\csname G!#1\endcsname
+ \expandafter\xyFN@\expandafter\NODE@\next}%
+ \DN@{\newgraphescape@{#1}}\xyFN@\next@}
+
+\xydef@\newgraphescape@#1{%
+ \ifx [\next %]
+ \ifx\newcommand\undefined \xyerror@{[n] only with LaTeX}%
+ \else
+ \def\nextiv@{\expandafter\newcommand\expandafter{\csname G!#1\endcsname}}\fi
+ \else \def\nextiv@{\expandafter\gdef\csname G!#1\endcsname}\fi \nextiv@}
+
+\xydef@\rungraphescape@#1{%
+ \expandafter\let\expandafter\next\csname graph !#1\endcsname
+ \ifx\next\relax \xyerror@{Undefined graph <escape> !#1}\fi \next}
+\DOCMODE)
+
+%\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%\note??=[use <prefix>]
+%%
+% This will setup a <prefix> such that all the entries of the graph
+% will get that prefix.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The final exercise illustrates much of the above.
+
+\begin{exercise}
+%
+ Typeset
+%
+\begin{displaymath}
+\begin{code}
+\SelectTips{cm}{}
+\objectmargin={1pt}
+\xygraph{ !{0;(.77,-.77):0}
+ !~:{@{-}|@{>}}
+ w (:[r(.6)]{x_1}
+ ,:[d]z:[r]y:[u(.6)]{x_2}:"x_1":"z"
+ :@( {"w";"z"}, {"y";"z"})"z":"x_2") }
+\end{code}
+\docode
+\end{displaymath}
+%
+\answercode
+\answertext{The author did\displaycode It also shows that one \emph{can} use
+ |{}|s inside delimited arguments \emph{provided} one adds a space to
+ avoid the |{}|s being shaved off!}
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection*{End \& log}
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xygraph.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% New for v3...
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs how we are formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% LaTeX-indent-level:1
+% TeX-brace-indent-level:1
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyguide.man b/Master/texmf-dist/source/generic/xypic/xyguide.man
new file mode 100644
index 00000000000..fa96c7b5c6c
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyguide.man
@@ -0,0 +1,2285 @@
+%% $Id: xyguide.man,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+%%
+%% ``Xy-pic User's Guide''.
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+
+\documentclass{article}
+%begin{latexonly}
+\usepackage{xydoc}
+%end{latexonly}
+\begin{htmlonly}
+\usepackage{xyhtmldoc}
+\end{htmlonly}
+\input{version}
+\CompilePrefix{xygui-}
+\makeindex
+\begin{document}
+
+\title{ \Xy-pic User's Guide }
+\author{ Kristoffer H. Rose\quad<krisrose@ens-lyon.fr>\thanks{%
+ Laboratoire de l'Informatique du Parall\'elisme,
+ Ecole Normale Sup\'erieure de Lyon;
+ 46, All\'ee d'Italie; F--69364 Lyon 7, France.}}
+\date{Version \xyversion, \printdate{\xydate}}
+\maketitle
+
+\begin{abstract}
+%
+ \Xy-pic is a package for typesetting graphs and diagrams using
+ Knuth's \TeX\ typesetting system. \Xy-pic works with most of the
+ many formats available; \eg, plain \TeX, \LaTeX, and \AMS-\TeX.
+ Several styles of input for various diagram types are supported; they
+ all share a mnemonic notation based on the \emph{logical composition
+ of visual components}. This guide concentrates on how to typeset
+ ``matrix-like'' diagrams, such as ??w![commutative diagrams], in the
+ following style:
+%
+\begin{displaymath}
+\begin{code}
+\xymatrix{
+ U \ar@/_/[ddr]_y \ar@/^/[drr]^x
+ \ar@{.>}[dr]|-{(x,y)} \\
+ & X \times_Z Y \ar[d]^q \ar[r]_p
+ & X \ar[d]_f \\
+ & Y \ar[r]^g & Z }
+\end{code}
+%
+\docode
+\end{displaymath}
+%
+was typeset by the \Xy-pic input lines
+%
+\displaycode\noindent
+%
+Such diagrams have the following characteristics:
+%
+\begin{itemize}
+
+\item
+ Specified as a matrix of entries that are automatically aligned in rows and
+ columns.
+
+\item
+ Any entry may be connected to any other entry using a variety of
+ arrow styles all rotated and stretched as required.
+
+\item
+ Arrows may be decorated with labels that are tied to a specified
+ point along the arrow and extend in a particular direction; and
+ arrows may be paired, cross, and visit/bend around other entries ``on
+ the way.''
+
+\end{itemize}
+%
+ Several other styles of input are supported; a short survey of the
+ possibilities is included last at the end along with information on
+ how \Xy-pic can be obtained.
+%
+\end{abstract}
+
+\tableofcontents
+
+
+
+\section*{Preface}\noindent
+\addcontentsline{toc}{section}{Preface}%
+%
+ This guide explains some features of \Xy-pic that are relevant to
+ typesetting of ``matrix-like diagrams'' as used in, for example,
+ category theory; please refer to the reference
+ manual~\cite{RM95:Xy-picRM} for complete information on the described
+ constructions. The guide assumes that you have some experience in
+ using \TeX\ for typesetting mathematics, \eg, have
+ studied~\cite[ch.~16--19]{K84:TeXbook}, \cite[sec.~3.3]{L94:LaTeX},
+ or~\cite{S90:JoyT}, and that \Xy-pic is installed on your \TeX\
+ system as described in the |INSTALL| file accompanying the
+ distribution.
+
+ The first section describes what you need to get started, in
+ particular all that is needed to typeset the diagram in the abstract.
+ Section~??[arrows] and~??[entries] explain advanced use of arrows and
+ entries, respectively. Finally, section~??[avail] explains where and
+ under what conditions \Xy-pic is available, gives the relation of
+ version \xyversion\ to previous versions, and lists further sources
+ of information.
+
+ Throughout we give exercises that you should be able to solve as you
+ go along; all exercises are answered at the end just prior to the
+ references and index.
+
+
+
+\section{Basics}
+??=[basics]
+%
+ This section explains the \Xy-diagram construction concepts needed to
+ get started with typesetting matrix-like diagrams.
+
+
+\subsection{Loading}
+??=[basics.loading]
+%
+ The \Xy-pic setup used in this guide is loaded??w[loading] by
+ inserting the lines
+%
+\begin{defs1}
+ \cs{input} |xy| \cr
+ ??c![\xyoption]|{all}|
+\end{defs1}
+\noindent\unskip
+%
+ in the definitions part of your
+ document.\footnote{??w![\LaTeXe]~\cite{L94:LaTeX} users can use
+ ??c![\usepackage]|[all]{xy}|.} If you wish to load only the
+ features you use, or you wish to use non-standard facilities like the
+ |v2| backwards compatibility mode\footnote{If you use the version~2
+ loading command \cs{input} |xypic| (or the |xypic| document style
+ option) then the ??c![v2] option described in section ??[compat] will
+ be loaded automatically.} or the ??c![ps] \PS\ backend then this is
+ also possible as described in the reference
+ manual~\cite{RM95:Xy-picRM}.
+
+
+\subsection{Entries}
+??=[basics.entries]
+%
+ A diagram is created by the command
+%
+\begin{defs1}
+ ??c![\xymatrix]|{|~\dots~|}|
+\end{defs1}
+\noindent\unskip
+%
+ where the ``\dots'' should be replaced by \emph{entries}??w[entry] to
+ be aligned in \emph{??w![rows]} and \emph{??w![columns]} where
+%
+\begin{itemize}
+
+\item
+ entries in a row are separated by ??c![&],\footnote{Thus when using
+ \protect\Xy-constructions involving |&| inside other tabular
+ constructions then enclose the \protect\Xy-pic construction in an
+ extra pair of braces!} and
+
+\item
+ entire rows are separated by ??c![\\].
+
+\end{itemize}
+%
+ For example,
+\begin{displaymath}
+\begin{code}
+\xymatrix{
+ A &*+[F]{\sum_{i=n}^m {i^2}} \\
+ & {\bullet} & D \ar[ul] }
+\end{code}
+\docode
+\end{displaymath}
+%
+ was typeset by
+%
+\displaycode\noindent
+%
+ Notice the following:
+%
+\begin{itemize}
+
+\item
+ entries are typeset as mathematics (using ``??w![text style]'');
+ entries should not start with a macro (as illustrated by the use of
+ |{}| around |\bullet|\,.
+
+\item
+ all entries are centered and the separation between rows and columns
+ is usually quite large in a diagram,
+
+\item
+ empty entries at the end of rows may be omitted,
+
+\item
+ ``\Xy-decorations'' (here |\ar[ul]|) in entries allow drawing of
+ arrows and such relative to the entries without changing the overall
+ layout, and
+
+\item
+ ``\Xy-modifiers'' (here |*+[F]|) first in entries allow changing the
+ format and shape in many ways.
+
+\end{itemize}
+
+
+
+\subsection{Arrows}
+??=[basics.arrows]
+%
+ An ``??w![arrow]'' in an \Xy-pic diagram is a generic term for the
+ drawn decorations between the entries of the basic matrix structure.
+ In \Xy-pic all arrows must be specified along with the entry in which
+ they start; this is called their \emph{??w![base entry]}. Each
+ particular arrow command then refers explicitly to its
+ \emph{??w![target entry]}. This is obtained using the ??c![\ar]
+ command which accepts many options of which we will describe a few
+ here and some more in section~??[arrows]. In its simplest form an
+ arrow is entered as |\ar[|\emph{hop}|]| where \emph{??w![hop]} is
+ a sequence of single letters: ??c![u] for up, ??c![d] for down,
+ ??c![l] for left, and ??c![r] for right, \eg, the arrow |\ar[ur]|
+ reads ``typeset an arrow from the current entry to that one up and one
+ right.''
+
+\begin{exercise}
+ Which entry does ??C![] refer to?
+\answertext{The target |[]| is the current entry itself.}
+\end{exercise}
+
+\vspace{\medskipamount}\noindent
+%
+ The relative ??w![coordinates] specified in this way are purely
+ logical, \eg, if the diagram contains very wide entries then
+ ``diagonal'' arrows will be nearly horizontal. The constructed arrows
+ are aligned along the line between the centers of the base and target
+ entries; they will not automatically disappear under entries that
+ they cross (we discuss how this is achieved in
+ section~??[arrows.pass]).
+
+ The ??w![arrow style] kan be changed by writing the command as
+ |\ar@|\emph{style}|[|\emph{hop}|]|. This will be described in
+ more detail in section~??[arrows.styles]; here we just list the most
+ common ??c![@]\emph{style}s (obvious variations also work):
+%
+\begin{displaymath}
+\begin{code}
+ \DEF\st#1{\hbox{\lower1ex\rlap{\kern1pc %
+ \xy*{}+/r2pt/\ar@{#1},<1pc,-1.8pc>*{}\endxy}|@{#1}|}}
+ \st{=>}\quad\st{.>}\quad\st{:>}\quad\st{~>}\quad\st{-->}\quad\st{-}\quad\st{}
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+
+\begin{exercise}
+%
+ Typeset
+%
+\begin{displaymath}
+\begin{code}
+\xymatrix{
+ {\bullet} \ar@{--}[d]\ar@{=}[dr]\ar@{-}[r]
+ & {\bullet} \ar@{.}[d] \\
+ {\bullet} & {\bullet} \ar[l] }
+\end{code}
+\docode
+\end{displaymath}
+%
+\answercode
+\answertext{The author did }
+\answerdisplaycode
+\answertext{\noindent Notice how
+ $\bullet$ has been enclosed in |{}| since it is an ``expandable''
+ entity, \ie, a defined macro: this is recommended.}
+\end{exercise}
+
+
+\subsection{Labels}
+??=[basics.labels]
+ You can put ??w![label]s on arrows. Labels are conceptualized as
+ sub- and superscripts on arrows such that they are placed in the
+ usual positions (as ``limits''), \ie, ??c![^] reads ``above'' and
+ ??c![_] ``below'' on an arrow pointing right. Notice that the
+ positions depend \emph{only} on the direction of the arrow, the
+ absolute notions of ``up,'' ``down,'' etc. are not important. For
+ example,
+%
+\begin{code}
+$\xymatrix@1{
+ X\ar[r]^a_b & Y & Z\ar[l]^A_B }$
+\end{code}
+\displaycode\noindent
+%
+ will set \begin{IMAGE}\docode\end{IMAGE} (the ??c![@1] is a
+ special code that can be
+ used for ``one-line'' diagrams to improve the placement on the line;
+ more such spacing codes are described in section~??[entries.resizing]).
+
+ It is possible to use labels that are not single letters, digits, or
+ control sequences: if a simple math formula in the default style
+ (script style) is desired then simply enclose in |{|\dots|}|. In
+ practice anything can be used as a label as described in
+ section~??[arrows.objects].
+
+ Each label is placed perpendicular to the arrow at the point halfway
+ between the centers of the base and target objects. This is usually
+ the most æsthethic, however, in diagrams where the sizes of the
+ entries vary much it is sometimes nicer to place the label at the
+ center of the actual arrow??w[label centered on arrow]. This
+ behaviour is requested by inserting a ??c![-] (minus) right after the
+ |^| or~|_|:
+%
+\begin{code}
+$\xymatrix@1{
+ A\times B\times C\times D \ar[r]^-{+} &B
+}$
+\end{code}
+%
+\begin{IMAGE}
+\docode
+\end{IMAGE} was typeset by
+%
+\displaycode\noindent
+%
+ (it becomes
+%
+\begin{code}
+$\xymatrix@1{
+ A\times B\times C\times D \ar[r]^{+} &B
+}$
+\end{code}
+%
+\begin{IMAGE}
+\docode
+\end{IMAGE}without the~|-|). In fact |-| is in just one of the may
+ possible placings of labels described in section~??[arrows.places].
+
+\begin{exercise}
+%
+ Typeset the second axiom of category theory as
+%
+\begin{displaymath}
+\begin{code}
+\xymatrix{
+ A \ar[r]^f \ar[dr]_{f;g}
+ & B \ar[d]^g \ar[dr]^{g;h} \\
+ & C \ar[r]_h & D }
+\end{code}
+\docode
+\end{displaymath}
+%
+\answercode
+\answertext{The author used }
+\answerdisplaycode
+\end{exercise}
+
+
+\subsection{Breaks}
+??=[basics.breaks]
+ It is also possible to ``??w![break]'' an arrow with a label using the
+ ??c![|] character:
+%
+\begin{code}
+$\xymatrix@1{A\ar[r]|f&B}$
+\end{code}
+%
+ \thecode\ will set
+\begin{IMAGE}
+\docode
+\end{IMAGE}.
+
+ If you just want an empty break you should use the special
+ ??c![\hole] break:
+%
+\begin{code}
+$\xymatrix@1{ A\ar[r]|\hole & B }$
+\end{code}
+%
+ the arrow \begin{IMAGE}\docode\end{IMAGE} was typeset by
+ including \thecode\ in the text.
+
+ A different use of breaks is to place a label somewhere in a diagram
+ outside the normal matrix mesh??w[entry outside matrix]: this is
+ accomplished by ``breaking'' an ??w![invisible arrow] obtained using
+ the ??c![@{}] ??w![arrow style]: the square
+%
+\begin{displaymath}
+\begin{code}
+\xymatrix{\ar @{} [dr] |{=}
+ A \ar[d] \ar[r] & B \ar[d] \\
+ B \ar[r] & C }
+\end{code}
+\docode
+\end{displaymath}
+%
+ was typeset by
+%
+\displaycode\noindent
+%
+ There is more on breaks in section~??[arrows.pass].
+
+\begin{exercise}
+%
+ Typeset the first axiom of category theory as the display
+%
+\begin{displaymath}
+\begin{code}
+\xymatrix{
+ A \ar[d]_f \ar[r]^f
+ & B \ar[dl]|{i_B} \ar[d]^g \\
+ B \ar[r]_g & C }
+\end{code}
+\docode
+\end{displaymath}
+%
+\answercode
+\answertext{The author entered }
+\answerdisplaycode
+\end{exercise}
+
+
+\subsection{Curving}
+??=[basics.bends]
+%
+ Arrows can be made to ??w![curve], for example to avoid going through
+ another entry, using the special style |@/|\emph{curving}|/|. The
+ simplest styles of \emph{curving} are the following, shown applied
+ to an arrow from $A$ to $B$:
+%
+\begin{displaymath}
+\begin{code}
+\DEF\a#1{*\hbox{\DEF\1{#1}\enspace\tt\codeof\1}& A \ar#1[r] & B}
+\xymatrix @R-1.4pc{
+ \a{@/^/} \\
+ \a{@/_/} \\
+ \a{@/_1pc/} }
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}??c[@/^/]??c[@/_/]
+\end{displaymath}
+%
+ As the last example shows a dimension can be inserted just after |^|
+ or |_| if more or less curving is desired.
+
+ In case it is easier to specify the in- and out-going directions of
+ the curving then that is also possible: use
+%
+\begin{defs1}
+ ??c![@(]\emph{in}|,|\emph{out}|)|
+\end{defs1}
+\noindent\unskip
+%
+ where \emph{in} and \emph{out} are one of the following
+ \emph{??w![direction]s}:
+%
+\begin{displaymath}
+\begin{code}
+\xy *=<2pc>[o][F]{}="c",
+ "c"; (-1,-1)**{},p+/3pc/ *+{|dl|} **@{-}?>*@{>},
+ "c"; ( 0,-1)**{},p+/3pc/ *+{|d|} **@{-}?>*@{>},
+ "c"; ( 1,-1)**{},p+/3pc/ *+{|dr|} **@{-}?>*@{>},
+ "c"; ( 1, 0)**{},p+/3pc/ *+{|r|} **@{-}?>*@{>},
+ "c"; ( 1, 1)**{},p+/3pc/ *+{|ur|} **@{-}?>*@{>},
+ "c"; ( 0, 1)**{},p+/3pc/ *+{|u|} **@{-}?>*@{>},
+ "c"; (-1, 1)**{},p+/3pc/ *+{|ul|} **@{-}?>*@{>},
+ "c"; (-1, 0)**{},p+/3pc/ *+{|l|} **@{-}?>*@{>}
+\endxy
+\end{code}
+\docode
+\end{displaymath}
+\noindent\unskip
+%
+ In this case the curving is computed such that the curve begins at the
+ base entry in the \emph{in} direction and ends at the target entry
+ from the \emph{out} direction (this means that $|@(|d_1|,|d_2|)|$
+ and $|@(|d_2|,|d_1|)|$ are mirror images. See
+ section~??[arrows.changing] for more directions).
+
+\begin{exercise}
+%
+ Typeset
+%
+\begin{displaymath}
+\begin{code}
+\xymatrix{
+ x \ar@(ul,dl)[]|{id} \ar@/^/[rr]|f
+ && f(x) \ar@/^/[ll]|{f^{-1}} }
+\end{code}
+\docode
+\end{displaymath}
+%
+\answercode
+\answertext{The author did }
+\answerdisplaycode
+\answertext{\noindent Note that both arrows are
+ curved ``above'' relative to their direction.}
+\end{exercise}
+
+
+\subsection{Speeding up typesetting}
+??=[basics.speeding]
+%
+ One thing that you will notice is that \Xy-pic is sometimes slow in
+ typesetting diagrams (this is to be expected considering the number
+ of drawing operations performed as reflected by the number last in
+ each |xymatrix| message). If you follow the rule of starting all
+ entries with a (nonexpandable) character or |{| then you can insert
+ the declaration
+%
+\begin{defs1}
+ ??c![\CompileMatrices]
+\end{defs1}
+\noindent\unskip
+%
+ in the preamble of your document: this will create temporary
+ files\footnote{The temporary files are named the same as your
+ document but |.tex| is replaced by |-|$n$|.xyc| where $n$ is a
+ sequence number.} containing \emph{compiled} versions of each
+ matrix that can be loaded very quickly; they are automatically
+ recreated when a matrix is changed.
+
+ If this causes some diagrams to not work, then such compilation can be
+ explicitly switched off by using ??c![\xymatrixnocompile] in place of
+ |\xymatrix|. Compilation can be switched off completely with
+ ??c![\NoCompileMatrices] (which respects \TeX\ grouping as does
+ ??c![\CompileMatrices], by the way).
+
+ And if you are still not satisfied with the speed then you can add
+ the following:
+%
+\begin{defs1}
+ ??c![\OnlyOutlines]
+\end{defs1}
+\noindent\unskip
+%
+ which will omit all compiled pictures; the additional command
+ ??c![\ShowOutlines] will add a dotted rectangle outlining the size of
+ the picture.
+
+
+
+\section{More Arrows and Labels}
+??=[arrows]
+%
+ In this section we explain a number of variations of the
+ ??w![arrow]??c[\ar] commands that are useful in ??w![commutative
+ diagrams].
+
+
+\subsection{Explicit label positioning}
+??=[arrows.places]
+%
+ The ??w![label]??w[explicit positioning] commands explained in
+ section~??[basics.labels] place the label text near the point along
+ the arrow halfway between the centers of the base and target entries.
+ This, however, may be changed by inserting a \emph{place} between
+ the ??c![^], ??c![_], or ??c![|], and the actual label (in fact |-|
+ is a \emph{place}). In general you may insert the following:
+%
+\begin{itemize}
+
+\item
+ ??c![<] will place the label at the point where the actual arrow
+ begins, \ie, ``appears from under'' the base, so
+%
+\begin{code}
+$\xymatrix@1{A\ar[r]^<{+}&B}$
+\end{code}
+%
+ \thecode\ will typeset \begin{IMAGE}\docode\end{IMAGE}.
+
+\item
+ Similarly, ??c![>] will place the label at the point where the actual
+ arrow ends, \ie, ``disappears below'' the target, so
+%
+\begin{code}
+$\xymatrix@1{A\ar[r]^>{+}&B}$
+\end{code}
+%
+ \thecode\ will typeset \begin{IMAGE}\docode\end{IMAGE}.
+
+\item
+ ??c![<<] and ??c![>>] will place the following label at a point just
+ a bit\footnote{``A bit'' is in fact a \TeX\ ??c![\jot] which is usually
+ 3pt.}\ further from the beginning and end of the arrow, so
+%
+\begin{code}
+$\xymatrix@1{A\ar[r]^>>{+}&B}$
+\end{code}
+%
+ \thecode\ will typeset \begin{IMAGE}\docode\end{IMAGE}.
+ Using more |<|s or |>|s will move the label further in.
+
+\item
+ A factor in ??c![()]s: $|(|a|)|$ indicates that the label should be
+ ``tied'' to the point $a$ of the way from the center of the base entry
+ (called ??c![(0)]) to the center of the target (called ??c![(1)])
+ instead of in the middle, so
+%
+\begin{code}
+$\xymatrix@1{A\ar[r]^(.3){+}&B}$
+\end{code}
+%
+ \thecode\ will typeset \begin{IMAGE}\docode\end{IMAGE}.
+
+\item
+ A factor can be given \emph{after} some |<| or |>|s, in which case
+ the place is computed as if the base was specified by the
+ |<|s and target specified by the |>|s. Hence
+%
+\begin{code}
+$\xymatrix@1{A\ar[r]^<(0){+}&B}$
+\end{code}
+%
+ \thecode\ will typeset \begin{IMAGE}\docode\end{IMAGE}.
+
+\item
+ Finally, there is a simple way to denote the place on an arrow where
+ it ??w![intersects]??w[crossing arrows] with a straight line between
+ two points: the place |!{|$t_1$|;|$t_2$|}|??c[!{;}] places the label
+ relative to the point on the arrow where the line from the target
+ $t_1$ to the target $t_2$ crosses it. \BUG: Only works for straight
+ arrows at present.
+
+\end{itemize}
+%
+ As usual more possibilities can be found in the reference
+ manual~\cite[fig. 2]{RM95:Xy-picRM}.
+
+\begin{exercise}??=[x.intercept]
+%
+ Typeset
+%
+\begin{displaymath}
+\begin{code}
+\xymatrix{
+ 1 \ar[rr] ^-{1000000x}
+ \ar[dr] _(.2){2000x} |!{[d];[rr]}\hole
+ && 1000000 \\
+ 1000 \ar[r] _{2x}
+ \ar[urr] _>>>>{x^2}
+ & 2000 }
+\end{code}
+\docode
+\end{displaymath}
+%
+\answercode
+\answertext{The author used the display }
+\answerdisplaycode
+\answertext{\noindent In particular
+ notice how the break was specified to happen exactly where the two
+ arrows cross. For an easier but not so general method see
+ exercise~??[x.cube] last in section~??[arrows.pass].}
+\end{exercise}
+
+
+\subsection{Labeling with any object}
+??=[arrows.objects]
+%
+ \Xy-pic supports a general format for entering any \TeX\
+ ??w![text]??w[text label] as labels (as well as entries to be
+ explained later). The character |*| is reserved for this: in its
+ simplest form |*{|\emph{math}|}| will typeset the \emph{math}
+ material as an object. This is like |{|\emph{math}|}| except that
+ the default style is ignored and there is no added blank margin.
+
+ However, in general??w[label with any object] the following form of
+ ??c![*]\emph{object}??w[object] is available:
+%
+\begin{defs1}
+|*|\emph{modifiers}|{|\emph{text}|}|
+\end{defs1}
+\noindent\unskip
+%
+ where \emph{modifiers}??w[object modifier] can be used to change
+ the ??w![shape] and ??w![size] of the constructed object. The
+ following are the most common, the full list of possibilities can be
+ found in the reference manual~\cite[fig. 3]{RM95:Xy-picRM}:
+%
+\begin{defs}
+ ??c![+] & ??w![grow] \cr
+ |+<|\emph{dimen}|>| & grow by \emph{dimen} \cr
+ ??c![+=] & grow to enclosing ??w![square] \cr
+ ??c![-] & ??w![shrink] \cr
+ |-<|\emph{dimen}|>| & shrink by \emph{dimen} \cr
+ ??c![-=] & shrink to contained square \cr
+ ??c![!] & do not center \cr
+ ??C![o] & round??w[round shape] \cr
+ ??C![l] ??C![r] ??C![u] ??C![d] & adjust left, right,\dots??w[adjust] \cr
+ ??C![F] ??C![F=] &
+\begin{IMAGE}
+\xy*[F-]\hbox{\strut~frame~}\endxy
+\end{IMAGE}??w[frame]
+%
+\begin{IMAGE}
+\xy*[F=]\hbox{\strut~double~}\endxy
+\end{IMAGE}??w[double frame]\cr
+ ??C![F.] ??C![F--]
+ &
+\begin{IMAGE}
+\xy*[F.]\hbox{\strut~dotted~}\endxy
+\end{IMAGE}??w[dotted frame]
+%
+\begin{IMAGE}
+\xy*[F--]\hbox{\strut~dashed~}\endxy
+\end{IMAGE}??w[dashed frame]\cr
+ ??C![F-,] ??C![F-:<3pt>]
+ &
+\begin{IMAGE}
+\xy*[F-,]\hbox{\strut~shaded~}\endxy
+\end{IMAGE}??w[shaded frame]
+\begin{IMAGE}
+\xy*[F-:<3pt>]\hbox{\strut~rounded~}\endxy
+\end{IMAGE}??w[rounded frame]
+\end{defs}
+\noindent\unskip
+%
+ Since objects specified this way start with no margin, a single |+|
+ is usually included to get the ??w![default spacing].
+
+\begin{exercise}
+%
+\begin{code}
+\xymatrix@1{ A \ar[r]^*+[o][F-]{x} & B }
+\end{code}
+%
+ Typeset $\smash{\docode}$~.
+%
+\answercode
+\answertext{The author typed }
+\answerdisplaycode
+\end{exercise}
+\vspace{3ex}
+
+ There can only be one \emph{boxing}. This can be any box
+ generation command. The following are the most useful
+ \emph{boxing}|{|\emph{text}|}| combinations:
+%
+%\filbreak
+\begin{defs}
+ ??c![@]\emph{variant}|{|\emph{tip}|}| & ??w![tip] (or ??w![shaft]) object \cr
+ ??c![\txt]|{|\dots|}| & ordinary \emph{??w![text]} \cr
+ ??c![\composite]|{|\dots??c![*]\dots|}| & ??w![combined objects] \cr
+ ??c![\frm]|{}| & ??w![repeat last object]
+\end{defs}
+\noindent\unskip
+%
+ (the possibilities for \emph{variant} and \emph{tip} are given in the
+ following section). Finally, ??c![\hbox]|{|\dots|}|\footnote{The
+ plain \TeX\ command |\hbox| corresponds to |\mbox| in \LaTeX\
+ and |\text| in the \AMS\ variants.} is a quick way to ensure
+ text-mode interpretation of a single object. However, ??c![\txt]
+ allows the use of ??c![\\] in \emph{text} to create a ??w![line
+ break], and the special form |\txt<6pc>{|\dots|}| will constrain the
+ text to a ??w![centered] 6pc wide column. By the way, |\txt| can be
+ used outside of \Xy-pic constructions.
+
+ Finally, several objects can be combined using the last form; the
+ |*|s serve to separate the composed object.
+
+\begin{exercise}
+%
+\begin{code}
+\xymatrix@1{
+ A \ar @{/*\composite{{+}*{\times}}/} [rr]
+ ^*+\txt{High\\label}
+ && B}
+\end{code}
+%
+ Typeset $\docode$~.
+%
+\answercode
+\answertext{The author did }
+\answerdisplaycode
+\end{exercise}
+
+\vskip-\baselineskip
+\subsection{More arrow styles}
+??=[arrows.styles]
+%
+ The ??w![arrow style]s described in section~??[basics.arrows] are all
+ examples of the general \emph{??w![arrow style]} constructions
+%
+\begin{defs1}
+??c![@]\emph{??w![variant]}|{|\emph{??w![tail]} \emph{??w![shaft]}
+ \emph{??w![head]}|}|\cr
+??c![@]\emph{variant}|{|\emph{head}|}|
+\end{defs1}
+\noindent\unskip
+%
+ that in describes arrows with the indicated \emph{tail},
+ \emph{shaft}, and \emph{head} (on the first form the tail and
+ head can be omitted; the second style defaults to having no tail and
+ a standard shaft).??w[arrow head]??w[arrow shaft]??w[arrow tail]
+
+ The following possibilities exist for \emph{head} and \emph{tail}
+ which we will denote \emph{tips} (here shown as heads):
+%
+\begin{unformatteddefs}
+\begin{code}
+{\DEF\DT#1#{\DTx{#1}}
+ \DEF\DTx#1#2{\Dx{#1}{#2}&\xy-(4,0)*{};(4,2)*+{}**{}?>*@#1{#2} **@#1{.}\endxy}
+ \DEF\Dx#1#2{\hbox{\DEF\1{#2}\enspace{\tt\codeof\1}\index code{#2}}}
+ \DEF\Darray#1{{\let\\=\cr \tabskip=2em plus 1fil minus.8em %
+ \halign to\hsize{&\hfil$##$\tabskip=1em&$##$\hfil\tabskip=2em plus 1fil \cr
+ #1\crcr}}}
+ %
+ \Darray{%
+ \DT{<} &\DT{>} &\DT{x} \\
+ \DT{<<} &\DT{>>} &\DT{+} \\
+ \DT{|<} &\DT{>|} &\DT{|} \\
+ \DT{|<<} &\DT{>>|} &\DT{||} \\
+ \DT{(} &\DT{)} &\DT{o} \\
+ \DT{/} &\DT{//}}}
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{unformatteddefs}
+%
+ and the \emph{shaft} should be one of the following:??w[dotted
+ arrow]??w[dashed arrow]??w[squiggly arrow]
+%
+\begin{unformatteddefs}
+\begin{code}
+{\DEF\DC#1#{\DCx{#1}}
+ \DEF\DCx#1#2{ \Dx{#1}{#2} & \xy *+{} ; (12,4)*+{} **@#1{#2}\endxy}
+ \DEF\Dx#1#2{\hbox{\DEF\1{#2}\enspace\tt\codeof\1\index code{#2}}}
+ \DEF\Darray#1{{\let\\=\cr \tabskip=2em plus 1fil %
+ \halign to\hsize{&\hfil$##$\tabskip=1em&$##$\hfil\tabskip=2em plus 1fil \\
+ #1\crcr}}}
+ \Darray{%
+ \DC{-} &\DC{--} \\
+ \DC{~} &\DC{~~} \\
+ \DC{.} }}%
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{unformatteddefs}
+\goodbreak
+%
+ The \emph{variant} should be empty or one of the following:
+%
+\begin{defs}
+??c![^] & ``above'' variant??w[half arrow] \cr
+??c![_] & ``below'' variant \cr
+|2| & ``double'' variant??w[double arrow] \cr
+|3| & ``triple'' variant??w[triple arrow]
+\end{defs}
+\noindent\unskip
+%
+ Here are some standard arrows in this notation, all from $A$ to $B$
+ as usual:
+%
+\begin{displaymath}
+\begin{code}
+\DEF\a#1{*\hbox{\DEF\next{#1}\tt\codeof\next}& A \ar#1[rr] && B}
+\xymatrix @R-1.8pc @C-1pc {
+ \a{@{<->}} \\
+ \a{@^{<->}} \\
+ \a{@_{<->}} \\
+ \a{@2{<->}} \\
+ \a{@3{<->}} }
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+%
+ As a special convenience |=| and |:| are provided as abbreviations
+ for |-| and |.| with variant forced to~|2|.
+
+ As it can be seen, the variant will affect the \emph{entire} arrow.
+ Sometimes this is not what is wanted. In that case a \emph{local
+ variant} can be used by entering any of the \emph{tail},
+ \emph{shaft}, and \emph{head}, on the following form:
+%
+\begin{defs1}
+\emph{variant}|{|\emph{tip}|}|\cr
+\emph{variant}|{|\emph{shaft}|}|
+\end{defs1}
+\noindent\unskip
+%
+ Here are some arrows where this is required:
+%
+\begin{displaymath}
+\begin{code}
+\DEF\a#1{*\hbox{\DEF\next{#1}\tt\codeof\next}& A \ar#1[r] & B}
+\xymatrix @R-1.8pc{
+\a{@{^{(}->}} \\
+\a{@{|-_{>}}} }
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+%
+ Notice that there is no distinction between shafts and tips using
+ this form, thus it is necessary to include all three of
+ \emph{tail}, \emph{shaft}, and \emph{head}, when using it. The
+ advantage is that it is possible then to ``fill with a tip.''??w[tip in
+ shaft]??w[shaft as tip] Furthermore, the following additional
+ possibilities are available when using this notation:
+%
+\begin{unformatteddefs}
+\begin{code}
+{\DEF\DT#1#{\DTx{#1}}
+ \DEF\DTx#1#2{\Dx{#1}{#2}&\xy-(4,0)*{};(4,2)*+{}**{}?>*@#1{#2} **@#1{.}\endxy}
+ \DEF\Dx#1#2{\hbox{\DEF\1{#1{#2}}\enspace{\tt\codeof\1}\index code{#1{#2}}}}
+ \DEF\Darray#1{{\let\\=\cr \tabskip=0pt plus 1fil %
+ \halign to\hsize{&\hfil$##$\tabskip=1em&$##$\hfil\tabskip=1em plus 1fil \cr
+ #1\crcr}\bigskip}}
+ \Darray{%
+ \DT{|-} &\DT^{|-} &\DT_{|-} \\
+ &&\DT {|=} &\DT3{|-} \\
+ \DT{*} &\DT^{`} &\DT_{`} \\
+ &&\DT^{'} &\DT_{'} }}%
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{unformatteddefs}
+\noindent\unskip
+%
+ The even more general form |*|\emph{object} can be used, where
+ \emph{object} refers to any of the constructions described in
+ section~??[arrows.objects].
+
+\begin{exercise}
+%
+\begin{code}
+\xymatrix{
+ A \ar @/^/ @{^{<}-_{>}} [r]
+ \ar @/_/ @{{*}{x}{*}} [r] & B }
+\end{code}
+%
+ Typeset $\docode$~.
+%
+\answercode
+\answertext{The author entered }
+\answerdisplaycode
+\end{exercise}
+
+
+\subsection{Sliding arrows sideways}
+??=[arrows.sliding]
+%
+ It is often desirable to have several ??w![parallel] arrows between
+ two objects. This can be done by ??w![sliding] either or both arrows
+ ??w![sideways] a distance given as a \TeX\ dimension enclosed in
+ ??c![@<>]s: it specifies how far ``sideways'' the arrow should be
+ moved, \eg,
+%
+\begin{code}
+\xymatrix{
+ A \ar@<1ex>[dr]^a_{.} \\
+ & B \ar@<1ex>[ul]^b \ar@<1ex>[r]^c
+ & C \ar@<1ex>[l]^d_{.} }
+\end{code}
+\displaycode
+%
+\noindent will typeset
+%
+\begin{displaymath}
+\docode
+\end{displaymath}
+%
+ A positive distance will slide the arrow in the ``|^|-direction,'' \eg,
+ the two arrows above are slid in the direction of the labels~$a$,
+ $b$, $c$, and $d$, respectively; a negative distance in the
+ ``|_|-direction.'' The distance |<@1ex>| is often appropriate since it
+ corresponds roughly to the height of letters like ``x,'' in the type size
+ being used.
+
+\begin{exercise}
+%
+\begin{code}
+\xymatrix@1{
+ A \ar@/^/[r] \ar@/^/@<-1ex>[r] & B }
+\end{code}
+%
+ Typeset $\docode$~.
+%
+\answercode
+\answertext{The author typed }
+\answerdisplaycode
+\end{exercise}
+
+
+\subsection{More targets}
+??=[arrows.targets]
+%
+ The ??w![target] address can be given in a large number of formats
+ called \emph{??w![position]s}. The full range of possibilities is
+ described in the reference manual~\cite[fig. 1]{RM95:Xy-picRM}; here
+ is a number of useful ones in addition to the \emph{hop} format
+ described in section~??[basics.arrows]:
+%
+\begin{itemize}
+
+\item
+ $|[|r|,|c|]|$??C[], where $r,c$ are integers, denotes the
+ \emph{??w![relative entry]} found $r$~??w![rows] below and
+ $c$~??w![columns] to the right of the current entry (the ??w![current
+ entry] itself is thus |[0,0]|). This always corresponds to a
+ |[|\emph{??w![hop]}|]|, \eg, |[1,2]| is the same as |[drr]| and
+ |[-2,0]| is the same as |[uu]|.
+
+\item
+ $|"|r|,|c|"|$, where $r,c$ are positive integers, denotes the
+ \emph{??w![absolute entry]} found in the $r$th row and $c$th column
+ of the diagram. The top left entry is |"1,1"|.
+
+\item
+ $t'??c![;]t$~, where $t'$ is any target, changes the ??w![base entry]
+ of the present arrow to $t'$ and then sets the target to $t$ relative
+ to the original base entry. For example,
+%
+\begin{code}
+\xymatrix{ A \\
+ B & C \ar@<1ex>[ul]
+ \ar@<1ex>[ul];[] }
+\end{code}
+\displaycode
+%
+\noindent\unskip typesets
+%
+\begin{displaymath}
+\docode
+\end{displaymath}
+%
+ \ie, the second |\ar[ul]| arrow starts at the |[ul]| entry and ends
+ in the current entry.
+
+\end{itemize}
+%
+ See section~??[entries.naming] for how to use a label as a target.
+
+
+\subsection{Changing the target}
+??=[arrows.changing]
+%
+ It is possible to ??w![overwrite] a ??w![target] with another by
+ appending something of the form ??c![*]\emph{object} to it. This
+ has the effect of typesetting the \emph{object} at the current
+ position, thus effectively on top of the target, and then use what
+ was typeset as the target.
+
+ A target may also have its ??w![position] changed??w[changing
+ position]??w[adjusting position]??w[moving target] by one of the
+ following constructions:
+%
+\begin{itemize}
+
+\item
+ ??c![+]\emph{vector} or ??c![-]\emph{vector} which changes the
+ target to be a zero-sized one at the position obtained by adding or
+ subtracting the \emph{vector} to its center, or
+
+\item
+ ??c![!]\emph{vector} which moves the center of the target by the
+ \emph{vector};
+
+\end{itemize}
+%
+ where a \emph{??w![vector]} should have the form
+%
+\begin{itemize}
+
+\item
+ $|<|D_x|,|D_y|>|$ , where $D_x,D_y$ are \TeX\ dimensions, is the
+ vector with those coordinates??w[vector coordinates],
+
+
+\item
+ the following ``corner offsets'' of a target are vectors as shown:
+%
+\begin{displaymath}
+\begin{code}
+\DEF\corner#1{\POS"box"+0;"box"+#1 **@{-} ?>*@{>} +/1pc/ *\hbox{\tt#1}}
+%
+\xy 0.(-11,-6).(11,6)!C="box"*\frm{.},"box";
+ "box"+L**@{.}, "box"+R**@{.}, "box"+D**@{.}, "box"+U**@{.}
+%
+ \corner{L} \corner{R} \corner{D} \corner{U}
+ \corner{DL}\corner{DR}\corner{UL}\corner{UR}
+\endxy
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+%
+ (they must be specified in upper case)??w[vector to corner], and
+
+\item
+ ??c![/]$d$ \emph{dimen}|/| is the \emph{vector} going
+ \emph{dimen} in the particular ??w![direction]??w[vector in
+ direction] $d$ which can be either the eight simple ones in
+ section~??[basics.bends], empty to denote that the
+ \emph{??w![current direction]} (the last direction of an arrow)
+ should be used, or one of the following:
+%
+\begin{defs}
+ |va(|$\alpha$|)|??c[va()] & ??w![absolute angle] \cr
+ $d$|:a(|$\alpha$|)|??c[:a()] & ??w![relative angle] in ??w![degrees] \cr
+ $d$|:(|$x$,$y$|)|??c[:()] & ??w![relative vector] \cr
+ $d$??c![^] / $d$??c![_] & short for |:a(90)| / |:a(-90)|
+\end{defs}
+\noindent\unskip
+%
+ where the $d$ in the last four may be empty to denote the ``current
+ direction.''
+
+\item
+ ??c![0] is the zero vector.
+
+\end{itemize}
+%
+ Many, many more possibilities are described in the reference
+ manual~\cite{RM95:Xy-picRM}.
+
+\begin{exercise}
+ What is the difference between a target $t$ and the target $t$|+0|?
+\answertext{The size: $t$|+0| always has zero size.}
+\end{exercise}
+
+
+\subsection{Arrows passing under}
+??=[arrows.pass]
+%
+ Arrows can pass under??w[arrow passing under] (or via) any other
+ entry: Just insert ??c![']$t$, \ie, a quote (apostrophe) character
+ followed by a target, for each entry that should be visited except
+ the last, ``ordinary \& final'' entry:
+%
+\begin{code}
+\xymatrix{
+ {\circ}
+ \ar@{|-->} '[dr] ^a
+ '[rr]+D*{\bullet} ^b
+ [drrr] ^c
+ & {\circ} & {\circ} & {\circ} \\
+ {\circ} & {\circ} & {\circ} & {\circ} }
+\end{code}
+\displaycode
+\noindent
+ typesets
+%
+\begin{displaymath}
+\docode
+\end{displaymath}
+%
+ As you see, labels are set separately on each ??w![segment].
+
+\begin{exercise}??=[x.cube]
+%
+ Typeset the ``lambda ??w![cube]''??w[crossing arrows]
+%
+\begin{displaymath}
+\begin{code}
+\xymatrix@!0{
+ & \lambda\omega \ar@{-}[rr]\ar@{-}'[d][dd]
+ & & \lambda C \ar@{-}[dd]
+\\
+ \lambda2 \ar@{-}[ur]\ar@{-}[rr]\ar@{-}[dd]
+ & & \lambda P2 \ar@{-}[ur]\ar@{-}[dd]
+\\
+ & \lambda\underline\omega \ar@{-}'[r][rr]
+ & & \lambda P\underline\omega
+\\
+ \lambda{\to} \ar@{-}[rr]\ar@{-}[ur]
+ & & \lambda P \ar@{-}[ur]
+}
+\end{code}
+\docode
+\end{displaymath}
+%
+\noindent\unskip
+%
+ \emph{Hint}: ``going under'' an empty entry leaves a small gap at
+ that location.??w[crossing arrows] The compactness is achieved using
+ a trick described in section~??[entries.resizing].
+%
+\answercode
+\answertext{The author constructed }
+\answerdisplaycode
+\answertext{A special thing is added: |@!| forces rows and columns to be
+ equally spaced as discussed in section~??[entries.resizing]; |@!0|
+ furthermore makes the spacing ignore the entry sizes, giving a
+ completely fixed grid. The gaps could also be made with the
+ |!|\dots\ crossing notation of exercise~??[x.intercept] last in
+ section~??[arrows.places] but the above is shorter.}
+\end{exercise}
+
+
+\subsection{More bending arrows}
+??=[arrows.bend]
+%
+ Finally, arrows can ??w![bend] around entries: just insert
+ ??c![`]$d\,t$, \ie, a backquote and a ??w![direction] $d$ followed by
+ a target $t$, for each ``??w![turn]'' that starts out in the
+ $d$-direction and ends in a ??w![quarter turn] towards the
+ target~$t$. This is different from the curving??w[curve] described
+ earlier in that all turns consist of a straight part ending in a turn
+ which is a multiple of \slashedfrac18 ??w![circle segments], and each
+ segment allows separate ??w![label]s.
+
+ The possible directions are those of section~??[basics.bends] and
+ ??[arrows.changing], and the possible targets include all those
+ discussed above. Actually the direction is only required for the
+ first in a series of turns since the final direction of one turn is
+ the obvious choice for the following turn. Furthermore, turns can be
+ changed from the default by adding either ??c![^]$d$ for
+ anticlockwise turn to $d$ or ??c![_]$d$ for clockwise turn to $d$,
+ where $d$ is the ``exit direction'' of the turn.
+
+ Finally, the turns will have ??w![radius] 10pt by default, but this
+ can be changed to any dimension $R$ from a particular turn and
+ onwards by inserting ??c![/]$R$ immediately after the |``| of the
+ turn??w[changing turn radius]. Here is an example involving all of
+ these features:
+%
+\begin{code}
+\xymatrix{
+ {\circ} \ar `r[d] ^a
+ `[rr] ^b
+ `/4pt[rr] ^c
+ `[rrr] ^d
+ `_dl[drrr]^e
+ [drrr]^f
+ & {\circ} & {\circ} & {\circ} \\
+ {\circ} & {\circ} & {\circ} & {\circ} }
+\end{code}
+\displaycode
+\noindent
+%
+ typesets
+%
+%
+\begin{displaymath}
+\docode
+\end{displaymath}
+%
+ The example illustrates the following points:
+%
+\begin{itemize}
+
+\item
+ If the segment can not be made as short as required then it will
+ point ``past'' the target. This is useful for ``??w![going around]''
+ entries.
+
+\item
+ There is \emph{one |`| per turn} thus each target appears as many
+ times as there are turns towards it, except the last target that
+ appears one more time namely both with |`| for each turn towards it
+ \emph{and} once as an ``ordinary'' target to set the final stretch.
+
+\item
+ The sizes of the intermediate targets are ignored.
+
+\end{itemize}
+
+\begin{exercise}
+%
+ Typeset
+\begin{IMAGE}$%
+%
+\begin{code}
+\xymatrix@1{
+ A \ar@<-2pt> `d[r] `[r] [r]
+ \ar@<+2pt> `d[r] `[r] [r] & B }
+\end{code}
+%
+ \docode$
+\end{IMAGE}~.
+%
+\answercode
+\answertext{The author typed }
+\answerdisplaycode
+\end{exercise}
+
+
+\subsection{Defining new arrow types}
+??=[arrows.defining]
+%
+ Last in this treatment of arrows we will explain how ??w![new arrows]
+ can be defined??w[defining arrows]. The crucial fact is that the
+ characters used for \emph{??w![tip]s} and \emph{??w![shaft]s} are
+ restricted to the following:
+%
+\begin{defs}
+ |><||ox+/()[]|\verb*+ + &\quad \emph{tip} characters??w[tip characters]\cr
+ |-.~:=| &\quad \emph{shaft} characters??w[shaft characters]
+\end{defs}
+\noindent\unskip
+%
+ When an arrow is interpreted by \Xy-pic it is first split into the
+ three components and then each component is looked up in a library of
+ so-called ``??w![directionals].'' It is possible to add new such
+ directionals using the command
+%
+\begin{defs1}
+ ??c![\newdir]|{| \emph{directional} |}{| \emph{composite} |}|
+\end{defs1}
+\noindent\unskip
+%
+ where \emph{directional} should be a sequence either of tip
+ characters or of shaft characters, and \emph{composite} should be a
+ list of objects??w[combined objects] separated with ??c![*] just like
+ the argument to ??c![\composite] described in
+ section~??[arrows.objects]. If arrows of a particular
+ \emph{??w![variant]} (always one of the letters |^_23|) needs an
+ alternate definition then another declaration can be given with the
+ variant inserted between |\newdir| and the first |{|.
+
+ There is one ??w![object modifier] which is very useful in this
+ context, in addition to those of section~??[arrows.objects]:
+%
+\begin{defs}
+ ??c![!]\emph{vector} &\quad shift object \emph{vector}
+\end{defs}
+\noindent\unskip
+%
+ (where the possibilities for \emph{vector} are described in
+ section~??[arrows.changing]). Combined with the direction code this
+ is very powerful, for example,
+%
+\begin{code}
+\newdir{|>}{%
+ !/4.5pt/@{|}*:(1,-.2)@^{>}*:(1,+.2)@_{>}}
+\end{code}
+\displaycode
+\noindent\unskip
+%
+ defines a new tip that makes
+%
+\begin{code}
+\xymatrix{ A \ar @{=|>} [r] & B }
+\end{code}
+\displaycode
+\noindent\unskip
+%
+ typeset
+%
+\begin{code}
+\newdir{|>}{!/4.5pt/@{|}*:(1,-.2)@^{>}*:(1,+.2)@_{>}}
+\xymatrix{ A \ar @{=|>} [r] & B }
+\end{code}
+%
+ $\docode$~. Notice how the ``relative direction'' is used here to
+ rotate??w[rotation] some of the composed components.
+
+\begin{exercise}??=[arrows.def.ex]
+ Often tips used as ``tails'' have their ink on the wrong side of the
+ point where they are placed. Fortunately space (\verb*+ +) is also a
+ tip character so we can define the directional \verb*+ >+ to generate
+ a ``tail-spaced'' arrow. Do this such that
+%
+\begin{code}
+\xymatrix{ A \ar @{>->} @< 2pt> [r]
+ \ar @{ >->} @<-2pt> [r] & B }
+\end{code}
+\displaycode
+\noindent
+%
+ typesets
+%
+\begin{displaymath}
+\begin{code}
+\newdir{ >}{{}*!/-5pt/@{>}}
+\xymatrix{ A \ar @{>->} @< 2pt> [r]
+ \ar @{ >->} @<-2pt> [r] & B }
+\end{code}
+\docode
+\begin{code}
+\newdir{ >}{{}*!/-5pt/@{>}}
+\end{code}
+\end{displaymath}
+%
+\answercode
+\answertext{The author used }
+\answerdisplaycode
+\end{exercise}
+
+ Finally, when \Xy-pic diagrams are used in conjunction with Knuth's
+ \emph{??w![computer modern fonts]} then the declaration
+%
+\begin{defs1}
+ ??c![\SelectTips{cm}{}]
+\end{defs1}
+\noindent\unskip
+%
+ will change the tips to some that look similar, \eg,
+%
+\begin{code}
+$\SelectTips{cm}{}
+ \xymatrix@1{A\ar@{->>|}[r]&B}$
+\end{code}
+\displaycode\noindent
+%
+ typesets
+\begin{IMAGE}
+\docode
+\end{IMAGE}. The second argument (here |{}|) can be used
+ to specify a point size |{10}|, |{11}|, or |{12}|, if desired (the
+ default is |{10}|\footnote{Except when \Xy-pic is loaded as a
+ \LaTeXe\ package where the default size is used.}); |{cm}| can be
+ replaced by |{eu}| and |{xy}| to get tips in ``Euler'' and the
+ default technical style, respectively. The declaration respects
+ \TeX\ grouping.
+
+\begin{exercise}
+\begin{code}
+\xymatrix@1{
+ A \ar[r] |-{\SelectTips{cm}{}\object@{>>}}
+ |>{\SelectTips{eu}{}\object@{>}}
+ & B }
+\end{code}
+%
+ Typeset $\docode$~. \emph{Hint}: With the construction
+ ??c![\object]\emph{object} one can typeset an \Xy-pic \emph{object}
+ (anything that could follow a |*| in section~??[arrows.objects]) in
+ any context.
+%
+\answercode
+\answertext{The author typed }
+\answerdisplaycode
+\end{exercise}
+
+
+
+\section{More Entries}
+??=[entries]
+%
+ This section explains what can go in an entry and how the general
+ form of the entries??w[entry] is changed.
+
+
+\subsection{Manual entry formatting}
+??=[entries.manual]
+%
+ All the entries we have seen thus far have been simple math objects.
+ However, it is possible to change the ??w![format] of an individual
+ ??w![entry]??w[entry format] by using the form:
+%
+\begin{defs1}
+ ??c![*]\emph{object} \emph{arrows}
+\end{defs1}
+\noindent\unskip
+%
+ This allows complete control over what object is placed in the entry,
+ overriding any spacing and other conventions for the entry. This was
+ how the frame was obtained in the figure in
+ section~??[basics.entries].
+
+ A simple use of this is to insert ??w![text in entries]??w[entries
+ with text]??w[labels with text] using ??c![\txt] objects just like
+ labels as described above in section~??[arrows.objects]:
+%
+\begin{code}
+\xymatrix{
+ *\txt{A very long and stupid\\program}
+ \ar[rr]^-{\txt{weird\\arrow}}
+ &&*\txt<2pc>{Com\-pli\-cated\\Code}}
+\end{code}
+\displaycode
+%
+\noindent will typeset
+%
+\begin{displaymath}
+\docode
+\end{displaymath}
+
+\begin{exercise}
+%
+\begin{code}
+\xymatrix{
+ *=0{\bullet}
+ \ar@/^/[dr]!U|1
+ \ar@/^/[drr]!U|2
+ \ar@/^/[drrr]!U|3
+\\
+ &*+[F]\txt{x}
+ &*+[F]\txt{x\\x}
+ &*+[F]\txt{x\\x\\x}
+}
+\end{code}
+%
+ Typeset
+%
+\begin{displaymath}
+\docode
+\end{displaymath}
+%
+\answercode
+\answertext{The author typed}
+\answerdisplaycode
+\end{exercise}
+
+
+\subsection{Extra entries outside the matrix}
+??=[entries.extra]
+%
+ It is possible to put ??w![extra entries]??w[entries outside matrix]
+ in your diagrams that are not part of any ``entry'' of the matrix
+ created by |&| and |\\|. This is done with the
+ \emph{??w![excursion]} command
+%
+\begin{defs1}
+ |\save|~$t$~|\restore|
+\end{defs1}
+\noindent\unskip
+%
+ where $t$ should be a target in one of the formats described in
+ sections~??[arrows.targets]-??[arrows.changing]. $t$ can do
+ any kind of typesetting desired, for example,
+%
+\begin{code}
+\xymatrix{
+ A \ar@{-}[dr]
+ &{}\save[]+<3cm,0cm>*\txt<8pc>{%
+ This is a very big commentary
+ but it does not otherwise affect
+ the diagram.}
+ \ar[l] \ar[d] \restore \\
+ & B \ar@{-}[r] & C \ar@{-}[r] & D
+}
+\end{code}
+\displaycode
+%
+\noindent will typeset
+%
+\begin{displaymath}
+\docode
+\end{displaymath}
+%
+ It illustrates how a ``down'' arrow does not necessarily have to point
+ particularly straight down -- in this case because it is based in the
+ displaced pseudo entry.
+
+
+\subsection{Spacing and rotation}
+??=[entries.resizing]
+%
+ The |*|\emph{object} form described above can be used to space
+ individual objects differently, however, it is also possible to
+ change the overall ??w![spacing] of a matrix by inserting the
+ following codes \emph{between} |\xymatrix| and the following |{|:
+%
+\begin{defs}
+ ??c![@=]\emph{dimen} & set spacing \cr
+ ??c![@R=]\emph{dimen} & set row spacing \cr
+ ??c![@C=]\emph{dimen} & set column spacing \cr
+ ??c![@M=]\emph{dimen} & set entry default margin \cr
+ ??c![@W=]\emph{dimen} & set entry default width \cr
+ ??c![@H=]\emph{dimen} & set entry default height \cr
+ ??c![@L=]\emph{dimen} & set label margin
+\end{defs}
+\noindent\unskip
+%
+ ??c![=] can be replaced by any of ??c![+], ??c![+=], ??c![-],
+ and ??c![-=] of section~??[arrows.objects] with the same meaning,
+ \ie, replace ``set'' with ``increase,'' ``increase to at most,''
+ ``decrease,'' and ``decrease to at least,'' respectively. For example,
+%
+\begin{code}
+$\xymatrix@1@=0pt@M=0pt{A&B\\C&D}$
+\end{code}
+%
+ \thecode\ in the text typesets \begin{IMAGE}\docode\end{IMAGE}.
+
+ In case \emph{??w![uniform spacing]} is desired, several alternative
+ forms exist.
+%
+\begin{defs}
+ ??c![@!] & force all spaces equal \cr
+ |@!0| & --- and ignore entry sizes \cr
+ |@!R| & force equal row spacing \cr
+ |@!C| & force equal column spacing
+\end{defs}
+\noindent\unskip
+%
+ Finally a special notation allows \emph{??w![rotation]} of an
+ entire matrix:
+%
+\begin{defs}
+ ??c![@]\,$d$ & rotate towards $d$
+\end{defs}
+\noindent\unskip
+%
+ Only the matrix grid will rotate, however, not the actual contents.
+
+\begin{exercise}
+\begin{code}
+\xymatrix@dr@C=1pc{
+ a \ar[r]\ar@{->>}[d] & a' \ar@{.>>}[d] \\
+ b \ar@{.>>}[r] & b' }
+\end{code}
+%
+ Typeset the ``strip lemma'' $$\docode$$
+%
+\answercode
+\answertext{The author entered the display}
+\answerdisplaycode
+\end{exercise}
+
+
+\subsection{Entry style}
+??=[entries.style]
+%
+ As mentioned above, the entries of a diagram are set in math mode in
+ text style. You may change this by redefinining the macro
+ ??c![\objectstyle]??w[entry style], and the label style by redefining
+ ??c![\labelstyle]??w[label style]. We can combine this with the
+ above to get ``small diagrams,'' \eg, typing
+%
+\begin{code}
+$\left(
+ \def\objectstyle{\scriptstyle}
+ \def\labelstyle{\scriptstyle}
+ \vcenter{\xymatrix @-1.2pc @ur {
+ A \ar[r]^{a} & B \ar[d]^{b} \\
+ A'\ar[u]^{a'} & B'\ar[l]^{b'} }}
+\right)$
+\end{code}
+\displaycode
+%
+\begin{code}
+$\left(
+ \DEF\objectstyle{\scriptstyle}
+ \DEF\labelstyle{\scriptstyle}
+ \vcenter{\xymatrix @-1.2pc @ur {
+ A \ar[r]^{a} & B \ar[d]^{b} \\
+ A'\ar[u]^{a'} & B'\ar[l]^{b'} }}
+\right)$
+\end{code}
+\noindent in a paragraph will typeset ``\begin{IMAGE}\docode\end{IMAGE}.''
+
+ You can even abandon the use of math mode entirely: the command
+ |\def| |\objectstyle| |{\hbox}|\ will change the format of entries to
+ plain text.??w[plain text entries]
+
+ Similarly, all entries are rectangular by default, but it is possible
+ to change this to \emph{??w![round]??w[elliptical]??w[circular]} by
+ declaring the default \emph{modifiers}??w[object
+ modifier]??w[default modifier] to be applied to all entries that do
+ not override them (\cf\ section~??[arrows.objects]):
+%
+\begin{code}
+\entrymodifiers={++[o][F-]}
+\SelectTips{cm}{}
+\xymatrix @-1pc {
+ *\txt{start} \ar[r]
+ & 0 \ar@(r,u)[]^b \ar[r]_a
+ & 1 \ar[r]^b \ar@(r,d)[]_a
+ & 2 \ar[r]^b
+ \ar `dr_l[l] `_ur[l] _a [l]
+ &*++[o][F=]{3}
+ \ar `ur^l[lll]`^dr[lll]^b [lll]
+ \ar `dr_l[ll] `_ur[ll] [ll] }
+\end{code}
+\displaycode
+%
+\noindent will typeset
+%
+\begin{displaymath}
+\docode
+\end{displaymath}
+%
+ Notice how we obtain the double ring using the |*|\emph{object}
+ form which then has to include all the desired modifiers (and how the
+ use of computer modern tips is nice for diagrams as these).
+
+
+\subsection{Naming for later use as targets}
+??=[entries.naming]
+%
+ If you build an entry with a long and complicated excursion then you
+ might wish to be able to refer to it later. \Xy-pic provides a
+ mechanism for this: there is a special ??w![target] form which we
+ haven't discussed yet:
+%
+\begin{defs1}
+ $t$ ??c![=]|"|\emph{name}|"|
+\end{defs1}
+\noindent\unskip
+%
+ This will introduce the new target |"|\emph{name}|"| which will
+ refer to the target just before the |=|. This is particularly useful
+ inside excursions, of course, and can also be used after
+ labels??w[labels as targets].
+
+\begin{exercise}
+%
+\begin{code}
+\xymatrix{
+ A \ar[r] ^a="a" & B \ar[r] ^b="b" & C
+ \ar @/^/ "a";"b" }
+\end{code}
+%
+ Typeset $\docode$.
+%
+\answercode
+\answertext{The author typed }
+\answerdisplaycode
+\answertext{\noindent Notice the use
+ of both explicit base and target in the arrow between the labels.}
+\end{exercise}
+
+
+\subsection{Grouping objects}
+??=[entries.grouping]
+%
+ Sometimes you wish to frame or otherwise treat a rectangle of objects
+ as a single object??w[grouping]. This is possible with the last two
+ target position forms that we will mention:
+%
+\begin{defs}
+ $t$|.|$s$ & merge $t$ with simple $s$ \cr
+ |{|$t$|}| & make $t$ simple
+\end{defs}
+\noindent\unskip
+%
+ The first will enlarge $t$ to also ``??w![cover]'' the ``simple'' $s$
+ (simple means that it cannot have changes etc.\ attached unless
+ encapsulated in |{}|s). Here is an example where we ??w![merge] and
+ frame:
+%
+\begin{code}
+\xymatrix @R=1pc {
+ 1,1 & 1,2 & 1,3 & 1,4 & 1,5 \\
+ 2,1 & 2,2 & 2,3 & 2,4 & 2,5
+ \save "1,2"."2,4"*[F.]\frm{}
+ \ar"1,1" \ar"2,1" \ar"1,5" \ar"2,5"
+ \restore }
+\end{code}
+\displaycode
+\noindent will typeset
+\begin{displaymath}
+\docode
+\end{displaymath}
+%
+ As you can see, the center of the merged object is the same as the
+ one of the target \emph{before} the ``|.|.''
+
+ Finally a more advanced example where we create two merged objects
+ with center in their ``real'' center, ??w![name] them and then connect
+ to them. It also shows how macros can be used inside diagrams: they
+ should always expand to ``commands'' like |\ar|\dots, etc.:
+%
+\begin{displaymath}
+\begin{code}
+\def\g#1{\save
+ [].[dr]!C="g#1"*[F]\frm{}\restore}%
+\xymatrix{
+ \g1 A\ar[r]&B\ar[d]&\g2 A'\ar[r]&B'\ar[d]\\
+ C\ar[u]&D\ar[l]& C'\ar[u]&D'\ar[l]
+ \ar @{.>} "g1" ;"1,4"
+ \ar @{-->} "2,1";"g2" }
+\end{code}
+\docode
+\end{displaymath}
+%
+ can be typeset by
+%
+\displaycode\noindent
+%
+ Then we can make arrows from/to the two frames by using the two new
+ targets |"g1"| and |"g2"| as shown.
+
+\begin{exercise}
+%
+ Change the lambda cube of exercise~??[x.cube] such it is enclosed in
+ a transparent (\ie, dotted) cube.
+%
+\answertext{The author added the \Xy-code}
+\begin{code}
+\save [].[dd].[ddrr].[rr]*[F.]\frm{}="back"
+ \restore
+\end{code}
+\answercode
+\answerdisplaycode
+\answertext{in the entry with $\lambda\omega$, and}
+\begin{code}
+ \save [].[dd].[ddrr].[rr]*[F.]\frm{}
+ \ar@{.} +UL;"back"+UL \ar@{.} +UR;"back"+UR
+ \ar@{.} +DL;"back"+DL \ar@{.} +DR;"back"+DR
+ \restore
+\end{code}
+\answercode
+\answerdisplaycode
+\answertext{in the entry with $\lambda2$ to produce}
+\begin{code}
+\xymatrix @!0 {
+ & \lambda\omega \ar@{-}[rr]\ar@{-}'[d][dd]
+ \save [].[dd].[ddrr].[rr]*[F.]\frm{}="back"\restore
+ & & \lambda C \ar@{-}[dd]
+\\
+ \lambda2 \ar@{-}[ur]\ar@{-}[rr]\ar@{-}[dd]
+ \save [].[ddrr]*[F.]\frm{}
+ \ar@{.} +UL;"back"+UL \ar@{.} +UR;"back"+UR
+ \ar@{.} +DL;"back"+DL \ar@{.} +DR;"back"+DR \restore
+ & & \lambda P2 \ar@{-}[ur]\ar@{-}[dd]
+\\
+ & \lambda\underline\omega \ar@{-}'[r][rr]
+ & & \lambda P\underline\omega
+\\
+ \lambda{\to} \ar@{-}[rr]\ar@{-}[ur]
+ & & \lambda P \ar@{-}[ur] }
+\end{code}
+\answercode
+\answertext{$$\begin{IMAGE}\docode\end{IMAGE}$$}
+\end{exercise}
+
+
+
+\section{Availability and Further Information}
+??=[avail]
+%
+ Below we describe how to and the conditions for obtaining \Xy-pic
+ version~\xyversion, the compatibility with previous versions, and we
+ conclude with a few appetisers to lure the reader into reading more
+ about \Xy-pic.
+
+
+\subsection{Getting \Xy-pic}
+??=[avail.ftp]
+%
+ The easiest way to retrieve??w[retrieving {\Xy}-pic] the latest version
+ of \Xy-pic is through the \Xy-pic home page~\cite{Xy-picHP} on the
+ ??w![World Wide Web]; it is also available by Internet ??w![ftp] from
+ \url{ftp://ftp.diku.dk/diku/users/kris/TeX/} as well as
+ \url{ftp://ftp.mpce.mq.edu.au/pub/maths/TeX/} in files starting with
+ |xy|. Finally, \Xy-pic has been contributed to the CTAN archives
+ where it is located in the directory \texttt{macros\slash generic\slash
+ diagrams\slash xypic}.
+
+\paragraph*{License:}
+%
+ \Xy-pic is free software in the sense that it is available under the
+ following ??w![license]??w[copyright] conditions:
+%
+\begin{center}\ordinarybars
+\begin{tabular}{|l|}
+ \hline
+ ~\Xy-pic: Graphs and Diagrams with \TeX~\\
+ \quad\copyright~1991--1997\quad Kristoffer H. Rose\\
+ \quad\copyright~1994--1997\quad Ross Moore\\
+ \hline
+\end{tabular}
+\end{center}
+%
+\begin{quotation}
+%
+ The \Xy-pic package is ??w![free software]; you can redistribute it
+ and/or modify it under the terms of the ??w![GNU General Public
+ License] as published by the Free Software Foundation; either version
+ 2 of the License, or (at your option) any later version.
+
+ The \Xy-pic package is distributed in the hope that it will be
+ useful, but \emph{without any ??w![warranty]}; without even the
+ implied warranty of \emph{merchantability} or \emph{fitness for a
+ particular purpose}. See the GNU General Public License for more
+ details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%
+\end{quotation}
+%
+ In practice this means that you are free to use \Xy-pic for your
+ documents but if you distribute any part of \Xy-pic (including
+ modified versions) to someone then you are obliged to ensure that the
+ full source text of \Xy-pic is available to them (the full text of
+ the license in the file ??c![COPYING] explains this in somewhat more
+ detail~\smiley~).
+
+
+\subsection{Backwards compatibility}
+??=[compat]
+%
+ The first widely distributed version of \Xy-pic was ??w![version 2]
+ (from release 1.40 to release 2.6). A special
+ \emph{??w![compatibility]} mode is used automatically if the
+ ??w![old style of loading] is used (using files named ??c![xypic.tex]
+ and ??c![xypic.sty]). You can also mix old and new diagrams in a
+ document if you load as described in section~??[basics.loading] and
+ add the declaration ??c![\xyoption]|{v2}|. This provides almost full
+ backwards compatibility: the following are the only known exceptions:
+%
+\begin{itemize}
+
+\item
+ Automatic ``shortening'' of arrow tails by ??c![|<<] break was a bug
+ and has been ``fixed'' so it does not work any more. \emph{Fix}: Put a
+ |||<\hole| break before it as described in section~??[arrows.styles].
+
+\item
+ The release~2.6 ??c![*] position operator is not available.
+ \emph{Fix}: Use the |:| and |::| operators (described in detail in
+ the reference manual~\cite{RM95:Xy-picRM}).
+
+\item
+ Using $t_1|;|t_2|:(|x|,|y|)|$ as the target of an arrow command does
+ not work. \emph{Fix}: Enclose it in braces, \ie, write
+ $|{|t_1|;|t_2|:(|x|,|y|)}|$.
+
+\item
+ The old ??c![\pit], ??c![\apit], and ??c![\bpit] commands are not
+ defined. \emph{Fix}: Use |*@{>}| (or |\tip|) with variants and
+ rotation.
+
+\item
+ The even older notation where an argument in braces to |\rto| and the
+ others was automatically taken to be a ``tail'' is not supported.
+ \emph{Fix}: Use the supported |||<|\dots\ notation.
+
+\end{itemize}
+%
+ Finally note that sometimes the spacing with version~\xyversion\ is
+ ``improved'' relative to earlier versions~\smiley~. Please report all
+ other things that do not work the same in version~2.6 and~\xyversion\
+ to the author.
+
+
+\subsection{Further reading}
+??=[avail.further]
+%
+ The reference manual~\cite{RM95:Xy-picRM} describes several more
+ input modes that are useful when the diagram is not organised as a
+ matrix. We'll give some examples of such diagrams but refer to the
+ reference manual for the details.
+%
+\begin{itemize}
+
+\item The ``??w![graph]'' feature allows input of data structured as
+ \emph{??w![directed graphs]} to make it easy to produce such
+ pictures as
+%
+\begin{displaymath}
+%
+% From xygraph.doc.
+%
+\begin{code}
+\SelectTips{cm}{}
+\objectmargin={1pt}
+\xygraph{ !{0;(.77,-.77):0}
+ !~:{@{-}|@{>}}
+ w (:[r(.6)]{x_1}
+ ,:[d]z:[r]y:[u(.6)]{x_2}:@/_/"x_1" (:@/_/"x_2") :"z"
+ :@( {"w";"z"}, {"y";"z"})"z" :"x_2" ) }
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+
+\item The ``??w![knot]'' feature allows drawing of mathematical \emph{knots
+ and ??w![links]} like
+%
+% From xyknot.doc:
+%
+\begin{displaymath}
+%
+\UseComputerModernTips
+\vtop{\vbox{\xygraph{!{0;/r1.5pc/:} !{\vover}[u]
+ !{\hcap[-2]<<} [d] !{\vover-} [ruu] !{\hcap[2]><}}\smallskip}
+\hbox{\qquad\ \small simple link}}\hfil
+%
+% Figure-eight
+%
+\vtop{\vbox{\xygraph{!{0;/r1.5pc/:}
+ [u] !{\vloop<(-.005)\khole||\vcrossneg \vunder- }
+ [] !{\ar @{-}@'{p-(1,0)@+}+(-1,1)}
+ [ul] !{\vcap[3]>\khole}
+ [rrr] !{\ar @{-}@'{p-(0,1)@+}-(1,1)}
+}\smallskip}\hbox{\small figure-8 knot}}\hfil\quad
+%
+% cinque-foil
+%
+\vtop{\vbox{\xygraph{!{0;/r1.25pc/:}
+ !P5"a"{~>{}} !P10"b"{~:{(1.7487,0):}~>{}}
+ !P20"c"{~={-9}~:{(2.2,0):}~>{}}
+ !{\xunderv~{"b3"}{"b2"}{"a2"}{"a1"}}
+ !{\xunderv~{"b5"}{"b4"}{"a3"}{"a2"}}
+ !{\xunderv~{"b7"}{"b6"}{"a4"}{"a3"}}
+ !{\xunderv~{"b9"}{"b8"}{"a5"}{"a4"}}
+ !{\xunderv~{"b1"}{"b10"}{"a1"}{"a5"}}
+ !{\vloop~{"c3"}{"c2"}{"b2"}{"b1"}<<}
+ !{\vloop~{"c7"}{"c6"}{"b4"}{"b3"}<<}
+ !{\vloop~{"c11"}{"c10"}{"b6"}{"b5"}<<}
+ !{\vloop~{"c15"}{"c14"}{"b8"}{"b7"}<<}
+ !{\vloop~{"c19"}{"c18"}{"b10"}{"b9"}<<}
+}\smallskip}\hbox{\quad\ \small cinquefoil}}
+%
+\vbox{\hbox to 2em{\hss}}
+\end{displaymath}
+
+\item The ``??w![2cell]'' feature provides special support for
+ \emph{categorical ??w![twocells]} like
+%
+\begin{displaymath}
+%
+% From xy2cell.doc.
+%
+\begin{code}
+\begin{xy}
+ *+{A}="A",+<1cm,1.5cm>*+{B}="B",
+ +<2cm,0pt>*+{C}="C",
+ +<1cm,-1.5cm>*+{D}="D",
+"A";"B",{\uppertwocell^\alpha{}},
+"B";"C",{\twocell^\zeta_\xi{\gamma}},
+"C"; \afterPOS{\drop\compositemap{}}"D"
+\POS "A";
+ \afterPOS{\drop\lowertwocell{}}"D"
+\end{xy}
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+
+\item The ``??w![poly]'' feature allows \emph{??w![polygon-like]}
+ structures:
+%
+\begin{displaymath}
+%
+% From xypoly.doc:
+%
+\begin{code}
+\begin{xy}
+/r2pc/: ="A", +(.2,1.5)="B","A",
+{\xypolygon6{~:{(1,-.1):(0,.33)::}
+ ~<>{;"B"**@{-}}}}\endxy
+\qquad \xy /r2pc/:
+{\xypolygon4"A"{~:{(0,.7)::}}},+(.7,1.1),
+{\xypolygon4"B"{~:{(.8,0):(0,.75)::}}},
+"A1";"B1"**@{.},"A2";"B2"**@{.},
+"A3";"B3"**@{.},"A4";"B4"**@{.}
+\endxy\qquad \xy /r2pc/:
+{\xypolygon3"A"{~:{(0,.7)::}}},+(.7,1.1),
+{\xypolygon3"B"{~:{(-.85,0):(-.15,.8)::}}}
+,"A1"\PATH~={**@{.}}'"B2"'"A3"'"B1"
+'"A2"'"B3"'"A1"
+\end{xy}
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+
+\item The ``??w![web]'' feature allows composition in lattices such as
+%
+\begin{displaymath}
+%
+% From xyweb.doc:
+%
+\begin{code}
+\def\latticebody{\dimen0=\latticeX pt
+ \ifdim\dimen0>0pt \divide\dimen0 by 64
+ \dimen0=\latticeY\dimen0 \relax
+ \ifdim 0pt>\dimen0 \dimen0=-\dimen0 \fi
+ \ifdim 2.5pt>\dimen0 \drop{\bullet}%
+ \else\drop{.}\fi \else\drop{.}\fi}
+\begin{xy}
+*\xybox{0;<1.5pc,1.28mm>:<.41pc,1.12pc>::
+,0,{\croplattice{-3}5{-5}5
+ {-1.3}{4.5}{-3.4}{4.4}}}="L"
+,{"L"+L \ar "L"+!R*+!L{\sigma^{(1)}}}
+,{"L"+D \ar "L"+!U*+!D{\sigma^{(2)}}}
+\end{xy}
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+
+\item The ``??w![arc]'' feature is suitable for effects like
+%
+\begin{displaymath}
+%
+% From xyarc.doc:
+%
+\begin{code}
+\begin{xy}
+0;/r5pc/:*@{*}="p",*+!DR{p};
+p+(.5,-.5)*@{*}="c",*+!UL{c}**@{-}
+,"c",{\ellipse<15pt>_,=:a(45){=}}
+ ,{\ellipse<>__,=:a(30){-}}
+,{\ellipse(1,.4){.}}
+ ,{\ellipse(1,.4)_,=:a(120){--}}
+,{\ellipse(,.75){.}}
+ ,{\ellipse(,.75)_,^,^{-}}
+\end{xy}
+\end{code}
+\begin{IMAGE}
+\docode
+\end{IMAGE}
+\end{displaymath}
+
+\end{itemize}
+%
+ In each case the figure is produced with relatively few lines using
+ techniques documented in the respective sections of the reference
+ manual together with the details of the \Xy-pic kernel and
+ extensions, ``arrow,'' and ``matrix'' features as used in this guide;
+ further extensions provide support for use of colour, \PS\ effects,
+ and much more.
+
+ Finally, the following documents might prove useful: \emph{How to
+ Typeset Pretty Diagram Arrows with {\TeX}}~\cite{R92:HowTPDAT}
+ presents some of the design decisions behind \Xy-pic,
+ \emph{{\Xy}-pic and Notation for Categorical
+ Diagrams}~\cite{R94:Xy-picNCD} explains how the modularity of \Xy-pic
+ can be used to obtain complex effects with commutative diagrams, and
+ \emph{Typesetting Neural Nets using
+ {\Xy}-pic}~\cite{M94:TypesettingNNX} explains how \emph{neural
+ networks} can be typeset using the package. Finally, a collection of
+ complex examples is maintained on the \Xy-pic home page and the ftp
+ servers discussed above.
+
+
+\subsection{Credits}
+??=[avail.credits]
+%
+ \Xy-pic version 2 was a small package created by the author. The
+ present version \xyversion\ is the result of more than three years of
+ continued collaboration with Ross Moore,\footnote{Mathematics
+ Department, Macquarie University, Sydney, Australia 2109;
+ e-mail: ross@mpce.mq.edu.au.} and would never have been developed
+ without his support and \TeX-nical expertise.\footnote{Partial
+ funding for this collaboration has been provided by a Macquarie
+ University Research Grant (MURG), by the Australian Research Council
+ (ARC), and through a research agreement with the Digital Equipment
+ Corporation (DEC).} This includes many of the modes mentioned above
+ which were created for use within specialised branches of
+ mathematics, however, the notations are designed to fit quite
+ naturally within the framework of \Xy-pic and are useful more
+ generally. Finally, we are grateful to Y\&Y Inc.\ for making very
+ nicely done \PS\ versions of the \Xy-pic fonts available.
+
+
+\appendix\section{Answers to all exercises}
+\Answers
+
+\BIBLIOGRAPHY
+\INDEX
+
+\end{document}
+
+
+% $Log: xyguide.man,v $
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.5 1997/05/29 21:02:36 krisrose
+% Fixed "missing breaks"...and tidied up documentation!
+%
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 13:17:15 krisrose
+% Maintenance release.
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% Reformatted for LaTeX with companion xydoc.sty.
+% Renamed from xypicman.doc to xyguide.man.
+%
+% Revision 2.6.1.1 1992/07/01 07:08:24 kris
+% Send to EuroTeX '92...
+%
+% Revision 2.6 1992/06/24 01:23:34 kris
+% Reorganised...
+% Documented new features: hooks, triple lines, positions, and LaTeXdiagrams.
+%
+% Revision 2.5 1992/02/24 03:30:54 kris
+% Documented changes in xypic.doc[2.5].
+%
+% Revision 2.4 1992/01/22 02:15:10 kris
+% Cosmetic changes; removed \pit and introduced \rotate.
+%
+% Revision 2.3 1992/01/13 01:51:02 kris
+% Changed to use `pure' XPPT [1.20].
+% Several cosmetic changes, e.g., corrected definition of \ddtor in footnote.
+%
+% Revision 2.2 1992/01/09 04:05:40 kris
+% Patched to fix problem with \text and support AMS-LaTeX.
+%
+% Revision 2.1 1992/01/02 14:54:07 kris
+% Release version.
+%
+% Revision 1.7 1991/12/17 04:53:23 kris
+% Version distributed as `final draft' on Usenet.
+% Added bent arrows properly; support for double tips; proper \Text;
+% fixed name clashes...
+% This version is for bug fixes only!!
+%
+% Revision 1.6 1991/12/06 08:53:06 kris
+% Draft ready for wider distribution...
+% Fits xypic.doc[1.39]; still needs better examples.
+%
+% Revision 1.5 1991/12/03 07:53:28 kris
+% Extended with the xypic.doc[1.37] possibility for exotic arrow
+% tips; also added description of \merge.
+%
+% Revision 1.4 1991/12/02 06:08:42 kris
+% Fixed various things; fits xypic.doc[1.36].
+%
+% Revision 1.3 1991/12/01 07:40:07 kris
+% Corresponds to xypic.doc[1.35].
+%
+% Revision 1.2 1991/11/28 04:42:49 kris
+% Corresponds to xypic.doc[1.34].
+% Cleaned up a lot; now only bending arrows are missing...and good examples.
+%
+% Revision 1.1 1991/11/27 06:48:17 kris
+% Initial: \beta-test on DIKU.
+%
+% Based on version in DIKU student report 91-7-10.
+
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyidioms.doc b/Master/texmf-dist/source/generic/xypic/xyidioms.doc
new file mode 100644
index 00000000000..6fe56625ac5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyidioms.doc
@@ -0,0 +1,283 @@
+%% $Id: xyidioms.doc,v 3.4 1997/05/18 01:14:25 krisrose Exp $
+%%
+%% Format-dependent idioms for Xy-pic.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyidiomsloaded\empty \message{not reloaded}\endinput \fi
+\let\xyidiomsloaded=\empty
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This included file provides some common ??w![idioms] whose definition
+ depends on the used format such that \Xy-pic can use predefined
+ ??w![dimension registers] etc.\ and yet still be independent of the
+ format under which it is used. The current ??w![version]
+ (\stripRCS$Revision: 3.4 $) handles ??w![plain \TeX] (version 2
+ and 3~\cite{K84:TeXbook}), ??w![\AMS-\TeX] (version 2.0 and
+ 2.1~\cite{S90:JoyT}), ??w![\LaTeX] (version 2.09~\cite{L86:LaTeX}
+ and~$2\varepsilon$~\cite{L94:LaTeX}), ??w![\AMS-\LaTeX] (version 1.0,
+ 1.1~\cite{AMS91:AMS-LaTeX}, and~1.2), and eplain (version
+ 2.6~\cite{B94:ExpandedPT})\footnote{The `v2' feature introduces some
+ name conflicts, in order to maintain compatibility with earlier
+ versions of \Xy-pic.\hfill}.
+ ??w[system dependencies]??w[format dependencies]
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}
+\DOCHEADER
+\noindent
+ This is a separate file so that we can abort the definitions easily
+ using |\endinput|.
+
+\paragraph*{Scratch registers:}
+%
+ All the formats currently treated allow the use of the following
+ plain \TeX\ ??w![scratch register conventions]
+ (\cf~\cite[p.346]{K84:TeXbook})
+%
+\begin{itemize}
+\item
+ |\count@| is available as a local scratch counter register.
+\item
+ |\dimen@|, |\dimen@i|, |\dimen@ii|, |\dimen3| to |\dimen9|, and
+ |\dimen255| are available as scratch dimension registers.
+\item
+ |\skip@|, |\skip1| to |\skip9|, and |\skip255| are available as
+ scratch skip registers.
+\item
+ |\toks@| and |\toks1| to |\toks9| are available as scratch token
+ lists.
+\item
+ |\boxz@| and |\box1| to |\box9| are available as scratch box
+ registers.
+\end{itemize}
+%
+ with the constraint that ??c![\global] should never (always)
+ be used when assigning to number 0, 2, 4, 6, 8, and 255 (1, 3, 5, 7,
+ and 9).
+
+\paragraph*{\Xy-specific scratch registers:}
+%
+ We first give new names to dimension registers 4, 6, and 8, since
+ none of the formats do that: |\A@|, |\B@|, and |\R@| are specific to
+ \Xy-pic and will be referred to as ??w![$A$], ??w![$B$], and
+ ??w![$R$] in comments.
+
+\DOCMODE(
+\xywarnifdefined\A@ \dimendef\A@=4
+\xywarnifdefined\B@ \dimendef\B@=6
+\xywarnifdefined\R@ \dimendef\R@=8
+\DOCMODE)
+
+ Some shared scratch registers are defined last.
+
+\paragraph*{Idioms:}
+%
+ First check that |\undefined| is indeed undefined\dots or rather: the
+ same as an extremely unlikely control sequence that we are making up:
+
+\DOCMODE(
+\ifx\undefined\AveryUNLIKELYc@ntr@lSEQUENCE@@\else
+\errmessage{Xy-pic Error: \string\undefined\space defined.}\fi
+\DOCMODE)
+
+ These idioms are so common they are just conditionally defined:
+
+\DOCMODE(
+\ifx\undefined\literal@ \def\literal@#1{#1}\fi
+\ifx\undefined\eat@ \def\eat@#1{}\fi
+
+\xydef@\xyFN@{\futurelet\next} % Now private because of AMS-LaTeX change.
+\ifx\undefined\DN@ \def\DN@{\def\next@}\fi
+\ifx\undefined\DNii@ \def\DNii@{\def\nextii@}\fi
+
+\ifx\undefined\setboxz@h\def\setboxz@h{\setbox\z@\hbox}\fi
+\ifx\undefined\wdz@ \def\wdz@{\wd\z@}\fi
+\ifx\undefined\boxz@ \def\boxz@{\box\z@}\fi
+
+\ifx\undefined\W@ \def\W@{\immediate\write16 }\fi
+
+\ifx\undefined\space@ \def\space@.{\futurelet\space@\relax}\space@. \fi
+
+\ifx\undefined\notempty \def\notempty#1{T\if @#1@F\else T\fi}\fi
+\DOCMODE)
+
+\paragraph*{Delayed setup:}
+%
+ This is used when it is advantageous to delay loading of something
+ until after the preamble, \ie, after all options, \etc, have been
+ loaded. This is particularly true for nested ??c![\xywithoption]
+ uses that will otherwise be executed repeatedly. Currently properly
+ supported with \LaTeXe\ and the |amsppt| style of \AMS-\TeX.
+
+\DOCMODE(
+\xydef@\xysetup@dummy#1{\xyuncatcodes#1}
+\xywarnifdefined\xysetup@@
+
+\ifx\AtEndDocument\undefined
+ \expandafter\ifx\csname amsppt.sty\endcsname\relax
+ \let\xysetup@@=\xysetup@dummy
+ \else
+ \def\xysetup@@#1{%
+ \expandafter\def\expandafter\topmatter\expandafter{\topmatter
+ #1\xyuncatcodes}}\fi
+\else
+ \def\xysetup@@#1{\AtBeginDocument{#1\xyuncatcodes}}
+\fi
+
+\ifx\xysetup@@\xysetup@dummy\else
+ \xysetup@@{\let\xysetup@@=\xysetup@dummy \xyuncatcodes}\fi
+\DOCMODE)
+
+ Similarly, the following provides a place to insert `trailing
+ messages' if the format supports it; otherwise it just throws away
+ the argument (useful for repeating the most important warnings).
+
+\DOCMODE(
+\xywarnifdefined\xyclosedown@@
+
+\ifx\AtEndDocument\undefined \let\xyclosedown@@=\eat@
+\else \def\xyclosedown@@#1{\AtEndDocument{#1}}\fi
+\DOCMODE)
+
+ This may be useful to hook into specialised mechanisms for including
+ |\special| material on the page.
+
+\DOCMODE(
+\xylet@\xy@begindvi=\literal@
+\DOCMODE)
+
+ For example, \LaTeXe\ (post Dec~'94) defines an |\AtBeginDvi| macro
+ to allow zero-sized material to be placed at the beginning of each
+ shipped-out page. Among other uses, this allows such material not to
+ be discarded, when on a page containing only floats. This is used by
+ \Xy-pic in connection with the \PS\ header dictionary |xyps-ps.doc|.
+
+\DOCMODE(
+\ifx\undefined\AtBeginDvi\else
+ \AtBeginDocument{\let\xy@begindvi=\AtBeginDvi}
+ \AtBeginDvi{\global\let\xy@begindvi=\literal@}\fi
+\DOCMODE)
+
+\paragraph*{Shared scratch registers:}
+%
+ Everything else in this file is also done by \AMS-\TeX\ so we exit
+ here when using that format after renaming their |\toks@@| to
+ |\toks@ii|\dots
+
+\DOCMODE(
+\ifx\amstexloaded@\relax
+\xylet@\toks@ii=\toks@@ \endinput \fi
+\DOCMODE)
+
+ Thus the job of allocating scratch registers is simple except for
+ counters where we only have one so we use \LaTeX\ scratch counters
+ when available and otherwise allocate two new ones:
+
+\DOCMODE(
+\ifx\@tempcnta\undefined
+\xynew@{count}\count@@
+\xynew@{count}\count@@@
+\else
+\xylet@\count@@=\@tempcnta
+\xylet@\count@@@=\@tempcntb
+\fi
+\DOCMODE)
+
+ Finally the second scratch token register not available with \LaTeX.
+
+\DOCMODE(
+\ifx\undefined\toks@ii \toksdef\toks@ii=2 \fi
+\DOCMODE)
+
+\paragraph*{End \& log:}
+%
+ That's all.
+
+\DOCMODE(
+\endinput
+
+% $Log: xyidioms.doc,v $
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% Revision 2.9 1994/06/09 15:02:49 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% Now contains scratch register allocations.
+% Cleaned of AMS-TeX special macros.
+% Renamed from xyamstex.doc to xyidioms.doc for version 2.7.
+%
+% Revision 2.4 1992/01/22 02:15:10 kris
+% \\ works with AMS-LaTeX: don't use \Let@ [Werner Struckmann/Darrel Hankerson]
+% Made redefinition of \text conditional.
+%
+% Revision 2.3 1992/01/10 21:43:09 kris
+% Fixed AMS-LaTeX name clash problems.
+%
+% Revision 2.2 1992/01/09 04:05:40 kris
+% Patched to fix problem with \text and support AMS-LaTeX.
+%
+% Revision 2.1 1992/01/02 14:55:27 kris
+% Release version.
+%
+% Revision 1.3 1991/12/17 04:51:16 kris
+% Version distributed with `final draft' on Usenet.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyimport.doc b/Master/texmf-dist/source/generic/xypic/xyimport.doc
new file mode 100644
index 00000000000..a2cff8f9642
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyimport.doc
@@ -0,0 +1,245 @@
+%% $Id: xyimport.doc,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+%%
+%% Xy-pic ``Import feature'' option.
+%% Copyright (c) 1993-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{import}{Import graphics extension}{\stripRCS$Revision: 3.6 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This feature provides the ability to easy add labels and annotations to
+graphics prepared outside \TeX\ or \LaTeX. An \Xy-pic graphics environment
+is established whose coordinates match that within the contents of the
+imported graphic, making it easy to specify exactly where a label should be
+placed, or arrow drawn to highlight a particular feature.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+A command |\xyimport| is defined which is used, in conjunction with
+imported graphics, to establish a coordinate system appropriate to the
+particular graphics. This enables <pos>itions within the graphic to be easily
+located, either for labelling or adding extra embellishing features.
+It is used in either of the follow ways:
+%
+\begin{defs1}
+|\xyimport(|{\em width}|,|{\em height}|){|<graphic>|}| \cr
+|\xyimport(|{\em width}|,|{\em height}|)(|%
+ {\em$x$-off}|,|{$y$-off}|){|<graphic>|}|
+\end{defs1}
+
+\begin{code}
+\def\ellipA{\resizebox{6cm}{!}{%
+ \includegraphics{import1.eps}}}
+\xy
+\xyimport(3.7,3.7)(1.4,1.4){\ellipA}*\frm{-}
+,!D+<2pc,-1pc>*+!U\txt{%
+ framed contents of graphics file}\endxy
+\qquad\qquad
+\xy\xyimport(3.7,3.7)(1.4,1.4){\ellipA}
+,!D+<2pc,-1pc>*+!U\txt{Rational points
+ on the elliptic curve: $x^3+y^3=7$}
+,(1,0)*+!U{1},(-1,0)*+!U{-1}
+,(0,1)*+!R{1},(0,-1)*+!R{-1}
+,(2,-1)*+!RU{P},(-1,2)*+!RU{-P}
+,(1.3333,1.6667)*+!UR{-2P}
+,(1.6667,1.3333)*!DL{\;2P}
+,(-.5,1.9)*++!DL{3P},(1.9,-.5)*!DL{\;-3P}
+,(-1,2.3)*+++!D{\infty}*=0{},{\ar+(-.2,.2)}
+,(.5,2.3)*+++!D{\infty}*=0{},{\ar+(-.2,.2)}
+,(2.3,-1)*+++!L{\infty}*=0{},{\ar+(.2,-.2)}
+\endxy
+\end{code}
+
+\begin{figure*}[t]
+%
+% example appears early so it will not float too far away.
+%
+% Special care needed in case there is no graphics available...
+\ifx\includegraphics\undefined \def\resizebox#1#2#3{%
+ \vbox to6cm{\vss\hbox to6cm{\hss(Picture import1.eps omitted)\hss}\vss}}\fi
+$$\docode$$
+\caption{importing a graphic for labelling}??=[importing]
+\end{figure*}
+
+\noindent
+Normally the <graphics> will be a box containing a graphic imported
+using the commands from packages such as |graphics|, |epsf| or
+|epsfig|, or using other commands provided by the local \TeX\
+implementation. However the <graphic> could be {\em any} balanced
+\TeX\ material whatsoever; provided it occupies non-zero size, both
+vertically and horizontally.
+
+The {\em width} and {\em height} are <number>s given in the coordinate
+system for the {\em contents of the <graphics>}. These are not dimensions,
+but coordinate-lengths, using the units appropriate to the picture displayed
+by <graphic>.
+
+When provided, |(|{\em$x$-off}|,|{$y$-off}|)| give the distance in
+coordinate units from bottom-left corner to where the origin of coordinates
+should be located, usually within area covered by the <graphic>.
+Usually the negatives of these numbers will give the coordinate location
+of the bottom-left corner of the <graphic>. If no offsets are supplied
+then the origin is presumed to lie at the bottom-left corner.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xyimport#1#{\xyimport@{#1}}
+\xydef@\xyimport@#1#2{\xydelayimport@{#1}{#2}}
+\xydef@\xydelayimport@#1#2{\xy@@ix@{#1{#2}}%
+ \xy@@{\expandafter\xyextern@\the\toks9}}
+
+\xydef@\xyextern@(#1,#2){\hbox\bgroup\R@c=#1\p@ \U@c=#2\p@\xyextern@i}
+
+\xydef@\xyextern@i#1#{\DN@{#1}%
+ \ifx\next@\empty \L@c=\z@ \D@c=\z@ \DN@{\xyextern@x}%
+ \else \DN@{\xyextern@ii#1}\fi \next@ }
+
+\xydef@\xyextern@ii(#1,#2){\L@c=#1\p@ \D@c=#2\p@
+ \advance\R@c-\L@c \advance\U@c-\D@c \xyextern@x}
+
+\xydef@\xyimportdefault@{3}
+\xydef@\xyexportwarning@#1#2#3{\xywarning@{%
+ #1 for import has zero #2; using \xyimportdefault@#3 default}}
+
+\xydef@\xyextern@x#1{\toks@={\egroup\L@c=}\setboxz@h{#1}%
+ \dimen@ii=\L@c \advance\dimen@ii\R@c \dimen@=\wdz@
+ \ifdim\dimen@=\z@ \xyexportwarning@{graphic}{width}{cm}%
+ \dimen@=\xyimportdefault@ cm\fi
+ \ifdim\dimen@ii=\z@ \xyexportwarning@{coords}{width}{unit}%
+ \dimen@ii=\xyimportdefault@\p@\fi
+ \quotient@\next@\dimen@\dimen@ii \dimen@=\next@\p@
+ \edef\tmp@{\expandafter\removePT@\the\L@c}\L@c=\tmp@\dimen@
+ \expandafter\addtotoks@\expandafter{\the\L@c\relax\R@c=}%
+ \edef\tmp@{\expandafter\removePT@\the\R@c}\R@c=\tmp@\dimen@
+ \expandafter\addtotoks@\expandafter{\the\R@c\relax\setbase@\z@\z@}%
+%
+ \expandafter\addtotoks@\expandafter{\expandafter{\the\dimen@}\z@\D@c=}%
+ \dimen@ii=\U@c \advance\dimen@ii\D@c \dimen@=\ht\z@\advance\dimen@\dp\z@
+ \ifdim\dimen@=\z@ \xyexportwarning@{graphic}{height}{cm}%
+ \dimen@=\xyimportdefault@ cm\fi
+ \ifdim\dimen@ii=\z@ \xyexportwarning@{coords}{height}{unit}%
+ \dimen@ii=\xyimportdefault@\p@\fi
+ \quotient@\next@\dimen@\dimen@ii \dimen@=\next@\p@
+ \edef\tmp@{\expandafter\removePT@\the\D@c}\D@c=\tmp@\dimen@
+ \expandafter\addtotoks@\expandafter{\the\D@c\relax\U@c=}%
+ \edef\tmp@{\expandafter\removePT@\the\U@c}\U@c=\tmp@\dimen@
+ \expandafter\addtotoks@\expandafter{\the\U@c\relax\setbase@@\z@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\the\dimen@}}%
+%
+ \setboxz@h{\kern-\L@c\lower\D@c\boxz@\kern\L@c}%
+ \wd\z@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@ \the\toks@ \X@c=\z@ \Y@c=\z@
+ \ifdim\X@min>-\L@c \X@min=-\L@c \fi \ifdim\X@max<\R@c \X@max=\R@c \fi
+ \ifdim\Y@min>-\D@c \Y@min=-\D@c \fi \ifdim\Y@max<\U@c \Y@max=\U@c \fi
+ \idfromc@{import}\POS }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Normally the |\xyimport| command is used at the beginning of an |\xy..\endxy|
+environment. It is not necessary to give any basis setup, for this is
+deduced by measuring the dimensions of the <graphic> and using the supplied
+{\em width}, {\em height} and offsets.
+The <graphic> itself defines named <pos> called |"import"|, located at the
+origin and having appropriate extents to describe the area covered by
+the <graphic>. This makes it particularly easy to surround the <graphic>
+with a frame, as on the left side of figure~??[importing],
+or to draw axes passing through the origin.
+
+% Special care needed in case there is no graphics available...
+\ifx\includegraphics\undefined \def\resizebox#1#2#3{%
+ \vbox to6cm{\vss\hbox to6cm{\hss(Picture import1.eps omitted)\hss}\vss}}\fi
+
+Here is the code used to apply the labelling in figure~??[importing]:
+\displaycode
+
+This example uses the \LaTeXe\ standard |graphics| package to import
+the graphics file |import1.eps|; other packages could have been used
+instead. e.g. |epsfig|, |epsf|, or the \expandafter|\string\picture|
+or \expandafter|\string\illustration| commands in \Textures\ on the
+Macintosh.
+
+The only possible problems that can occur are when the graphics package is
+loaded after \Xy-pic has been loaded. Generally it is advisable to have
+\Xy-pic loading {\em after} all other macro packages.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyimport.doc,v $
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 09:19:22 ross
+% no changes
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/05 22:10:51 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+%
+% NEW for version 3.0 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\endinput
+$$
+\xy\xyimport(37,37)(18,18){\ellB}
+,!D+<1pc,-1pc>*+!U\txt{Rational points
+on the elliptic curve: $x^3+y^3=1729$}
+,(10,0)*+!U{10},(-10,0)*+!U{-10}
+,(0,10)*+!R{10},(0,-10)*+!R{-10}
+,(1,12)*+!DL{P_1}
+,(12,1)*+!DL{-P_1=(12\,,1)}
+,(10,9)*!LD{\;\;\;P_2=(10\,,9)}
+,(9,10)*++!D{\;\;-P_2}
+,(-15.5,17.5)*+!DL{-P_1-P_2}
+,(17.5,-15.5)*+!DL{P_1+P_2}
+,(13,-7)*+!UR{-2P_1-P_2\;\;}
+,(18,-3)*+++!L{\infty}*=0{},{\ar+(2,-2)}
+,(3,18)*+++!D{\infty}*=0{},{\ar+(-2,2)}
+\endxy
+$$
+
+\end{document}
diff --git a/Master/texmf-dist/source/generic/xypic/xyknot.doc b/Master/texmf-dist/source/generic/xypic/xyknot.doc
new file mode 100644
index 00000000000..e3c3f132b92
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyknot.doc
@@ -0,0 +1,2014 @@
+%% $Id: xyknot.doc,v 3.4 1997/05/18 01:13:24 ross Exp $
+%%
+%% Xy-pic ``Knots and Links'' feature.
+%% Copyright (c) 1994-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this macro package; if not, write to the Free Software Foundation,
+%% Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{knot}{Knots and Links feature}{\stripRCS$Revision: 3.4 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+ This feature provides a language for specifying knots, links and
+ general arrangements of crossing strings.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\TODO: Document this feature!
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\DOCMODE(
+\message{knots and links,}
+\DOCMODE)
+
+This |knot| feature is really a `construction kit', providing pieces which
+may be placed appropriately to form knots and links.
+The types of pieces provided are of two kinds: the ``crossings'',
+representing one string crossing over or under another;
+and ``joins'' which are used to connect what would otherwise be loose ends.
+Several types of each are provided, along with a simple way of specifying
+where to place arrowheads and labels.
+
+\begin{figure*}[tb]
+\begin{syntax}
+%
+ <knot-piece>
+ &\iss & <piece><scale><knot-labels>
+ & interpret knot-piece
+\cr
+\noalign{\smallskip}
+%
+ <piece>
+ &\iss & <crossing>\orr<join>
+ & piece is a ??!^[crossing] or a ??!^[join]
+\cr
+\noalign{\smallskip}
+%
+ <scale>
+ &\iss & <empty>\orr~|-|~\orr |[|<num>|]|
+ & invert or ??!^[scale the knot piece]; \cr
+& & \orr |~|<pos><pos><pos><pos>
+ & ??!^[alter size and shape] using the <pos>s
+\cr
+%
+\noalign{\smallskip}
+<knot-labels>
+ &\iss & <empty>\orr <knot-tips><knot-labels>
+ & arrowtips at ends, aligned with orientation
+\cr
+%
+\noalign{\smallskip}
+ & & \orr <where><what><knot-labels>
+ & list??^[knot-labels] of ??!^[arrowtips, breaks and labels]
+\cr
+%
+\noalign{\smallskip}
+ & & \orr |@|<adjust><knot-labels>
+ & ??!^[adjust hole] position for a <crossing>;
+ \newline adjust other parameter??^[join control] for a <join>.
+\cr
+%
+\noalign{\smallskip}
+ <knot-tips>
+ & \iss &~~~|==|\orr|=!| & ??!^[arrowtips] at both/neither end
+ \cr
+ & & \orr|=<|\orr|=>| & ??!^[arrowtips] also at start/finish
+\cr
+\noalign{\smallskip}
+%
+ <where>
+ & \iss &~~~||||\orr||||<adjust> & `over' string on a <crossing>;%
+ ??^[which string]
+ \newline middle??^[join places] place on a <join>.
+\cr
+ & & \orr|<|\orr|<|<adjust> & initial portion of `under' string
+ on a <crossing>;??^[which string]
+ \newline earlier??^[join places] place on a <join>.
+\cr
+ & & \orr|>|\orr|>|<adjust> & final portion of `under' string
+ on a <crossing>;??^[which string]
+ \newline later??^[join places] place on a <join>.
+\cr
+%
+\noalign{\smallskip}
+ <adjust>
+ & \iss &~~~|(+|<num>|)|\orr|(-|<num>|)|
+ & ??!^[adjustment] from current value of parameter
+\cr
+ & & \orr|(=|<num>|)|\orr|(|<num>|)| & set parameter value??^[adjustment]
+\cr
+\noalign{\smallskip}
+%
+ <what>
+ &\iss & ~~~|>|\orr|<| & arrowhead aligned with/against ??!^[orientation]
+\cr
+ & & \orr|\knothole|\orr|\khole| & leave ??!^[hole in the string]
+\cr
+ & & \orr|{|<text>|}| & set??^[simple label] <text> as label,
+ using |\labelstyle|
+\cr
+ & & \orr|{*|<object>|}| & drop <object>??^[knot object]
+\cr
+ & & \orr|{|<anchor><it>|}| & <break> or label??^[knot object]
+ as on an <arrow>
+\cr
+ & & \orr|||| & ??!^[null-break]
+\cr
+%
+\end{syntax}
+\caption{\protect<knot-piece> construction set}
+??=[f.path]
+\end{figure*}
+
+
+All the pieces ultimately use curves from the |curve| extension, usually
+indirectly via the |arrow| feature.
+As such, processing can be memory-intensive and may seem rather slow.
+All the warnings and advice given elsewhere on techniques to handle pages
+and individual diagrams with many curves are especially applicable when
+using this feature.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Most constructions use |\ar| so make sure this feature is loaded.
+
+\DOCMODE(
+\xyrequire{arrow}\xycatcodes
+\DOCMODE)
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\centerline{
+%
+\UseComputerModernTips
+\vtop{\vbox{\xygraph{!{0;/r1.5pc/:} !{\vover}[u]
+ !{\hcap[-2]<<} [d] !{\vover-} [ruu] !{\hcap[2]><}}\smallskip}
+\hbox{\qquad\ \small simple link}}\hfil
+%
+% Figure-eight
+%
+\vtop{\vbox{\xygraph{!{0;/r1.5pc/:}
+ [u] !{\vloop<(-.005)\khole||\vcrossneg \vunder- }
+ [] !{\ar @{-}@'{p-(1,0)@+}+(-1,1)}
+ [ul] !{\vcap[3]>\khole}
+ [rrr] !{\ar @{-}@'{p-(0,1)@+}-(1,1)}
+}\smallskip}\hbox{\small figure-8 knot}}\hfil\quad
+%
+% cinque-foil
+%
+\vtop{\vbox{\xygraph{!{0;/r1.25pc/:}
+ !P5"a"{~>{}} !P10"b"{~:{(1.7487,0):}~>{}}
+ !P20"c"{~={-9}~:{(2.2,0):}~>{}}
+ !{\xunderv~{"b3"}{"b2"}{"a2"}{"a1"}}
+ !{\xunderv~{"b5"}{"b4"}{"a3"}{"a2"}}
+ !{\xunderv~{"b7"}{"b6"}{"a4"}{"a3"}}
+ !{\xunderv~{"b9"}{"b8"}{"a5"}{"a4"}}
+ !{\xunderv~{"b1"}{"b10"}{"a1"}{"a5"}}
+ !{\vloop~{"c3"}{"c2"}{"b2"}{"b1"}<<}
+ !{\vloop~{"c7"}{"c6"}{"b4"}{"b3"}<<}
+ !{\vloop~{"c11"}{"c10"}{"b6"}{"b5"}<<}
+ !{\vloop~{"c15"}{"c14"}{"b8"}{"b7"}<<}
+ !{\vloop~{"c19"}{"c18"}{"b10"}{"b9"}<<}
+}\smallskip}\hbox{\quad\ \small cinquefoil}}
+}%
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection*{Crossings}
+
+A ``crossing'' is intended to represent two strings passing close by,
+but not meeting. The macros provided specify typesetting within a square
+cell of coordinate values; using a non-square basis alters this shape,
+but see also note~??[alter size and shape] below, for the technique
+that was used in the ``cinquefoil'' example above.
+
+\begin{notes}
+\note??=[crossing]
+Several families of crossing are provided. Those having names as |\v...|
+and |\h...| are designed to stack respectively vertically and
+horizontally. More precisely the current <pos> starts at the top-left
+corner and finishes at either the bottom-left or top-right.
+Say that a crossing is either a `vertical crossing' or `horizontal
+crossing' respectively.
+
+This certainly applies to the |\..cross..| and |\..twist..| families,
+see figure~??[f.crossings] in which the strings enter and leave the
+square all with vertical tangents or all with horizontal tangents.
+Indeed {\em all} crossings are either vertical or horizontal, with
+the final letter indicating which for the |\xover..| families.
+
+Furthermore there is a natural {\em orientation\/} for each crossing,
+as well as along each strand. This corresponds to the order in which ink
+is applied to the printed page, following the natural parametrization of
+each strand as a curved connection or arrow.
+This orientation determines whether a crossing is `over' (mathematically,
+positive or right-handed) or `under' (mathematically, negative or
+left-handed). It is used in determining the location of labels and the
+direction of arrowheads placed along the strings.
+Note that |\..cross..| and |\..twist..| crossings may set the same
+curves, but with different orientation and label-positioning.
+
+\begin{figure*}[ht]
+$$
+\knotholesize{5pt}\UseComputerModernTips
+ \xygraph{!{0;/r2pc/:}="O"
+ [] !{\vcross<>|>>><{x}|{y}>{z}}
+ [rur]!{\vcrossneg<>|>>><{x}|{y}>{z}}
+ [rur]!{\vuncross<>|>>><{x}|{y}>{z}}
+ [urrr]!{\hcross<>|>>><{x}|{y}>{z}}
+ [r]!{\hcrossneg<>|>>><{x}|{y}>{z}}
+ [r]!{\huncross<>|>>><{x}|{y}>{z}}
+ "O" !{+(.5,-1.5)}
+ [] !{*\txt\small\tt{\string\vcross}}
+ [rr]!{*\txt\small\tt{\string\vcrossneg}}
+ [rr]!{*\txt\small\tt{\string\vuncross}}
+ [rrr]!{*\txt\small\tt{\string\hcross}}
+ [rr]!{*\txt\small\tt{\string\hcrossneg}}
+ [rr]!{*\txt\small\tt{\string\huncross}}
+ "O" !{+(0,-3)}
+ [] !{\vtwist<>|>>><{x}|{y}>{z}}
+ [rur]!{\vtwistneg<>|>>><{x}|{y}>{z}}
+ [rur]!{\vuntwist<>|>>><{x}|{y}>{z}}
+ [urrr]!{\htwist<>|>>><{x}|{y}>{z}}
+ [r]!{\htwistneg<>|>>><{x}|{y}>{z}}
+ [r]!{\huntwist<>|>>><{x}|{y}>{z}}
+ "O" !{+(.5,-4.5)}
+ !{*\txt\small\tt{\string\vtwist}}
+ [rr]!{*\txt\small\tt{\string\vtwistneg}}
+ [rr]!{*\txt\small\tt{\string\vuntwist}}
+ [rrr]!{*\txt\small\tt{\string\htwist}}
+ [rr]!{*\txt\small\tt{\string\htwistneg}}
+ [rr]!{*\txt\small\tt{\string\huntwist}}
+ "O" !{+(0,-6)}
+ []!{\xoverv<>|>>><{x}|{y}>{z}}
+ [urr]!{\xunderv<>|>>><{x}|{y}>{z}}
+ [urr]!{\xunoverv<>|>>><{x}|{y}>{z}}
+ [urrr]!{\xoverh<>|>>><{x}|{y}>{z}}
+ [r]!{\xunderh<>|>>><{x}|{y}>{z}}
+ [r]!{\xunoverh<>|>>><{x}|{y}>{z}}
+ "O" !{+(.5,-7.5)}
+ !{*\txt\small\tt{\string\xoverv}}
+ [rr]!{*\txt\small\tt{\string\xunderv}}
+ [rr]!{*\txt\small\tt{\string\xunoverv}}
+ [rrr]!{*\txt\small\tt{\string\xoverh}}
+ [rr]!{*\txt\small\tt{\string\xunderh}}
+ [rr]!{*\txt\small\tt{\string\xunoverh}}
+ "O" !{+(0,-9)}
+ !{\vover<>|>>><{x}|{y}>{z}}
+ [rur]!{\vunder<>|>>><{x}|{y}>{z}}
+ [rur]!{\vunover<>|>>><{x}|{y}>{z}}
+ [urrr]!{\hover<>|>>><{x}|{y}>{z}}
+ [r]!{\hunder<>|>>><{x}|{y}>{z}}
+ [r]!{\hunover<>|>>><{x}|{y}>{z}}
+ "O" !{+(.5,-10.5)}
+ !{*\txt\small\tt{\string\vover}}
+ [rr]!{*\txt\small\tt{\string\vunder}}
+ [rr]!{*\txt\small\tt{\string\vunover}}
+ [rrr]!{*\txt\small\tt{\string\hover}}
+ [rr]!{*\txt\small\tt{\string\hunder}}
+ [rr]!{*\txt\small\tt{\string\hunover}}
+}$$
+\caption{knot crossings with orientations and label positions}%
+??=[f.crossings]
+\end{figure*}
+
+\noindent
+Figure~??[f.crossings] displays the orientation on all the crossings,
+grouping them into subfamilies consisting of right-handed, left-handed
+and non-crossings. Also indicated are the default positions for labels
+and arrow-tips; each piece uses the same code for tips and labels,
+e.g. |\vover<>||>>><{x}||{y}>{z}|.
+
+The |\x...| crossings do not stack easily since their tangents are at
+$45^\circ$ to the coordinate axes. It is the last letter in the name
+which denotes whether the particular crossing is vertical or horizontal.
+On the other hand |\vover|\,, |\vunder| etc. stack vertically on top of
+a |\vcross|\,, |\vtwist| etc.; similarly |\hover| stacks at the left
+of |\hcross|\,, |\htwist| etc.
+
+\begin{code}
+$$\xy 0;/r1pc/:
+ ,{\vunder\vtwist\vtwist\vunder-}\endxy
+\qquad\qquad\qquad \xy 0;/r1pc/:+(0,-1.5)
+ ,{\hover\hcross\hcross\hover-}\endxy$$
+\end{code}
+\docode
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Parsing}
+
+\DOCMODE(
+\xydef@\xykparsecross@{%
+ \def\xykSCALE@@{}\edef\xyknotPLACE{\xykmidPLACE@}%
+ \let\xykparser@=\xykparsecross@@
+ \def\xykdefaultbreak@{\let\xykbreak@=\xykforetemp@
+ \def\xyknotPLACE{(.5)}\appendtoholder@}%
+ \xyFN@\xykparsescale@ }
+
+{\xyuncatcodes \catcode`@=11
+\gdef\next{%
+ \ifx\space@\next \expandafter\DN@\space{\xyFN@\xykparsecross@@}%
+ \else\addLT@\ifx\next \addLT@\DN@{\xyprecross@}%
+ \else\addGT@\ifx\next \addGT@\DN@{\xypostcross@}%
+ \else\addEQ@\ifx\next \addEQ@\DN@{\xyFN@\xykparsetips@@}%
+ \else\ifx|\next\DN@|{\xymidcross@}%
+ \else\addAT@\ifx\next \addAT@\DN@(##1){%
+ \xyadjustBREAK@i##1@@\xyFN@\xykparsecross@@}%
+ \else\DN@{\afterknot@}%
+ \fi\fi\fi\fi\fi\fi \next@ }}
+\xylet@\xykparsecross@@=\next
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xyprecross@{%
+ \def\xykholder@{\xykprebreak@@}%
+ \edef\xyknotPLACE{\xykprePLACE@}%
+ \xyFN@\xykparsebreak@}
+
+\xydef@\xypostcross@{%
+ \def\xykholder@{\xykpostbreak@@}%
+ \edef\xyknotPLACE{\xykpostPLACE@}%
+ \xyFN@\xykparsebreak@}
+
+\xydef@\xymidcross@{%
+ \def\xykholder@{\xykmidbreak@@}%
+ \edef\xyknotPLACE{\xykmidPLACE@}%
+ \xyFN@\xykparsebreak@}
+\DOCMODE)
+
+These macros are common to most crossings.
+
+\DOCMODE(
+\xydef@\xykcross@#1{\xykcheckTIPS@
+ \expandafter\toks@\expandafter{\expandafter#1\knotSTYLE}}
+
+\xydef@\xykoverstring@{\addtotoks@{{}}\xykmidbreak@ \xyknottips@}
+\xydef@\xykunderstring@{\xykprebreak@ \xykpostbreak@ \xyknottips@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{``cross'' crossings:}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The initialisation\dots
+
+\DOCMODE(
+\xydef@\vcross{\begingroup\def\afterknot@{\xyvcross}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\hcross{\begingroup\def\afterknot@{\xyhcross}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\vcrossneg{\begingroup\def\afterknot@{\xyvcrossneg}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\hcrossneg{\begingroup\def\afterknot@{\xyhcrossneg}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\vuncross{\begingroup\def\afterknot@{\xyvuncross}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\huncross{\begingroup\def\afterknot@{\xyhuncross}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+\DOCMODE)
+
+The interface\dots
+
+\DOCMODE(
+\xydef@\xyvcross{\xykcross@\xykcrossv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyhcross{\xykcross@\xykcrossh
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyvcrossneg{\xykcross@\xykcrossv
+ \xykunderstring@ \xykoverstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyhcrossneg{\xykcross@\xykcrossh
+ \xykunderstring@ \xykoverstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyvuncross{\xykcross@\xykuncrossv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyhuncross{\xykcross@\xykuncrossh
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+\DOCMODE)
+
+The drawing code\dots
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<",{\xykz_\ar #1@'{"_<"**{}?(.25)@+,?+(.375,0)@+,
+ "_>";"^>"**{}?-(.375,0)@+,?(.25)@+}"_>"#3#4#5},
+ "_<",{\xykz^\ar #2@'{"^<"**{}?(.25)@+,?+(.375,0)@+,
+ "^>";"_>"**{}?-(.375,0)@+,?(.25)@+}"^>"#6#7#8}
+ \restore\POS #9}}
+\xylet@\xykcrossv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "_<",{\xykz_\ar #1@'{"_>"**{}?(.25)@+,?+(0,.375)@+,
+ "^>";"^<"**{}?-(0,.375)@+,?(.25)@+}"^>"#3#4#5},
+ "_>",{\xykz^\ar #2@'{"_<"**{}?(.25)@+,?+(0,.375)@+,
+ "^<";"^>"**{}?-(0,.375)@+,?(.25)@+}"^<"#6#7#8}
+ \restore\POS #9}}
+\xylet@\xykcrossh=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<",{\xykz^\ar #1@'{"_<"**{}?(.25)@+,?(.375)+(.375,0)@+,
+ "^>";"_>"**{}?(.375)-(.375,0)@+,?(.25)@+}"^>"#3#4#5},
+ "_<",{\xykz^\ar #2@'{"^<"**{}?(.25)@+,?(.375)+(.375,0)@+,
+ "_>";"^>"**{}?(.375)-(.375,0)@+,?(.25)@+}"_>"#6#7#8}
+ \restore\POS #9}}
+\xylet@\xykuncrossv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "_<",{\xykz^\ar #1@'{"_>"**{}?(.25)@+,?(.375)+(0,.375)@+,
+ "^<";"^>"**{}?(.375)-(0,.375)@+,?(.25)@+}"^<"#3#4#5},
+ "_>",{\xykz^\ar #2@'{"_<"**{}?(.25)@+,?(.375)+(0,.375)@+,
+ "^>";"^<"**{}?(.375)-(0,.375)@+,?(.25)@+}"^>"#6#7#8}
+ \restore\POS #9}}
+\xylet@\xykuncrossh=\next
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{``over'' crossings:}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The initialisation\dots
+
+\DOCMODE(
+\xydef@\vover{\begingroup\def\afterknot@{\xyvover}%
+ \def\xykprePLACE@{(.2)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.8)}\def\xykpostbreak@@{|(.725)\knothole}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\hover{\begingroup\def\afterknot@{\xyhover}%
+ \def\xykprePLACE@{(.2)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.8)}\def\xykpostbreak@@{|(.725)\knothole}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\vunder{\begingroup\def\afterknot@{\xyvunder}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.8)}%
+ \def\xykmidPLACE@{(.2)}\def\xykpostbreak@@{|(.275)\knothole}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\hunder{\begingroup\def\afterknot@{\xyhunder}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.8)}%
+ \def\xykmidPLACE@{(.2)}\def\xykpostbreak@@{|(.275)\knothole}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\vunover{\begingroup\def\afterknot@{\xyvunover}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.8)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\hunover{\begingroup\def\afterknot@{\xyhunover}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.8)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+
+
+\xydef@\xoverv{\begingroup\def\afterknot@{\xyxoverv}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.85)}%
+ \def\xykmidPLACE@{(.15)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\xunderv{\begingroup\def\afterknot@{\xyxunderv}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.85)}%
+ \def\xykmidPLACE@{(.15)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\xoverh{\begingroup\def\afterknot@{\xyxoverh}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.85)}%
+ \def\xykmidPLACE@{(.15)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\xunderh{\begingroup\def\afterknot@{\xyxunderh}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.85)}%
+ \def\xykmidPLACE@{(.85)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\xunover{\begingroup\def\afterknot@{\xyxunover}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.85)}%
+ \def\xykmidPLACE@{(.15)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\xunoverv{\begingroup\def\afterknot@{\xyxunoverv}%
+ \def\xykprePLACE@{(.2)}\def\xykpostPLACE@{(.8)}%
+ \def\xykmidPLACE@{(.2)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+
+\xydef@\xunoverh{\begingroup\def\afterknot@{\xyxunoverh}%
+ \def\xykprePLACE@{(.2)}\def\xykpostPLACE@{(.8)}%
+ \def\xykmidPLACE@{(.8)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+\DOCMODE)
+
+The interface\dots
+
+\DOCMODE(
+\xydef@\xyvover{\xykcross@\xykoverv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyhover{\xykcross@\xykoverh
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyvunder{\xykcross@\xykoverv
+ \xykunderstring@ \xykoverstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyhunder{\xykcross@\xykoverh
+ \xykunderstring@ \xykoverstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyvunover{\xykcross@\xykunoverv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyhunover{\xykcross@\xykunoverh
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+
+
+\xydef@\xyxoverv{\xykcross@\xykxoverv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyxunderv{\xykcross@\xykxoverv
+ \xykunderstring@ \xykoverstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyxoverh{\xykcross@\xykxoverh
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyxunderh{\xykcross@\xykxoverh
+ \xykunderstring@ \xykoverstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyxunover{\xykcross@\xykxoverv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyxunoverv{\xykcross@\xykxunoverv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyxunoverh{\xykcross@\xykxunoverh
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+
+\DOCMODE)
+
+The drawing code\dots
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<",{\xykz^\ar #1@'{"^>"**{}?(.25)@+,?(.625)+(0,-.125)@+,
+ "_>";"^>"**{}?(.625)-(.125,0)@+,?(.25)@+}"_>"#3#4#5},
+ "_<",{\xykz^\ar #2@'{"^<"**{}?(.25)@+,?(.625)+(.125,0)@+,
+ "^>";"^<"**{}?(.625)-(0,.125)@+,?(.25)@+}"^>"#6#7#8},\restore\POS#9}}
+\xylet@\xykoverv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "_<",{\xykz^\ar #1@'{"^<"**{}?(.25)@+,?(.625)+(.125,0)@+,
+ "^>";"^<"**{}?(.625)-(0,.125)@+,?(.25)@+}"^>"#3#4#5},
+ "_>",{\xykz^\ar #2@'{"_<"**{}?(.25)@+,?(.625)+(0,.125)@+,
+ "^<";"_<"**{}?(.625)+(.125,0)@+,?(.25)@+}"^<"#6#7#8},\restore\POS#9}}
+\xylet@\xykoverh=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<",{\xykz^\ar #1@'{"^>"**{}?(.25)@+,?-(0,.175)@+,?(.75)@+}
+ "^>"#3#4#5},
+ "_<",{\xykz^\ar #2@'{"^<"**{}?(.25)@+,?+(.125,0)@+,
+ "_>"**{}?+(0,.7)@+,"_>";"^>"**{}?-(.125,0)@+,?(.25)@+}
+ "_>"#6#7#8},\restore\POS#9}}
+\xylet@\xykunoverv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "_<",{\xykz^\ar #1@'{"^<"**{}?(.25)@+,?+(.175,0)@+,?(.75)@+}
+ "^<"#3#4#5},
+ "_>",{\xykz^\ar #2@'{"_<"**{}?(.25)@+,?+(0,.125)@+,
+ "^>"**{}?-(.7,0)@+,"^>";"^<"**{}?-(0,.125)@+,?(.25)@+}
+ "^>"#6#7#8},\restore\POS#9}}
+\xylet@\xykunoverh=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<";"^>"**{}?="^_","_<";"_>"**{}?;"^_",**{}?="^_",
+ "^>",{\xykz^\ar #1@'{"^_"@+}"_<"#3#4#5},
+ "^<",{\xykz_\ar #2@'{"^_"@+}"_>"#6#7#8},\restore\POS#9}}
+\xylet@\xykxoverv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<";"_<"**{}?="^_","^>";"_>"**{}?;"^_",**{}?="^_",
+ "^<",{\xykz_\ar #1@'{"^_"@+}"_>"#3#4#5},
+ "_<",{\xykz_\ar #2@'{"^_"@+}"^>"#6#7#8},\restore\POS#9}}
+\xylet@\xykxoverh=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<";"^>"**{}?="^_","_<";"_>"**{}?;"^_",**{}?="^_",
+ "^>",{\xykz^\ar #1@'{"^_"@+}"_>"#3#4#5},
+ "^<",{\xykz^\ar #2@'{"^_"@+}"_<"#6#7#8},\restore\POS#9}}
+\xylet@\xykxunoverv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<";"_<"**{}?="^_","^>";"_>"**{}?;"^_",**{}?="^_",
+ "^<",{\xykz^\ar #1@'{"^_"@+}"^>"#3#4#5},
+ "_<",{\xykz^\ar #2@'{"^_"@+}"_>"#6#7#8},
+ \restore\POS#9}}
+\xylet@\xykxunoverh=\next
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{``twist'' crossings:}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The initialisation\dots
+
+\DOCMODE(
+\xydef@\vtwist{\begingroup\def\afterknot@{\xyvtwist}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\htwist{\begingroup\def\afterknot@{\xyhtwist}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\vtwistneg{\begingroup\def\afterknot@{\xyvtwistneg}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\htwistneg{\begingroup\def\afterknot@{\xyhtwistneg}%
+ \def\xykprePLACE@{(.1)}\def\xykpostPLACE@{(.9)}%
+ \def\xykmidPLACE@{(.9)}\def\xykpostbreak@@{|\knothole}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\vuntwist{\begingroup\def\afterknot@{\xyvuntwist}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.85)}%
+ \def\xykmidPLACE@{(.85)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+\xydef@\huntwist{\begingroup\def\afterknot@{\xyhuntwist}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.85)}%
+ \def\xykmidPLACE@{(.85)}\def\xykpostbreak@@{}%
+ \xyFN@\xykparsecross@ }%
+\DOCMODE)
+
+The interface\dots
+
+\DOCMODE(
+\xydef@\xyvtwist{\xykcross@\xyktwistv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyvtwistneg{\xykcross@\xyktwistv
+ \xykunderstring@ \xykoverstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyvuntwist{\xykcross@\xykuntwistv
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(0,-1)}}
+
+\xydef@\xyhtwist{\xykcross@\xyktwisth
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyhuntwist{\xykcross@\xykuntwisth
+ \xykoverstring@ \xykunderstring@ \xykhvobject@{+(1,0)}}
+
+\xydef@\xyhtwistneg{\xykcross@\xyktwisth
+ \xykunderstring@ \xykoverstring@ \xykhvobject@{+(1,0)}}
+\DOCMODE)
+
+The drawing code\dots
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^>",{\xykz_\ar #1@'{"_>"**{}?(.25)@+,?-(.375,0)@+,
+ "_<";"^<"**{}?+(.375,0)@+,?(.25)@+}"_<"#3#4#5},
+ "^<",{\xykz^\ar #2@'{"_<"**{}?(.25)@+,?+(.375,0)@+,
+ "_>";"^>"**{}?+(-.375,0)@+,?(.25)@+}"_>"#6#7#8}
+ \restore\POS #9}}
+\xylet@\xyktwistv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^>",{\xykz^\ar #1@'{"_>"**{}?(.125)@+,?(.375)-(.25,0)@+,
+ ?(.625)-(.25,0)@+,?(.875)@+}"_>"#3#4#5},
+ "^<",{\xykz^\ar #2@'{"_<"**{}?(.125)@+,?(.375)+(.25,0)@+,
+ ?(.625)+(.25,0)@+,?(.875)@+}"_<"#6#7#8}
+ \restore\POS #9}}
+\xylet@\xykuntwistv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<",{\xykz_\ar #1@'{"^>"**{}?(.25)@+,?+(0,-.375)@+,
+ "_>";"_<"**{}?+(0,.375)@+,?(.25)@+}"_>"#3#4#5},
+ "_<",{\xykz^\ar #2@'{"_>"**{}?(.25)@+,?+(0,.375)@+,
+ "^>";"^<"**{}?-(0,.375)@+,?(.25)@+}"^>"#6#7#8}
+ \restore\POS #9}}
+\xylet@\xyktwisth=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\save,
+ "^<",{\xykz^\ar #1@'{"^>",**{}?(.125)@+,?(.375)+(0,-.25)@+,
+ ?(.625)+(0,-.25)@+,?(.875)@+}"^>"#3#4#5},
+ "_<",{\xykz^\ar #2@'{"_>",**{}?(.125)@+,?(.375)+(0,.25)@+,
+ ?(.625)+(0,.25)@+,?(.875)@+}"_>"#6#7#8},\restore\POS #9}}
+\xylet@\xykuntwisth=\next
+
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[scale the knot piece]
+The above examples also show how to use |-| to get the mirror-image of a
+particular crossing. Any numerical scale factor can be used by enclosing
+it within |[..]| e.g. |[2.3]| scaling a single piece without affecting
+the rest of the picture. The scale-factor {\em must\/} occur before any
+label or arrow-tip specifiers, see below). Vertical crossings remain
+vertical under scalings; the current <pos> still moves by 1 coordinate
+unit in the `down' direction. Similarly horizontal crossings remain
+horizontal. The single character |-| is a shorthand version for |[-1]|,
+effectively giving a half-turn rotation in a rectangular basis.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xykparsescale@{%
+ \ifx\space@\next \expandafter\DN@\space{\xyFN@\xykparsescale@}%
+ \else\addDASH@\ifx\next \addDASH@\DN@{\def\xykSCALE@@{-1}%
+ \xyFN@\xykparser@}%
+ \else\ifx[\next \DN@[##1]{\dimen@=##1\p@
+ \ifdim\dimen@=\z@\xywarning@{\xykscaleerror@}%
+ \else\edef\xykSCALE@@{\expandafter\removePT@\the\dimen@}\fi
+ \xyFN@\xykparser@}%
+ \else\ifx~\next \DN@~##1##2##3##4{%
+ \def\xykSCALE@@{@{##1}{##2}{##3}{##4}}\xyFN@\xykparser@}%
+ \else\DN@{\xyFN@\xykparser@}%
+ \fi\fi\fi\fi \next@}
+
+\xydef@\xykscaleerror@{Ignoring zero scale factor}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[alter size and shape]
+A knot-piece need not be rectangular. By specifying
+|~|<pos>$_1$<pos$_2$><pos$_3$><pos$_4$> the four corners |UL|, |UR|,
+|DL|, |DR| are set to the given <pos>s respectively.
+The local basis is established so that
+\begin{eqnarray*}
+r\hbox{--hop}&\!\!\leftrightarrow\!\!&
+{\textstyle{1\over2}}\bigl(\hbox{<pos$_2$>}-\hbox{<pos$_1$>}
++\hbox{<pos$_4$>} -\hbox{<pos$_3$>}\bigr) \\
+u\hbox{--hop}&\!\!\leftrightarrow\!\!&
+{\textstyle{1\over2}}\bigl(\hbox{<pos$_1$>}-\hbox{<pos$_3$>}
++\hbox{<pos$_2$>} -\hbox{<pos$_1$>}\bigr)\;.
+\end{eqnarray*}
+
+\note??=[adjust hole]
+With a non-rectangularly shaped piece it will usually be necessary to
+adjust the place where the `hole' occurs in the `under' string. This is
+done by specifying |@(|<num>|)|, with $0\le <num>\le1$ being the parameter
+value of the new location for the hole.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+%\xydef@\xykobject@{%
+% \ifx\xykSCALE@@\empty\DN@{\xykkeepscale@}%
+% \else \DN@{\xyksavescale@{}}%
+% \fi \next@ }
+
+\xydef@\xykhobject@{\aftergroup\xykhadjust@
+ \ifx\xykSCALE@@\empty\DN@{\xykkeepscale@}%
+ \else \DN@{\xyksavescale@{}}%
+ \fi \next@ }
+
+\xydef@\xykvobject@{\aftergroup\xykvadjust@
+ \ifx\xykSCALE@@\empty\DN@{\xykkeepscale@}%
+ \else \DN@{\xyksavescale@{}}%
+ \fi \next@ }
+
+\xydef@\xykhvobject@{\aftergroup\xykhvadjust@
+ \ifx\xykSCALE@@\empty\DN@{\xykkeepscale@}%
+ \else \DN@{\xyksavescale@{}}%
+ \fi \next@ }
+
+\xydef@\xykhuobject@{\aftergroup\xykhuadjust@
+ \ifx\xykSCALE@@\empty\DN@{\xykkeepscale@}%
+ \else \DN@{\xyksavescale@{}}%
+ \fi \next@ }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xyksavescale@#1#2{%
+ \expandafter\ifx\the\Edge@c\zeroEdge\relax \def\xyksaveEdgec{}%
+ \else
+ \edef\xyksaveEdgec{\noexpand\Edge@c={\expandafter\noexpand\the\Edge@c}%
+ \L@c=\the\L@c \R@c=\the\R@c \D@c=\the\D@c \U@c=\the\U@c}%
+ \fi
+%
+ \edef\next@##1##2{\endgroup
+ \def\noexpand\xyksaveEdgec{}%
+ \def\noexpand\xykSCALE@@\noexpand{##1}%
+ \def\noexpand\xykjoincontrol\noexpand{\xykjoincontrol}%
+ \noexpand\toks@\noexpand{##2}%
+ \noexpand\xy@@{\def\noexpand\xyksaveEdgec{}%
+ \def\noexpand\xykSCALE@@{##1}%
+ \def\noexpand\xykjoincontrol{\xykjoincontrol}}}%
+ \expandafter\expandafter\expandafter\next@
+ \expandafter\expandafter\expandafter{\expandafter\xykSCALE@@\expandafter}%
+ \expandafter{\the\toks@}%
+%
+ \xykrescale@ #1\the\toks@\restore\POS#2}
+
+\xydef@\xykkeepscale@{%
+ \edef\next@##1{\endgroup \noexpand\toks@={##1}%
+ \def\noexpand\xykjoincontrol{\xykjoincontrol}}%
+ \expandafter\next@\expandafter{\the\toks@}%
+ \def\xykSCALE@@{}\def\xyksaveEdgec{}%
+ \xy@@{\def\xykSCALE@@{}\def\xyksaveEdgec{}}%
+ \edef\next@{\def\noexpand\xykjoincontrol{\xykjoincontrol}}%
+ \expandafter\xy@@\expandafter{\next@}%
+ \xyknoflexscale@ \the\toks@}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xykrescale@{\expandafter\xykcheckscale@\xykSCALE@@ !}%
+
+\xydef@\xykcheckscale@#1#2!{%
+ \expandafter\DN@\expandafter{\codeof{#1}}%
+ \expandafter\DNii@\expandafter{\codeof{@}}%
+ \ifx\next@\nextii@\relax\DN@{\xykflexiscale@#2%
+ \xy@@{\divide\X@xbase2\divide\X@ybase2\divide\Y@xbase2\divide\Y@ybase2%
+ \def\xykSCALE@@{}}\def\xykSCALE@@{}%
+ \expandafter\toks@\expandafter{\afterFLEX@}}%
+ \else\DN@{\save \xykrescale@@}\fi \next@ }
+
+\xydef@\xykflexiscale@{%
+ \expandafter\def\expandafter\afterFLEX@\expandafter{\the\toks@}%
+ \xykflexiscale@@ }
+
+\xydef@\xykrescale@@{%
+ \edef\next@{\X@xbase=\xykSCALE@@\X@xbase \X@ybase=\xykSCALE@@\X@ybase
+ \Y@xbase=\xykSCALE@@\Y@xbase \Y@ybase=\xykSCALE@@\Y@ybase}%
+ \expandafter\xy@@\expandafter{\next@}%
+ \ifdim\xykSCALE@@\p@<\z@\relax \DN@{\xyknegflexscale@}%
+ \else\DN@{\xyknoflexscale@}\fi \next@ }
+\DOCMODE)
+
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4{\save="@",
+ #1,="^<",\POS"@",#2,="^>",\POS"@",#3,="_<",\POS"@",#4,="_>",
+ (0,0);"^>"-"^<"+"_>"-"_<":"^<"-"_<"+"^>"-"_>"::}}
+\xylet@\xykflexiscale@@=\next
+
+{\xyuncatcodes \gdef\next{\save ="^<",
+ +(1,0)="^>",-(1,1)="_<",+(1,0)="_>"\restore }}
+\xylet@\xyknoflexscale@@=\next
+\xylet@\xyknoflexscale@=\next
+
+{\xyuncatcodes \gdef\next{\save ="_>",
+ +(-1,1)="^<",+(1,0)="^>",-(1,1)="_<"\restore }}
+\xylet@\xyknegflexscale@@=\next
+\xylet@\xyknegflexscale@=\next
+
+{\xyuncatcodes \gdef\next{\save ="_<",
+ +(1,0)="_>",+(-1,1)="^<",+(1,0)="^>"\restore }}
+\xylet@\xykhscale@@=\next
+
+{\xyuncatcodes \gdef\next{\save ="^>",
+ -(1,0)="^<",+(1,-1)="_>",-(1,0)="_<"\restore }}
+\xylet@\xykvscale@@=\next
+\DOCMODE)
+
+
+\DOCMODE(
+\xydef@\xykhadjust@{%
+ \let\xyknoflexscale@=\xykhscale@@
+ \let\xyknegflexscale@=\xyknegflexscale@@ }
+
+\xydef@\xykvadjust@{%
+ \let\xyknoflexscale@=\xyknoflexscale@@
+ \let\xyknegflexscale@=\xykhscale@@ }
+
+\xydef@\xykhvadjust@{%
+ \let\xyknoflexscale@=\xyknoflexscale@@
+ \let\xyknegflexscale@=\xyknegflexscale@@ }
+
+\xydef@\xykhuadjust@{%
+ \let\xyknoflexscale@=\xykhscale@@
+ \let\xyknegflexscale@=\xykvscale@@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[arrowtips, breaks and labels]
+The |knot| feature allows for the easy placement of the following objects
+along the strings of a crossing:\par
+\begin{itemize}
+\item labels on the strings;
+\item arrowheads for direction or orientation;
+\item holes in strings, allowing another string to be drawn passing over.
+\end{itemize}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note ??=[which string]
+The characters |<|, |>| and |||| are used to indicate to which string
+portion the object is associated; with |||| denoting the string which
+crosses the other, while |<| and |>| denote the initial and final
+portions of the `crossed' string.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xykprebreak@{%
+ \ifx\xykprebreak@@\empty\addtotoks@{{}}\else
+ \expandafter\addtotoks@\expandafter{\expandafter{\xykprebreak@@}}\fi}
+
+\xydef@\xykpostbreak@{%
+ \ifx\xykpostbreak@@\empty\addtotoks@{{}}\else
+ \expandafter\addtotoks@\expandafter{\expandafter{\xykpostbreak@@}}\fi}
+
+\xydef@\xykmidbreak@{%
+ \ifx\xykmidbreak@@\empty\addtotoks@{{}}\else
+ \expandafter\addtotoks@\expandafter{\expandafter{\xykmidbreak@@}}\fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note ??=[simple label]
+A simple label enclosed in braces, for example |\vcross>{x}|, is set in
+math-mode using the |\labelstyle|, at a pre-determined place on the string
+portion, shifted in either the `above' or `below' direction from the curve
+at this point. (For each crossing depicted in figure~??[f.crossings] only
+default values are used for the place and shift-direction.)
+
+\note ??=[knot object]
+If the first character within the braces |{..}| is |*| e.g.
+|\htwist>{*|<object>|}|, then a general <object> may be placed as a label.
+Furthermore if the first character is |^| or |_| or ||||, then
+the interpretation is, e.g. |\vtwist<{^|<anchor><it>|}|,
+as in ??g[xyarrow.doc:f.arrow]
+to place <it> as a label along an |\ar| of the |arrow| feature.
+
+\note ??=[orientation]
+A second character |<| or |>| specifies that an arrowhead should appear
+at the pre-determined place on the chosen string.
+Here |>| denotes an arrowhead pointing with the natural orientation,
+while |<| points against. Due to the curvature of the strings, it is
+usually best to |\UseComputerModernTips| rather than normal arrow-tips.
+
+\note ??=[hole in the string]
+To generate a `hole' use |\knothole|, or simply |\khole|, as following
+token. This generates a `break', in the sense of
+??g[xyarrow.doc:break with <it>].
+Indeed such a `hole' is used to separate the two portions of the `crossed'
+string. Default size for the hole is 5pt, which is alterable via
+|\knotholesize{|<dimen>|}|; normally used to set the size for {\em all}\/
+holes in a diagram.
+
+\note ??=[null-break]
+If the resulting |\khole| is either too large or perhaps non-existent,
+this could be due to a technicality in the way breaks in curves are
+handled. This problem should not occur with the standard crossings, using
+a rectangular basis, but it may occur with non-rectangular bases.
+An easy `fix' is to include an extra {\em null-break}\ on the string,
+using |<|||, |>||| or ||||||, which should place the zero-sized break at
+parameter value .5 on the curve. The specification should precede a
+|\khole| at a higher parameter value, or come after one at a lower value.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The aim of the above `fix' is to position the null-break as close as
+possible to where the curve is farthest from the line joining its
+end-points, which is usually at parameter value |(.5)|.
+
+\DOCMODE(
+\xydef@\xykparsebreak@{%
+ \ifx\space@\next \expandafter\DN@\space{\xyFN@\xykparsebreak@}%
+ \else \addLT@\ifx\next
+ \expandafter\appendtoholder@\xykbacktemp@\next@
+ \addLT@\DN@{\xyFN@\xykparser@}%
+ \else \addGT@\ifx\next
+ \expandafter\appendtoholder@\xykforetemp@\next@
+ \addGT@\DN@{\xyFN@\xykparser@}%
+ \else \ifx|\next
+ \expandafter\appendtoholer@\xyknulltemp@\next@
+ \DN@|{\xyFN@\xykparser@}%
+ \else \ifx\next \bgroup\DN@##1{\checkgroupbreak@##1@}%
+ \else \ifx (\next\DN@(##1){\xyadjustknotPLACE@i##1@@%
+ \xyFN@\xykparsebreak@}%
+ \else \ifx\next \knothole@\DN@##1{\expandafter\appendtoholder@@
+ \expandafter{\expandafter|\xyknotPLACE\knothole}\next@
+ \xyFN@\xykparser@}%
+ \else
+ \expandafter\xykdefaultbreak@\xykbreak@\next@
+ \DN@{\xyFN@\xykparser@}%
+ \fi\fi\fi\fi\fi\fi\fi \next@ }
+\DOCMODE)
+
+Templates for arrowheads.
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next{^>*\dir{>}}}
+\xylet@\xykforetips@=\next
+
+{\xyuncatcodes \gdef\next{^<*\dir{<}}}
+\xylet@\xykbacktips@=\next
+
+{\xyuncatcodes \gdef\next{*!/-1pt/=0\dir{>}}}
+\xylet@\xykforetemp@=\next
+
+{\xyuncatcodes \gdef\next{*!/1pt/=0\dir{<}}}
+\xylet@\xykbacktemp@=\next
+
+{\xyuncatcodes \gdef\next{*=<\xykholesize>[o]{}}}
+\xylet@\xykholetemp@=\next
+\xydef@\knothole@{\hbox to\xykholesize{%
+ \dimen@=\xykholesize \divide\dimen@\tw@
+ \hfill \vrule height\dimen@ depth\dimen@ width\z@ }}
+\xylet@\knothole=\knothole@
+\xylet@\khole=\knothole@
+
+{\xyuncatcodes \gdef\next{*=<0pt>{}}}
+\xylet@\xyknulltemp@=\next
+\xylet@\xykbreak@=\xyknulltemp@
+\DOCMODE)
+
+When the next token is a begin-group character |{| then look at the first
+token inside the group. If it is |^|,|_| or |||| then the group contents
+will be an <anchor> for user-chosen places along the string.
+Otherwise the place is taken to be the already specified |\xyknotPLACE|
+and the group contains a label, to be set in the usual way for labels,
+using |_| due to the orientation of the curve.
+However if the first token is |*| then the user is assumed to be
+dropping his own label, possibly with <object> modifiers.
+
+\DOCMODE(
+\xydef@\checkgroupbreak@#1#2@{%
+ \ifx|#1\DN@{\appendtoholder@@#1#2\next@ \xyFN@\xykparser@}%
+ \else \ifx_#1\DN@{\appendtoholder@@_#2\next@ \xyFN@\xykparser@}%
+ \else \ifx^#1\DN@{\appendtoholder@@^#2\next@ \xyFN@\xykparser@}%
+ \else
+ \def\next##1\next{\expandafter\DNii@\expandafter{\xyk@@##1}}%
+ \expandafter\next\xyknotPLACE\next
+ \ifx*#1%
+ \expandafter\DN@\expandafter{%
+ \expandafter\appendtoholder@@\nextii@#1#2\next@ \xyFN@\xykparser@}%
+ \else %\expandafter\DNii@\expandafter{\expandafter\xyk@@\xyknotPLACE}%
+ \expandafter\DN@\expandafter{%
+ \expandafter\appendtoholder@@\nextii@{#1#2}\next@ \xyFN@\xykparser@}%
+ \fi\fi\fi\fi \next@ }
+\DOCMODE)
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next{%
+ \expandafter{\expandafter^\xyknotPLACE##1}}}%
+ \DN@{\xydef@\xykholder@@##1}\DNii@{\expandafter\toks@}%
+ \expandafter\expandafter\expandafter\next@
+ \expandafter\expandafter\expandafter{\expandafter\nextii@\next}
+
+\xydef@\appendtoholder@#1\next@{\xykholder@@{#1}%
+ \DN@##1{\expandafter\DN@\expandafter{\xykholder@##1}}%
+ \expandafter\next@\expandafter{\the\toks@}\appendtoholder@@@ }
+
+\xydef@\appendtoholder@@#1\next@{%
+ \DN@##1\next@{\expandafter\DN@\expandafter{\xykholder@##1}}%
+ \next@#1\next@ \appendtoholder@@@}%
+
+\xydef@\appendtoholder@@@{%
+ \expandafter\expandafter\expandafter\DN@
+ \expandafter\expandafter\expandafter{\next@}%
+ \DNii@{\expandafter\def\xykholder@}%
+ \expandafter\nextii@\expandafter{\next@}}
+\DOCMODE)
+
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next{%
+ \expandafter{\expandafter|\xyknotPLACE##1}}}%
+\DN@{\xydef@\xykholer@@##1}\DNii@{\expandafter\toks@}%
+ \expandafter\expandafter\expandafter\next@
+ \expandafter\expandafter\expandafter{\expandafter\nextii@\next}
+
+\xydef@\appendtoholer@#1\next@{\xykholer@@{#1}%
+ \DN@##1{\expandafter\DN@\expandafter{\xykholder@##1}}%
+ \expandafter\next@\expandafter{\the\toks@}\appendtoholder@@@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+??=[knot-labels]
+Multiple breaks, arrow-heads and labels may be specified along the
+two strings of a crossing; simply place their specifications one after
+another; e.g. |<>||>>><{x}||{y}>{z}| was used in figure~??[f.crossings].
+
+The only proviso is that all `breaks' along a single strand must occur
+with increasing order of parameter position. On the `crossed' string
+this includes the automatic `hole' to create space for the other string.
+Hence it is advisable to use just the |(+..)| and |(-..)| variants for
+small adjustments, and to keep these correctly ordered.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xykz#1{\let\xyk@@=#1\xy@@{\let\xyk@@=#1}}
+{\xyuncatcodes \global\let\next=_}
+\xylet@\xyk@@=\next
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+??=[adjustment]
+Adjustment of position along the strings can be achieved using a <factor>,
+as in |\vover||(+.1)>|. Allowed syntax is |(|<sign><num>|)| where <sign>
+is |+| or |-| to increment or decrement from the pre-defined value.
+Also allowable are |=| or <empty> to set the parameter position to <num>,
+which must lie between 0 and 1 to have any meaning.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This parses adjustments of the |\xyknotPLACE|.
+
+\DOCMODE(
+\xydef@\xyadjustknotPLACE@i{%
+ \ifx\xyknotPLACE\empty\DN@{\dimen@=.5\p@}%
+ \else\DN@{\expandafter\xygetknotPLACE@@\xyknotPLACE}%
+ \fi \next@ \relax \let\xywhichknotPLACE@@=\xysetknotPLACE@@
+ \xyFN@\xyadjustknotPLACE@}
+
+\xydef@\xyadjustknotPLACE@{\expandafter\ifx\space@\next
+ \expandafter\DN@\space{\xyFN@\xyadjustknotPLACE@}%
+ \else\addDASH@\ifx\next\DN@{\xyadjustknotPLACE@@}%
+ \else\addPLUS@\ifx\next\DN@{\xyadjustknotPLACE@@}%
+ \else\addEQ@\ifx\next\addEQ@\DN@{\dimen@=\z@ \xyadjustknotPLACE@@}%
+ \else \DN@{\dimen@=\z@ \xyadjustknotPLACE@@}%
+ \fi\fi\fi\fi \next@}
+
+\xydef@\xyadjustknotPLACE@@#1@@{\advance\dimen@#1\p@
+ \expandafter\xysetknotPLACE@\expandafter{\the\dimen@}}
+
+\xydef@\xysetknotPLACE@#1{%
+ \expandafter\xywhichknotPLACE@@\expandafter{\removePT@#1}}
+
+{\xyuncatcodes\gdef\next#1{\def\xyknotPLACE{(#1)}}}%
+\xylet@\xysetknotPLACE@@=\next
+
+{\xyuncatcodes \catcode`@=11
+ \gdef\next(#1){\DN@\next@{#1}\ifx\next@\empty
+ \dimen@=\z@\else\dimen@=#1\p@ \fi}}%
+\xylet@\xygetknotPLACE@@=\next
+\DOCMODE)
+
+These use the same mechanism to adjust parameters stored in
+|\xykpostbreak@@| and |\xykjoincontrol@@|.
+
+\DOCMODE(
+%\xydef@\xyadjustJOIN@i#1@@{\xykjoincontrol@i{#1}}%
+\xydef@\xyadjustJOIN@i{%
+ \ifx\xykjoincontrol\empty\DN@{\dimen@=.75\p@}%
+ \else\DN@{\expandafter\xygetknotPLACE@@\expandafter(\xykjoincontrol)}%
+ \fi \next@ \relax \let\xywhichknotPLACE@@=\xysetjoincontrol@
+ \xyFN@\xyadjustknotPLACE@}
+
+%\xydef@\xyadjustBREAK@i#1@@{\def\xykpostbreak@@{|(##1)\knothole}}%
+\xydef@\xyadjustBREAK@i{%
+ \ifx\xykpostbreak@@\empty\DN@{\dimen@=.5\p@}%
+ \else\DN@{\expandafter\xygetpostBREAK@\xykpostbreak@@}%
+ \fi \next@ \relax \let\xywhichknotPLACE@@=\xysetpostbreak@
+ \xyFN@\xyadjustknotPLACE@}
+
+\xydef@\xygetpostBREAK@|#1\knothole{\DN@{#1}%
+ \ifx\next@\empty\dimen@=.5\p@\else \xygetknotPLACE@@#1\fi}
+
+\xydef@\xysetpostbreak@#1{\def\xykpostbreak@@{|(#1)\knothole}}
+\xydef@\xysetjoincontrol@#1{\edef\xykjoincontrol{#1}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+??=[arrowtips]
+Arrowheads can also be placed at either, or both, ends of of the strings
+forming a crossing. This is governed by a pair of booleans,
+initially |{FF}|.
+It is changed for {\em all}\/ subsequent strings in a diagram by
+|\knottips{..}| where the recognised values are |{FF}|, |{FT}|, |{TF}|
+and |{TT}|, denoting tips (|T|) or not (|F|) at the start and end of each
+string. To add arrowtips at the start of strings in a particular crossing,
+append the 2-character combination |=<|\,; similarly |=>| adds tips at the
+ends, if not already requested. The combinations |==| and |=!| specify
+both (|{TT}|) and none (|{FF}|) respectively.
+These 2-character pairs can be mixed in with any specifications for labels
+and breaks, etc. Multiple pairs compound their effect; in particular
+|=<=>| gives the same result as |==|, while |=!=<| is needed to change
+|{FT}| into |{TF}|.
+
+These are best used with single pieces, as in the following equation.
+%
+\begin{code}
+\UseComputerModernTips \knottips{FT}
+\def\Conway#1{\mathord{\nabla\Bigl[\,
+ \raise5pt\xybox{0;/r1pc/:#1}\,\Bigr]}}
+$$
+\Conway\htwist - \Conway\htwistneg
+ \;=\; -z\,\Conway\huntwist $$
+\end{code}
+\docode
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xykparsetips@{%
+ \def\xyknotTIPS@@{}\def\xyknotPLACE{}%
+ \let\xykparser@=\xykparsetips@@
+ \xyFN@\xykparser@ }
+
+\xydef@\xykparsetips@@{%
+ \ifx\space@\next \expandafter\DN@\space{\xyFN@\xykparsetips@@}%
+ \else\addLT@\ifx\next
+ \ifx\xyknotTIPS@@\empty \def\xyknotTIPS@@{TF}%
+ \else\DN@{FF}\ifx\next@\xyknotTIPS@@ \def\xyknotTIPS@@{TF}%
+ \else\DN@{FT}\ifx\next@\xyknotTIPS@@ \def\xyknotTIPS@@{TT}%
+ \fi\fi\fi
+ \addLT@\DN@{\xyFN@\xykparser@}%
+ \else\addGT@\ifx\next
+ \ifx\xyknotTIPS@@\empty \def\xyknotTIPS@@{FT}%
+ \else\DN@{FF}\ifx\next@\xyknotTIPS@@ \def\xyknotTIPS@@{FT}%
+ \else\DN@{TF}\ifx\next@\xyknotTIPS@@ \def\xyknotTIPS@@{TT}%
+ \fi\fi\fi
+ \addGT@\DN@{\xyFN@\xykparser@}%
+ \else\addEQ@\ifx\next \def\xyknotTIPS@@{TT}%
+ \addEQ@\DN@{\xyFN@\xykparser@}%
+ \else \ifx!\next \def\xyknotTIPS@@{FF}\DN@!{\xyFN@\xykparser@}%
+ \else\DN@{\xyFN@\xykparser@}%
+ \fi\fi\fi\fi\fi \next@ }
+\DOCMODE)
+
+This reads the setting for tips on string ends.
+
+\DOCMODE(
+\xydef@\xykcheckTIPS@{%
+ \ifx\xyknotTIPS@@\empty \edef\xyknotTIPS@@{\xyknotTIPS@}\fi
+ \DN@{FF}\ifx\next@\xyknotTIPS@@\def\tmp@{}%
+ \else\DN@{FT}\ifx\next@\xyknotTIPS@@
+ \expandafter\def\expandafter\tmp@\expandafter{\xykforetips@}%
+ \else\DN@{TF}\ifx\next@\xyknotTIPS@@
+ \expandafter\def\expandafter\tmp@\expandafter{\xykbacktips@}%
+ \else
+ \DN@##1\next@{\DN@{\xykforetips@##1}}%
+ \expandafter\next@\xykbacktips@\next@
+ \DNii@{\expandafter\def\expandafter\tmp@\expandafter}%
+ \expandafter\nextii@\expandafter{\next@}%
+ \fi\fi\fi \def\xyknotTIPS@@{}}
+
+\xydef@\xyknottips@{%
+ \ifx\tmp@\empty\addtotoks@{{}}\else
+ \expandafter\addtotoks@\expandafter{\expandafter{\tmp@}}\fi}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\end{notes}
+
+\subsection*{Joins}
+\note??=[join]
+The ``joins'' are used to connect the loose ends of crossing strings.
+In particular ``loops'' and ``caps'' are for placing on ends of
+horizontal or vertical `twist' and `cross' crossings, leaving the
+current <pos> fixed. The ``bends'' join non-adjacent crossings of
+the same type, either horizontal or vertical.
+
+The |\xcap..| pieces are designed to join adjacent |\xover..| pieces;
+they move $c$ either vertically or horizontally,
+as appropriate. Finally the |\xbend..| pieces allow for smooth joins
+of $45^\circ$ slopes to horizontal or vertical slopes. For these the
+actual positioning of the piece, see figure~??[f.knotjoins],
+is not entirely obvious.
+
+\begin{figure*}[ht]
+$$
+\knotholesize{5pt}\UseComputerModernTips
+\xygraph{!{0;/r2pc/:}="O" %[]!{\NoPSspecials}
+ [ll] !{*=0\dir{o},{\vloop<>|>>><{x}|{y}>{z}},*=0\dir{x}}
+ [rr]!{*=0\dir{o},{\vcap<>|>>><{x}|{y}>{z}},*=0\dir{x}}
+ [urr]!{*=0\dir{o},{\vcap-<>|>>><{x}|{y}>{z}},*=0\dir{x}}
+ [u(.5)rr]!{*=0\dir{o},{\vloop-<>|>>><{x}|{y}>{z}},*=0\dir{x}}
+ [d(.5)rr]!{*=0\dir{o},{\hloop<>|>>><{x}|{y}>{z}},*=0\dir{x}}
+ [rr]!{*=0\dir{o},{\hcap<>|>>><{x}|{y}>{z}},*=0\dir{x}}
+ [rrr]!{*=0\dir{o},{\hcap-<>|>>><{x}|{y}>{z}},*=0\dir{x}}
+ [rr]!{*=0\dir{o},{\hloop-<>|>>><{x}|{y}>{z}},*=0\dir{x}}
+ "O"!{+(.5,-.5)}
+ [ll]!{*\txt\small\tt{\string\vloop}} [rr]!{*\txt\small\tt{\string\vcap}}
+ [rr]!{*\txt\small\tt{\string\vcap-}}[rr]!{*\txt\small\tt{\string\vloop-}}
+ [rr]!{*\txt\small\tt{\string\hloop}}[rr]!{*\txt\small\tt{\string\hcap}}
+ [rr]!{*\txt\small\tt{\string\hcap-}}[rr]!{*\txt\small\tt{\string\hloop-}}
+ "O"!{-(1,3)} %[]!{\NoPSspecials}
+ [ur]!{*=0\dir{o},{\xcapv<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [urr]!{*=0\dir{o},{\sbendv<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [r] !{*=0\dir{o},{\zbendv<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [dr] !{*=0\dir{o},{\sbendh<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [r] !{*=0\dir{o},{\zbendh<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [r] !{*=0\dir{o},{\xcaph<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ "O"!{-(1.5,3.5)}
+ [rr]!{*\txt\small\tt{\string\xcapv}}
+ [rr]!{*\txt\small\tt{\string\sbendv}}
+ [rr]!{*\txt\small\tt{\string\zbendv}}
+ [rr]!{*\txt\small\tt{\string\sbendh}}
+ [rr]!{*\txt\small\tt{\string\zbendh}}
+ [rr]!{*\txt\small\tt{\string\xcaph}}
+"O"!{+(0,-5)} %[]!{\NoPSspecials}
+ [ll] !{*=0\dir{o},{\xbendr<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [ur] !{*=0\dir{o},{\xbendl<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [urr]!{*=0\dir{o},{\xbendu<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [r] !{*=0\dir{o},{\xbendd<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ "O"!{-(3.5,6.5)}
+ [rr]!{*\txt\small\tt{\string\xbendr}}
+ [rr]!{*\txt\small\tt{\string\xbendl}}
+ [rr]!{*\txt\small\tt{\string\xbendu}}
+ [rr]!{*\txt\small\tt{\string\xbendd}}
+ "O"!{+(2,-5)} %[]!{\NoPSspecials}
+ [r(4)] !{*=0\dir{o},{\xbendd-<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [ur] !{*=0\dir{o},{\xbendu-<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [r] !{*=0\dir{o},{\xbendl-<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ [urr] !{*=0\dir{o},{\xbendr-<>|>>><{x}|{y}>{z}},*=0\dir{+}}
+ "O"!{+(4.5,-6.5)}
+ [rr]!{*\txt\small\tt{\string\xbendd-}}
+ [rr]!{*\txt\small\tt{\string\xbendu-}}
+ [rr]!{*\txt\small\tt{\string\xbendl-}}
+ [rr]!{*\txt\small\tt{\string\xbendr-}}
+}$$
+\caption{knot joins, with orientations, labels and shifts}%
+ ??=[f.knotjoins]
+\end{figure*}
+
+\noindent
+Figure~??[f.knotjoins] displays the orientation on the joins.
+Also indicated are default positions for labels and arrow-tips;
+each piece uses the same code,
+e.g. |\vloop|\ |<>||>>><{x}||{y}>{z}|. Furthermore the current <pos>
+before the piece is drawn is marked using $\;^{_{\xybox{*\dir{o}}}}\;$;
+that afterwards is indicated by
+$\;^{_{\xybox{*\dir{x}}}}\;$ or $\;^{_{\xybox{*\dir{+}}}}\;$.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The ability to scale in size and place arrow-tips, breaks, labels etc.
+apply also to <join> pieces. The only difference is\dots
+
+\note??=[join places]
+The three places referred to by |<|\,,||||\,,|>| are all on a single
+string. In particular |||| is always at the middle of the <join>,
+whereas |<| and |>| are at {\em earlier} and {\em later} parameter
+values respectively. Any adjustments??^[adjustment] involving breaks
+should occur in increasing parameter order.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Parsing}
+
+\DOCMODE(
+\xydef@\xykparsejoin@{%
+ \def\xykSCALE@@{}%
+ \edef\xyknotPLACE{\xykmidPLACE@}%
+ \let\xykparser@=\xykparsejoin@@
+ \def\xykdefaultbreak@{\let\xykbreak@=\xykforetemp@
+ \def\xyknotPLACE{(.5)}\appendtoholder@}%
+% \edef\xyknotPLACE{\xykmidPLACE@}\appendtoholder@}%
+ \xyFN@\xykparsescale@ }
+\DOCMODE)
+
+\DOCMODE(
+{\xyuncatcodes \catcode`@=11
+\gdef\next{%
+ \ifx\space@\next \expandafter\DN@\space{\xyFN@\xykparsejoin@@}%
+ \else\addLT@\ifx\next \let\xykbreak@=\xykbacktemp@
+ \def\xykdefaultbreak@{\def\xyknotPLACE{(.5)}%
+% \def\xykdefaultbreak@{\edef\xyknotPLACE{\xykmidPLACE@}%
+ \appendtoholder@}\addLT@\DN@{\xyprecross@}%
+ \else\addGT@\ifx\next \let\xykbreak@=\xykforetemp@
+ \def\xykdefaultbreak@{\def\xyknotPLACE{(.5)}%
+% \def\xykdefaultbreak@{\edef\xyknotPLACE{\xykmidPLACE@}%
+ \appendtoholder@}\addGT@\DN@{\xypostcross@}%
+ \else\ifx|\next \let\xykbreak@=\xyknulltemp@
+% \else\ifx|\next \let\xykbreak@=\xykholetemp@
+ \def\xykdefaultbreak@{\def\xyknotPLACE{(.5)}%
+% \def\xykdefaultbreak@{\edef\xyknotPLACE{\xykmidPLACE@}%
+ \appendtoholer@}\DN@|{\xymidcross@}%
+ \else\addEQ@\ifx\next \addEQ@\DN@{\xyFN@\xykparsetips@@}%
+% \else\addAT@\ifx\next \addAT@\DN@{\xykjoincontrol@}%
+ \else\addAT@\ifx\next \addAT@\DN@(##1){%
+ \xyadjustJOIN@i##1@@\xyFN@\xykparsejoin@@}%
+ \else\DN@{\afterknot@}%
+ \fi\fi\fi\fi\fi\fi \next@ }}
+\xylet@\xykparsejoin@@=\next
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\note??=[join control]
+A parameter can be altered, using |@|<adjust>, to effect subtle
+adjustments to the shape of any join. Within a rectangular basis the
+horizontal or vertical tangents are preserved and overall reflection
+or rotation symmetry is preserved. Thus this parameter affects the
+`flatness' of a cap or loop, or the amount of curvature is s-bends and
+z-bends. For |\xcap..|s and |\xbend..|s the $45^\circ$ angle is altered;
+this is especially useful to match the tangents when a knot-piece
+has been specified using the technique of note~??[alter size and shape].
+
+The normal range for these parameters is between 0 and 1. Other values
+can be used with interesting results---the parameter determines the
+location of control points for a B\'ezier cubic curve.
+
+\begin{tabular}{ccl}
+piece & value & effect on\dots \\
+\noalign{\hrule}
+|\..cap| & .25 & flatness of cap;\\
+|\..loop| & .75 & flatness of loop;\\
+|\sbend..| & .75 & curvature in the `s';\\
+|\zbend..| & .75 & curvature in the `z';\\
+|\xcap..| & .5 & height of cap, slope at base;\\
+|\xbend..| & .5 & curvature, slope at base.\\
+\noalign{\hrule}
+\end{tabular}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{notes}
+
+The following example gives three ways of specifying a `trefoil' knot,
+using the |poly| feature to establish the location of the vertices for
+knot-pieces. In each the <crossing>s are calculated to fit together
+smoothly; a different way of creating <join>s is used in each.
+Also the third displays subtle changes of the ??^![join control].
+
+\begin{code}
+\def\TrefoilA{\xygraph{!{0;/r.75pc/:}
+ !P3"a"{~>{}}!P9"b"{~:{(1.3288,0):}~>{}}
+ !P3"c"{~:{(2.5,0):}~>{}}
+ !{\vover~{"b2"}{"b1"}{"a1"}{"a3"}}
+ !{"b4";"b2"**\crv{"c1"}}
+ !{\vover~{"b5"}{"b4"}{"a2"}{"a1"}}
+ !{"b7";"b5"**\crv{"c2"}}
+ !{\vover~{"b8"}{"b7"}{"a3"}{"a2"}}
+ !{"b1";"b8"**\crv{"c3"}}}}
+%
+\def\TrefoilB{\xygraph{!{0;/r.75pc/:}
+ !P3"a"{~>{}}!P9"b"{~:{(1.3288,0):}~>{}}
+ !P3"c"{~:{(2.5,0):}~>{}}
+ !{\vover~{"b2"}{"b1"}{"a1"}{"a3"}}
+ !{\vcap~{"c1"}{"c1"}{"b4"}{"b2"}@(+.1)}
+ !{\vover~{"b5"}{"b4"}{"a2"}{"a1"}}
+ !{\vcap~{"c2"}{"c2"}{"b7"}{"b5"}@(+.2)}
+ !{\vover~{"b8"}{"b7"}{"a3"}{"a2"}}
+ !{\vcap~{"c3"}{"c3"}{"b1"}{"b8"}}}}
+%
+\def\TrefoilC{\xygraph{!{0;/r.75pc/:}
+ !P3"a"{~>{}}
+ !P12"b"{~:{(1.414,0):}~>{}}
+ !{\vover~{"b2"}{"b1"}{"a1"}{"a3"}}
+ !{\save 0;"b2"-"b5":"b5",
+ \xcaph @(+.1)\restore}
+ !{\vover~{"b6"}{"b5"}{"a2"}{"a1"}}
+ !{\save 0;"b6"-"b9":"b9",
+ \xcaph @(+.2)\restore}
+ !{\vover~{"b10"}{"b9"}{"a3"}{"a2"}}
+ !{\save 0;"b10"-"b1":"b1",
+ \xcaph @(+.3)\restore} }}
+$$\TrefoilA\quad\TrefoilB
+ \quad\TrefoilC$$
+\end{code}
+\docode
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xykjoincontrol@@{.75}%
+\xydef@\xyk@joincontrol@#1{\DN@{#1}%
+ \ifx\next@\empty\edef\xykjoincontrol@@{.75}%
+ \else\dimen@=#1\p@
+ \edef\xykjoincontrol@@{\expandafter\removePT@\the\dimen@}\fi}
+\xylet@\xykjoincontrol\empty %\xyk@joincontrol@
+
+\xydef@\xykjoincontrol@(#1){\DN@{#1}%
+ \ifx\next@\empty\edef\xykjoincontrol{\xykjoincontrol@@}%
+ \else\dimen@=#1\p@
+ \edef\xykjoincontrol{\expandafter\removePT@\the\dimen@}%
+ \fi \xyFN@\xykparsejoin@@ }
+
+\xydef@\xykjoincontrol@i#1{\DN@{#1}%
+ \ifx\next@\empty\edef\xykjoincontrol{\xykjoincontrol@@}%
+ \else\dimen@=#1\p@
+ \edef\xykjoincontrol{\expandafter\removePT@\the\dimen@}\fi}
+\DOCMODE)
+
+These macros are common to most joins.
+
+\DOCMODE(
+\xydef@\xykjoin@#1{%
+ \expandafter\toks@\expandafter{\expandafter#1\knotSTYLE}}
+
+\xydef@\xyksetjoin@{\xykcheckTIPS@
+ \xykprebreak@ \xykmidbreak@ \xykpostbreak@ \xyknottips@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{``cap'' joins:}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The initialisation\dots
+
+\DOCMODE(
+\xydef@\hcap{\begingroup\def\afterknot@{\xyhcap}%
+ \def\xykprePLACE@{(.385)}\def\xykpostPLACE@{(.615)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.25}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\vcap{\begingroup\def\afterknot@{\xyvcap}%
+ \def\xykprePLACE@{(.385)}\def\xykpostPLACE@{(.615)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.25}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\xcapv{\begingroup\def\afterknot@{\xyxcapv}%
+ \def\xykprePLACE@{(.2)}\def\xykpostPLACE@{(.8)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.5}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\xcaph{\begingroup\def\afterknot@{\xyxcaph}%
+ \def\xykprePLACE@{(.2)}\def\xykpostPLACE@{(.8)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.5}%
+ \xyFN@\xykparsejoin@ }%
+\DOCMODE)
+
+The interface\dots
+
+\DOCMODE(
+\xydef@\xyvcap{\xykjoin@\xykcapv \xyksetjoin@ \xykhobject@{}}
+\xydef@\xyhcap{\xykjoin@\xykcaph \xyksetjoin@ \xykvobject@{}}
+\xydef@\xyxcapv{\xykjoin@\xykxcapv \xyksetjoin@ \xykvobject@{+(0,-1)}}
+\xydef@\xyxcaph{\xykjoin@\xykxcaph \xyksetjoin@ \xykhobject@{+(1,0)}}
+\DOCMODE)
+
+The drawing code\dots
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "_>",{\xyksaveEdgec},{\xykz_\ar #1@'{"^>"**{}?(\xykjoincontrol)@+
+ ,?-(.25,0)@+,"_<";"^<"**{}?+(.25,0)@+,?(\xykjoincontrol)@+}
+ "_<"#3#4#5#6},\restore \POS#7}}
+\xylet@\xykcapv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "_<",{\xyksaveEdgec},{\xykz_\ar #1@'{"_>"**{}?(\xykjoincontrol)@+,
+ ?+(0,.25)@+,"^<";"^>"**{}?-(0,.25)@+,?(\xykjoincontrol)@+}
+ "^<"#3#4#5#6}
+ \restore \POS#7}}
+\xylet@\xykcaph=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "^>";"_>"**{}?="^_","^<";"_<"**{}?;"^_",**{}?(\xykjoincontrol)="^_",
+ "_<",{\xyksaveEdgec},{\xykz_\ar #1@'{"^_"@+}
+ "^<"#3#4#5#6},\restore \POS#7}}
+\xylet@\xykxcapv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "^<";"^>"**{}?="^_","_<";"_>"**{}?;"^_",**{}?(\xykjoincontrol)="^_",
+ "_>",{\xyksaveEdgec},{\xykz_\ar #1@'{"^_"@+}
+ "_<"#3#4#5#6},\restore \POS#7}}
+\xylet@\xykxcaph=\next
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{``loop'' joins:}
+
+The initialisation and interface\dots
+
+\DOCMODE(
+\xydef@\hloop{\begingroup\def\afterknot@{\xyhloop}%
+ \def\xykprePLACE@{(.07)}\def\xykpostPLACE@{(.93)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.75}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\vloop{\begingroup\def\afterknot@{\xyvloop}%
+ \def\xykprePLACE@{(.07)}\def\xykpostPLACE@{(.93)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.75}%
+ \xyFN@\xykparsejoin@ }%
+
+\xydef@\xyvloop{\xykjoin@\xykloopv \xyksetjoin@ \xykhobject@{}}
+\xydef@\xyhloop{\xykjoin@\xyklooph \xyksetjoin@ \xykvobject@{}}
+\DOCMODE)
+
+The drawing code\dots
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "_>",{\xykz_\ar #1@'{"^>"**{}?(\xykjoincontrol)@+,?(1.25)-(.25,0)@+,
+ "_<";"^<"**{}?(1.25)+(.25,0)@+,?(\xykjoincontrol)@+}"_<"#3#4#5#6}
+ \restore \POS#7}}
+\xylet@\xykloopv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "_<",{\xykz_\ar #1@'{"_>"**{}?(\xykjoincontrol)@+,?(1.25)+(0,.25)@+,
+ "^<";"^>"**{}?(1.25)+(0,-.25)@+,?(\xykjoincontrol)@+}"^<"#3#4#5#6}
+ \restore \POS#7}}
+\xylet@\xyklooph=\next
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{``bend'' joins:}
+
+The initialisation\dots
+
+\DOCMODE(
+\xydef@\zbendh{\begingroup\def\afterknot@{\xyzbendh}%
+ \def\xykprePLACE@{(.25)}\def\xykpostPLACE@{(.75)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{\xykjoincontrol@@}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\sbendv{\begingroup\def\afterknot@{\xysbendv}%
+ \def\xykprePLACE@{(.25)}\def\xykpostPLACE@{(.75)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{\xykjoincontrol@@}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\sbendh{\begingroup\def\afterknot@{\xysbendh}%
+ \def\xykprePLACE@{(.25)}\def\xykpostPLACE@{(.75)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{\xykjoincontrol@@}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\zbendv{\begingroup\def\afterknot@{\xyzbendv}%
+ \def\xykprePLACE@{(.25)}\def\xykpostPLACE@{(.75)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{\xykjoincontrol@@}%
+ \xyFN@\xykparsejoin@ }%
+
+
+\xydef@\xbendr{\begingroup\def\afterknot@{\xyxbendr}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.75)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.5}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\xbendl{\begingroup\def\afterknot@{\xyxbendl}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.75)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.5}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\xbendu{\begingroup\def\afterknot@{\xyxbendu}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.75)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.5}%
+ \xyFN@\xykparsejoin@ }%
+\xydef@\xbendd{\begingroup\def\afterknot@{\xyxbendd}%
+ \def\xykprePLACE@{(.15)}\def\xykpostPLACE@{(.75)}%
+ \def\xykmidPLACE@{(.5)}\edef\xykjoincontrol{.5}%
+ \xyFN@\xykparsejoin@ }%
+\DOCMODE)
+
+
+The interface\dots
+
+\DOCMODE(
+\xydef@\xyzbendh{\xykjoin@\xykzbendh \xyksetjoin@ \xykhvobject@{+(1,-1)}}
+\xydef@\xysbendv{\xykjoin@\xyksbendv \xyksetjoin@ \xykhvobject@{+(1,-1)}}
+\xydef@\xysbendh{\xykjoin@\xyksbendh \xyksetjoin@ \xykhuobject@{+(1,1)}}
+\xydef@\xyzbendv{\xykjoin@\xykzbendv \xyksetjoin@ \xykhuobject@{+(1,1)}}
+
+\xydef@\xyxbendr{\xykjoin@\xykxbendr \xyksetjoin@ \xykhvobject@{+(1,-1)}}
+\xydef@\xyxbendl{\xykjoin@\xykxbendl \xyksetjoin@ \xykhvobject@{+(0,-1)}}
+\xydef@\xyxbendu{\xykjoin@\xykxbendu \xyksetjoin@ \xykhvobject@{+(1,0)}}
+\xydef@\xyxbendd{\xykjoin@\xykxbendd \xyksetjoin@ \xykhvobject@{+(1,-1)}}
+\DOCMODE)
+
+
+The implementation\dots
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "^<",{\xyksaveEdgec},
+ {\xykz^\ar #1@'{"^>"**{}?(\xykjoincontrol)@+,
+ "_>";"_<"**{}?(\xykjoincontrol)@+}"_>"#3#4#5#6}%
+ \restore \POS#7}}
+\xylet@\xykzbendh=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "^<",{\xyksaveEdgec},
+ {\xykz_\ar #1@'{"_<"**{}?(\xykjoincontrol)@+,
+ "_>";"^>"**{}?(\xykjoincontrol)@+}"_>"#3#4#5#6}%
+ \restore \POS#7}}
+\xylet@\xyksbendv=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "_<",{\xyksaveEdgec},
+ {\xykz_\ar #1@'{"_>"**{}?(\xykjoincontrol)@+,
+ "^>";"^<"**{}?(\xykjoincontrol)@+}"^>"#3#4#5#6}%
+ \restore \POS#7}}
+\xylet@\xyksbendh=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "_<",{\xyksaveEdgec},
+ {\xykz^\ar #1@'{"^<"**{}?(\xykjoincontrol)@+,
+ "^>";"_>"**{}?(\xykjoincontrol)@+}"^>"#3#4#5#6}%
+ \restore \POS#7}}
+\xylet@\xykzbendv=\next
+
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "^<"-(0,.5),{\xyksaveEdgec},
+ {\xykz_\ar #1@'{"_<";"_>"**{}?(\xykjoincontrol)@+,}"_>"#3#4#5#6}%
+ \restore \POS#7}}
+\xylet@\xykxbendr=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "^>"-(0,.5),{\xyksaveEdgec},
+ {\xykz^\ar #1@'{"_>";"_<"**{}?(\xykjoincontrol)@+,}"_<"#3#4#5#6}%
+ \restore \POS#7}}
+\xylet@\xykxbendl=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "_<"+(.5,0),{\xyksaveEdgec},
+ {\xykz_\ar #1@'{"_>";"^>"**{}?(\xykjoincontrol)@+,}"^>"#3#4#5#6}%
+ \restore \POS#7}}
+\xylet@\xykxbendu=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\save,
+ "^<"+(.5,0),{\xyksaveEdgec},
+ {\xykz^\ar #1@'{"^>";"_>"**{}?(\xykjoincontrol)@+,}"_>"#3#4#5#6}%
+ \restore \POS#7}}
+\xylet@\xykxbendd=\next
+
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Changing the string-style}
+%
+It is not necessary to use solid curves; any style available to curves
+and arrows can be chosen using\dots
+%
+\begin{defs}
+|\knotstyle{|<char>|}| & use |\dir{|<char>|}| \cr
+|\knotstyles{|<char>|}{|<char>|}| & two styles \cr
+|\knotSTYLE{|<code>|}| & use <code> \cr
+\end{defs}
+%
+In each case the new style applies to {\em all} subsequent knot pieces,
+except that the two styles apply only to crossings.
+The latter case allows use of object <modifier>s. The <code> consists of
+two groups |{..}{..}|\,, each containing <arrow> forms, as in
+??g[xyarrow.doc:f.arrow] and notes~??g[xyarrow.doc:build arrow],
+??g[xyarrow.doc:object <modifier>s].
+Only the first <arrow> form is used with <join>s whereas the two forms
+are used respectively with the two strings of a <crossing> in the order
+that they are drawn.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next{{@{-}}{@{-}}}}
+\xylet@\knotSTYLE=\next
+
+{\xyuncatcodes \gdef\next#1{\def\knotSTYLE{{@{#1}}{@{#1}}}}}
+\xylet@\knotstyle=\next
+
+{\xyuncatcodes \gdef\next#1#2{\def\knotSTYLE{{@{#1}}{@{#2}}}}}
+\xylet@\knotstyles=\next
+
+{\xyuncatcodes \gdef\next#1{\def\knotSTYLE{#1}}}
+\xylet@\KNOTstyle=\next
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Initialisation:}\ default values for the methods.
+
+\DOCMODE(
+\xydef@\knotholesize@#1{\def\xykholesize{#1}}
+\xydef@\xykholesize{5pt}
+\xylet@\knotholesize=\knotholesize@
+\xylet@\holesize=\knotholesize@
+
+\xydef@\knottips#1{\def\xyknotTIPS@{#1}}
+\xydef@\xyknotTIPS@{FF}
+\xydef@\xyknotTIPS@@{}
+
+\xydef@\xykSCALE@@{}
+
+%\xydef@\xyknotbreak@@{}%
+\xydef@\xykprebreak@@{}%
+\xydef@\xykpostbreak@@{}%
+\xydef@\xykmidbreak@@{}%
+
+\xydef@\xykprePLACE@{(.25)}%
+\xydef@\xykpostPLACE@{(.75)}%
+\xydef@\xykmidPLACE@{}%
+\xylet@\xykPLACE@=\xykmidPLACE@
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%\subsection*{Flexible crossings}
+
+%Xtwist
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+{\gdef\next#1#2#3#4{%\message{#1:#2:#3:#4}%
+ \save(0,0);"#2"-"#1"+"#4"-"#3":(.5,0):
+ "#3"-"#1"+"#4"-"#2"::(0,.5)::}}
+\xylet@\xykflexbase@=\next
+\xylet@\xykflexbase=\xykflexbase@
+\DOCMODE)
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8{\xykflexbase{#1}{#2}{#3}{#4}%
+% \save(0,0);"#2"-"#1"+"#4"-"#3":(.5,0):
+% "#3"-"#1"+"#4"-"#2"::(0,.5)::
+ "#1",{\ar @{#5}@'{"#1"+(0,.125)@++(.1875,.125)@+,
+ "#4"-(.1875,.25)@++(.1875,.125)@+}"#4" #6},
+ "#2",{\ar @{#5}@'{"#2"+(0,.125)@++(-.1875,.125)@+,
+ "#3"+(.1875,-.25)@++(-.1875,.125)@+}"#3" #7}%
+\restore \POS#8}}
+\xylet@\Xtwist=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8{\xykflexbase{#1}{#2}{#3}{#4}%
+% \save(0,0);"#2"-"#1"+"#4"-"#3":(.5,0):
+% "#3"-"#1"+"#4"-"#2"::(0,.5)::
+ "#1",{\ar @{#5}@'{"#1"+(0,.0625)@++(.1875,.0625)@+,
+ "#3"+(.1875,-.125)@++(-.1875,.0625)@+}"#3" #6},
+ "#2",{\ar @{#5}@'{"#2"+(0,.0625)@++(-.1875,.0625)@+,
+ "#4"-(.1875,.125)@++(.1875,.0625)@+}"#4" #7}%
+\restore \POS#8}}
+\xylet@\Xuntwist=\next
+\DOCMODE)
+
+
+%Xover
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\xykflexbase{#1}{#2}{#3}{#4}%
+% \save(0,0);"#2"-"#1"+"#4"-"#3":(.5,0):
+% "#3"-"#1"+"#4"-"#2"::(0,.5)::
+ "#1",{\ar @{#5}@'{"#1"+(.1875,.0625)@++(.1875,.1875)@+,
+ "#4"+(-#9,-.125)@+}"#4" #6},
+ "#2",{\ar @{#5}@'{"#2"+(-.1875,.0625)@++(-.1875,.1875)@+,
+ "#3"+(#9,-.125)@+}"#3" #7}%
+\restore \POS#8}}
+\xylet@\Xover=\next
+
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7#8#9{\xykflexbase{#1}{#2}{#3}{#4}%
+% \save(0,0);"#2"-"#1"+"#4"-"#3":(.5,0):
+% "#3"-"#1"+"#4"-"#2"::(0,.5)::
+ "#1",{\ar @{#5}@'{"#1"+(.1875,.0625)@++(.1875,.1875)@+,
+ "#2"+(-.1875,.0625)@+}"#2" #6},
+% "#3"+(#9,-.125)@+}"#3" #6},
+ "#3",{\ar @{#5}@'{"#3"+(#9,-.125)@+,"#3"+(.25,-.25)@+,
+% "#2",{\ar @{#5}@'{"#2"+(-.1875,.0625)@++(-.1875,.1875)@+,
+ "#4"+(-#9,-.125)@+}"#4" #7}%
+\restore \POS#8}}
+\xylet@\Xunover=\next
+\DOCMODE)
+
+
+%Xcap
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next#1#2#3#4#5#6#7{\xykflexbase{#1}{#2}{#3}{#4}%
+% \save(0,0);"#2"-"#1"+"#3"-"#4":(.5,0):
+% "#4"-"#1"+"#3"-"#2"::(0,.5)::
+ "#1",{\ar @{#5}@'{"#1"+(0,.125)@++(.125,.25)@+,
+ "#4"+(-.125,.375)@++(.125,-.25)@+}"#4" #6},
+\restore \POS#7}}
+\xylet@\Xcap=\next
+\DOCMODE)
+
+
+%XXover
+
+\DOCMODE(
+{\xyuncatcodes \catcode`@=11
+ \gdef\next#1#2#3#4#5#6#7#8#9{\dimen@=#1\p@
+ \ifdim\dimen@=\z@ \DN@{\Xunover{#2}{#3}{#4}{#5}{#8}{#6}{#7}{"#5"}}%
+ \else\ifdim\dimen@>\z@
+ \DNii@{#6}\ifx\nextii@\empty
+ \DN@{\Xover{#2}{#3}{#4}{#5}{#8}{|(.45)\knothole}{#7}{"#5"}}%
+ \else \DN@{\Xover{#2}{#3}{#4}{#5}{#8}{#6}{#7}{"#5"}}\fi
+ \else
+ \DNii@{#7}\ifx\nextii@\empty
+ \DN@{\Xover{#2}{#3}{#4}{#5}{#8}{#6}{|(.45)\knothole}{"#5"}}%
+ \else\DN@{\Xover{#2}{#3}{#4}{#5}{#8}{#6}{#7}{"#5"}}\fi
+ \fi\fi
+ \def\tmp@{{#9}}\ifx\tmp@\empty\def\tmp@{{0}}\else\dimen@=#9\p@\fi
+ \expandafter\next@\tmp@ }}
+\xylet@\XXover=\next
+
+{\xyuncatcodes \catcode`@=11
+ \gdef\next#1#2#3#4#5#6#7#8{\dimen@=#1\p@
+ \ifdim\dimen@=\z@ \DN@{\Xuntwist{#2}{#4}{#3}{#5}{#8}{#6}{#7}{"#5"}}%
+ \else\ifdim\dimen@>\z@
+ \DNii@{#6}\ifx\nextii@\empty
+ \DN@{\Xtwist{#2}{#4}{#3}{#5}{#8}{|(.45)\knothole}{#7}{"#5"}}%
+ \else \DN@{\Xtwist{#2}{#4}{#3}{#5}{#8}{#6}{#7}{"#5"}}\fi
+ \else
+ \DNii@{#7}\ifx\nextii@\empty
+ \DN@{\Xtwist{#2}{#4}{#3}{#5}{#8}{#6}{|(.45)\knothole}{"#5"}}%
+ \else\DN@{\Xtwist{#2}{#4}{#3}{#5}{#8}{#6}{#7}{"#5"}}\fi
+ \fi\fi \next@ }}
+\xylet@\XXtwist=\next
+
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ simplified switch-like interface
+
+
+\DOCMODE(
+{\xyuncatcodes \catcode`@=11
+ \gdef\next#1#2#3#4{\dimen@=#1\p@
+ \ifdim\dimen@=\z@ \DN@{\xykuncrossv{#4}{#2}{#3}{+(0,-1)}}%
+ \else\ifdim\dimen@>\z@
+ \DNii@{#2}\ifx\nextii@\empty
+ \DN@{\xyktwistv{#4}{|\knothole}{#3}{+(1,0)}}%
+ \else \DN@{\xyktwistv{#4}{#2}{#3}{+(1,0)}}\fi
+ \else
+ \DNii@{#3}\ifx\nextii@\empty
+ \DN@{\xyktwistv{#4}{#2}{|\knothole}{+(0,-1)}}%
+ \else\DN@{\xyktwistv{#4}{#2}{#3}{+(0,-1)}}\fi
+ \fi\fi \next@ }}
+\xylet@\Vcross=\next
+
+{\xyuncatcodes \catcode`@=11
+ \gdef\next#1#2#3#4{\dimen@=#1\p@
+ \ifdim\dimen@=\z@ \DN@{\xykuncrossh{#4}{#2}{#3}{+(0,-1)}}%
+ \else\ifdim\dimen@<\z@
+ \DNii@{#2}\ifx\nextii@\empty
+ \DN@{\xyktwisth{#4}{|\knothole}{#3}{+(1,0)}}%
+ \else \DN@{\xyktwisth{#4}{#2}{#3}{+(1,0)}}\fi
+ \else
+ \DNii@{#3}\ifx\nextii@\empty
+ \DN@{\xyktwisth{#4}{}{|\knothole}{+(1,0)}}%
+ \else\DN@{\xyktwisth{#4}{#2}{#3}{+(1,0)}}\fi
+ \fi\fi \next@ }}
+\xylet@\Hcross=\next
+
+{\xyuncatcodes \catcode`@=11
+ \gdef\next#1#2#3{\dimen@=#1\p@ \save
+ \ifdim\dimen@<\z@
+ \DN@{\POS="@",p="@@",(0,0);(-1,0):(0,-1)::"@@";"@",}%
+ \else\DN@{}\fi
+ \next@ \xykcaph{#3}{#2}\restore }}
+\xylet@\Hcap=\next
+
+{\xyuncatcodes \catcode`@=11
+ \gdef\next#1#2#3{\dimen@=#1\p@ \save
+ \ifdim\dimen@<\z@
+ \DN@{\POS="@",p="@@",(0,0);(0,-1)::"@@";"@",}%
+ \else\DN@{}\fi
+ \next@ \xykcapv{#3}{#2}\restore }}
+\xylet@\Vcap=\next
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyknot.doc,v $
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 09:20:49 ross
+% no changes
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Created by Ross Moore, September 1994.
+\DOCMODE)
diff --git a/Master/texmf-dist/source/generic/xypic/xylatex.ini b/Master/texmf-dist/source/generic/xypic/xylatex.ini
new file mode 100644
index 00000000000..3ba119f8437
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xylatex.ini
@@ -0,0 +1,77 @@
+%% $Id: xylatex.ini,v 3.3 1996/12/19 03:31:56 krisrose Exp $ -*-latex-*-
+%%
+%% Generate LaTeX + Xy-pic format file.
+%% Copyright (c) 1993-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+
+% Load LaTeX (2e) but don't dump yet.
+% (This ca
+
+\let\xypicsaveddump=\dump
+\let\dump=\endinput
+\input latex.ltx
+
+% KERNEL:
+%
+\input xy
+
+% Extensions and features: You can replace this line with selective loading
+% of particular options if you like.
+%
+\xyoption{all}
+
+% BACKEND: Default is NOT to load any backend but by uncommenting the
+% following line you can include the PostScript backend by default.
+%
+%\xyoption{ps}
+
+% DRIVERS: Default is NOT to load any driver but by uncommenting the
+% following line you can include the DVIPS driver (or any other one you
+% choose) by default (this will not select it, only make it available).
+%
+%\xyoption{dvips}
+
+% Finally dump the format file (using the hack above):
+%
+\xypicsaveddump
+
+% $Log: xylatex.ini,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/06 02:56:02 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% NEW file to go in version 2.10!
diff --git a/Master/texmf-dist/source/generic/xypic/xyline.doc b/Master/texmf-dist/source/generic/xypic/xyline.doc
new file mode 100644
index 00000000000..40fa19abedb
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyline.doc
@@ -0,0 +1,664 @@
+%% $Id: xyline.doc,v 3.6 1998/03/06 01:28:05 krisrose Exp $
+%%
+%% Xy-pic ``Line Width'' extension.
+%% Copyright (c) 1993-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{line}{Line styles extension}{\stripRCS$Revision: 3.6 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This extension provides the ability to request various effects related
+ to the appearance of straight lines; \eg. thickness, non-standard dashing,
+ and colour.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+These are effects which are not normally available within \TeX.
+Instead they require a suitable `back-end' option to provide the necessary
+|\special| commands, or extra fonts, together with appropriate
+commands to implement the effects. Thus
+$$
+\xy
+ *+\txt<.8\hsize>{Using this extension will have no effect on the output
+ unless used with a backend that explicitly supports it.}
+ *\frm{-}
+\endxy
+$$
+
+The extension provides special effects that can be used with any \Xy-pic
+<object>, by defining |[|<shape>|]| modifiers.
+The modification is local to the <object> currently being built,
+so will have no effect if this object is never actually used.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Adjusting line thickness}
+
+
+The following table lists the modifiers primarily to alter the thickness
+of lines used by \Xy-pic. They come in two types --- either a single keyword,
+or using the key-character |||| with the following text parsed.
+%
+\begin{defs}%
+ |[thicker]| & double line thickness \cr
+ |[thinner]| & halve line thickness \cr
+ |[||(|<num>|)]| & multiple of usual thickness\cr
+ |[||<|<dimen>|>]| & set thickness to <dimen>\cr
+ |[|||<dimen>|]| & also sets to <dimen>\cr
+ |[||=|<word>|]| & make |[|<word>|]| set current style settings\cr
+ |[||*]| & reuse previous style\cr
+ |[butt]| & butt cap at ends\cr
+ |[roundcap]| & round cap at ends\cr
+ |[projcap]| & projecting square cap.\cr
+\end{defs}
+%
+\noindent
+Later settings of the linewidth override earlier settings;
+multiple calls to |[thicker]| and |[thinner]| compound,
+but the other variants set an absolute thickness.
+The line-thickness specification affects arrow-tips as well as the
+thickness of straight lines and curves.
+Three kinds of line-caps are available; they are discussed below
+in the section on `poly-lines'.
+%
+\begin{code}
+\xy/r8pc/:*++\txt\huge{C}="c"
+,0*++\txt\huge{P}="p",
+,"p",{\ar@*{[|(1)]}"p";"c"<20pt>}
+,"p",{\ar@*{[|(4)]}"p";"c"<14pt>}
+,"p",{\ar@*{[|(10)]}"p";"c"<4pt>}
+,"p",{\ar@*{[|(20)]}"p";"c"<-16pt>}
+\endxy
+\end{code}
+$$\docode$$
+\medskip
+\displaycode
+%
+Using the \PS\ back-end, the size of the arrow-head grows
+aesthetically with the thickness of the line used to draw it.
+This growth varies as the square-root of the thickness;
+thus for very thick lines (20+ times normal) the arrowhead
+begins to merge with the stem.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Load the |style| extension to establish the necessary infra-structure.
+
+\DOCMODE(
+%\xydefcsname@{shape [|...]}#1{\xyFN@\xywidthchar@#1@@}%
+\xydefcsname@{*stylechar@|@}#1{\xyFN@\xywidthchar@#1@@}%
+
+%\xydefcsname@{shape [thinner]}{\xyshape@thinner@}
+%\xydefcsname@{shape [thicker]}{\xyshape@thicker@}
+\xydefcsname@{style [thinner]}{\xyshape@thinner@}
+\xydefcsname@{style [thicker]}{\xyshape@thicker@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Implementation}
+
+Record the line thickness locally in a dimen register.
+The initial value is read from the |xydash10| font.
+Each time |\xylinethick@| is changed, its previous value is stored
+as the expansion of |\xyprevwidth@@|, in case this is needed by
+a specific back-end.
+
+\DOCMODE(
+\xynew@{dimen}\xylinethick@ \xylinethick@=\xydashw@
+
+\xydef@\xyshape@thicker@{\xylinewidth@i{\multiply\xylinethick@\tw@}}
+\xydef@\xyshape@thinner@{\xylinewidth@i{\divide\xylinethick@\tw@}}
+
+\xydef@\xylinewidth@i#1{\edef\xyprevwidth@@{\the\xylinethick@}%
+ #1\edef\next@{\xylinethick@=\the\xylinethick@}%
+ \edef\next@ii{\noexpand\addtotoks@{%
+ \noexpand\xylinewidth@@{\next@}{\xyprevwidth@@}}}%
+ \next@ii }
+
+
+\xydef@\xywidthchar@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xywidthchar@}%gobble spaces
+% \else\ifx @\next \DN@ @@{\addtotoks@{\checkXyStyle@}}%
+ \else\ifx @\next \DN@ @@{\checkXyStyle@}%
+ \else\ifx (\next \DN@ (##1)##2@@{%
+ \xylinewidth@i{\xylinethick@=##1\xydashw@}}%
+ \else\addLT@\ifx \next \addGT@{\addLT@\DN@ ##1}##2@@{%
+ \xylinewidth@i{\xylinethick@=##1\relax}}%
+% \else\ifx *\next \DN@ *@@{\addtotoks@{\checkXyStyle@}}%
+% \else\ifx *\next \DN@ *@@{\checkXyStyle@}%
+ \else\ifx *\next \DN@ *@@{\recoverXyStyle@}%
+% \else\addEQ@\ifx \next \addEQ@\DN@##1@@{%
+% \addtotoks@{\checkXyStyle@\xynamestyle@{##1}}}%
+ \else\addEQ@\ifx \next \addEQ@\DN@##1@@{\checkXyStyle@
+ \addtotoks@{\xynamestyle@{##1}}}%
+ \else\ifx C\next \DN@ C##1@@{\xysetlinecap@{##1}@}%
+ \else\ifx J\next \DN@ J##1@@{\xysetlinejoin@{##1}@}%
+ \else\ifx M\next \DN@ M(##1)@@{\xymiterlimit@{##1}@}%
+ \else \DN@##1@@{\xylinewidth@i{\xylinethick@=##1\relax}}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The diagram in figure~??g[xyrotate.doc:rotate and flips],
+page~??gp[xyrotate.doc:rotate and flips], uses different line-thicknesses
+and colours.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Poly-lines}
+
+By a `poly-line' we mean a path built from straight line segments having no
+gaps where each segment abuts the next. The poly-line could be the edges of
+a polygon, either closed or open if the end-points are different.
+
+The reason for considering a poly-line as a separate <object>, rather than
+simply as a <path> built from straight lines, becomes apparent only when
+the lines have appreciable thickness. Then there are several standard ways
+to fashion the `joins' (where segments meet). Also the shape of the `caps'
+at either end of the poly-line can be altered.
+
+The following modifiers are used to determine the shapes of the line `caps'
+and `joins':
+%
+\begin{defs}%
+ |[||J|<val>|]| & join style, <val> = 0, 1 or 2\cr
+ |[mitre]| & mitre-join, same as |[||J0]|\cr
+ |[roundjoin]| & round join, same as |[||J1]|\cr
+ |[bevel]| & bevel-join, same as |[||J2]|\cr
+ |[||C|<val>|]| & end-cap, <val> = 0, 1 or 2\cr
+ |[butt]| & ``butt'' cap, same as |[||C0]|\cr
+ |[roundcap]| & round cap, same as |[||C1]|\cr
+ |[projcap]| & ``projecting square'' cap,\hfil\break same as |[||C2]|\cr
+ |[||M(|<num>|)]| & set mitrelimit to <num>$\ge1$\cr
+\end{defs}
+%
+\noindent
+These effects are currently implemented only with the \PS\ back-end
+or when using |\xypolyline| (described below) with a \PS\ <driver>.
+In this case the `cap' setting can be applied to any segment, straight
+or curved, whether part of a poly-line or not; however the `join' setting
+applies only to poly-lines. Arrow-tips are not affected.
+The defaults are to use round joins and round-cap ends.
+
+Adjusting the miter-limit affects how far miters are allowed to protrude
+when two wide lines meet at small angles. The <num> is in units of the
+line-thickness. Higher values mean using bevels only at smaller angles,
+while the value of 1 is equivalent to using bevels at all angles.
+The default miter-limit is 10.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Current values are stored in case these are needed within nested portions
+of diagrams.
+
+\DOCMODE(
+\xydef@\xylinecap@{2}
+\xydef@\xylinejoin@{2}
+\xydef@\xylinemiter@{10}
+\DOCMODE)
+
+%These are simple methods that alter the stored values.
+%
+%\DOCMODE(
+%\xydef@\xysetlinecap@@#1{\xylinestyle@{C}{#1}{\def\xylinecap@{#1}}}
+%\xydef@\xysetlinejoin@@#1{\xylinestyle@{J}{#1}{\def\xylinejoin@{#1}}}
+%\xydef@\xysetmiterlimit@@#1{\xylinestyle@{M}{#1}{\def\xylinemiter@{#1}}}
+%\DOCMODE)
+%
+%Finally we need the interface to pass the new values to a <driver>.
+%
+%\DOCMODE(
+%\xydef@\xynolinestyle@@#1#2#3{\let\next=#1\relax #3%
+% \ifx\next C\DN@{\xyundefinedLine@{linecap}{#2}@@}%
+% \else\ifx\next J\DN@{\xyundefinedLine@{linejoin}{#2}@@}%
+% \else\ifx\next M\DN@{\xyundefinedLine@{miterlimit}{#2}@@}%
+% \fi\fi\fi \next@ }
+%
+%\xylet@\xylinestyle@\xynolinestyle@@
+%\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Recognise keywords for `line-caps' and `line-joins':
+
+\DOCMODE(
+\xydefcsname@{style [bevel]}{\xyshape@bevel@}
+\xydefcsname@{style [roundjoin]}{\xyshape@rdjoin@}
+\xydefcsname@{style [miter]}{\xyshape@miter@}
+%
+\xydefcsname@{style [butt]}{\xyshape@butt@}
+\xydefcsname@{style [roundcap]}{\xyshape@rdcap@}
+\xydefcsname@{style [projcap]}{\xyshape@projcap@}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xyshape@butt@{\xysetlinecap@@0}
+\xydef@\xyshape@rdcap@{\xysetlinecap@@1}
+\xydef@\xyshape@projcap@{\xysetlinecap@@2}
+
+\xydef@\xyshape@miter@{\xysetlinejoin@@0}
+\xydef@\xyshape@rdjoin@{\xysetlinejoin@@1}
+\xydef@\xyshape@bevel@{\xysetlinejoin@@2}
+
+\xydef@\xysetlinecap@#1@{\DN@ii{#1}\count@=#1\relax
+ \expandafter\DN@\expandafter{\the\count@}%
+ \ifx\next@\next@ii\else
+ \xywarning@{ignoring extra tokens in line-cap: \next@}\fi
+ \expandafter\xysetlinecap@@\expandafter{\next@}}
+
+\xydef@\xysetlinejoin@#1@{\DN@ii{#1}\count@=#1\relax
+ \expandafter\DN@\expandafter{\the\count@}%
+ \ifx\next@\next@ii\else
+ \xywarning@{ignoring extra tokens in line-join: \next@}\fi
+ \expandafter\xysetlinejoin@@\expandafter{\next@}}
+
+\xydef@\xysetmiterlimit@#1@{\DN@ii{#1}\dimen@=#1\p@\relax
+ \edef\next@{\expandafter\removePT@\the\dimen@}%
+ \ifx\next@\next@ii\else
+ \xywarning@{ignoring extra tokens in miter-limit: \next@}\fi
+ \expandafter\xysetmiterlimit@@\expandafter{\next@}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+These use the more sophisticated approach that is easier to adjust for
+different <driver>s.
+
+\DOCMODE(
+\xydef@\xysetlinecap@@#1{\xy@linecap@i{\def\xylinecap@{#1}}}
+\xydef@\xysetlinejoin@@#1{\xy@linejoin@i{\def\xylinejoin@{#1}}}
+\xydef@\xysetmiterlimit@@#1{%
+ \xy@linemiter@i{\def\xylinemiter@{#1}}}
+
+\xydef@\xy@linecap@i#1{#1\addtotoks@{\xy@linecap@@{#1}}}
+\xydef@\xy@linejoin@i#1{#1\addtotoks@{\xy@linejoin@{#1}}}
+\xydef@\xy@linemiter@i#1{#1\addtotoks@{\xy@linemiter@{#1}}}
+\DOCMODE)
+
+Implementation of line-caps:
+
+\DOCMODE(
+\xydef@\xy@linecap@#1{\checkXyStyle@ \edef\xyprevcap@@{\xylinecap@}%
+ #1\let\prexylinecap@=\prexylinecap@@ \let\postxylinecap@=\postxylinecap@@
+ \applyLIFOstyle@\prexylinecap@{\xylinecap@}%
+ \postxylinecap@{\xyprevcap@@}}
+
+\xydef@\prexylinecap@@{\let\prexylinecap@=\eat@
+ \let\postxylinecap@=\postxylinecap@@ \outputxylinecap@ }
+\xydef@\postxylinecap@@{\let\postxylinecap@=\eat@
+ \let\prexylinecap@=\prexylinecap@@ \resetxylinecap@@ }
+\xylet@\prexylinecap@=\prexylinecap@@
+\xylet@\postxylinecap@=\postxylinecap@@
+
+\xydef@\outputxylinecap@#1{\xycapSpecial@@{#1}}
+\xydef@\resetxylinecap@#1{\resetxylinecap@i{#1}\outputxylinecap@{#1}}
+\xydef@\resetxylinecap@i#1{\def\xylinecap@{#1}}
+\xylet@\resetxylinecap@@=\resetxylinecap@
+
+\xylet@\xycapSpecial@@=\eat@
+\DOCMODE)
+
+Implementation of line-joins:
+
+\DOCMODE(
+\xydef@\xy@linejoin@#1{\checkXyStyle@
+ \edef\xyprevjoin@@{\xylinejoin@}#1%
+ \let\prexylinejoin@=\prexylinejoin@@
+ \let\postxylinejoin@=\postxylinejoin@@
+ \applyLIFOstyle@\prexylinejoin@{\xylinejoin@}%
+ \postxylinecap@{\xyprevjoin@@}}
+
+\xydef@\prexylinejoin@@{\let\prexylinejoin@=\eat@
+ \let\postxylinejoin@=\postxylinejoin@@ \outputxylinejoin@ }
+\xydef@\postxylinejoin@@{\let\postxylinejoin@=\eat@
+ \let\prexylinejoin@=\prexylinejoin@@ \resetxylinejoin@@ }
+\xylet@\prexylinejoin@=\prexylinejoin@@
+\xylet@\postxylinejoin@=\postxylinejoin@@
+
+\xydef@\outputxylinejoin@#1{\xyjoinSpecial@@{#1}}
+\xydef@\resetxylinejoin@#1{\resetxylinejoin@i{#1}\outputxylinejoin@{#1}}
+\xydef@\resetxylinejoin@i#1{\def\xylinejoin@{#1}}
+\xylet@\resetxylinejoin@@=\resetxylinejoin@
+
+\xylet@\xyjoinSpecial@@=\eat@
+\DOCMODE)
+
+Implementation of miter-limit:
+
+\DOCMODE(
+\xydef@\xy@linemiter@#1{\checkXyStyle@
+ \edef\xyprevmiter@@{\xylinemiter@}#1%
+ \let\prexylinemiter@=\prexylinemiter@@
+ \let\postxylinemiter@=\postxylinemiter@@
+ \applyLIFOstyle@\prexylinemiter@{\xylinemiter@}%
+ \postxylinecap@{\xyprevmiter@@}}
+
+\xydef@\prexylinemiter@@{\let\prexylinemiter@=\eat@
+ \let\postxylinemiter@=\postxylinemiter@@ \outputxylinemiter@ }
+\xydef@\postxylinemiter@@{\let\postxylinemiter@=\eat@
+ \let\prexylinemiter@=\prexylinemiter@@ \resetxylinemiter@@ }
+\xylet@\prexylinemiter@=\prexylinemiter@@
+\xylet@\postxylinemiter@=\postxylinemiter@@
+
+\xydef@\outputxylinemiter@#1{\xymiterSpecial@@{#1}}
+\xydef@\resetxylinemiter@#1{\resetxylinemiter@i{#1}\outputxylinemiter@{#1}}
+\xydef@\resetxylinemiter@i#1{\def\xylinemiter@{#1}}
+\xylet@\resetxylinemiter@@=\resetxylinemiter@
+
+\xylet@\xymiterSpecial@@=\eat@
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The path taken by the `poly-line' this is read as the list of <pos>itions
+in the current `stack', ignoring size extents.
+The macro |\xypolyline| is used as a <decor>; it reads the <pos>itions from
+the stack, but leaves the stack intact for later use.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Implementation of `poly-lines'.
+
+\DOCMODE(
+\xydef@\xypolyline#1{\xypolyline@{#1}}
+
+\xydef@\xypolyline@#1{\hbox\bgroup
+ \enter@{\pfromthep@ \basefromthebase@ \cfromthec@}%
+ \def\xyps@list{}\edef\smapp@@{\s@bot}%
+ \smapxy@i{\enter@{\pfromthep@ \basefromthebase@ }%
+ \edef\xyps@list{\expandafter\removePT@\the\X@c\space
+ \expandafter\removePT@\the\Y@c\space \xyps@list}\leave@}%
+ \leave@ \xy@polystyle@@{#1}\xydopoly@style\egroup
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\styledboxz@}}%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The following diagram illustrates the use of line-thickness, line-joins
+and line-caps with poly-lines. It contains an example of each of the styles.
+
+\begin{code}
+\xycompileto{poly}%
+{/r4pc/:,*[|<5pt>][thicker]\xybox{%
+ *+(3,2){}="X"
+;@={p+CU,p+LU,p+LD,p+RD,p+RU,p+CU}
+ ,{0*[miter]\xypolyline{}}
+ ,{\xypolyline{*}},@i@)
+,"X",*+(2.5,1.5){}="X"
+,@={!CU,!LU,!LD,!RD,!RU,!CU}
+ ,{0*[gray][roundjoin]\xypolyline{}}
+ ,{0*[gray]\xypolyline{*}},@i@)
+,"X",*+(2,1){}="X"
+,@={!CU,!LU,!LD,!RD,!RU,!CU}
+ ,{0*[white]\xypolyline{*}}
+ ,{0*[bevel]\xypolyline{}},@i@)
+,"X"-(.7,0)*++\txt\LARGE{A}="a"
+,"X"+(.7,0)*++\txt\LARGE{B}="b"
+,{\ar@{-}@*{[butt][thinner]}"a";"b"<1pc>}
+,{\ar@{-}@*{[roundcap][thinner]}"a";"b"}
+,{\ar@{-}@*{[projcap][thinner]}"a";"b"<-1pc>}
+}}
+\end{code}
+$$\docode$$
+\displaycode
+\noindent
+Note the use of |{0*[...]\xypolyline{..}}| to apply style-modifiers
+to a polyline. The |@={!..}| method for loading the stack gives
+equivalent results to using |;@={p+..}|, since |\xypolyline|
+ignores the edge extents of each <pos> in the stack.
+
+Note also that the argument |#1| to |\xypolyline| affects what
+is typeset. Allowable arguments are:
+%
+\begin{defs}
+|\xypolyline{}| & solid line\cr
+|\xypolyline{.}| & dotted line\cr
+|\xypolyline{-}| & dashed line\cr
+|\xypolyline{*}| & fill enclosed polygon\cr
+|\xypolyline{?}| & fill enclosed polygon using even-odd rule\cr
+|\xypolyline{{*}}| & use |\dir{*}| for lines\cr
+|\xypolyline{<toks>}|\kern-20pt & \kern20pt using |\dir{<toks>}| \cr
+\end{defs}
+\noindent
+The latter cases one has |**\dir{...}| being used to connect the vertices
+of the polyline, with |{{*}}| being needed to get |**\dir{*}|.
+Similarly |**\dir| is used when a <driver> is not available to specifically
+support polylines; in particular the two `fill' options |*| and |?| will
+result in a dotted polygon outline the region intended to be filled.
+
+In all cases it is up to the user to load the stack before calling
+|\xypolyline{|\dots|}|. A particularly common case is the outline of
+an existing \Xy-pic <object>, as in the example above. Future extensions
+to |\frm| will provide a simplified mechanism whereby the user need not
+call |\xypolyline| explicitly for such effects.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xylet@\xypolyline@Special=\eat@
+\xylet@\xypolyfill@Special=\eat@
+\xylet@\xypolyeofill@Special=\eat@
+\xylet@\xypolydot@Special=\eat@
+\xylet@\xypolydash@Special=\eat@
+
+\xydef@\UnloadpolySpecials@{%
+ \let\xypolyline@Special=\eat@
+ \let\xypolyfill@Special=\eat@
+ \let\xypolyeofill@Special=\eat@
+ \let\xypolydot@Special=\eat@
+ \let\xypolydash@Special=\eat@
+}
+
+\xydef@\xy@polystyle@#1{%
+ \let\poly@style@@=\xypolyline@Special
+ \DNii@{#1}\ifx\nextii@\empty
+ \else\DN@{*}\ifx\next@\nextii@ \let\poly@style@@=\xypolyfill@Special
+ \else\DN@{?}\ifx\next@\nextii@ \let\poly@style@@=\xypolyeofill@Special
+ \else\expandafter\DN@\expandafter{\addDOT@{}}\ifx\next@\nextii@
+ \let\poly@style@@=\xypolydot@Special
+ \else\expandafter\DN@\expandafter{\addDASH@{}}\ifx\next@\nextii@
+ \let\poly@style@@=\xypolydash@Special
+ \else\DN@{{*}}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{*}}%
+ \else \def\poly@style@@{\xypolystraight@{#1}}%
+ \fi\fi\fi\fi\fi\fi }
+
+\xydef@\xydopoly@style{\expandafter\poly@style@@\expandafter{\xyps@list}}
+\xydef@\xynopolystyle@#1#2{\xyundefinedLine@{polyline}{{#1}}@@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+When there is no special support this handles the various cases using
+ordinary thin line types.
+
+\DOCMODE(
+\xydef@\xypolynospec@#1{\DNii@{#1}%
+ \ifx\nextii@\empty\def\poly@style@@{\xypolystraight@{-}}%
+ \else\DN@{.}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{.}}%
+ \else\DN@{-}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{--}}%
+ \else\DN@{*}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{.}}%
+ \else\DN@{?}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{.}}%
+ \else\DN@{{*}}\ifx\next@\nextii@ \def\poly@style@@{\xypolystraight@{*}}%
+ \else \def\poly@style@@{\xypolystraight@{#1}}%
+ \fi\fi\fi\fi\fi\fi }
+\DOCMODE)
+
+Gobble the collected positions in |{\xyps@list}|; recover the vertices
+from the stack, then set straight lines in the appropriate style.
+
+\DOCMODE(
+\xydef@\xypolystraight@#1#2{%
+ \enter@{\pfromthep@ \basefromthebase@ \cfromthec@}%
+ \edef\smapp@@{\s@bot}\csname S@0\endcsname\czeroEdge@\pfromc@\def\smapp@@{0}%
+ \smapxy@i{\czeroEdge@\enter@{\pfromthec@}{\connect@\dir{#1}}\leave@}\leave@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Initially poly-lines are uninstalled, until loaded by a <driver>.
+
+\DOCMODE(
+\xylet@\xy@polystyle@@=\xypolynospec@
+
+\xydef@\UninstallPolylines@{%
+ \UnloadpolySpecials@
+ \let\xy@polystyle@@=\xypolynospec@ }
+\UninstallPolylines@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Installation}
+
+Initially there is no support for the actual effects.
+
+\DOCMODE(
+\xydef@\xyundefinedLine@#1#2@@{%
+ \xywarning@{The #1 #2 effect is not implemented with the current driver.}}%
+
+\xydef@\xynolinewidth@#1#2{%
+ \xyundefinedLine@{linewidth}{\the\xylinethick@}@@}%
+\xydef@\xynolinecap@#1{\xyundefinedLine@{linecap}{\xylinecap@}@@}%
+\xydef@\xynolinejoin@#1{\xyundefinedLine@{linejoin}{\xylinejoin@}@@}%
+\xydef@\xynolinemiter@#1{\xyundefinedLine@{miterlimit}{\xylinemiter@}@@}%
+\DOCMODE)
+
+Nothing further can be done unless allowed by a specific <driver>, which
+must establish an alternative expansions to be bound to |\xylinewidth@@|
+and the other hooks.
+
+\DOCMODE(
+\xylet@\xylinewidth@@=\xynolinewidth@
+\xylet@\xy@linecap@@=\xynolinecap@
+\xylet@\xy@linejoin@@=\xynolinejoin@
+\xylet@\xy@linemiter@@=\xynolinemiter@
+
+\xydef@\UnloadLine@#1{%
+ \ifx#1\relax\else\xyunload@{line width extension}\fi
+ \let\resetxyline@@=\resetxyline@
+ \let\resetxylinecap@@=\resetxylinecap@
+ \let\resetxylinejoin@@=\resetxylinejoin@
+ \let\resetxylinemiter@@=\resetxylinemiter@
+ \let\transxyline@@=\DN@
+ \let\xylineSpecial@@=\eat@
+ \let\xycapSpecial@@=\eat@
+ \let\xyjoinSpecial@@=\eat@
+ \let\xymiterSpecial@@=\eat@
+ \let\xylinewidth@@=\xynolinewidth@
+ \let\xy@linecap@@=\xynolinecap@
+ \let\xy@linejoin@@=\xynolinejoin@
+ \let\xy@linemiter@@=\xynolinemiter@
+ \UninstallPolylines@ }
+
+\xyaddunsupport{line}{\UnloadLine@\relax}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This is a possible alternative for |\xylinewidth@@|. Indeed it is used
+with the \PS\ support, which then redefines just |\xylineSpecial@@|.
+
+\DOCMODE(
+\xydef@\xylinewidth@#1#2{\checkXyStyle@
+ #1\let\prexyline@=\prexyline@@ \let\postxyline@=\postxyline@@
+ \applyLIFOstyle@\prexyline@{\the\xylinethick@}\postxyline@{#2}}
+\xydef@\prexyline@@{\let\prexyline@=\eat@
+ \let\postxyline@=\postxyline@@ \outputxyline@ }
+\xydef@\postxyline@@{\let\postxyline@=\eat@
+ \let\prexyline@=\prexyline@@ \resetxyline@@ }
+\xylet@\prexyline@=\prexyline@@
+\xylet@\postxyline@=\postxyline@@
+
+\xydef@\resetxyline@#1{\resetxyline@i{#1}\outputxyline@{#1}}
+\xydef@\resetxyline@i#1{\xylinethick@=#1\relax}
+\xydef@\outputxyline@#1{\transxyline@@{#1}%
+ \expandafter\xylineSpecial@@\expandafter{\next@}}
+\xylet@\resetxyline@@=\resetxyline@
+\DOCMODE)
+
+These need to be rebound by a back-end which supports variation in the
+line-thickness.
+
+\DOCMODE(
+\xydef@\transxyline@#1{\edef\next@{\removePT@#1}}
+
+\xylet@\transxyline@@=\DN@
+\xylet@\xylineSpecial@@=\eat@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyline.doc,v $
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.3 1996/12/18 09:22:29 ross
+% adjustments for styles now within the kernel code
+% fixed problem with line-widths
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.12 1994/10/25 03:01:14 ross
+% Final 3beta release [bug fixes & AMS-LaTeX fitting].
+%
+% Revision 2.11 1994/07/05 09:27:49 ross
+% fixed documentation bug
+%
+% Revision 2.10 1994/06/15 12:46:03 ross
+% Second release 3beta.
+% Colour and line style saving works; label colouring bug fixed.
+%
+% Revision 2.9 1994/06/09 14:39:49 ross
+% Release 3beta.
+%
+% NEW for version 2.9 by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xymacpat.xyp b/Master/texmf-dist/source/generic/xypic/xymacpat.xyp
new file mode 100644
index 00000000000..2987acd7bbe
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xymacpat.xyp
@@ -0,0 +1,61 @@
+% $Id: xymacpat.xyp,v 3.3 1996/12/18 09:25:21 ross Exp $
+%
+% Patterns for Xy-pic tile extension.
+% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%
+% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+% See the companion README and INSTALL files for further information.
+% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%
+% The Xy-pic package is free software; you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by the
+% Free Software Foundation; either version 2 of the License, or (at your
+% option) any later version.
+%
+% The Xy-pic package is distributed in the hope that it will be useful, but
+% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+% for more details.
+%
+% You should have received a copy of the GNU General Public License along
+% with this package; if not, write to the Free Software Foundation, Inc.,
+% 675 Mass Ave, Cambridge, MA 02139, USA.
+%
+mac01 00 <FFFFFFFFFFFFFFFF>
+mac02 08 <DDFF77FFDDFF77FF>
+mac03 16 <DD77DD77DD77DD77>
+mac04 32 <AA55AA55AA55AA55>
+mac05 16 <55FF55FF55FF55FF>
+mac06 32 <AAAAAAAAAAAAAAAA> <AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA>
+mac07 16 <EEDDBB77EEDDBB77> <EEEEEEDDDDDDBBBBBB777777EEEEEEDDDDDDBBBBBB777777>
+mac08 48 <8888888888888888> <888888888888888888888888888888888888888888888888>
+mac09 40 <B130031BD8C00C8D> <B1B1B13030300303031B1B1BD8D8D8C0C0C00C0C0C8D8D8D>
+mac10 56 <8010022001084004> <808080101010020202202020010101080808404040040404>
+mac11 36 <FF888888FF888888> <FFFFFF888888888888888888FFFFFF888888888888888888>
+mac12 42 <FF808080FF080808> <FFFFFF808080808080808080FFFFFF080808080808080808>
+mac13 63 <8000000000000000> <808080000000000000000000000000000000000000000000>
+mac14 58 <8040200002040800> <808080404040202020000000020202040404080808000000>
+mac15 49 <8244394482010101> <828282444444393939444444828282010101010101010101>
+mac16 34 <F87422478F172271> <F8F8F87474742222224747478F8F8F171717222222717171>
+mac17 48 <55A04040550A0404> <555555A0A0A04040404040405555550A0A0A040404040404>
+mac18 50 <2050888888880502> <202020505050888888888888888888888888050505020202>
+mac19 31 <BF00BFBFB0B0B0B0> <BFBFBF000000BFBFBFBFBFBFB0B0B0B0B0B0B0B0B0B0B0B0>
+mac20 64 <0000000000000000>
+mac21 60 <8000080080000800>
+mac22 56 <8800220088002200>
+mac23 48 <8822882288228822>
+mac24 48 <AA00AA00AA00AA00>
+mac25 32 <FF00FF00FF00FF00> <FFFFFF000000FFFFFF000000FFFFFF000000FFFFFF000000>
+mac26 48 <1122448811224488> <111111222222444444888888111111222222444444888888>
+mac27 48 <FF000000FF000000> <FFFFFF000000000000000000FFFFFF000000000000000000>
+mac28 56 <0102040810204080> <010101020202040404080808101010202020404040808080>
+mac29 56 <AA00800088008000> <AAAAAA000000808080000000888888000000808080000000>
+mac30 49 <FF80808080808080> <FFFFFF808080808080808080808080808080808080808080>
+mac31 51 <081C22C180010204> <0808081C1C1C222222C1C1C1808080010101020202040404>
+mac32 50 <881422418800AA00> <888888141414222222414141888888000000AAAAAA000000>
+mac33 58 <40A00000040A0000> <404040A0A0A00000000000000404040A0A0A000000000000>
+mac34 51 <038448300C020101> <0303038484844848483030300C0C0C020202010101010101>
+mac35 46 <8080413E080814E3> <8080808080804141413E3E3E080808080808141414E3E3E3>
+mac36 44 <102054AAFF020408> <101010202020545454AAAAAAFFFFFF020202040404080808>
+mac37 26 <77898F8F7798F8F8> <7777778989898F8F8F8F8F8F777777989898F8F8F8F8F8F8>
+mac38 48 <0008142A552A1408> <0000000808081414142A2A2A5555552A2A2A141414080808>
diff --git a/Master/texmf-dist/source/generic/xypic/xymatrix.doc b/Master/texmf-dist/source/generic/xypic/xymatrix.doc
new file mode 100644
index 00000000000..4c269ad502a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xymatrix.doc
@@ -0,0 +1,1345 @@
+%% $Id: xymatrix.doc,v 3.4 1997/05/18 01:14:25 krisrose Exp $
+%%
+%% Xy-pic ``Matrix'' feature.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{matrix}{Matrix feature}{\stripRCS$Revision: 3.4 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This option implements ``\Xy-matrices'', \ie, matrices where it is
+ possible to refer to the entry objects by their row/column address.
+ We first describe the general form of \Xy-matrices in~\S??[matrix],
+ then in~\S??[coord] we summarise the new <coord>inate forms used to
+ refer to entries. In~\S??[spacing] we explain what parameters can be
+ set to change the spacing and orientation of the matrix, and
+ in~\S??[entries] we explain how the appearance of the entries can be
+ changed.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{\Xy-matrices}
+??=[matrix]
+%
+ The fundamental command of this feature is
+%
+\begin{defs1}
+ ??c![\xymatrix] <setup> |{|<rows>|}|
+\end{defs1}
+\noindent\unskip
+%
+ that reads a ??w![matrix] of entries in the generic \TeX\ row\&column
+ format, \ie, where rows are separated with ??c![\\] and contain
+ columns separated with ??c![&] (we discuss in the following sections
+ what <setup> can be). Thus a matrix with "maxrow" rows and "maxcol"
+ columns where each entry contains "row"|,|"col" is entered as
+$$
+\begin{array}{llll}
+|\xymatrix{|\\
+~{|1,1 &|} &{|1,2 &|}\quad\cdots &{|1,|"maxcol"| \\|} \\
+~{|2,1 &|} &{|2,2 &|} &{|2,|"maxcol"| \\|} \\
+~~\vdots &\qquad\ddots \\
+~{"maxrow"|,1 &|}&{"maxrow"|,2 &|} &{"maxrow"|,|"maxcol"| }|}
+\end{array}
+$$
+ (\TeX\-nically the |&| character represents any `alignment tab', \ie,
+ character with category code~4).
+
+ A ??w![<matrix>] can appear either in an \Xy-picture (as <decor>) or
+ ``stand-alone''.
+
+ The aspects in which |\xymatrix| differs from ordinary matrix
+ constructions, such as Plain \TeX's |\matrix{|\dots|}| and \LaTeX's
+ |array| environment, are
+%
+\begin{itemize}
+
+\item
+ arbitrary \Xy-pic <decor>ations may be specified in each entry and
+ will be interpreted in a state where $c$ is the current entry,
+
+\item
+ the entire matrix is an object itself with reference point as the top
+ left entry, and
+
+\item
+ a progress message ``|<xymatrix| "rows"|x|"cols" "size"|>|'' is
+ printed for each matrix with $"rows"\times"cols"$ entries and \Xy-pic
+ complexity "size" (the number of primitive operations performed),
+ unless the declaration ??c![\SilentMatrices] is issued.
+
+\item
+ Entries starting with a ??c![*] are special (described
+ in~\S??[entries])\footnote{In general it is recommended that entries
+ start with a non-expanding token, \ie, an ordinary (non-active)
+ character, {\tt\otherbgroup}, or |\relax|, for compilation to work.},
+ so use |{*}| to get a $\star$.
+
+\end{itemize}
+%
+ For example,
+%
+\begin{code}
+\xy
+ \xymatrix{A&B\\C&D}
+ \drop\frm{-}
+ \drop\cir<8pt>{}
+\endxy
+\end{code}
+\displaycode
+%
+\noindent
+ will typeset
+%
+$$\docode$$
+%
+ \BUG: Matrix nesting is not safe.
+
+ Matrices are often quite slow to typeset so as a convenience all
+ matrices can be set to compile (and not) automatically with the
+ declarations
+%
+\begin{defs1}
+|\CompileMatrices| \cr
+|\NoCompileMatrices| \cr
+\end{defs1}
+\noindent\unskip
+%
+ Matrices can be compiled or not individually, by using the explicit
+ commands ??c![\xymatrixcompile] and ??c![\xymatrixnocompile] as
+ well as by encapsulating in the usual
+ |\xycompileto{|"name"|}{|\dots|}| (see note~??g[xy.doc:compile]).
+
+ \NOTE: Matrices will only compile correctly if all entries start with
+ a nonexpandable token, \ie, |{| or |\relax| or some non-active
+ character.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{On the following code:}
+
+ The complexity of this option stems from the fact that we cannot
+ build the actual \Xy-picture until after the matrix has been typeset
+ so that we know the sizes and places of all the entries. The
+ handling described here is thus separated into several subprocedures.
+
+\paragraph*{Setup:}
+
+ Not much---only to keep track of the rows and columns. These are not
+ accesible to the user---should they?
+
+\DOCMODE(
+\xynew@{count}\Row
+\xynew@{count}\Col
+
+\xydef@\maxrow@{0} % highest row number used
+\xydef@\maxcol@{0} % highest column number used
+\xydef@\maxcolrow@{0} % a row with maximal number of columns
+\DOCMODE)
+
+ There are some user-defined parameters summarised later.
+
+ The following is an experimental set of `optimal' queueing macros
+ using two queues and two counters to keep track of the progress.
+
+\DOCMODE(
+\xynew@{toks}\queue@
+\xynew@{toks}\queue@@
+
+\xynew@{count}\qcount@
+\xynew@{count}\qcount@@
+
+\xydef@\clearq@{%
+ \global\queue@={}\global\qcount@=\@ne
+ \global\queue@@={}\global\qcount@@=\z@}
+
+\xydef@\addq@#1{\global\advance\matrixsize@\@ne
+ \ifnum\qcount@@<\qcount@ \let\addq@@=\addq@i
+ \else \let\addq@@=\addq@ii \fi
+ \expandafter\addq@@\the\queue@@\addq@@{#1}}
+
+\xylet@\addq@@=\relax
+
+\xydef@\addq@i#1\addq@@#2{%
+ \global\advance\qcount@@\@ne \global\queue@@={#1#2}}
+
+\xydef@\addq@ii#1\addq@@#2{%
+ \global\advance\qcount@\@ne \global\qcount@@=\z@
+ \global\queue@=\expandafter{\the\queue@#1#2}\global\queue@@={}}
+
+\xydef@\finishq@{\expandafter\addq@ii\the\queue@@\addq@@{}}
+\DOCMODE)
+
+ \HACK: intended to make the addition of tokens to the token list
+ faster: we first add to the `small' |\queue@@| as many times as we
+ have added to the `big' |\queue@| before that. So we know we should
+ always expand |\queue@@|: this is done first (last in the macro
+ text). Then we call |\addq@@| that will either add to the small one
+ or add the small one to the big one and then clear the small one!
+
+ "Usage": Call |\clearq@| first. Then use |\addq@| as many times as
+ desired. To get the queue in |\queue@| call |\finishq@| and use it.
+ Finally clear |\queue@| (globally) or continue.
+
+\paragraph*{Main procedure:}
+
+ Here is the main code which is concerned with initialisations and
+ output of messages explaining how far the matrix construction has
+ progressed.
+
+\DOCMODE(
+\xynew@{count}\matrixsize@
+\xynew@{if}\ifnoisymatrices@ \noisymatrices@true
+
+\xydef@\SilentMatrices{\noisymatrices@false}
+\xydef@\NoisyMatrices{\noisymatrices@true}
+
+\xydef@\xymatrixnocompile{\global\matrixsize@=\z@
+ \ifnoisymatrices@\message{<xymatrix}\fi
+ \if\inxy@
+ \DN@{\nter@{}\xy@\xymatrix{\enter@{%
+ \def\noexpand\xy@minX@@{\xy@minX@@}\def\noexpand\xy@maxX@@{\xy@maxX@@}%
+ \def\noexpand\xy@minY@@{\xy@minY@@}\def\noexpand\xy@maxY@@{\xy@maxY@@}%
+ \edef\noexpand\xymatrixprefix@@{\codeof\xymatrixprefix@@}}}}%
+ \else \DN@{\xy \nter@\endxy \xy@\xymatrix{\nter@{}}}\fi \next@
+ \xy@@{\save@ \edef\matrixorigin@{\X@c=\the\X@c \Y@c=\the\Y@c}%
+ \edef\xy@minX@@{\the\X@c}\edef\xy@maxX@@{\the\X@c}%
+ \edef\xy@minY@@{\the\Y@c}\edef\xy@maxY@@{\the\Y@c}}%
+ \xdef\maxrow@{0}\xdef\maxcol@{0}\xdef\maxcolrow@{0}%
+ \mkHWdefaults@ \xymatrix@prefix""}
+
+\xylet@\xymatrix=\xymatrixnocompile
+
+\xydef@\xymatrixprefix@@{}
+
+\xydef@\xymatrix@prefix"#1"{\DN@{#1}\edef\xymatrixprefix@@{\codeof\next@}%
+ \DNii@##1{\xy@{"#1"}{\edef\xymatrixprefix@@{##1}}}%
+ \expandafter\nextii@\expandafter{\xymatrixprefix@@}%
+ \xyFN@\xymatrix@setup}
+
+\xydef@\xymatrix@setup{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@setup}%gobble spaces
+ \else\ifx \bgroup\next \let\next@=\xymatrix@ii
+ \else\addAT@\ifx\next \addAT@\DN@{\xy@{@}{}\xyFN@\xymatrix@at}%
+ \else\ifx "\next \let\next@=\xymatrix@prefix
+ \else \DN@{\xyerror@{\string\xymatrix<setup>{<rows>} expected}{}}%
+ \fi\fi\fi\fi \next@}
+
+\xydef@\xymatrix@ii#1{%
+%
+%\W@{ H@max=\meaning\H@max}%
+%\W@{ W@max=\meaning\W@max}%
+%\W@{ HW@max=\meaning\HW@max}%
+%\W@{ mkHrow@={\meaning\mkHrow@}}%
+%\W@{ mkWcol@={\meaning\mkWcol@}}%
+%\W@{ mkHmax@={\meaning\mkHmax@}}%
+%\W@{ mkWmax@={\meaning\mkWmax@}}%
+%\W@{ mkHWmax@={\meaning\mkHWmax@}}%
+%
+ \xymatrix@pretypeset{#1}%
+% \ifnum\maxcol@=\z@ \mkWcol@ \mkWmax@ %\mkHrow@ \mkHmax@
+ \ifnum\maxcol@=\z@ \mkWcol@ \mkWmax@ \mkHrow@ \mkHmax@
+ \xdef\maxcol@{\the\Col}\xdef\maxcolrow@{\the\Row}\fi
+ \ifnoisymatrices@\message{\maxcol@ x\maxrow@}\fi
+ \xymatrix@measureit@@ \the\queue@ \global\queue@={}%
+ \xymatrix@typeset{#1}\restore\xymatrix@insert
+ \xy@@\leave@ \leave@
+ \ifnoisymatrices@\message{\the\matrixsize@>}\fi \ignorespaces}
+\DOCMODE)
+
+ Here is where compilation of matrices is turned on/off.
+
+\DOCMODE(
+\xydef@\xymatrixcompile#1#{\xymatrixcompile@{#1}}
+\xydef@\xymatrixcompile@#1#2{\xycompile{\xymatrixnocompile#1{#2}}}
+
+\xydef@\CompileMatrices{\let\xymatrix=\xymatrixcompile}
+\xydef@\NoCompileMatrices{\let\xymatrix=\xymatrixnocompile}
+\DOCMODE)
+
+ \TODO: Proper nesting that ensures that the matrix state is
+ reestablished after the current one has been typeset.
+
+ Each subprocedure is explained below.
+
+\paragraph*{Set row-rotation:}
+
+ This sets the general direction of the rows as the current direction
+ indicates. This direction is not known until \Xy-time so it gets put
+ into the row/column definitions.
+
+\DOCMODE(
+\xydef@\xy@cossign@@{+}
+\xydef@\xy@sinsign@@{+}
+\xydef@\xy@cosabs@@{1}
+\xydef@\xy@sinabs@@{0}
+\xydef@\xy@tanabs@@{0}
+\xydef@\xy@cotabs@@{100}
+
+\xydef@\xymatrix@rotation{%?*[rotation]
+ \xy@@{%
+ \edef\xy@cossign@@{\ifdim\cosDirection\p@<\z@-\else+\fi}%
+ \edef\xy@sinsign@@{\ifdim\sinDirection\p@<\z@-\else+\fi}%
+ \edef\xy@cosabs@@{%
+ \if\xy@cossign@@\cosDirection\else\xy@cossign@@\cosDirection\fi}%
+ \edef\xy@sinabs@@{%
+ \if\xy@sinsign@@\sinDirection\else\xy@sinsign@@\sinDirection\fi}%
+ \dimen@=\xy@cosabs@@\p@ \dimen@ii=\xy@sinabs@@\p@
+ \ifdim\dimen@ii<.01\p@ \def\xy@cotabs@@{100}%
+ \else \quotient@\xy@cotabs@@\dimen@\dimen@ii \fi
+ \dimen@=\xy@cosabs@@\p@ \dimen@ii=\xy@sinabs@@\p@
+ \ifdim\dimen@<.01\p@ \def\xy@tanabs@@{100}%
+ \else \quotient@\xy@tanabs@@\dimen@ii\dimen@ \fi}}
+\DOCMODE)
+
+\paragraph*{Pretypeset:}
+
+ The purpose of this is to
+%
+\begin{itemize}
+\item
+ set box8 to an halign with all the entries properly typeset to be
+ measured in the next step, and
+\item
+ store in a queue the operations that will define each entry as an
+ object once the measurement is done and the distances between rows
+ and columns is known.
+\end{itemize}
+%
+ This is achieved as follows: Row/column counters, maxima, and queues
+ are reset. The tab- and interlineskip is removed to make taking the
+ constructed box apart easier. And the halign template is used to
+ apply an appropriate action for each entry that updates the counters
+ and queue.
+
+ The special |\xymatrixsavedCOORD@| is used to store the original
+ |\COORD@| except when diagrams are nested.
+
+\DOCMODE(
+\xylet@\xymatrixsavedCOORD@=\relax
+
+\xydef@\xymatrix@pretypeset#1{%
+ \global\Row=\z@ \xdef\maxcol@{0}\clearq@
+ \setbox8=\vtop{%
+ \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
+ \let\COORD@=\xymatrixCOORD@
+ \everycr{}\let\\=\cr \tabskip=\z@ \offinterlineskip
+ \halign{\prentry@ ##!@&&\xyFN@\prentry@@##!@\cr#1\crcr}%
+ \prentry@@@}%
+ \xdef\maxrow@{\the\Row}%
+ \finishq@}
+\DOCMODE)
+
+ The first entry in each row is special; in particular it moves the
+ entries from the columns of the previous row (if any) into the
+ second-level queue:
+
+\DOCMODE(
+\xydef@\prentry@{\relax
+ \ifnum\Row>\z@
+ \ifnum\maxcol@<\Col\xdef\maxcol@{\the\Col}\xdef\maxcolrow@{\the\Row}\fi
+ \expandafter\xdef\csname maxcol@\the\Row\endcsname{\the\Col}\fi
+ \global\advance\Row\@ne \global\Col=\z@ \xyFN@\prentry@@}
+\DOCMODE)
+
+ The common part should first typeset the object. Then the resulting
+ <setup> commands should be emitted as described below.
+
+ While typesetting the entry, \Xy-commands are "disabled" by
+ redefining |\xy@| to just `eat' its arguments, so they don't
+ interfere\dots
+
+\DOCMODE(
+\xylet@\lastprentry@@=\relax
+
+\xydef@\xyeatall@{\let\xy@=\xyeat@ \change@oxy@\xyeat@ \let\xy@@ix@=\eat@}
+
+\xydef@\prentry@@{\global\advance\Col\@ne
+ \let\next@=\prentry@@norm
+ \ifoldxymatrix@\else \ifx *\next \DN@*{\xyFN@\prentry@@star}\fi \fi
+ \next@}
+
+\xydef@\prentry@@star{\ifx *\next \DN@*{\xyFN@\prentry@@star@ii}%
+ \else \DN@##1##{\prentry@@star@i{##1}}\fi \next@}
+
+\xydef@\prentry@@star@i#1#2#3!@{\gdef\lastprentry@@{*#1{#2}#3}%
+ \setbox\lastobjectbox@=\object#1{#2}%
+ \prentry@@x}
+
+\xydef@\prentry@@star@ii{%
+ \ifx [\next
+ \DN@[##1]{\DN@####1{\def\entrymodifiers@{[##1]####1}}%
+ \expandafter\next@\expandafter{\entrymodifiers@}\prentry@@norm}%]
+ \else
+ \DN@##1{\DN@####1{\def\entrymodifiers@{##1####1}}%
+ \expandafter\next@\expandafter{\entrymodifiers@}\prentry@@norm}%
+ \fi \next@}
+
+\xydef@\prentry@@norm#1!@{\gdef\lastprentry@@{#1}%
+ \DN@{\setbox\lastobjectbox@=\object}%
+ \expandafter\next@\entrymodifiers@{\xyeatall@ \everyentry@ #1}%
+ \prentry@@x}
+
+\xydef@\prentry@@x{%
+ \edef\next@{{\noexpand\pre@emit{\the\Row}{\Upness@}{\the\Col}{\Leftness@}%
+ {\the\L@c}{\the\R@c}{\the\D@c}{\the\U@c}{\expandafter\noexpand\the\Edge@c}}}%
+ \expandafter\addq@\next@ \box\lastobjectbox@}
+\DOCMODE)
+
+ Finally the following ensures that the last row in the diagram is
+ treated correctly: if the last entry was an empty row then we ignore
+ the row entirely if the |\ifoldxymatrix@| switch is set just as we
+ ignore |*|-entries above.
+
+\DOCMODE(
+\xynew@{if}\ifoldxymatrix@ \oldxymatrix@false
+
+\xydef@\prentry@@@{\relax \let\next@=\prentry@@@i
+ \ifoldxymatrix@ \ifnum\Col=\@ne \ifx\lastprentry@@\empty
+ \global\advance\Row\m@ne \let\next@=\relax \fi\fi\fi
+ \global\let\lastprentry@@=\relax \next@}
+
+\xydef@\prentry@@@i{%
+ \ifnum\maxcol@<\Col \xdef\maxcol@{\the\Col}\xdef\maxcolrow@{\the\Row}\fi
+ \expandafter\xdef\csname maxcol@\the\Row\endcsname{\the\Col}}
+\DOCMODE)
+
+ Furthermore the code (??_[edge])~sets the edge and extents of the
+ object and (??_[extents])~adds the object to the size of the matrix.
+ \BUG: Currently ignores upness and leftness parameters.
+
+\DOCMODE(
+\xydef@\xy@minX@@{\z@}
+\xydef@\xy@maxX@@{\z@}
+\xydef@\xy@minY@@{\z@}
+\xydef@\xy@maxY@@{\z@}
+
+\xydef@\pre@emit#1#2#3#4#5#6#7#8#9{%
+ % #1=R,#2=Upn,#3=C,#4=Leftn,#5=L,#6=R,#7=D,#8=U,#9=Edge.
+ \global\Row=#1\global\Col=#3\relax
+ \ifnum#3=\@ne
+ \ifnum#1=\@ne \xy@@{\matrixorigin@}%?*[1,1]
+ \else \count@@=#1\advance\count@@\m@ne %?*[r,1]
+ \edef\next@{\noexpand\xy@@{\noexpand\cfromid@
+ {\xymatrixprefix@@\the\count@@,1}}}\next@
+ \pre@emit@ \W@maxout\Hrow@c@@\W@maxin\Hrow@in\xy@tanabs@@
+ \X@c\xy@sinsign@@\xy@sinabs@@\xymatrixrowsep@
+ \pre@emit@ \Hrow@c@@\W@maxout\Hrow@in\W@maxin\xy@cotabs@@
+ \Y@c{-\xy@cossign@@}\xy@cosabs@@\xymatrixrowsep@
+ \fi
+ \else \count@@=#3\advance\count@@\m@ne %?*[r,c]
+ \pre@emit@ \Wcol@c@@\H@maxout\Wcol@in\H@maxin\xy@cotabs@@
+ \X@c\xy@cossign@@\xy@cosabs@@\xymatrixcolsep@
+ \pre@emit@ \H@maxout\Wcol@c@@\H@maxin\Wcol@in\xy@tanabs@@
+ \Y@c\xy@sinsign@@\xy@sinabs@@\xymatrixcolsep@
+ \fi
+ \DN@##1{\xy@@{\L@c=#5\R@c=#6\D@c=#7\U@c=#8\Edge@c={#9}\idfromc@{##1#1,#3}}}%
+ \expandafter\next@\expandafter{\xymatrixprefix@@}%?*[edge]
+ \xy@@{%?*[extents]
+ \dimen@=\X@c \advance\dimen@-\L@c
+ \ifdim\dimen@<\xy@minX@@ \edef\xy@minX@@{\the\dimen@}\fi
+ \dimen@=\X@c \advance\dimen@+\R@c
+ \ifdim\dimen@>\xy@maxX@@ \edef\xy@maxX@@{\the\dimen@}\fi
+ \dimen@=\Y@c \advance\dimen@-\D@c
+ \ifdim\dimen@<\xy@minY@@ \edef\xy@minY@@{\the\dimen@}\fi
+ \dimen@=\Y@c \advance\dimen@+\U@c
+ \ifdim\dimen@>\xy@maxY@@ \edef\xy@maxY@@{\the\dimen@}\fi}}
+\DOCMODE)
+
+ The following procedure represents the similarity of the four lines
+ for the coordinates in the computation above\dots \TODO: describe
+ this properly\dots
+
+\DOCMODE(
+\xydef@\pre@emit@#1#2#3#4{#1\A@ #2\B@ #3\R@ #4\dimen@
+ \edef\next@{{\the\A@}{\the\B@}{\the\R@}{\the\dimen@}}%
+ \expandafter\pre@emit@i\next@}
+
+\xydef@\pre@emit@i#1#2#3#4#5{\xy@@{%
+ % Emit R := min(#1,#5#2) + min(#3,#5#4)
+ \dimen@=#2\R@=#5\dimen@ \dimen@=#1\relax \ifdim\R@>\dimen@ \R@=\dimen@ \fi
+ \dimen@=#4\B@=#5\dimen@ \dimen@=#3\relax \ifdim\B@>\dimen@ \B@=\dimen@ \fi
+ \advance\R@\B@}%
+ \pre@emit@ii}
+
+\xydef@\pre@emit@ii#1#2#3#4{\xy@@{%
+ % Emit #1 := #1 + #2*[ R + #3#4 ]
+ \dimen@=#4\dimen@=#3\dimen@ \advance\R@\dimen@ \advance#1#2\R@}}
+
+\xydef@\Wcol@in#1{#1=\csname Wcol@\the\Col\endcsname #1=.5#1}
+\xydef@\Wcol@out#1{#1=\csname Wcol@\the\Col\endcsname #1=.5#1}
+\xydef@\Wcol@c@@#1{#1=\csname Wcol@\the\count@@\endcsname #1=.5#1}
+\xydef@\W@maxin#1{#1=\W@max #1=.5#1}
+\xydef@\W@maxout#1{#1=\W@max #1=.5#1}
+
+\xydef@\Hrow@in#1{#1=\csname Hrow@\the\Row\endcsname #1=.5#1}
+\xydef@\Hrow@out#1{#1=\csname Hrow@\the\Row\endcsname #1=.5#1}
+\xydef@\Hrow@c@@#1{#1=\csname Hrow@\the\count@@\endcsname #1=.5#1}
+\xydef@\H@maxin#1{#1=\H@max #1=.5#1}
+\xydef@\H@maxout#1{#1=\H@max #1=.5#1}
+\DOCMODE)
+
+ \BUG: It should be possible to change te adjustment more profoundly
+ for individual entries, rows, and columns.
+
+\paragraph*{Measure:}
+
+ Take the created box8 apart to define the macros |\Wcol@|"col" and
+ |\Hrow@|"row" containing the width and height of the bounding box of
+ the entries in the row/column. Finally the commands collected in the
+ queue are executed (hopefully they'll invoke |\pre@emit| a number of
+ times). This is a hook because some special cases won't need it\dots
+
+\DOCMODE(
+\xydef@\H@max{\z@}
+\xydef@\W@max{\z@}
+\xydef@\HW@max{\z@}
+
+\xydef@\mkHrow@{}
+\xydef@\mkWcol@{}
+\xydef@\mkHmax@{}
+\xydef@\mkWmax@{}
+\xydef@\mkHWmax@{}
+
+\xydef@\mkHWdefaults@{\let\xymatrix@measureit@@=\xymatrix@measureit
+ \let\mkHrow@=\Hrow@R \let\mkWcol@=\Wcol@C
+ \def\mkHmax@{\ifdim\dimen@>\H@max\relax \xdef\H@max{\the\dimen@}\fi}%
+ \def\mkWmax@{\ifdim\dimen@>\W@max\relax \xdef\W@max{\the\dimen@}\fi}%
+ \let\mkHWmax@=\HWmax@max}
+
+\xydef@\Hrow@R{\expandafter\xdef\csname Hrow@\the\Row\endcsname{\the\dimen@}}
+\xydef@\Wcol@C{\expandafter\xdef\csname Wcol@\the\Col\endcsname{\the\dimen@}}
+
+\xydef@\Hrow@max{\expandafter\gdef\csname Hrow@\the\Row\endcsname{\H@max}}
+\xydef@\Wcol@max{\expandafter\gdef\csname Wcol@\the\Col\endcsname{\W@max}}
+
+\xydef@\Hrow@HWmax{\expandafter\gdef\csname Hrow@\the\Row\endcsname{\HW@max}}
+\xydef@\Wcol@HWmax{\expandafter\gdef\csname Wcol@\the\Col\endcsname{\HW@max}}
+
+\xydef@\HWmax@max{%
+ \ifdim\H@max>\W@max\global\let\HW@max=\H@max\else\global\let\HW@max=\W@max\fi}
+
+\xydef@\HWmax@set#1{\gdef\HW@max{#1}%
+ \global\let\H@max=\HW@max \global\let\W@max=\HW@max}
+
+\xydef@\xymatrix@measureit{%
+ \xdef\H@max{\z@}\xdef\W@max{\z@}%
+ \setbox6=\vbox{\unvbox8 \global\Row=\maxrow@
+ \loop@ \dimen@ii=\lastskip\unskip \ifnum\z@<\Row
+ \setbox4=\lastbox \dimen@=\dp4 \advance\dimen@\ht4 \mkHrow@ \mkHmax@
+ \ifnum\Row=\maxcolrow@
+ \setbox2=\hbox{\unhbox4 %
+ \global\Col=\maxcol@
+ \loop@ \dimen@ii=\lastskip\unskip \ifnum\z@<\Col
+ \setbox\z@=\lastbox \dimen@=\wdz@ \mkWcol@ \mkWmax@
+ \global\advance\Col\m@ne
+ \repeat@}\fi
+ \global\advance\Row\m@ne
+ \repeat@}%
+ \mkHWmax@}
+
+\xylet@\xymatrix@measureit@@=\relax
+\DOCMODE)
+
+ \TODO: Allow non-default spacing between particular rows/columns as
+ well as different justification of the entire matrix\dots
+
+\paragraph*{Typeset:}
+
+ Retypeset the entire diagram using a hacked halign: its template
+ typesets each entry as
+$$
+ |\POS|\,|"|"row"|,|"col"|"|\,|*|\,"object"\,|\relax|\,"\Xy-commands"|\relax|
+$$
+ where "object" is the contents of the entry translated into \Xy-pic
+ <object> form and "\Xy-commands" entails the commands used in this
+ particular entry.
+
+\DOCMODE(
+\xydef@\xymatrix@typeset#1{%
+ \clearq@
+ \hbox{\vtop{\xyqall@
+ \xy@@{\ifx\xymatrixsavedCOORD@\relax
+ \enter@{\noexpand\let\noexpand\COORD@\noexpand\xymatrixsavedCOORD@}%
+ \let\xymatrixsavedCOORD@=\COORD@ \let\COORD@=\xymatrixCOORD@
+ \else \enter@{}\fi}%
+ \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
+ \let\COORD@=\xymatrixCOORD@
+ \kern\z@ \global\Row=\z@
+ \everycr{}\let\\=\cr \tabskip=\z@ \offinterlineskip
+ \halign{\entry@##!@&&\entry@@##!@\cr#1\crcr}%
+ \xy@@{\leave@}}}%
+ \finishq@ \expandafter\xy@@\expandafter{\the\queue@}\global\queue@={}}
+\DOCMODE)
+
+ Here are the template execution macros: We reset the |\queue@| for
+ each entry, |\drop| it the usual way except first all \Xy-commands
+ are `redirected' to the queue, and then typeset them.
+
+\DOCMODE(
+\xydef@\entry@{\relax \global\advance\Row\@ne \global\Col=\z@ \entry@@}
+\DOCMODE)
+
+ Again some parsing determines whether this is a |*|-object or a
+ normal object:
+
+\DOCMODE(
+\xydef@\entry@@{\global\advance\Col\@ne
+ \DN@##1,##2,##3@{\xy@{ENTRY "##3##1,##2"}{\Row=##1 \Col=##2\relax
+ \cfromid@{##3##1,##2}\pfromc@}}%
+ \edef\nextii@{\the\Row,\the\Col,\xymatrixprefix@@ @}%
+ \expandafter\next@\nextii@
+ \xyFN@\entry@@i}
+
+\xydef@\entry@@i{\let\next@=\entry@@norm
+ \ifoldxymatrix@\else \ifx *\next \DN@*{\xyFN@\entry@@star}\fi \fi
+ \next@}
+
+\xydef@\entry@@star{\ifx *\next \DN@*{\xyFN@\entry@@star@ii}%
+ \else \DN@##1##{\entry@@star@i{##1}}\fi \next@}
+
+\xydef@\entry@@star@i#1#2#3!@{%
+ \xy@@ix@{{#1}{#2}}\xy@@{\expandafter\dropentry@\the\toks9}%
+ \setboxz@h{\xyqall@
+ \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
+ \let\COORD@=\xymatrixCOORD@ \everyentry@ #3}%
+ \setbox\z@=\copy\voidb@x}
+
+\xydef@\entry@@star@ii{%
+ \ifx [\next
+ \DN@[##1]{\DN@####1{\def\entrymodifiers@{[##1]####1}}%
+ \expandafter\next@\expandafter{\entrymodifiers@}\entry@@norm}%]
+ \else
+ \DN@##1{\DN@####1{\def\entrymodifiers@{##1####1}}%
+ \expandafter\next@\expandafter{\entrymodifiers@}\entry@@norm}%
+ \fi \next@}
+
+\xydef@\entry@@norm#1!@{%
+ \DN@##1{\expandafter\xy@@ix@
+ \expandafter{\expandafter{\entrymodifiers@}{##1}}}%
+ \expandafter\next@\expandafter{\everyentry@#1}%
+ \xy@@{\expandafter\dropentry@\the\toks9}%
+ \setbox\z@=\expandafter\object\entrymodifiers@{\xyqall@
+ \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
+ \let\COORD@=\xymatrixCOORD@ \everyentry@ #1}%
+ \setbox\z@=\copy\voidb@x}
+\DOCMODE)
+
+ Dropping the entry is just retypesetting it at the right location
+ again ignoring the \Xy-stuff:
+
+\DOCMODE(
+\xydef@\dropentry@#1#2{\drop@{#1}{\xyeatall@
+ \ifx\xymatrixsavedCOORD@\relax \let\xymatrixsavedCOORD@=\COORD@ \fi
+ \let\COORD@=\xymatrixCOORD@ #2}}
+\DOCMODE)
+
+ The macros used for queuing are these; only the toks9 replacement is
+ tricky; furthermore queueing is "not" done if we are saving because
+ the effect will give the same result without risk of extremely long
+ lines in the compiled file!
+
+\DOCMODE(
+\xydef@\xyqall@{%
+ \ifxysaving@ \let\xy@=\xyqs@ \let\xy@@ix@=\xysave@@toksix@
+ \else \let\xy@=\xyq@ \let\xy@@ix@=\xyq@@toksix@ \fi
+ \change@oxy@\xy@}
+
+\xydef@\xyq@#1#2{\addq@{#2}}
+
+\xydef@\xyq@@toksix@{\begingroup
+ \xyuncatcodes \afterassignment\xyq@@toksix@i \global\toks9=}
+
+\xydef@\xyq@@toksix@i{%
+ \DN@##1{\endgroup \xy@@{\global\toks9={##1}}}%
+ \expandafter\next@\expandafter{\the\toks9}}
+
+\xydef@\xyqs@{\global\advance\matrixsize@\@ne \xysave@}
+\DOCMODE)
+
+\paragraph*{Insert:}
+
+ Finally we insert the matrix in the \Xy-picture logically by ensuring
+ that it has the right size
+
+\DOCMODE(
+\xydef@\xymatrix@insert{%
+ \xy@@{\edef\nextii@{{\xy@minX@@}{\xy@maxX@@}{\xy@minY@@}{\xy@maxY@@}}%
+ \expandafter\xymatrix@insert@\nextii@}}
+
+\xydef@\xymatrix@insert@#1#2#3#4{\matrixorigin@
+ \L@c=+\X@c \advance\L@c-#1\relax
+ \R@c=-\X@c \advance\R@c+#2\relax
+ \D@c=+\Y@c \advance\D@c-#3\relax
+ \U@c=-\Y@c \advance\U@c+#4\relax
+ \Edge@c={\rectangleEdge}}
+\DOCMODE)
+
+ \TODO: Should handle other forms than reference point at center
+ of~|"1,1"| as hardcoded here. In particular reference point at
+ baseline of |"1,1"| would be useful\dots
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{New coordinate formats}
+??=[coord]
+%
+ It is possible within entries to refer to all the entries of the
+ \Xy-matrix using the following special <coord>inate forms:
+%
+\begin{defs}
+%
+ {}\kern-10pt|"|$r$|,|$c$|"|\kern5pt
+ & Position and extents of entry in row $r$, column $c$ (top left is
+ |"1,1"|)
+\cr
+ {}\kern-15pt|[|$\Delta r$|,|$\Delta c$|]|\kern10pt
+ & $\Delta r$ rows below, $\Delta c$ columns right of current entry
+\cr
+ {}\kern-15pt|[| <hop>\star\ |]|\kern10pt
+ & entry reached by <hop>s; each <hop> is one of |dulr| describing
+ one `move' to a neighbor entry
+\cr
+ {}\kern-15pt|[| <hop>\plus\ <place>\ |]|
+ & <place> on straight line to "non-empty" |[|<hop>\star|]|
+\cr
+\end{defs}
+\noindent\unskip
+%
+ So the current entry has the synonyms |[0,0]|, |[]|, |[rl]|, |[ud]|,
+ |[dudu]|, etc., as well as its `absolute' name |"|$r$|,|$c$|"|.
+
+ These forms are useful for defining diagrams where the entries are
+ related, \eg,
+%
+\begin{code}
+$$\xy
+\xymatrix{
+ A \POS[];[d]**\dir{~},
+ [];[dr]**\dir{-} \\
+ B & C \POS[];[l]**\dir{.} }
+\endxy$$
+\end{code}
+\docode
+%
+ was typeset by
+%
+\displaycode
+%
+ If an entry outside the \Xy-matrix is referenced then an error is
+ reported.
+
+ In case several matrices are used in the same diagram, and they refer
+ to each other, then it is useful to give the matrices different
+ |"|<prefix>|"| <setup> such that they can refer to each other using
+ the following special coordinate forms that all have the same meaning
+ except the target entry is picked from a particular matrix:
+%
+\begin{defs1}
+ |"|<prefix>$r$|,|$c$|"| \cr
+ |["|<prefix>|"|$\Delta r$|,|$\Delta c$|]| \cr
+ |["|<prefix>|"| <hop>\star\ |]| \cr
+ |["|<prefix>|"| <hop>\plus\ <place>\ |]| \cr
+\end{defs1}
+\noindent\unskip
+%
+ In fact absolute references "must" always be given using
+ |"|<prefix><row>|,|<col>|"|, "even inside the matrix itself".
+
+ Here is an example using this:
+%
+\begin{code}
+\xy
+ \xymatrix"*"{%
+ A & B \\
+ C & D }%
+ \POS*\frm{--}
+ \POS-(10,3)
+ \xymatrix{%
+ A' \ar@{.}["*"] & B' \ar@{.}["*"] \\
+ C' \ar@{.}["*"] & D' \ar@{.}["*"] }%
+ \POS*\frm{--}
+\endxy
+\end{code}
+$$\docode$$
+%
+ was typeset (using the `frame' extension and `arrow' feature) by
+%
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ These handle the parsing and interpretation of bracketed
+ <coord>inates; the number is computed already at parse time:
+
+\DOCMODE(
+\xylet@\thematrixCOORD@@=\relax
+\xylet@\thematrixprefix@@=\relax
+
+\xydef@\xymatrixCOORD@{%
+ \ifx [\next %]
+ \DN@[##1]{\xy@{[##1]}{\def\thematrixCOORD@@{[##1]}}%
+ \xyFN@\xymatrixCOORD@i##1]}%
+ \else \let\next@=\xymatrixsavedCOORD@ \fi \next@}
+
+\xydef@\xymatrixCOORD@i{\count@=\Row \count@@=\Col
+ \let\thematrixprefix@@=\xymatrixprefix@@
+ \ifcat A\noexpand\next
+ \DN@##1{\expandafter\notrelaxorelse@\csname xymatrixCOORD@i@##1\endcsname
+ \xymatrixCOORD@other}%[[
+ \else\ifx ]\next \DN@]{\xymatrixCOORD@x}%
+ \else\ifx "\next \DN@"##1"{\DN@{##1}\edef\thematrixprefix@@{\codeof\next@}%
+ \xyFN@\xymatrixCOORD@ii}%
+ \else \let\next@=\xymatrixCOORD@other \fi\fi\fi \next@}
+
+\xydef@\xymatrixCOORD@i@u{\advance\count@ \m@ne\xyFN@\xymatrixCOORD@ii}
+\xydef@\xymatrixCOORD@i@d{\advance\count@ \@ne \xyFN@\xymatrixCOORD@ii}
+\xydef@\xymatrixCOORD@i@l{\advance\count@@\m@ne\xyFN@\xymatrixCOORD@ii}
+\xydef@\xymatrixCOORD@i@r{\advance\count@@\@ne \xyFN@\xymatrixCOORD@ii}
+
+\xydef@\xymatrixCOORD@ii{%
+ \ifcat A\noexpand\next
+ \DN@##1{\expandafter\notrelaxorelse@\csname xymatrixCOORD@i@##1\endcsname
+ \xymatrixCOORD@error}%
+ \else\ifx ]\next \DN@]{\xymatrixCOORD@x}%
+ \else \let\next@=\xymatrixCOORD@xx \fi\fi \next@}
+
+\xydef@\xymatrixCOORD@error#1{\DN@{#1}%
+ \xyerror@{illegal <coord> (\codeof\next@): illegal [...] target form}{}%
+ \xyFN@\xymatrixCOORD@ii}
+
+\xydef@\xymatrixCOORD@other#1,#2]{%
+ \advance\count@#1\advance\count@@#2\xymatrixCOORD@x}
+\DOCMODE)
+
+ The next does the actual lookup at \Xy-time where we can still print
+ an error message using the saved original form.
+
+\DOCMODE(
+\xydef@\xymatrixCOORD@x{%
+ \DN@##1{\xy@@{%
+ \expandafter\let\expandafter\next@\csname Q@##1\endcsname
+ \ifx\next@\relax \xyerror@RC{##1}\else \next@ \fi}%
+ \afterCOORD@}%
+ \edef\nextii@{{\thematrixprefix@@\the\count@,\the\count@@}}%
+ \expandafter\next@\nextii@}
+
+\xydef@\xymatrixCOORD@xx{%
+ \DN@##1{\xy@@{%
+ \expandafter\let\expandafter\next@\csname Q@##1\endcsname
+ \ifx\next@\relax \xyerror@RC{##1}\else \next@\no@@ \fi}%
+ \afterPLACE\xymatrixCOORD@after}%
+ \edef\nextii@{{\thematrixprefix@@\the\count@,\the\count@@}}%
+ \expandafter\next@\nextii@}
+
+\xydef@\xymatrixCOORD@after{%
+ \ifx ]\next \DN@]{\afterCOORD@}%
+ \else \let\next@=\xymatrixCOORD@error \fi \next@}
+
+\xydef@\xyerror@RC#1{\xyerror@{in entry \string"\the\Row,\the\Col\string":
+ No \codeof\thematrixCOORD@@\space(is \string"#1\string") from here}{}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Spacing and rotation}
+??=[spacing]
+%
+ Any matrix can have its ??w![spacing]??w[matrix spacing] and
+ ??w![orientation]??w[matrix orientation] changed by adding <setup>
+ `switches' between |\xymatrix| and the opening |{|.
+
+ The default spacing between entries of matrix is changed with the
+ switches
+%
+\begin{defs1}
+ ??c![@R]<add~op> <dimen> \cr
+ ??c![@C]<add~op> <dimen> \cr
+ ??c![@] <add~op> <dimen> \cr
+\end{defs1}
+\noindent\unskip
+%
+ that change ??w![row spacing], ??w![column spacing], and both,
+ respectively, as indicated by the <add~op> and <dimen>, where the
+ <dimen> may be omitted and can be given as one of |R| and |C| to
+ indicate the current value of the parameter in question. \NOTE: there
+ is "no default".
+
+ In addition, \Xy-pic can be instructed to use a `??w![fixed grid]'
+ for the matrix with the switches
+%
+\begin{defs1}
+ ??c![@!R] \cr
+ ??c![@!C] \cr
+ ??c![@!]
+\end{defs1}
+\noindent\unskip
+%
+ that ensure that the row spacing, column spacing, and both,
+ respectively, pretending that "all" entries have the size of the
+ largest entry (without modifying the real size of the entries, of
+ course, only the spacing -- to get the entries to "really" have the
+ same size use a |@*|\dots\ <setup> described in \S??[entries]
+ below). The special variants
+%
+\begin{defs1}
+ ??c![@!0] \cr
+ ??c![@!=]<dimen>
+\end{defs1}
+\noindent\unskip
+%
+ pretend that entries have zero or <dimen> height and width for
+ computing row and column spacing; as above inserting |R| or |C| just
+ after the |!| makes this affect only the row "or" column spacing,
+ \eg, |@!R0| means that the row spacing only is between the centers of
+ the rows.
+
+ Finally, the spacing of things that are typeset can be adjusted
+ separately:
+%
+\begin{defs1}
+ ??c![@M]<add~op> <dimen> \cr
+ ??c![@W]<add~op> <dimen> \cr
+ ??c![@H]<add~op> <dimen> \cr
+ ??c![@L]<add~op> <dimen>
+\end{defs1}
+\noindent\unskip
+%
+ will adjust the ??w![entry margin], ??w![entry width], ??w![entry
+ height], and ??w![label separation] used (the latter is actually
+ passed to the arrow feature).
+
+\DOCMODE(
+\xylet@\xymatrix@addop@@=\relax
+
+\xydef@\xymatrix@at{\def\xymatrix@addop@@{\xymatrix@R\xymatrix@C}%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@at}%gobble spaces
+ \else\ifx !\next \DN@!{\xyFN@\xymatrix@fix}%
+ \else\addPLUS@\ifx \next \let\next@=\xymatrix@addop
+ \else\addDASH@\ifx \next \let\next@=\xymatrix@addop
+ \else\addEQ@\ifx \next \let\next@=\xymatrix@addop
+ \else\ifx 1\next \DN@1{\def\everyentry@{\vphantom(}%)
+ \let\objectmargin@=\p@ \xyFN@\xymatrix@setup}%
+ \else\ifx R\next \def\xymatrix@addop@@{\xymatrix@R}\DN@ R{\xymatrix@addop}%
+ \else\ifx C\next \def\xymatrix@addop@@{\xymatrix@C}\DN@ C{\xymatrix@addop}%
+ \else\ifx M\next \def\xymatrix@addop@@{\xymatrix@M}\DN@ M{\xymatrix@addop}%
+ \else\ifx L\next \def\xymatrix@addop@@{\xymatrix@L}\DN@ L{\xymatrix@addop}%
+ \else\ifx H\next \def\xymatrix@addop@@{\xymatrix@H}\DN@ H{\xymatrix@addop}%
+ \else\ifx W\next \def\xymatrix@addop@@{\xymatrix@W}\DN@ W{\xymatrix@addop}%
+ \else\ifx *\next \DN@*{\xyFN@\xymatrix@mods}%
+ \else \DN@{\afterDIRECTIONorEMPTY
+ {\xymatrix@rotation \xyFN@\xymatrix@setup}{%
+ \xyerror@{<addop> or <direction> or one of RCMLHW*! expected}{}%
+ \xyFN@\xymatrix@setup}}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\xymatrix@fix{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@fix}%gobble spaces
+ \else\ifx R\next \let\mkHrow@=\Hrow@max \DN@ R{\xyFN@\xymatrix@fix@}%
+ \else\ifx C\next \let\mkWcol@=\Wcol@max \DN@ C{\xyFN@\xymatrix@fix@}%
+ \else \let\mkHrow@=\Hrow@HWmax \let\mkWcol@=\Wcol@HWmax
+ \let\next@=\xymatrix@fix@
+ \fi\fi\fi \next@}
+
+\xydef@\xymatrix@fix@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@fix@}%gobble spaces
+ \else\ifx 0\next \def\mkHWmax@{\HWmax@set\z@}\DN@ 0{\xyFN@\xymatrix@setup}%
+ \else\addEQ@\ifx\next \addEQ@\DN@{\afterassignment\xymatrix@fix@x\dimen@ii=}%
+ \else \let\mkHWmax@=\HWmax@max \let\next@=\xymatrix@setup \fi\fi\fi \next@}
+
+\xydef@\xymatrix@fix@x{%
+ \edef\mkHWmax@{\noexpand\HWmax@set{\the\dimen@ii}}\xyFN@\xymatrix@setup}
+
+\xydef@\xymatrix@addop{\afterADDOP{\xyFN@\xymatrix@addop@}}
+\xydef@\xymatrix@addop@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@addop@}%gobble spaces
+ \else\ifx R\next \DN@ R{\xy@{R}{}\dimen@ii=\xymatrixrowsep@\xymatrix@addop@x}%
+ \else\ifx C\next \DN@ C{\xy@{C}{}\dimen@ii=\xymatrixcolsep@\xymatrix@addop@x}%
+ \else \DN@{\afterassignment\xymatrix@addop@x\dimen@ii=}\fi\fi\fi \next@}
+
+\xydef@\xymatrix@addop@x{\expandafter\xy@\expandafter{\the\dimen@ii}{}%
+ \xymatrix@addop@@ \xyFN@\xymatrix@setup}
+
+\xydef@\xymatrix@R{\Addop@@\xymatrixrowsep@\dimen@ii}
+\xydef@\xymatrix@C{\Addop@@\xymatrixcolsep@\dimen@ii}
+
+\xydef@\xymatrix@M{\Addop@@\objectmargin@\dimen@ii}
+\xydef@\xymatrix@L{\Addop@@\labelmargin@\dimen@ii}
+
+\xydef@\xymatrix@H{\Addop@@\objectheight@\dimen@ii}
+\xydef@\xymatrix@W{\Addop@@\objectwidth@\dimen@ii}
+\DOCMODE)
+
+ The spacing can also be changed for en entire \TeX\ group by the
+ declarations
+%
+\begin{defs1}
+ |\xymatrixrowsep| <add~op> |{|<dimen>|}| \cr
+ |\xymatrixcolsep| <add~op> |{|<dimen>|}| \cr
+\end{defs1}
+\noindent\unskip
+%
+ The default spacing for both is |2pc|.
+
+\DOCMODE(
+\xydef@\xymatrixrowsep@{2pc}
+\xydef@\xymatrixcolsep@{2pc}
+
+\xydef@\xymatrixrowsep{\afterADDOP{\Addop@@\xymatrixrowsep@}}
+\xydef@\xymatrixcolsep{\afterADDOP{\Addop@@\xymatrixcolsep@}}
+\DOCMODE)
+%
+ \TODO: optimize processing of matrices with constant grid.
+
+ An entire matrix can be rotated by adding a rotation <setup> of the
+ form
+%
+\begin{defs1}
+ |@|<direction> \cr
+\end{defs1}
+\noindent\unskip
+%
+ This will set the orientation of the rows to <direction> (the default
+ corresponds to |r|, \ie, rows are oriented left to right).
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The code is the first procedure of the main matrix code above
+ (??_[rotation]); factors are used by |\pre@emit|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Entries}
+??=[entries]
+%
+ The appearance of a single entry can be modified by entering it as
+%
+\begin{defs1}
+??c![*] <object> <pos> <decor>
+\end{defs1}
+\noindent\unskip
+%
+ This makes the particular entry ignore the entry modifiers and
+ typeset as a kernel object with the same reference point as the
+ (center of) the default object would have had.
+
+ Additional object <modifier>s may be added to an otherwise ordinary
+ entry by using the forms
+%
+\begin{defs1}
+??c![**]|[|<shape>|]| <entry> \cr
+%|**| <add~op> <size> \cr
+|**{|<modifier>*|}| <entry> \cr
+\end{defs1}
+\noindent\unskip
+%
+ The first sets the default <shape> for objects
+ (\cf~note~??g[xy.doc:<shape>]), the second a default size (change,
+ \cf~note~??g[xy.doc:<object> size]), and the last makes it possible
+ to add any <object> modifier of~\S??g[xy.doc:object], \eg, for
+ recentering entries after the ??w![default entry] form which is
+ equivalent to `|!C| |+<|$2\times"object"\-"margin"$|>|' (with the
+ effect of centering the object and add the "object"\-"margin") to all
+ sides.
+
+\begin{exercise}
+ Typeset the following diagram:
+%
+\begin{code}
+\xymatrix @!=1pc {
+ **[l] A\times B
+ \ar[r]^{/A} \ar[d]_{/B}
+ & B \ar[d]^{\times A}
+\\
+ A \ar[r]_{B\times}
+ & **[r] B\times A
+}
+\end{code}
+$$\docode$$
+%
+\answercode
+\answertext{The author did \displaycode}
+\end{exercise}
+
+ It is also possible to use these |@|<setup>s (as usual between
+ |\xymatrix| and the leading |{|):
+%
+\begin{defs1}
+??c![@*]|[|<shape>|]| \cr
+|@*| <add~op> <size> \cr
+\end{defs1}
+\noindent\unskip
+%
+ which are equivalent to changing all entries to behave as if they had
+ started with the similar |**|-form. \TODO: Allow |**|<add~op><size>
+ <entry> for entries.
+
+ If the default set of entry modifiers should be changed then the
+ following declaration must be issued before the |\xymatrix| command;
+ this is the only way to actually switch the initial default centering
+ and spacing off:
+%
+\begin{defs1}
+??c![\entrymodifiers]|={| <modifier>\star\ |}|
+\end{defs1}
+
+\begin{exercise}
+ How did the author typeset the following matrix?
+%
+\begin{code}
+\entrymodifiers={=<1pc>[o][F-]}
+\xymatrix @ur {
+ A \save[];[r] **\dir{-},
+ [];[dr]**\dir{-},
+ [];[d] **\dir{-}\restore
+ & B \\
+ C & D }
+\end{code}
+$$\docode$$
+%
+\answercode
+\answertext{Modifiers are used to make all entries round with a frame -- the
+ general form is used to ensure that the sequence is well-defined.
+ Finally the matrix is rotated to make it possible to enter it as a
+ simple square: \displaycode}
+\end{exercise}
+
+ \BUG: The four constructions |@*[|\dots|]|, |**[|\dots|]|, |@*|
+ <add~op> <size>, and, |**{|\dots|}|, "accumulate in reverse order".
+ Only entries starting with a single |*| completely override the
+ modifiers <setup> with a |@*|-construction.
+
+\DOCMODE(
+\xydef@\xymatrix@mods{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xymatrix@mods}%gobble spaces
+ \else\ifx [\next
+ \DN@ [##1]{\xy@{[##1]}{}\DN@####1{\def\entrymodifiers@{[##1]####1}}%
+ \expandafter\next@\expandafter{\entrymodifiers@}\xyFN@\xymatrix@setup}%]
+ \else\addPLUS@\ifx \next \DN@##1{\DNii@{##1}\xyFN@\xymatrix@change}%
+ \else\addDASH@\ifx \next \DN@##1{\DNii@{##1}\xyFN@\xymatrix@change}%
+ \else\addEQ@\ifx \next \DN@##1{\DNii@{##1}\xymatrix@set}%
+ \else \let\next@=\xymatrix@mods@error \fi\fi\fi\fi\fi \next@}
+
+\xydef@\xymatrix@set{%
+ \begingroup \plainxy@
+ \afterVECTORorEMPTY\xymatrix@mods@x\xymatrix@mods@error}
+
+\xydef@\xymatrix@change{%
+ \addEQ@\ifx\next \DN@##1{\expandafter\DNii@\expandafter{\nextii@##1}%
+ \expandafter\xy@\expandafter{\nextii@}{}\begingroup \plainxy@
+ \afterVECTORorEMPTY\xymatrix@mods@x\xymatrix@mods@xx}%
+ \else \DN@{\expandafter\xy@\expandafter{\nextii@}{}\begingroup \plainxy@
+ \afterVECTORorEMPTY\xymatrix@mods@x\xymatrix@mods@xx}\fi
+ \next@}
+
+\xydef@\xymatrix@mods@x{\expandafter\xy@\expandafter{\nextii@}{}%
+ \def\next@##1##2##3{\def\nextii@####1{##1##2####1##3}}%
+ \addGT@{\addLT@{\expandafter\next@\expandafter{\nextii@}}}%
+ \DN@##1{\gdef\tmp@@@{{##1}}}%
+ \edef\nextiii@{{\the\X@c,\the\Y@c}}%
+ \expandafter\expandafter\expandafter\next@
+ \expandafter\expandafter\expandafter{\expandafter\nextii@\nextiii@}%
+ \endgroup
+ \DN@##1{\xy@{##1}{}\DN@####1{\def\entrymodifiers@{##1####1}}%
+ \expandafter\next@\expandafter{\entrymodifiers@}\xyFN@\xymatrix@setup}%
+ \expandafter\next@\tmp@@@}
+
+\xydef@\xymatrix@mods@xx{\expandafter\xy@\expandafter{\nextii@}{}%
+ \expandafter\gdef\expandafter\tmp@@@\expandafter{\expandafter{\nextii@}}%
+ \endgroup
+ \DN@##1{\xy@{##1}{}\DN@####1{\def\entrymodifiers@{##1####1}}%
+ \expandafter\next@\expandafter{\entrymodifiers@}\xyFN@\xymatrix@setup}%
+ \expandafter\next@\tmp@@@}
+
+\xydef@\xymatrix@mods@error{\endgroup
+ \xyerror@{Impossible @*<addop><size> <setup>.}{}\xyFN@\xymatrix@setup}
+
+\xywarnifdefined\entrymodifiers
+\expandafter\def\addEQ@\entrymodifiers#1{\def\entrymodifiers@{#1}\ignorespaces}
+
+\xydef@\entrymodifiers@{\entrybox}
+
+\xydef@\entrybox#1{\hbox{\setbox\z@=\objectbox{#1}%
+ \L@p=\wdz@ \D@p=\ht\z@ \advance\D@p\dp\z@
+ \dimen@=\objectwidth@ \advance\dimen@-\L@p
+ \ifdim\dimen@>\z@ \advance\L@p\dimen@ \R@p=.5\dimen@ \else \R@p=\z@ \fi
+ \dimen@=\objectheight@ \advance\dimen@-\D@p
+ \ifdim\dimen@>\z@ \advance\D@p\dimen@ \fi
+ \dimen@=\objectmargin@ \advance\L@p2\dimen@ \advance\D@p2\dimen@
+ \U@p=-.5\ht\z@ \advance\U@p.5\dp\z@ \advance\R@p\objectmargin@
+ \setboxz@h{\kern\R@p \raise\U@p\boxz@}%
+ \wdz@=\L@p \ht\z@=.5\D@p \dp\z@=.5\D@p \boxz@}}
+\DOCMODE)
+
+ Finally, the following is specially suited for `one-line' matrices
+ included in text:
+%
+\begin{defs1}
+??c![@1] \cr
+\end{defs1}
+\noindent\unskip
+%
+ will insert a `math strut' (|\vphantom(|) into each entry to make its
+ centering appropriate for text.
+
+ This is just an abbreviation using the following declaration which
+ will setup <decor> that should be inserted before everything else in
+ each entry. Initially it is empty but
+%
+\begin{defs1}
+??c![\everyentry]|={| <decor> |}|
+\end{defs1}
+\noindent\unskip
+%
+ will insert <decor> first in each entry; inside the counter registers
+ ??c![\Row] and ??c![\Col] are set to the current entry's row and
+ column, respectively. For example,
+%
+\begin{code}
+\everyentry={{\the\Row,\the\Col}}
+\xymatrix @*[F]@*[o] {
+ {} \POS[];[r]**\dir{..} & \\
+ {} \POS[];[ur]**\dir{--}
+}
+\end{code}
+\displaycode
+\noindent\unskip
+%
+ will typeset
+%
+$$\docode$$
+
+\DOCMODE(
+\xywarnifdefined\everyentry
+\expandafter\def\addEQ@\everyentry#1{\def\everyentry@{#1}\ignorespaces}
+
+\xylet@\everyentry@=\empty
+\DOCMODE)
+
+ \noindent\NOTE: When using compilation, changes to |\everyentry| and
+ |\entrymodifiers| will "not" result in recompilation even when the
+ constructed matrix changes -- you may have to remove the |.xyc| file
+ manually.
+
+\begin{exercise}
+ How did the author typeset the following diagram?
+%
+\begin{code}
+\xymatrix @W=3pc @H=1pc @R=0pc @*[F-] {%
+ : \save+<-4pc,1pc>*\hbox{\it root}
+ \ar[]
+ \restore
+\\
+ {\bullet}
+ \save*{}
+ \ar`r[dd]+/r4pc/`[dd][dd]
+ \restore
+\\
+ {\bullet}
+ \save*{}
+ \ar`r[d]+/r3pc/`[d]+/d2pc/
+ `[uu]+/l3pc/`[uu][uu]
+ \restore
+\\
+ 1 }
+\end{code}
+$$\docode$$
+%
+ "Hints": The arrow feature was used to make the bending arrows and
+ the frame extension for the frames around each cell.
+%
+\answercode
+\answertext{Here is how: \displaycode}
+\end{exercise}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection*{End \& log}
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xymatrix.doc,v $
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/06 02:56:02 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% Revision 2.9 1994/06/09 15:02:49 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% NEW for version 2.7 extracted from diagram code in xypic.doc 2.6.1.1.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs how we are formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% LaTeX-indent-level:1
+% TeX-brace-indent-level:1
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xymovie.doc b/Master/texmf-dist/source/generic/xypic/xymovie.doc
new file mode 100644
index 00000000000..a2b891243d4
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xymovie.doc
@@ -0,0 +1,161 @@
+%% $Id: xymovie.doc,v 3.5 1997/05/28 13:05:01 krisrose Exp $
+%%
+%% Xy-pic ``Movie Storyboard extension'' option.
+%% Copyright (c) 1996-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{movie}{Movie Storyboard extension}{\stripRCS$Revision: 3.5 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This extension interprets the ??c![\scene] primitive of the
+ ??c![movie] class, setting the progress indicators to dummy values.
+ The following assumes that your are familiar with the |movie| class.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The size of the frame is determined by the command
+%
+\begin{defs1}
+??c![\MovieSetup]|{width=|"width"|,height=|"height"|,|\dots|}|
+\end{defs1}
+\noindent\unskip
+%
+ (the \dots\ indicate the other arguments required by the |movie|
+ class but silently ignored by the \Xy-pic |movie| extension).
+
+ \NOTE: This extension still experimental and subject to change. The
+ only documentation is in the |movie.cls| source file.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The implementation mimics the aspects of the |keyval| package needed
+ here, namely reading the ??c![height] and ??c![width] parameters.
+
+\DOCMODE(
+\xynew@{dimen}\m@height
+\xynew@{dimen}\m@width
+
+\xydef@\extractparameterm@#1#2#3{%
+ \DN@##1,#1=##2,##3@{\csname m@#1\endcsname=##2\relax}%
+ \next@,#2,#3,@}
+
+\xydef@\MovieSetup#1{%
+ \extractparameterm@{height}{#1}{height=2in}%
+ \extractparameterm@{width}{#1}{width=2in}%
+}
+\DOCMODE)
+
+ The progress macros all default to
+
+\DOCMODE(
+\xydef@\theScene{0}
+\xydef@\theF{0}
+\xydef@\theFr{1}
+\xydef@\F#1{#1(0)}
+\xydef@\Fr#1{#1(1)}
+\DOCMODE)
+
+ We need to interpret and ignore the arguments to |\scene| except the
+ |*| which is used on the last scene since this means that we should
+ output the scene with progress values corresponding to ``The End''.
+
+\DOCMODE(
+\xynew@{if}\iflastframe@
+\xynew@{count}\m@scene
+
+\xydef@\scene{\advance\m@scene\@ne
+ \DN@{\ifx*\next \lastframe@true \DN@*{\xyFN@\scene@}%
+ \else \let\next@=\scene@ \fi \next@}%
+ \xyFN@\next@}
+
+\xydef@\scene@{%
+ \ifx[\next \DN@[##1]{\scene@i}\else \let\next@=\scene@i \fi \next@}
+
+\long\def\scene@i#1{{%
+%
+ \def\caption##1{\gdef\m@caption{Scene \the\m@scene. ##1}}%
+ \edef\theScene{\the\m@scene}%
+ \def\theF{0}\def\theFr{1}%
+ \def\F##1{##1(0)}\def\Fr##1{##1(1)}%
+ \scene@frame{#1}%
+%
+ \iflastframe@
+ \def\caption##1{}%
+ \gdef\m@caption{The End.}%
+ \def\theF{1}\def\theFr{0}%
+ \def\F##1{##1(1)}\def\Fr##1{##1(0)}%
+ \scene@frame{#1}%
+ \fi
+ }\ignorespaces}
+
+\def\scene@frame#1{\vbox{\null
+ \dimen@=\m@width \advance\dimen@2\xydashw@
+ \hrule width\dimen@
+ \hbox to\dimen@{\vrule width\xydashw@ \hss
+ \vbox to\m@height{\hsize=\m@width \null\vfil{#1}\vfil\null}%
+ \hss \vrule width\xydashw@}%
+ \hrule width\dimen@
+ \setbox0=\hbox{%
+ \setbox0=\hbox to\m@width{\hss\strut \m@caption\hss}%
+ \dimen0=\dp0 \ht0=0pt \dp0=0pt \raise\dimen0\box0}%
+ \ht0=0pt \dp0=0pt \box0\relax
+ \null}}
+\DOCMODE)
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xymovie.doc,v $
+% Revision 3.5 1997/05/28 13:05:01 krisrose
+% Fixed missing breaks bug.
+%
+% Revision 3.4 1997/05/18 02:37:17 krisrose
+% Fits movie.cls 3.4...still experimental.
+%
+% Revision 1.1 1997/05/18 01:22:10 krisrose
+% Initial revision
+%
+% NEW for version 3.4.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs how we are formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% TeX-parse-self:nil
+% LaTeX-indent-level:1
+% TeX-brace-indent-level:1
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xynecula.doc b/Master/texmf-dist/source/generic/xypic/xynecula.doc
new file mode 100644
index 00000000000..2185441aa29
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xynecula.doc
@@ -0,0 +1,594 @@
+%% $Id$
+%%
+%% Xy-pic ``Necula extensions'' option.
+%% Copyright (c) 1998 George C. Necula <necula@cs.cmu.edu>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1998 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{necula}{Necula's extensions}{\stripRCS$Revision: 0.0 $}%
+ {George C. Necula}{necula@cs.cmu.edu}%
+ {School of Computer Science,
+ Carnegie Mellon University,
+ 5000 Forbes Avenue,
+ Pittsburgh, PA 15213-3891, USA}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This option contains two extensions of the \Xy-pic kernel: A way to
+ expand \TeX\ macros in object <modifier>s, and a way to specify
+ arbitrary polygons as the <shape> of an object.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Expansion}
+
+ The special syntax ??c![e|]<macros>|||| is introduced in
+ an object ??w![<modifier>]s and ??w![<coord>]inates. It
+ expands the given \TeX\ <macros> (with |\edef|) before
+ reinterpretation as a <modifier> of <coord>, respectively.
+
+\DOCMODE(
+\def\expandbeforenext@#1{%
+ \DN@ e|##1|{\edef\tmp@{##1}\expandafter\xyFN@\expandafter#1\tmp@}%
+}
+
+\xylet@\xy@oldOBJECT@=\OBJECT@
+\xydef@\xy@newOBJECT@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xy@newOBJECT@}%gobble spaces
+ \else\ifx e\next
+ \expandbeforenext@\OBJECT@
+ \else
+ \DN@{\xy@oldOBJECT@}\fi\fi
+ \next@}%
+\let\OBJECT@=\xy@newOBJECT@
+
+\xylet@\xy@oldCOORD@=\COORD@
+\xydef@\xy@newCOORD@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xy@newCOORD@}%gobble spaces
+ \else\ifx e\next
+ \expandbeforenext@\COORD@
+ \else
+ \DN@{\xy@oldCOORD@}\fi\fi
+ \next@}%
+\let\COORD@=\xy@newCOORD@
+\DOCMODE)
+
+ This code may become part of the \Xy-pic kernel at a certain point.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Polygon shapes}
+
+ A polygon <shape> is specified as
+%
+\begin{defs1}
+%
+ ??c![[P:]<pos>|,|\dots|,|<pos>|]|
+%
+\end{defs1}
+\noindent\unskip
+%
+ where |[P:|$p_1$|,|\dots|,|$p_n$|]| denotes the shape obtained by
+ tracking the edge with each $p_i$ a position relative to the object
+ reference point. <vector>s and <corner>s can be used
+ directly; otherwise use |-p| to get the relative position.
+
+ \NOTE: Do not use |{}| or |[]| in the <pos>itions.
+
+ \BUG: The algorithm assumes that the reference point is always inside
+ the polygon.
+
+ It is possible to frame polygons is also possible.
+
+\DOCMODE(
+% Define the polygon as a stylechar so that it is deferred
+\xydefcsname@{*stylechar@P@}#1{\Pshape@#1@}
+\xynew@{count}\c@poly@count \c@poly@count=\z@ % Polygon identifiers
+
+\xydef@\Pshape@:#1@{% Strip the mandatory :
+ \addtotoks@{%
+% \xy@showthe c{Before parse}\xy@showthe p{Before parse}%
+% \xy@showdim{Before parse}%
+ \def\poly@list{@}%
+ \poly@parse #1,\relax,%Sets the poly@list
+ \def\poly@cache{}%
+ \edef\poly@id{\the\c@poly@count}%
+ \global\advance\c@poly@count\@ne
+ \poly@setEdge
+ % Save the old values of Lc for shifting
+ \edef\poly@saveLcshape{\the\L@c}%
+ \polygonEdge@Outer% Set U,R,D,L
+ \poly@setEdge
+ % Now shift the object to keep it centered
+ \dimen@=\poly@saveLcshape\advance\dimen@-\L@c
+ \advance\R@p -\dimen@
+% \xy@showthe c{After parse}%
+}}
+
+% Set the edge
+% A polygonal edge is represented as \polygonEdge x1,y1;x2,y2;...;xn,yn@id@
+% where xi,yi define the vertices of the polygonal edge as displacement from
+% the object reference point (xn=x1,yn=y1), and id is a numerical id used for
+% caching the result of the last intersection operation. The cached values for
+% polygon id are stored in the global macro poly@cache<id>.
+\xydef@\poly@setEdge{\expandafter\poly@setEdge@\poly@list\poly@id}
+\xydef@\poly@setEdge@#1@#2{\Edge@c={\polygonEdge#1@#2@}%
+ \expandafter\xdef\csname poly@cache#2%
+ \endcsname{\poly@cache}}
+
+% Define the polygon framing operations
+\xydefcsname@{frm[P]{-}}{\expandafter\draw@polyframe\the\Edge@c{-}}
+\xydefcsname@{frm[P]{.}}{\expandafter\draw@polyframe\the\Edge@c{.}}
+\xydefcsname@{frm[P]{=}}{\expandafter\draw@polyframe\the\Edge@c{=}}
+
+
+\xydef@\draw@polyframe\polygonEdge#1@#2@#3{%
+ \def\poly@dir{#3}%
+ \def\poly@list{#1@}%
+ \def\poly@id{#2}%
+ \edef\poly@cache{\csname poly@cache\poly@id\endcsname}%
+ \draw@polygon}
+
+% A polygon is maintained as a list of relative positions, as follows:
+% poly@list = Xdimen_0,Ydimen_0;...;Xdimen_n,Ydimen_n @
+% The list is closed, i.e., the first and last element coincide
+% Each polygon has an id storred in \poly@id
+% Each polygon caches the result of the last intersection operation
+% as d@x,d@y,x1,y1,x2,y2 where the first two values define the slope
+% and the two sets of points are the two intersection points
+% These values are storred in \poly@cache<id>.
+%
+%
+% Helper function for dealing with polygon lists
+
+% Map over a polygon list. Make sure you define
+% \let\poly@map@next=\poly@map before. Then, you can define
+% \let\poly@map@next=\poly@map@stop if you want to stop the traversal
+
+\xydef@\poly@empty{}
+\xydef@\poly@map#1#2,#3;#4@{%
+ #1{#2}{#3}%
+ \def\tmp@{#4}%
+ \ifx \poly@empty\tmp@ \else
+ \poly@map@next#1#4@%
+ \fi
+}
+
+\xydef@\poly@map@stop#1@{}
+
+\xydef@\poly@mapExpand#1#2{%
+ \edef\tmp@{\noexpand\poly@map\noexpand #1#2}%
+ \tmp@}
+
+% Parse a polygon definition
+
+\xydef@\poly@parse #1,{%
+ \ifx #1\relax %Done. Copy the head of the list at its end
+ \poly@close
+ \let\next@=\relax
+ \else
+ % Save everything
+ \save@
+ % Process the position using POS
+ \POS #1%
+ % Now add the new c to the list
+ \edef\tmp@{{\the\X@c}{\the\Y@c}}%
+ \expandafter\poly@append\tmp@
+ \restore
+ \let\next@=\poly@parse % continue parsing
+ \fi
+ \next@
+}
+ % Append to the list of polygon points
+\xydef@\poly@append#1#2{\expandafter\poly@append@\poly@list{#1,#2;}}
+\xydef@\poly@append@#1@#2{\global\def\poly@list{#1#2@}}
+
+ % Close the polygon
+\xydef@\poly@close{\expandafter\poly@close@\poly@list}
+\xydef@\poly@close@#1,#2;#3@{\poly@append{#1}{#2}}
+
+% Draw a polygon at the current location
+
+\xydef@\draw@polygon{% First separate the head
+% \W@{Drawing polygon \poly@list}\xy@showthe c{ Centered at}%
+ \save@
+ % Set the origin to point at the reference point
+ \X@origin=\X@c \Y@origin=\Y@c
+ \poly@setp % Set p at the beginning of the polygon and set poly@rest
+ % Zero the edges
+ \U@c=\z@\R@c=\z@\D@c=\z@\L@c=\z@\U@p=\z@\R@p=\z@\D@p=\z@\L@p=\z@
+ \Edge@c={\zeroEdge}\Edge@p={\zeroEdge}%
+ \let\poly@map@next=\poly@map
+ \poly@mapExpand\poly@drawseg\poly@rest
+ \restore
+}
+
+ % Set p to the first element. Requires the origin to be
+ % at the reference point
+\xydef@\poly@setp{\expandafter\poly@setp@\poly@list}
+\xydef@\poly@setp@#1,#2;#3@{%
+ \X@p=#1\advance\X@p\X@origin \Y@p=#2\advance\Y@p\Y@origin%
+ \global\def\poly@rest{#3@}}
+
+\xydef@\poly@drawseg#1#2{%
+ \dimen@=#1\X@c=\the\dimen@\advance\X@c \X@origin
+ \dimen@=#2\Y@c=\the\dimen@\advance\Y@c \Y@origin
+% \W@{Next segment is at offset #1,#2 and absolute \the\X@c,\the\Y@c}%
+ \expandafter\connect@\expandafter\dir\poly@dir%
+ \X@p=\X@c\Y@p=\Y@c}
+
+% Polygonal edge
+% Requires c to be the reference point
+\xydef@\polygonEdge#1@#2@#3{%
+ \def\poly@list{#1@}%
+ \def\poly@id{#2}%
+ \edef\poly@cache{\csname poly@cache\poly@id\endcsname}%
+ \ifcase#3\relax
+ \DN@{\polygonEdge@Inters
+% \ifpoly@badinters
+% \xyerror@{Could not find intersection for polygon}\fi
+ }%0
+ \or \DN@{\polygonEdge@Under}%1
+ \or \DN@{\polygonEdge@Dist}%2
+ \or \DN@{\rectangleProp@}%3 I do not understand Prop!
+ \or \DN@{\polygonEdge@Inner}%4
+ \or \DN@{\polygonEdge@Outer}%5
+ \else \DN@{}\fi
+ \next@}
+
+
+\newif\ifpoly@badinters
+
+\xydef@\polygonEdge@Inters{%
+% \W@{Edge intersection with (\the\X@c, \the\Y@c) -> (\the\X@p,\the\Y@p)}%
+% \W@{ for polygon: \poly@id}%
+% \W@{ with list: \poly@list}%
+% \W@{ with cache: \poly@cache}%
+ % Check the cache first
+ \ifx\poly@cache\poly@empty
+ \poly@intersdoit
+ \else
+ \expandafter\poly@intersprobecache\poly@cache @%
+ \fi
+% \xy@showthe c{Inters res}%
+}
+
+%
+% Redefine poly@cachehit to poly@cachehitdisable to diable polygon caching
+\xydef@\poly@cachehit#1#2{%
+% \W@{ intersection point found in cache}%
+ \X@c=#1\Y@c=#2}
+
+\xydef@\poly@cachehitdisable#1#2{\poly@intersdoit}
+%\let\poly@cachehit=\poly@cachehitdiasable% Uncomment this line to disable $
+
+
+% Probes the cache
+%
+\xydef@\poly@intersprobecache#1,#2,#3,#4,#5@{%
+ \dimen@=#1\advance\dimen@-\d@X
+ \ifdim\zz@\dimen@
+ \dimen@=#2\advance\dimen@-\d@Y
+ \ifdim\zz@\dimen@
+ \poly@cachehit{#3}{#4}
+ \else
+ \poly@intersdoit
+ \fi
+ \else
+ \poly@intersdoit
+ \fi
+}
+
+
+% Computes the intersection between the line cp and the edge.
+% Both intersection points are stored in the cache, the one in the
+% direction towards p first.
+\xydef@\poly@intersdoit{%
+% \W@{ intersection not in cache. Computing it}%
+ % Save A@ and B@ because we cannot change them
+ \edef\polyoldA@{\the\A@}\edef\polyoldB@{\the\B@}%
+ % Initialize the intersection points
+ \def\poly@intersneg{}\def\poly@interspos{}%
+ \save@
+ \poly@setorigin % Set origin at the beginning of the polygon and
+ % set poly@rest
+ \def\zeroDivide@{\poly@badinterstrue}% Handle the division by zero except.
+ \let\poly@map@next=\poly@map
+ \poly@mapExpand\poly@interseg\poly@rest
+ \ifx\poly@intersneg\poly@empty
+ \poly@badinterstrue
+ \else
+ \ifx\poly@interspos\poly@empty
+ \poly@badinterstrue
+ \else
+ \poly@badintersfalse
+ \fi
+ \fi
+ \restore
+ \A@=\polyoldA@\B@=\polyoldB@ % Restore A@ and B@
+ \ifpoly@badinters \else
+ \edef\tmp@{\poly@interspos,\poly@intersneg @}%
+ \expandafter\poly@intersfinish\tmp@
+ \fi
+}
+
+\xydef@\poly@intersfinish#1,#2,#3@{%
+ \X@c=#1\Y@c=#2\relax
+ \xdef\poly@cache{\the\d@X,\the\d@Y,#1,#2,#3}%
+ \poly@setEdge
+}
+
+
+ % Set origin to the first point. Define poly@rest
+ % Requires c to be set to the reference point
+\xydef@\poly@setorigin{\expandafter\poly@setorigin@\poly@list}
+\xydef@\poly@setorigin@#1,#2;#3@{%
+ \X@origin=#1\advance\X@origin\X@c \Y@origin=#2\advance\Y@origin\Y@c%
+ \global\def\poly@rest{#3@}}
+
+
+
+
+%
+% Compute one intersection with a given edge
+% c is set to the reference point, p is set to the end of the ray
+% origin is set to the start of the segment
+\xydef@\poly@interseg#1#2{%
+ % Default is no intersection
+% \W@{ Intersection with edge (\the\X@origin,\the\Y@origin) -> (#1,#2)}%
+ % Compute the absolute values
+ \dimen@=#1\advance\dimen@\X@c \edef\poly@saveXcinters{\the\dimen@}%
+ \dimen@=#2\advance\dimen@\Y@c \edef\poly@saveYcinters{\the\dimen@}%
+ \save@
+ \poly@badintersfalse
+ % Set R@c and U@c to the distance to end of segment
+ \R@c=\poly@saveXcinters \advance\R@c -\X@origin
+ \U@c=\poly@saveYcinters \advance\U@c -\Y@origin
+ % Now call intersect to set X@c and Y@c to the intersection point
+ \intersect@
+ \A@=\X@c \B@=\Y@c % Save result
+ \restore
+ \ifpoly@badinters
+% \W@{ \space failed after intersect}%
+ \else
+% \W@{ \space after intersect@ (\the\A@,\the\B@)}%
+ % Verify that it is on the segment from origin to (#1, #2)
+
+\poly@isonseg\X@origin\Y@origin\A@\B@\poly@saveXcinters\poly@saveYcinters
+ \ifpoly@badinters
+% \W@{ \space failed after seg check}%
+ \else
+ % Verify that (A,B) is on the ray from c to p
+ \poly@isonray\X@c\Y@c\A@\B@\X@p\Y@p
+ \ifpoly@badinters
+ % It is on the negative ray
+% \W@{ \space a negative intersection}%
+ \edef\poly@intersneg{\the\A@,\the\B@}%
+ \else
+% \W@{ \space a positive intersection}%
+ \edef\poly@interspos{\the\A@,\the\B@}%
+ \fi
+ \fi
+ \fi
+ % Set the origin to the start of the next segment
+ \X@origin=\poly@saveXcinters\Y@origin=\poly@saveYcinters
+}
+
+
+%
+% Computes the distance from reference point to the intersection
+%
+\xydef@\polygonEdge@Dist{\xyerror@{Dist is not yet implemented for polygons}}
+
+%
+% Checks that #1 <= #2 <= #3 or that #3 <= #2 <= #1
+% Sets ifpoly@badinters otherwise
+% ifpoly@closedrange decides whether the second inequality is also checked
+% All checks are done with a precision of 100*almostz@ =~ 5000sp = 0.08pt
+\newif\ifpoly@closedrange
+\xydef@\poly@isinrange#1#2#3{%
+ \ifpoly@badinters \else
+ \dimen@=#1\dimen@i=#2\dimen@ii=#3\relax
+% \W@{check if in \ifpoly@closedrange closed\else open\fi\space
+% range 1=\the\dimen@,2=\the\dimen@i,3=\the\dimen@ii}%
+ \advance\dimen@ii -\dimen@ \advance\dimen@i -\dimen@
+ \ifdim\dimen@ii<0pt\relax
+ \ifdim\dimen@i>100\almostz@
+ \poly@badinterstrue
+ \fi
+ \dimen@i=-\dimen@i \dimen@ii=-\dimen@ii
+ \else
+ \ifdim\dimen@i<-100\almostz@\relax
+ \poly@badinterstrue
+ \fi
+ \fi
+ \ifpoly@closedrange
+ \advance\dimen@ii 100\almostz@
+ \ifdim\dimen@i>\dimen@ii
+ \poly@badinterstrue
+ \fi
+ \fi
+% \ifpoly@badinters \W@{ failed}\else\W@{ succeeded}\fi
+ \fi}
+
+%
+% Checks that (#3,#4) is on a segment defined by (#1,#2)->(#5,#6)
+\xydef@\poly@isonseg#1#2#3#4#5#6{%
+ % Check X first
+ \poly@closedrangetrue
+ \poly@isinrange{#1}{#3}{#5}%
+ \poly@isinrange{#2}{#4}{#6}%
+
+}
+
+%
+% Checks that (#3,#4) is on a ray defined by (#1,#2)->(#5,#6)
+\xydef@\poly@isonray#1#2#3#4#5#6{%
+ % Check X first
+ \poly@closedrangefalse
+ \poly@isinrange{#1}{#3}{#5}%
+ \poly@isinrange{#2}{#4}{#6}%
+
+}
+%
+% Test whether (Xp,Yp) is inside the polygon (or on the edge)
+% Sets \ifInside@ accordingly
+\xydef@\polygonEdge@Under{%
+% \W@{}\W@{Edge Under with c=(\the\X@c,\the\Y@c) and p=(\the\X@p,\the\Y@p)}%
+% \W@{ for polygon: \poly@list}%
+ % Save A@ and B@
+ \edef\polysaveA@under{\the\A@}\edef\polysaveB@under{\the\B@}%
+ % Save X@c and Y@c
+ \edef\poly@saveXcUnder{\the\X@c}\edef\poly@saveYcUnder{\the\Y@c}%
+ % Compute the intersection
+ \polygonEdge@Inters
+ \ifpoly@badinters% p is very close to c
+ \Inside@true
+ \else
+ \A@=\X@c\B@=\Y@c
+ % Restore c
+ \X@c=\poly@saveXcUnder\Y@c=\poly@saveYcUnder
+ % Now verify that the intersection point is on the ray c->p
+ \poly@isonseg\X@c\Y@c\X@p\Y@p\A@\B@
+ \ifpoly@badinters \Inside@false \else \Inside@true\fi
+ \A@=\polysaveA@under\B@=\poly@saveB@under
+ \fi
+% \ifInside@\W@{->inside}\else\W@{->outside}\fi
+}
+
+%
+% Compute the inner rectangle
+%
+\xydef@\polygonEdge@Inner{%
+% \W@{}\W@{Edge Inner with (\the\X@c, \the\Y@c) -> (\the\X@p,\the\Y@p)}%
+% \W@{ for polygon: \poly@list}%
+% \W@{ with cache: \poly@cache}%
+ % Save everything except c
+ \enter@{\basefromthebase@ \pfromthep@ \DirectionfromtheDirection@}%
+ % Save c in Lc,Dc
+ \L@c=\X@c \D@c=\Y@c
+ % Compute the two intersection points
+ \polygonEdge@Inters
+ \ifpoly@badinters
+ \czeroEdge@
+ \else
+ % Save the result in Rc,Uc and in X@c,Y@c
+ \expandafter\poly@getinterspoints\poly@cache @%
+ % Now compute the inner rectangle centered
+ \ifdim\X@c>\R@c
+ \L@c=\R@c \R@c=\X@c
+ \else
+ \L@c=\X@c
+ \fi
+ \X@c=0.5\L@c \advance\X@c 0.5\R@c \advance\R@c -\X@c \L@c=\R@c
+ \ifdim\Y@c>\U@c
+ \D@c=\U@c \U@c=\Y@c
+ \else
+ \D@c=\Y@c
+ \fi
+ \Y@c=0.5\D@c \advance\Y@c 0.5\U@c \advance\U@c -\Y@c \D@c=\U@c
+ \Edge@c={\rectangleEdge}%
+ \fi
+ \leave@
+% \xy@showthe c{After inner}%
+}
+
+\xydef@\poly@getinterspoints#1,#2,#3,#4,#5,#6@{%
+ \R@c=#3\U@c=#4\X@c=#5\Y@c=#6}
+
+%
+% Compute the outer rectangle (set Uc,Dc,Lc,Rc and Edgec).
+% Does not change Xc,YC
+%
+\xydef@\polygonEdge@Outer{%
+% \W@{Computing outer for \poly@list}\xy@showthe c{Before outer}%
+ % Save everything except c
+ \enter@{\basefromthebase@ \pfromthep@ \DirectionfromtheDirection@}%
+ \czeroEdge@ % Zero out c
+ \let\poly@map@next=\poly@map
+ \poly@mapExpand\poly@findextent\poly@list
+ \Edge@c={\rectangleEdge}%
+ \leave@
+% \xy@showthe c{After outer}
+}
+
+\xydef@\poly@findextent#1#2{%
+% \xy@showthe c{Before find extent}%
+% \W@{ extx=#1, exty=#2}%
+ \dimen@=#1\dimen@=\the\dimen@% it fails if I remove the second assign
+ \ifdim\dimen@>\R@c \R@c=\dimen@ \fi
+ \ifdim -\dimen@>\L@c \L@c=-\dimen@ \fi
+ \dimen@=#2\dimen@=\the\dimen@% it fails if I remove the second assign
+ \ifdim\dimen@>\U@c \U@c=\dimen@ \fi
+ \ifdim -\dimen@>\D@c \D@c=-\dimen@ \fi
+% \xy@showthe c{ After extent}%
+}
+
+% Change to account for polynomial shapes, in addition to circular ones
+%
+\xydef@\Fshape@#1:{\def\whichframe@@{{#1}}\let\whichoptions@@=\empty
+ \DN@{{}}\ifx\whichframe@@\next@ \def\whichframe@@{{-}}\fi
+ \expandafter\xyFN@\expandafter\Fshape@whichframe\the\Edge@c}
+
+\xydef@\Fshape@whichframe{%
+ \ifx\next\circleEdge
+ \edef\whichframe@@{[o]\whichframe@@}%
+ \DN@##1{\xyFN@\Fshape@i}%
+ \else
+ \ifx\next\polygonEdge
+ \edef\whichframe@@{[P]\whichframe@@}%
+ \DN@\polygonEdge##1@##2@{\xyFN@\Fshape@i}%
+ \else
+ \DN@##1{\xyFN@\Fshape@i}%
+ \fi\fi
+ \next@
+}
+
+\xyendinput
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ \BUG: This code should be merged with the `frame' and `poly'
+ options.
+
+ The example at the end of \S??g[:smart] illustrates the extensions.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+% $Log$
+% Received from George.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyoztex.doc b/Master/texmf-dist/source/generic/xypic/xyoztex.doc
new file mode 100644
index 00000000000..4a5e34df9be
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyoztex.doc
@@ -0,0 +1,316 @@
+%% $Id: xyoztex.doc,v 3.3 1996/12/18 09:26:26 ross Exp $
+%%
+%% Xy-pic ``OzTeX'' driver interface option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{oztex}{OzTeX driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This driver provides the necessary interface to support the \PS\ back-end and
+other \PS\ effects when using the DVI driver of versions 1.8+ of \OzTeX\ by
+Andrew Trevorrow,\footnote{\OzTeX\ is a shareware implementation of \TeX\ for
+Macintosh available from many bulletin boards and ftp sites; v1.5 and earlier
+versions were freeware. Email contact: <akt@kagi.com>.} "Earlier versions
+of \OzTeX\ should instead use the driver option |\xyoption{17oztex}|."
+
+Effects such as colour, line-thickness and rotated or scaled diagrams are
+only partially supported in that the effects cannot be applied to any text or
+symbols placed using fonts. This is due to the nature of \OzTeX\ <driver>,
+whose optimization of the placement of font-characters precludes the
+applicability of such effects. Furthermore the \PS\ dictionary must be
+available in a file called |global.ps| or appended to the
+|OzTeXdict.pro|. However with version 1.8 and later of \OzTeX, there is the
+alternative of using the |dvips| <driver>, which does support all the \PS\
+effects available in \Xy-pic.
+
+\NOTE: To use \Xy-pic effectively with \OzTeX\ requires changing several
+memory parameters. In particular a `Big-\TeX' is needed, along with an
+increase in the |pool_size| parameter. Explicit instructions are contained
+in the file |INSTALL.|\-|OzTeX| of the \Xy-pic distribution.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE(
+\xydef@\OzTeX@@#1{\dvimessage@{OzTeX}{#1}}
+
+\newdriver{%
+ \xyaddsupport{color}\oztexColor@@
+ \xyaddsupport{crayon}\oztexCrayon@@
+ \xyaddsupport{ps}\oztexPS@@
+ \xyaddsupport{rotate}\oztexRotate@@
+ \xyaddsupport{line}\oztexLine@@
+ \xyaddsupport{frame}\oztexFrames@@
+ \xyaddsupport{tile}\oztexTiles@@
+ \xyaddsupport{cmtip}\relax
+}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Supported |\special| effects are...
+%
+\begin{itemize}
+
+\item colour, using \PS, but not of font-characters.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\DOCMODE(
+\xydef@\oztexColor@@{\OzTeXColours@}
+
+\xydef@\OzTeXColours@{\OzTeXPStypes@
+ \let\xylocalColor@=\xyNoColor@@ \def\xycolor@{\xycolor@@}%
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%\XYpredict@
+ \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}%
+ \installPScolor@ }\else\DN@{}\fi \next@
+ \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\OzTeXCrayon@@{}}%
+ \else\let\next@=\xystandardcolors@\fi \next@
+ \let\xycolorwarning@=\relax
+ \let\oztexColor@@=\relax
+ \let\UnloadColor@@=\NoOzTeXColor@
+}
+
+\xydef@\NoOzTeXColor@{%
+ \let\xylocalColor@=\xyNoColor@@
+ \let\xycolor@=\xyNoColor@
+ \let\xycolorwarning@=\xycolorwarning@@
+ \let\oztexColor@@=\OzTeXColours@
+ \let\UnloadColor@@=\UnloadColor@
+ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item crayon colours, similarly restricted.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The 68 colours are those that |dvips| recognizes by name,
+thanks to Tomas Rokicki.
+
+\DOCMODE(
+\xydef@\OzTeXCrayon@@{\installCrayolaColors@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \PS\ back-end.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\oztexPS@@{\oztexPS@}
+
+\xydef@\oztexPSunload@{\UnloadPS@
+ \def\xyPSdictname{}\UsePSdict@@false
+ \let\installxyps@@=\relax
+ \let\UnloadPS@@=\UnloadPS@
+ \xyPSshapes@true
+ \let\oztexPS@@=\oztexPS@ }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\OzTeXSpecial@#1{\special{empty.ps {#1}xy}}
+\xydef@\OzTeXMacro@#1{\special{empty.ps {#1}xy}}
+\xydef@\OzTeXDict@#1{\special{empty.ps @bxy{#1}stopped pop @exy}}
+\xydef@\OzTeXinclude@#1{\special{#1}}
+\xydef@\OzTeXraw@#1{\special{empty.ps @bxy #1 @exy}}%
+
+\xydef@\OzTeXPStypes@{%
+ \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \ifx\PSspecial@@\OzTeXSpecial@\else
+ \let\PSspecial@@=\OzTeXSpecial@
+ \let\PSmacro@@=\OzTeXMacro@
+ \let\PSdict@@=\OzTeXDict@
+ \let\PSraw@@=\OzTeXraw@
+ \let\PSinclude@@=\OzTeXinclude@
+ \let\xyPSobeylines@@=\obeyOzTeXlines@
+ \let\PSspecialdict@@=\OzTeXDict@
+ \OzTeX@@{PostScript}%
+ \fi
+% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \OzTeXCurrpt@ }
+
+{\catcode`\^^M=\active %
+ \gdef\next{\catcode`\^^M=\active \let^^M=\space \obeyspaces}}
+\xylet@\obeyOzTeXlines@=\next
+\DOCMODE)
+
+The \PS\ operators |@bxy| and |@exy| are defined in |xyps-ps| for bypassing
+the mechanism used in \OzTeX\ to isolate code passed in |\special| commands.
+Although it is possible (albeit difficult) to devise \PS\ to deduce the
+current location for use with the ``raw'' specials, this information cannot
+be used to do rotations and scaling as with other <driver>s.
+Hence the value of |\xyPScurrpt@@| is taken to be empty.
+
+\DOCMODE(
+\xydef@\OzTeXCurrpt@{\let\xyPScurrpt@@=\OzTeXCurrpt@@}%
+\xydef@\OzTeXCurrpt@@{\PSraw@@{xyp}}
+\DOCMODE)
+
+\medskip
+
+This avoids dumping the dictionary into the dvi-file, making sure
+that instead it goes into a file, specified by |\xyPSdictname|,
+which defaults to |global.ps|.
+
+\DOCMODE(
+\xydef@\oztexPS@{\OzTeXPStypes@
+ \let\oztexPS@@=\relax
+ \let\UnloadPS@@=\oztexPSunload@
+ \let\installxyps@@=\@OzTeX@PS@
+ \installxyps@ }
+
+\xydef@\@OzTeX@PS@{\UsePSdict@@true
+ \let\includePSmessage@=\xyOzTeXheader
+ \ifx\undefined\xyPSdictname\def\xyPSdictname{global.ps}\fi}
+
+\xydef@\xyOzTeXheader#1#2#3{\UsePSdict@@true}
+\DOCMODE)
+
+The parameters |#1#2#3| of |\xyOzTeXheader| gobble tokens
+that are unnecessary with \OzTeX.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item variable line-widths and poly-lines, using \PS.
+\DOCMODE(
+\xydef@\oztexLine@@{\oztexLine@}
+
+\xydef@\oztexLine@{\OzTeXPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%\XYpredict@
+ \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
+ \else\DN@{\xydriverfail@{line-styles are}\UnloadLine@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item extra frames and fills, using \PS.
+\DOCMODE(
+\xydef@\oztexFrames@@{\OzTeXFrames@}
+
+\xydef@\OzTeXFrames@{\OzTeXPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
+ \else\DN@{\xydriverfail@{frames are}\UnloadPSFrames@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item patterns and tiles, using \PS.
+\DOCMODE(
+\xydef@\oztexTiles@@{\OzTeXTiles@}
+
+\xydef@\OzTeXTiles@{\OzTeXPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@
+ \xystandardpatterns@ }%
+ \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item rotated/scaled diagrams and text, recognised but not supported.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+In fact \OzTeX\ cannot support rotations and scaling.
+Instead we go through all the motions of providing \PS\ support,
+then set a flag that causes a limited number of warning messages to be
+generated as requests are made for these effects.
+
+\DOCMODE(
+\xydef@\oztexRotate@@{\OzTeXRotate@}
+
+\xydef@\OzTeXRotate@{\OzTeXPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
+ \OzTeXRotScale@ \installPSrotscale@ \xyPSshapes@false }%
+ \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+This never worked properly. It requires too much hacking at Trevorrow's
+code for little gain, since text-rotation can never work anyway.
+Use the \dvips\ option instead!
+
+\DOCMODE(
+\xydef@\OzTeXRotScale@{%
+ \def\xyrot@start(##1){%
+ {xyp xyt ##1\space xyr}{OzXy begin gsave}}%
+ \def\xyscale@start(##1,##2){%
+ {xyp xyt ##1\space##2\space xys}{OzXy begin gsave}}%
+ \def\xyrot@end{grestore end}\def\xyscale@end{grestore end}}
+\DOCMODE)
+
+The default code will just do nothing as far as the output is concerned...
+
+\DOCMODE(
+\let\OzTeXRotScale@=\xyRotScale@@
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{itemize}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyoztex.doc,v $
+% Revision 3.3 1996/12/18 09:26:26 ross
+% improvements to file-loading commands
+% fixed missing @ bug
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xypic.doc b/Master/texmf-dist/source/generic/xypic/xypic.doc
new file mode 100644
index 00000000000..631e0e10b1a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xypic.doc
@@ -0,0 +1,75 @@
+%% $Id: xypic.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+%%
+%% Xy-pic v2 compatibility loading.
+%% Copyright (c) 1993-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This file (version \stripRCS$Revision: 3.3 $) just loads the |v2|
+ feature.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\DOCHEADER
+
+ Here it is\dots
+
+\DOCMODE(
+\input xyv2
+\endinput
+\DOCMODE)
+
+ The log reveals that this was originally the main file.
+
+\DOCMODE(
+% $Log: xypic.doc,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% This file NEW for version 2.7 for backwards compatibility.
+% Original xypic.doc renamed to xy.doc.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xypic.map b/Master/texmf-dist/source/generic/xypic/xypic.map
new file mode 100644
index 00000000000..9fd5279567e
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xypic.map
@@ -0,0 +1,66 @@
+%% $Id: xypic.map,v 3.7 1999/02/16 15:12:50 krisrose Exp krisrose $
+%%
+%% Xy-pic PostScript type 1 font map for DVIPS.
+%% Copyright (c) 1995-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+
+% USAGE:
+% Put this line in your DVIPS (and/or other PS driver) header
+% file directory (uncommented, starting in column 1):
+%
+% p+ xypic.map
+%
+% THANKS to Y&Y Inc. for making the much improved PFB fonts available to
+% TeX community.
+
+
+xydash10 XYDASH10 <xydash10.pfb
+xyatip10 XYATIP10 <xyatip10.pfb
+xyatip11 XYATIP10 "1.1 ExtendFont" <xyatip10.pfb
+xyatip12 XYATIP10 "1.2 ExtendFont" <xyatip10.pfb
+xybtip10 XYBTIP10 <xybtip10.pfb
+xybtip11 XYBTIP10 "1.1 ExtendFont" <xybtip10.pfb
+xybtip12 XYBTIP10 "1.2 ExtendFont" <xybtip10.pfb
+
+xybsql10 XYBSQL10 <xybsql10.pfb
+xycirc10 XYCIRC10 <xycirc10.pfb
+
+xycmat10 XYCMAT10 <xycmat10.pfb
+xycmat11 XYCMAT10 "1.1 ExtendFont" <xycmat10.pfb
+xycmat12 XYCMAT10 "1.2 ExtendFont" <xycmat10.pfb
+xycmbt10 XYCMBT10 <xycmbt10.pfb
+xycmbt11 XYCMBT10 "1.1 ExtendFont" <xycmbt10.pfb
+xycmbt12 XYCMBT10 "1.2 ExtendFont" <xycmbt10.pfb
+
+xyeuat10 XYEUAT10 <xyeuat10.pfb
+xyeuat11 XYEUAT10 "1.1 ExtendFont" <xyeuat10.pfb
+xyeuat12 XYEUAT10 "1.2 ExtendFont" <xyeuat10.pfb
+xyeubt10 XYEUBT10 <xyeubt10.pfb
+xyeubt11 XYEUBT10 "1.1 ExtendFont" <xyeubt10.pfb
+xyeubt12 XYEUBT10 "1.2 ExtendFont" <xyeubt10.pfb
+
+% Obsolete fonts not included by default (and not available for PDF).
+%xyline10 XYLINE10 <xyline10.pfa
+%xyqc10 XYQC10 <xyqc10.pfa
+%xymisc10 XYMISC10 <xymisc10.pfa
diff --git a/Master/texmf-dist/source/generic/xypic/xypic.sty b/Master/texmf-dist/source/generic/xypic/xypic.sty
new file mode 100644
index 00000000000..1a493530c68
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xypic.sty
@@ -0,0 +1,29 @@
+%% $Id: xypic.sty,v 3.3 1996/12/19 03:31:56 krisrose Exp $ -*-tex-*-
+%%
+%% LaTeX style option to load Xy-pic in version 2 compatibility mode.
+%% by Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is in the public domain. It is distributed in the hope that it
+%% will be useful, but WITHOUT ANY WARRANTY; without even the implied
+%% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+%%
+\input{xy.sty}
+\xyoption{v2}
+\catcode`\@=\xystycatcode
+\endinput
+
+% $Log: xypic.sty,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
diff --git a/Master/texmf-dist/source/generic/xypic/xypoly.doc b/Master/texmf-dist/source/generic/xypic/xypoly.doc
new file mode 100644
index 00000000000..5c4dac00198
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xypoly.doc
@@ -0,0 +1,1262 @@
+%% $Id: xypoly.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Polygon'' feature.
+%% Copyright (c) 1994-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this macro package; if not, write to the Free Software Foundation,
+%% Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{poly}{Polygon feature}{\stripRCS$Revision: 3.7 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+ This feature provides a means for specifying the locations of
+ vertices for regular polygons, with any number ($\ge 3$) of sides.
+ Polygons can be easily drawn and/or the vertex positions used to constuct
+ complex graphics within an \Xy-picture. Many non-regular polygons can
+ be specified by setting a non-square basis.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+Some of the effects use |\ar| so make sure the `arrow' feature is loaded.
+\DOCMODE(
+\xyrequire{arrow}\xycatcodes
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\message{polygons,}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\medskip
+
+A polygon is most easily specified using \dots
+\begin{defs}
+ |\xypolygon|<number>|{}| & \quad with <number> sides;\cr
+ |\xypolygon|<number>|{|<tok>|}|\kern-30pt &\quad\quad <tok> at vertices;\cr
+ |\xypolygon|<number>|{|<object>|}|\kern-60pt &\cr
+ \multispan2 \quad\quad with a general <object> at each vertex;\hfill\cr
+%% \multispan2 |!P| \quad alias for |\xypolygon| within |\xygraph| \cr
+\end{defs}
+\unskip\noindent
+%
+Here <number> is a sequence of digits, giving the number of sides.
+If used within an |\xy|\dots|\endxy| environment then the polygon
+will be centred on $c$, the current <pos>. However an |\xypolygon|
+can be used outside such an environment, as ``stand-alone'' polygon;
+the whole picture must be specified within the |\xypolygon| command.
+
+In either case the shape is obtained by spacing vertices equally
+around the ``unit circle'' with respect to the current basis.
+If this basis is non-square then the vertices will lie on an ellipse.
+Normally the polygon, with at most 12 vertices, is oriented so as to
+have a flat base when specified using a standard square basis.
+With more than 12~vertices the orientation is such that the line
+from the centre to the first vertex is horizontal, pointing to the right.
+Any other desired orientation can be obtained, with any number of vertices,
+by using the |~={|\dots|}| as described below.
+
+\medskip
+The general form for |\xypolygon| is \dots
+\begin{defs1}
+ |\xypolygon|<number>|"|<prefix>|"{|<switches>\dots|}|
+\end{defs1}\unskip\noindent
+%
+where the |"|<prefix>|"| and <switches> are optional.
+Their uses will be described shortly.
+
+\medskip
+
+A |\xypolygon| establishes positions for the vertices of a polygon.
+At the same time various things may be typeset,
+according to the specified <switches>.
+An <object> may be dropped at each vertex, ``spokes'' drawn to the
+centre and successive vertices may be connected as the polygon's ``sides''.
+Labels and breaks can be specified along the spokes and sides.
+
+Each vertex is automatically named:
+|"1"|, |"2"|, \ldots, |"|<number>|"| with |"0"| as centre.
+When a <prefix> has been given,
+names |"|<prefix>|0"|, \dots, |"|<prefix><number>|"| are used instead.
+While the polygon is being constructed the macro |\xypolynum| expands to
+the number of sides, while |\xypolynode| expands to the number
+of each vertex, spoke and side at the time it is processed.
+This occurs in the following order:
+{\it vertex}$\,1$, {\it spoke}$\,1$, {\it vertex}$\,2$,
+{\it spoke}$\,2$, {\it side}$\,1$, {\it vertex}$\,3$,
+{\it spoke}$\,3$, {\it side}$\,2$, \dots , {\it vertex}$\;n$,
+{\it spoke}$\;n$, {\it side}$\;n-1$, {\it side}$\;n$
+where the final side joins the last vertex to the first.
+
+The macro |\xypolyname| holds the name of the polygon,
+which is <prefix> if supplied. In this case the value of
+|\xypolynum| is also stored as |\|<prefix>|NUMSIDES|,
+accessible outside the polygon.
+
+As stated above, a polygon with up to 12 vertices is oriented
+so as to have a flat base, when drawn using a standard square basis.
+Its vertices are numbered in anti-clockwise order, commencing with the one
+at horizontal-right of centre, or the smallest angle above this
+(see example below).
+With more than 12 vertices then vertex |"1"| is located on the horizontal,
+extending to the right from centre (assuming a standard square basis).
+By providing a switch of the form |~={|<angle>|}| then the vertex |"1"|
+will be located on the unit circle at <angle>$^\circ$ anti-clockwise
+from ``horizontal'' --- more correctly, from the $X$-direction in the
+basis to be used when setting the polygon, which may be established
+using a |~:{|\dots|}| switch.
+
+\begin{code}
+\def\objectstyle{\scriptscriptstyle}
+\xy \xygraph{!{/r2pc/:}
+[] !P3"A"{\bullet}
+"A1"!{+U*++!D{1}} "A2"!{+LD*+!RU{2}}
+"A3"!{+RD*+!LU{3}} "A0"
+[rrr]*{0}*\cir<5pt>{}
+!P6"B"{~<-\cir<5pt>{}}
+"B1"1 "B2"2 "B3"3 "B4"4 "B5"5 "B6"6 "B0"
+[rrr]0 !P9"C"{~*{\xypolynode}}}\endxy
+\end{code}
+$$\docode$$\nobreak
+\begin{exercise}
+Give code to typeset these.
+\answertext{Here is the code actually used to typeset the |\xypolygon|s,
+within an |\xygraph|. It illustrates three different ways to place
+the numbers. Other ways are also possible.}
+\answercode
+\answertext\displaycode
+\end{exercise}
+\goodbreak\goodbreak
+
+One important use of <prefix> is to allow the vertices of more than one
+polygon to be accessed subsequently within the same picture.
+Here are some examples of this,
+incorporating the |~:{|\dots|}| switch to perform simple rescalings.
+Firstly the edges of a dodecahedron as a planar graph:
+
+\begin{code}
+\xy /l1.5pc/:,{\xypolygon5"A"{}},
+{\xypolygon5"B"{~:{(1.875,0):}~>{}}},
+{\xypolygon5"C"{~:{(-2.95,0):}~>{}}},
+{\xypolygon5"D"{~:{(-3.75,0):}}},
+{"A1"\PATH~={**@{-}}'"B1"'"C4"'"B2"},
+{"A2"\PATH~={**@{-}}'"B2"'"C5"'"B3"},
+{"A3"\PATH~={**@{-}}'"B3"'"C1"'"B4"},
+{"A4"\PATH~={**@{-}}'"B4"'"C2"'"B5"},
+{"A5"\PATH~={**@{-}}'"B5"'"C3"'"B1"},
+"C1";"D1"**@{-},"C2";"D2"**@{-},
+"C3";"D3"**@{-},"C4";"D4"**@{-},
+"C5";"D5"**@{-} \endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\noindent
+Next a hexagonal pyramid, a rectangular box
+and an octahedral crystal specified as a triangular anti-prism.
+Notice how the |~:{|\dots|}| switch is used to create non-square bases,
+allowing the illusion of 3D-perspective in the resulting diagrams:
+
+\begin{code}
+\xy/r2pc/: ="A", +(.2,1.5)="B","A",
+{\xypolygon6{~:{(1,-.1):(0,.33)::}
+ ~<>{;"B"**@{-}}}}\endxy
+\quad \xy /r2pc/:
+{\xypolygon4"A"{~:{(0,.7)::}}},+(.7,1.1),
+{\xypolygon4"B"{~:{(.8,0):(0,.75)::}}},
+"A1";"B1"**@{.},"A2";"B2"**@{.},
+"A3";"B3"**@{.},"A4";"B4"**@{.}
+\endxy\quad \xy /r2pc/:
+{\xypolygon3"A"{~:{(0,.7)::}}},+(.7,1.1),
+{\xypolygon3"B"{~:{(-.85,0):(-.15,.8)::}}}
+,"A1"\PATH~={**@{.}}'"B2"'"A3"'"B1"
+'"A2"'"B3"'"A1" \endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+|\xypolynode| simply reads the value of a counter called |\xypolynode@|.
+It is set initially at -1, to indicate no polygon yet. This is used to
+establish the default naming in case polygons are nested.
+
+\DOCMODE(
+\xynew@{count}\xypolynode@\xypolynode@=\m@ne
+\xydef@\xypolynode{\the\xypolynode@}
+
+\xydef@\xypolyNUMSIDES@{}
+\xydef@\xypolynum{\xypolyNUMSIDES@}
+\DOCMODE)
+
+To allow recursion the values of |\xypolyNUMSIDES@| and |\xypolynode@| are saved
+upon entering an |\xypolygon|, to be restored at the end.
+
+\DOCMODE(
+\xydef@\xypolygon{\xypoly@}%
+
+\xydef@\xypoly@{%
+ \if\inxy@
+ \if\inxypoly@
+ \edef\next@{\noexpand\xy@@{\noexpand\nter@{\xypolynode@=\the\xypolynode@
+ \noexpand\def\noexpand\xypolyNUMSIDES@{\xypolyNUMSIDES@}}}}%
+ \else
+ \DN@{\xy@@{\def\inxypoly@{TT}%
+ \nter@{\def\inxypoly@{TF}\xypolynode@=\m@ne}}}%
+ \fi
+ \else
+ \if\inxypoly@
+ \edef\next@{\noexpand\xy
+ \noexpand\xy@@{\noexpand\nter@{\xypolyside=\the\xypolyside
+ \noexpand\def\noexpand\xypolyNUMSIDES@{\xypolyNUMSIDES@}\endxy}}}%
+ \else
+ \DN@{\xy \xy@@{\def\inxypoly@{TT}%
+ \nter@{\def\inxypoly@{TF}\xypolynode@=\m@ne \endxy}}}%
+ \fi
+ \fi
+ \next@ \count@=\z@ \xyFN@\xypoly@n}
+
+\xydef@\inxypoly@{TF}%
+\xydef@\xypoly@x{\xy@@{\leave@\leave@}}
+\DOCMODE)
+
+Read the number of vertices by parsing digits.
+
+\DOCMODE(
+\xydef@\xypoly@n{%
+ \DN@##1{\multiply\count@10\relax \advance\count@##1\relax \xyFN@\xypoly@n}%
+ \ifx \space@\next
+ \ifnum\count@>\z@ \expandafter\DN@\space@{\xyFN@\xypoly@i}%
+ \else \expandafter\DN@\space@{\xyFN@\xypoly@n}\fi
+ \else\ifx 0\next \else\ifx 1\next \else\ifx 2\next \else\ifx 3\next
+ \else\ifx 4\next \else\ifx 5\next \else\ifx 6\next \else\ifx 7\next
+ \else\ifx 8\next \else\ifx 9\next
+ \else \let\next@=\xypoly@i \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next@}
+
+\xydef@\xypoly@i{\edef\xypolyNUMSIDES@{\the\count@}\xyFN@\xygetpolyprefix@}
+\DOCMODE)
+
+Next we check whether a prefix has been supplied for creating the vertex
+names. If so it is stored as |\xypolyPREFIX@|, which otherwise expands to
+empty. The number of sides is also stored using the prefix.
+
+\DOCMODE(
+\xydef@\xypolyPREFIX@{}%
+\xydef@\xypolyPREFIX@@{}%
+\xydef@\xypolyname{\xypolyPREFIX@}%
+
+\xydef@\xygetpolyprefix@{%
+ \ifx\next"\DN@"##1"{\def\xypolyPREFIX@@{##1}\expandafter
+ \edef\csname\xypolyPREFIX@@ NUMSIDES\endcsname{\xypolyNUMSIDES@}%
+ \xypolyprefix@@ }%
+ \else
+ \ifnum\xypolynode@<\z@\def\xypolyPREFIX@@{}%
+ \else
+ \edef\xypolyPREFIX@@{\xypolyPREFIX@\the\xypolynode@,}%
+ \fi \DN@{\xypolyprefix@@}%
+ \fi \next@ }
+
+\xydef@\xypolyprefix@@{%
+ \expandafter\toks@\expandafter{\addEQ@\POS"}%
+ \expandafter\addtotoks@\expandafter{\xypolyPREFIX@@0"\relax}%
+ \the\toks@
+ \ifnum\xypolynode@<\z@
+ \expandafter\def\expandafter\xypolyPREFIX@\expandafter{\xypolyPREFIX@@}%
+ \xy@@{\enter@{\xypolynode@=\the\xypolynode@
+ \noexpand\def\noexpand\xypolyPREFIX@{\xypolyPREFIX@}}\xypolynode@=\z@ }%
+ \else
+ \xy@@{\enter@{\xypolynode@=\the\xypolynode@
+ \noexpand\def\noexpand\xypolyPREFIX@{\xypolyPREFIX@}}\xypolynode@=\z@ }%
+ \expandafter\def\expandafter\xypolyPREFIX@\expandafter{\xypolyPREFIX@@}%
+ \fi
+ \xypoly@@i }
+\DOCMODE)
+
+Currently any tokens remaining before the opening brace are
+discarded, with an accompanying message.
+
+\DOCMODE(
+\xydef@\xypoly@@i#1#{\begingroup
+ \DN@{#1}\ifx\next@\empty\else
+ \xywarning@{discarding unused tokens: #1}\fi \xypoly@@ }
+\DOCMODE)
+
+Next it is time to analyse the braced information,
+e.g. to set switches and/or adjust the scale.
+If this information is empty |{}| then the default
+values are used.
+
+\DOCMODE(
+\xydef@\xypoly@@#1{\xypolydefaults@
+ \DN@{#1}\ifx\next@\empty\DN@{\xypoly@@@}%
+ \else \DN@{\xyFN@\xypolyparams@#1~!}\fi \next@}
+
+\xydef@\xypolydefaults@{\def\xypolySCALE@{}%
+ \def\xypolySPOKES@{{}}\def\xypostSPOKES@{}\let\xypreSPOKES@\relax
+ \def\xypolySIDES@{{-}}\def\xypostSIDES@{}\let\xypreSIDES@\relax
+ \def\xypolyVERTEX@{}\def\xypolyALIGN@{}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Vertex object:}
+
+Unless the first character is |~|, signifying a ``switch'', then the whole
+of the braced material is taken as specifying the <object> for each vertex.
+It will be typeset with a circular edge using |\drop[o]...|,
+except when there is just a single token <tok>.
+In this case it is dropped as |\drop=0{|<tok>|}|, having zero size.
+An object can also be dropped at each vertex using the switch |~*{|\dots|}|,
+in which case it will be circular, with the current {\it objectmargin\/}
+applied.
+
+The next example illustrates three different ways of specifying a |\circ|
+at the vertices.
+
+\begin{code}
+\xy/r2pc/: {\xypolygon12{\circ}},
++/r5pc/,{\xypolygon10{~<{-}~>{}{\circ}}},
++/r5pc/,{\xypolygon8{~*{\circ}~<=}}\endxy
+\end{code}
+$$\docode$$
+
+\displaycode
+
+\DOCMODE(
+{\xyuncatcodes \gdef\next{*=0}}
+\xylet@\xypolynullvertex@=\next
+
+{\xyuncatcodes \gdef\next{*[o]}}
+\xylet@\xypolyvertex@=\next
+
+{\xyuncatcodes \gdef\next{*+[o]}}
+\xylet@\xypolywidevertex@=\next
+
+\xydef@\xypolyparams@{%
+ \ifx\space@\next \expandafter\DN@\space{\xyFN@\xypolyparams@}%
+ \else\ifx\next~\DN@~{\xyFN@\xypolywhich@}%
+ \else\ifx\next\bgroup\DN@##1~!{%
+% \ifx\empty\xypolyVERTEX@\def\xypolyVERTEX@{*[o]{##1}}%
+ \ifx\empty\xypolyVERTEX@\expandafter
+ \def\expandafter\xypolyVERTEX@\expandafter{\xypolyvertex@{##1}}%
+ \else\xypolyVERTEXerror@{##1}\fi \xypoly@@@}%
+ \else\DN@##1~!{\DN@{##1}\ifx\next@\empty\else
+ \ifx\empty\xypolyVERTEX@\def\xypolyVERTEX@{*##1}%
+% \checkpolytok@\xypolyVERTEX@{*=0}##1@@!\relax
+ \expandafter\checkpolytok@\expandafter\xypolyVERTEX@
+ \expandafter{\xypolynullvertex@}##1@@!\relax
+ \else\xypolyVERTEXerror@{##1}\fi\fi \xypoly@@@}%
+ \fi\fi\fi \next@ }
+
+\xydef@\xypolyVERTEXerror@#1{\xywarning@{%
+ vertex already specified, discarding unused tokens:#1}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Switches}{}\hfill
+\par{}
+
+\noindent
+The allowable switches are given in the following table:
+%
+\begin{defs}
+|~:{|\ldots|}| & useful for rescaling.\cr
+|~*{|<object>|}| & <object> at each vertex.\cr
+|~={|<angle>|}| & align first vertex.\cr
+|~<{|\ldots|}| & directional for ``spokes'';\cr
+|~<<{|<arrow>|}| & use <arrow> for spokes;\cr
+|~<>{|\ldots|}| & labels \& breaks on spokes.\cr
+|~>{|\ldots|}| & directional for ``sides'';\cr
+|~><{|<arrow>|}| & use <arrow> for sides;\cr
+|~>>{|\ldots|}| & labels \& breaks on sides.\cr
+\end{defs}
+%
+\noindent
+Using |~<<{|<arrow>|}| or |~><{|<arrow>|}| is most appropriate
+when arrowheads are required on the sides or spokes, or when
+labels/breaks are required. Here <arrow> is as in
+figure~??g[xyarrow.doc:f.arrow],
+so it can be used simply to specify the style of directional to be used.
+Thus |~<<{}| sets each spoke as a default arrow,
+pointing outwards from the centre; |~<<{@{-}}| suppresses the arrowhead,
+while |~><{@{}}| uses an empty arrow along the sides.
+Labels and breaks are specified with |~<>{|\ldots|}| and |~>>{|\ldots|}|,
+where the |{|\ldots|}| use the notation for a <label>,
+as in figure~??g[xyarrow.doc:f.path].
+
+When no tips or breaks are required then the switches |~<{|\ldots|}|
+and |~>{|\ldots|}| are somewhat faster, since less processing is needed.
+Labels can still be specified with |~<>{|\ldots|}| and |~>>{|\ldots|}|,
+but now using the kernel's <place> notation of figure~??g[xy.doc:f.pos].
+In fact any kernel code can be included using these switches.
+With |~<>| the current $p$ and $c$ are the centre and vertex respectively,
+while for |~>>| they are the current vertex and the previous vertex.
+(The connection from vertex |"|<number>|"| to vertex |"1"| is done last.)
+The pyramid above is an example of how this can be used.
+Both |~<{|\ldots|}| and |~<<{|<arrow>|}| can be
+specified together, but only the last will actually be used;
+similarly for |~>{|\ldots|}| and |~><{|<arrow>|}|.
+
+\begin{code}
+\def\alphanum{\ifcase\xypolynode\or A
+\or B\or C\or D\or E\or F\or G\or H\fi}
+\xy/r3pc/: {\xypolygon3{~={40}}},
+{\xypolygon4{~={40}~>{{--}}}},
+{\xypolygon5{~={40}}},
+{\xypolygon6{~={40}~>{{--}}}},
+{\xypolygon11{~={40}}},
+{\xypolygon50{~={40}~>.}}, +/r8pc/,
+{\xypolygon7{~<<{@{-}}~><{}
+ ~<>{|*@{x}}~*{\alphanum}
+ ~>>{_{\alpha_\xypolynode^{}}}}}
+\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+
+Use of the |~={|\ldots|}| switch was described earlier.
+When using the |~:{|\ldots|}| more can be done than just setting the base.
+In fact any kernel code can be supplied here.
+It is processed prior to any other part of the polygon.
+The graphics state has $c$ at the centre of the polygon,
+$p$ at the origin of coordinates within the picture and
+has basis unchanged from what has previously been established.
+The current point $c$ will be reset to the centre following any code
+interpreted using this switch.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Note that |~!| was appended by |\xypoly@@|, in order to indicate the end
+of the braced tokens. The macro |\xypolywhich@| is the main parser,
+with |\xypoly@SPOKES@| and |\xypoly@SIDES@| handling the subcases
+for |~<| and |~>|.
+
+\DOCMODE(
+\xydef@\xypolywhich@{%
+ \ifx\next!\DN@!{\xypoly@@@}%
+ \else \addLT@\ifx\next \addLT@\DN@{\xyFN@\xypoly@SPOKES@}%
+ \else \addGT@\ifx\next \addGT@\DN@{\xyFN@\xypoly@SIDES@}%
+ \else \addEQ@\ifx\next \addEQ@\DN@##1{%
+ \def\xypolyALIGN@{##1}\xyFN@\xypolyparams@ }%
+ \else \ifx :\next \DN@:##1{%
+ \def\xypolySCALE@{##1}\xyFN@\xypolyparams@ }%
+% \else\ifx\next*\DN@*##1{\def\xypolyVERTEX@{*+[o]{##1}}\xyFN@\xypolyparams@}%
+ \else\ifx\next*\DN@*##1{\expandafter
+ \def\expandafter\xypolyVERTEX@\expandafter{\xypolywidevertex@{##1}}%
+ \xyFN@\xypolyparams@}%
+ \fi\fi\fi\fi\fi\fi \next@ }
+
+\xydef@\xypoly@SPOKES@{%
+ \addLT@\ifx\next \addLT@\DN@##1{%
+ \def\xypreSPOKES@{##1}\def\xypolySPOKES@{}\xyFN@\xypolyparams@ }%
+ \else \addGT@\ifx\next \addGT@\DN@##1{%
+ \def\xypostSPOKES@{##1}\xyFN@\xypolyparams@ }%
+ \else \ifx\next\bgroup \DN@##1{%
+ \def\xypolySPOKES@{##1}\let\xypreSPOKES@\relax
+ \checkpolytok@\xypolySPOKES@{}##1@@!{\xyFN@\xypolyparams@}}%
+ \else \DN@##1{%
+ \let\xypreSPOKES@\relax \def\xypolySPOKES@{{##1}}\xyFN@\xypolyparams@}%
+ \fi\fi\fi \next@ }
+
+\xydef@\xypoly@SIDES@{%
+ \addLT@\ifx\next \addLT@\DN@##1{%
+ \def\xypreSIDES@{##1}\def\xypolySIDES@{}\xyFN@\xypolyparams@ }%
+ \else \addGT@\ifx\next \addGT@\DN@ ##1{%
+ \def\xypostSIDES@{##1}\xyFN@\xypolyparams@ }%
+ \else \ifx\next\bgroup \DN@##1{%
+ \def\xypolySIDES@{##1}\let\xypreSIDES@\relax
+ \checkpolytok@\xypolySIDES@{}##1@@!{\xyFN@\xypolyparams@}}%
+ \else \DN@##1{%
+ \let\xypreSIDES@\relax \def\xypolySIDES@{{##1}}\xyFN@\xypolyparams@}%
+ \fi\fi\fi \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+A further simplification exists for sides and spokes without <arrow>s.
+If <tok> is a single character then |~>|<tok>, |~>{|<tok>|}|, |~>{{|<tok>|}}|
+all specify the directional |\dir{|<tok>|}|; similarly with the |~<| switch.
+On the other hand, compound directionals require all the braces,
+e.g. |~>{{--}}| and |~>{2{.}}|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This is achieved with the macro
+|\checkpolytok@#1#2#3#4@!#5| which handles the bare <tok> case
+by adding braces around <tok> which has been passed as |#3|, preceeding
+it with |#2|. This is then |\def|'d to the control-sequence name
+passed as |#1|. Finally continue with the command passed as |#5|.
+
+\DOCMODE(
+\xydef@\checkpolytok@#1#2#3#4@!#5{\DNii@{#1}\DN@{#4}%
+ \ifx\next@\empty\expandafter\def\nextii@{{}}%
+ \else\ifx#4@\expandafter\def\nextii@{#2{#3}}\fi\fi #5}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\medskip
+
+After all switches have been processed, remaining tokens
+are used to specify the <object> for each vertex.
+Such tokens will be used directly after a |\drop|,
+so can include object <modifier>s as in figure~??g[xy.doc:f.object].
+If an <object> has already been specified, using the |~*| switch,
+then the following message will be written to the \TeX\ log:
+
+\begin{center}
+\noindent{\tt Xy-pic Warning: vertex already specified,
+discarding unused tokens:}
+\end{center}
+%
+with tokens at the end indicating what remains unprocessed.
+Similarly extra tokens before the |{|\dots|}| generate a message:
+
+\begin{center}
+\noindent|Xy-pic Warning: discarding unused tokens: |
+\end{center}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Nested Polygons}{}\hfill
+\par{}
+
+\noindent
+When |\xypolygon| is specified within either a |~<>{|\dots|}|
+or |~>>{|\dots|}| switch for another polygon,
+then the inner polygon inherits a name which incorporates also the number
+of the part on which it occurs, as given by |\xypolynode|.
+This name is accessed using |\xypolyname|.
+In the following example the inner polygon is
+placed using |~<>| in order to easily adjust its orientation
+to the outward direction of the spokes.
+
+\begin{code}
+\xypolygon4{~:{/r5pc/:}
+ ~<>{*\frm<8pt>{o}\xypolygon4{~:{/-2pc/:}
+ ~*{\xypolyname\xypolynode}}}
+ [o]=<5pc>{\xypolynode}}
+\end{code}
+$$\docode$$
+\displaycode
+
+Notice how nested polygons inherit names |"1,1"|, |"1,2"|, \dots,
+|"4,1"|, \dots, |"4,4"| for their vertices. If a <prefix> is supplied
+at the outermost level then the names become: |"|<prefix>$i,j$|"|.
+Specifying a <prefix> for the inner polygon overrides this naming scheme.
+The same names may then be repeated for each of the inner polygons,
+allowing access afterwards only to the last---possibly useful as a
+memory saving feature when the vertices are not required subsequently.
+
+Four levels of nesting gives a quite acceptable ``Sierpinski gasket''.
+The innermost triangle is provided by |\blacktriangle|
+from the \AMS\ symbol font |msam5|, at 5-point size.
+Further levels can be achieved using the \PS\ backend,
+otherwise line segments become too small to be rendered using \Xy-fonts.
+
+\begin{code}
+\font\msamv=msam5 at 5pt
+\def\blacktriangle{{\msamv\char'116}}
+\def\objectstyle{\scriptscriptstyle}
+\xypolygon3{~:{/r5.2pc/:}
+ ~>{}~<>{?\xypolygon3"a"{~:{(.5,0):}
+ ~>{}~<>{?\xypolygon3"b"{~:{(.5,0):}
+ ~>{}~<>{?\xypolygon3"c"{~:{(.5,0):}
+ ~>{}~<>{?\xypolygon3"d"{~:{(.5,0):}
+~<>{?*!/d.5pt/=0\hbox{\blacktriangle}}
+}} }} }} }} }
+\end{code}
+$$\docode$$\goodbreak
+\displaycode
+
+\noindent
+Note the use of naming in this example; when processing this manual
+it saves 13,000+ words of main memory and 10,000+ string characters
+as well as 122 strings and 319 multi-letter control sequences.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{figure*}[ht]
+{\footnotesize \def"#1"{\edef\qq{#1}\expandafter\futurelet\expandafter\next\expandafter\q\qq}%
+\def\q{\ifx-\next \def\next-{~\llap{$-$}}\else \def\next{~}\fi \next}%
+\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}cllllllllll}
+$n$ & $\sin{\pi\over n}$ & $\cos{\pi\over n}$
+ & $\sin{2\pi\over n}$ & $\cos{2\pi\over n}$
+ & $\sin{3\pi\over n}$ & $\cos{3\pi\over n}$
+ & $\sin{4\pi\over n}$ & $\cos{4\pi\over n}$
+ & $\sin{5\pi\over n}$ & $\cos{5\pi\over n}$\cr
+ 0 & "\sinPIon0" & "\cosPIon0" & "\sinTwoPIon0" & "\cosTwoPIon0"
+ & "\sinThreePIon0" & "\cosThreePIon0" & "\sinFourPIon0" & "\cosFourPIon0"
+ & "\sinFivePIon0" & "\cosFivePIon0"\cr
+ 1 & "\sinPIon1" & "\cosPIon1" & "\sinTwoPIon1" & "\cosTwoPIon1"
+ & "\sinThreePIon1" & "\cosThreePIon1" & "\sinFourPIon1" & "\cosFourPIon1"
+ & "\sinFivePIon1" & "\cosFivePIon1"\cr
+ 2 & "\sinPIon2" & "\cosPIon2" & "\sinTwoPIon2" & "\cosTwoPIon2"
+ & "\sinThreePIon2" & "\cosThreePIon2" & "\sinFourPIon2" & "\cosFourPIon2"
+ & "\sinFivePIon2" & "\cosFivePIon2"\cr
+ 3 & "\sinPIon3" & "\cosPIon3" & "\sinTwoPIon3" & "\cosTwoPIon3"
+ & "\sinThreePIon3" & "\cosThreePIon3" & "\sinFourPIon3" & "\cosFourPIon3"
+ & "\sinFivePIon3" & "\cosFivePIon3"\cr
+ 4 & "\sinPIon4" & "\cosPIon4" & "\sinTwoPIon4" & "\cosTwoPIon4"
+ & "\sinThreePIon4" & "\cosThreePIon4" & "\sinFourPIon4" & "\cosFourPIon4"
+ & "\sinFivePIon4" & "\cosFivePIon4"\cr
+ 5 & "\sinPIon5" & "\cosPIon5" & "\sinTwoPIon5" & "\cosTwoPIon5"
+ & "\sinThreePIon5" & "\cosThreePIon5" & "\sinFourPIon5" & "\cosFourPIon5"
+ & "\sinFivePIon5" & "\cosFivePIon5"\cr
+ 6 & "\sinPIon6" & "\cosPIon6" & "\sinTwoPIon6" & "\cosTwoPIon6"
+ & "\sinThreePIon6" & "\cosThreePIon6" & "\sinFourPIon6" & "\cosFourPIon6"
+ & "\sinFivePIon6" & "\cosFivePIon6"\cr
+ 7 & "\sinPIon7" & "\cosPIon7" & "\sinTwoPIon7" & "\cosTwoPIon7"
+ & "\sinThreePIon7" & "\cosThreePIon7" & "\sinFourPIon7" & "\cosFourPIon7"
+ & "\sinFivePIon7" & "\cosFivePIon7"\cr
+ 8 & "\sinPIon8" & "\cosPIon8" & "\sinTwoPIon8" & "\cosTwoPIon8"
+ & "\sinThreePIon8" & "\cosThreePIon8" & "\sinFourPIon8" & "\cosFourPIon8"
+ & "\sinFivePIon8" & "\cosFivePIon8"\cr
+ 9 & "\sinPIon9" & "\cosPIon9" & "\sinTwoPIon9" & "\cosTwoPIon9"
+ & "\sinThreePIon9" & "\cosThreePIon9" & "\sinFourPIon9" & "\cosFourPIon9"
+ & "\sinFivePIon9" & "\cosFivePIon9"\cr
+10 & "\sinPIon{10}" & "\cosPIon{10}"& "\sinTwoPIon{10}"& "\cosTwoPIon{10}"
+ &"\sinThreePIon{10}"&"\cosThreePIon{10}"&"\sinFourPIon{10}"&"\cosFourPIon{10}"
+ & "\sinFivePIon{10}" & "\cosFivePIon{10}"\cr
+11 & "\sinPIon{11}" & "\cosPIon{11}"& "\sinTwoPIon{11}"& "\cosTwoPIon{11}"
+ &"\sinThreePIon{11}"&"\cosThreePIon{11}"&"\sinFourPIon{11}"&"\cosFourPIon{11}"
+ & "\sinFivePIon{11}" & "\cosFivePIon{11}"\cr
+12 & "\sinPIon{12}" & "\cosPIon{12}"& "\sinTwoPIon{12}"& "\cosTwoPIon{12}"
+ &"\sinThreePIon{12}"&"\cosThreePIon{12}"&"\sinFourPIon{12}"&"\cosFourPIon{12}"
+ & "\sinFivePIon{12}" & "\cosFivePIon{12}"\cr
+\end{tabular*}}
+\caption{Trigonometry tables for Polygon vertices.}
+??=[f.trigonometry]
+\end{figure*}
+
+\DOCMODE(
+\xydef@\xytrigerror@#1#2{\string#1 only works from 0 to 12}
+
+\xydef@\cosPIon#1{\ifcase#1 1\or-1\or0\or.5\or\halfroottwo\or
+ .809017\or\halfrootthree\or.900969\or.92388\or.939693\or.951057\or
+ .959493\or.965926\else1\xytrigerror@\cosPIon{#1}\fi}
+\xydef@\sinPIon#1{\ifcase#1 0\or0\or1\or\halfrootthree\or\halfroottwo\or
+ .587785\or.5\or.433884\or.382683\or.34202\or.309017\or
+ .281733\or.258819\else0\xytrigerror@\sinPIon{#1}\fi}
+
+\xydef@\cosTwoPIon#1{\ifcase#1 1\or1\or-1\or-\cosPIon3\or\cosPIon2\or
+ \sinPIon{10}\or\cosPIon3\or.62349\or\cosPIon4\or
+ .766044\or\cosPIon5\or.841254\or\cosPIon6%
+ \else1\xytrigerror@\cosTwoPIon{#1}\fi}
+\xydef@\sinTwoPIon#1{\ifcase#1 0\or0\or0\or-\sinPIon3\or\sinPIon2\or
+ \cosPIon{10}\or\sinPIon3\or.781831\or\sinPIon4\or
+ .642788\or\sinPIon5\or.540641\or\sinPIon6%
+ \else0\xytrigerror@\sinTwoPIon{#1}\fi}
+
+\xydef@\cosThreePIon#1{\ifcase#1 1\or-1\or0\or-1\or-\cosPIon4\or
+ -\cosPIon5\or\cosPIon2\or.222521\or\sinPIon8\or\cosPIon3\or
+ \sinTwoPIon5\or.654861\or\cosPIon4%
+ \else1\xytrigerror@\cosThreePIon{#1}\fi}
+\xydef@\sinThreePIon#1{\ifcase#1 0\or0\or1\or0\or\sinPIon4\or
+ \sinTwoPIon5\or\sinPIon2\or.974928\or\cosPIon8\or\sinPIon3\or
+ \cosTwoPIon5\or.75575\or\sinPIon4%
+ \else0\xytrigerror@\sinThreePIon{#1}\fi}
+
+\xydef@\cosFourPIon#1{\ifcase#1 1\or1\or1\or-\cosPIon3\or-1\or-\cosPIon5\or
+ \cosTwoPIon3\or-\cosThreePIon7\or0\or.173648\or\cosTwoPIon5\or
+ .415415\or\cosPIon3%
+ \else1\xytrigerror@\cosFourPIon{#1}\fi}
+\xydef@\sinFourPIon#1{\ifcase#1 0\or0\or0\or-\sinPIon3\or0\or\sinPIon5\or
+ \sinTwoPIon3\or\sinThreePIon7\or1\or.984808\or\sinTwoPIon5\or
+ .909632\or\sinPIon3%
+ \else0\xytrigerror@\sinFourPIon{#1}\fi}
+
+\xydef@\cosFivePIon#1{\ifcase#1 1\or-1\or0\or\cosPIon3\or-\cosPIon4\or
+ -1\or-\cosPIon6\or-\cosTwoPIon7\or-\cosThreePIon8\or-\cosFourPIon9\or
+ 0\or.142315\or\sinPIon{12}%
+ \else1\xytrigerror@\cosFivePIon{#1}\fi}
+\xydef@\sinFivePIon#1{\ifcase#1 0\or0\or1\or-\sinPIon3\or-\sinPIon4\or
+ 0\or\sinPIon6\or\sinTwoPIon7\or\sinThreePIon8\or\sinFourPIon9\or1\or
+ .989821\or\cosPIon{12}%
+ \else0\xytrigerror@\sinFivePIon{#1}\fi}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Coordinates for the vertices are read from trigonometry tables using control
+sequences
+%
+\begin{defs}
+ |\cosPIon|$n$ & |\sinPIon|$n$ \cr
+ |\cosTwoPIon|$n$ & |\sinTwoPIon|$n$ \cr
+ |\cosThreePIon|$n$ & |\sinThreePIon|$n$ \cr
+ |\cosFourPIon|$n$ & |\sinFourPIon|$n$ \cr
+ |\cosFivePIon|$n$ & |\sinFivePIon|$n$ \cr
+\end{defs}\unskip\noindent
+%
+which expand to the values of $\cos{\pi\over n}$, $\sin{\pi\over n}$,
+$\cos{2\pi\over n}$, \dots, $\sin{5\pi\over n}$ and are also available for
+other uses. The parameter~$n$ must be a non-negative integer up to~12.
+The complete table is in figure~??[f.trigonometry].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Specific Polygons:}
+
+All the information from the switches is passed as 8 separate
+parameters to a macro appropriate to the number of sides.
+The parameters have the following uses, and are set as shown:
+
+\begin{defs}
+|#1| & pre-arrow: set by |~<<{...}| else |;|\cr
+|#2| & vertex <object>, set by |~*{...}| \cr
+|#3| & prefix for naming \cr
+|#4| & post-vertex: empty with |\ars| else |**@{...}| \cr
+ & ~~where |{...}| is set by |~<{...}| \cr
+|#5| & post-arrow/vertex: set by |~<>{...}| \cr
+|#6| & pre-edge/arrow, set by |~><{...}| \cr
+|#7| & post-edge: empty with |\ars| else |**@{...}| \cr
+ & ~~where |{...}| is set by |~>{...}| \cr
+|#8| & post-arrow/edge, set by |~>>{...}| \cr
+\end{defs}
+
+The organisation of this information is done by |\xyPolygon@@@#1|
+which takes as a single parameter a macro appropriate to the
+number of sides, supplied by |\xypoly@@@|.
+
+\DOCMODE(
+\xydef@\xypoly@@@{\count@=\xypolyNUMSIDES@\relax
+ \ifx\xypolyALIGN@\empty
+ \ifnum\count@<\thr@@\relax\DN@{\xypolytoosmall@{\the\count@}}%
+ \else \advance\count@-\thr@@
+ \ifcase\count@ \DN@{\xyPolygon@@@\xytriangle@@}%
+ \or \DN@{\xyPolygon@@@\xysquare@@}%
+ \or \DN@{\xyPolygon@@@\xypentagon@@}%
+ \or \DN@{\xyPolygon@@@\xyhexagon@@}%
+ \or \DN@{\xyPolygon@@@\xyheptagon@@}%
+ \or \DN@{\xyPolygon@@@\xyoctagon@@}%
+ \or \DN@{\xyPolygon@@@\xynonagon@@}%
+ \or \DN@{\xyPolygon@@@\xydecagon@@}%
+ \or \DN@{\xyPolygon@@@\xyundecagon@@}%
+ \or \DN@{\xyPolygon@@@\xydodecagon@@}%
+ \else \DN@{\xylargePolygon@{0}{\xypolyNUMSIDES@}}%
+ \fi\fi
+ \else
+ \DN@{\xylargePolygon@{\xypolyALIGN@}{\xypolyNUMSIDES@}}%
+ \fi \next@ \xypoly@@@x}
+
+\xydef@\xypoly@@@x{\restore\xypoly@x}
+
+\xydef@\xypolytoosmall@#1{\xyerror@{#1 sides is too few for a polygon}}
+\DOCMODE)
+
+Here is |\xyPolygon@@@|. It constructs a list of tokens to be
+interpreted, after having closed the grouping that was current
+while parsing.
+It starts by setting the value of |\xypolyNUMSIDES@|,
+then a |\save| before adjusting the scale according to the value
+of |\xypolySCALE@|.
+
+\DOCMODE(
+\xydef@\xyPolygon@@@#1{%
+ \toks@={\def\xypolyNUMSIDES@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\xypolyNUMSIDES@}\save}%
+%
+ \ifx\empty\xypolySCALE@ \addtotoks@{\POS"}%
+ \else \addtotoks@{\POS;0;}%
+ \expandafter\addtotoks@\expandafter{\xypolySCALE@\relax\POS"}%
+ \fi
+ \expandafter\addtotoks@\expandafter{\xypolyPREFIX@0"\relax}%
+%
+ \ifx\xypreSPOKES@\relax
+ \addtotoks@{#1{;}}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\xypolyVERTEX@}}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\xypolyPREFIX@}}%
+ \DN@##1\next@{\def\tmp@{**\dir##1}}%
+ \expandafter\next@\expandafter{\xypolySPOKES@}\next@
+ \expandafter\addtotoks@\expandafter{\expandafter{\tmp@}}%
+ \else
+ \expandafter\DN@\expandafter{\expandafter\ar\xypreSPOKES@}%
+ \addtotoks@{#1}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\next@}}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\xypolyVERTEX@}}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\xypolyPREFIX@}{}}%
+ \fi
+ \expandafter\addtotoks@\expandafter{\expandafter{\xypostSPOKES@}}%
+%
+ \ifx\xypreSIDES@\relax
+ \addtotoks@{{;}}%
+ \DN@##1\next@{\def\tmp@{**\dir##1}}%
+ \expandafter\next@\expandafter{\xypolySIDES@}\next@
+ \expandafter\addtotoks@\expandafter{\expandafter{\tmp@}}%
+ \else
+ \expandafter\DN@\expandafter{\expandafter\ar\xypreSIDES@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\next@}{}}%
+ \fi
+ \expandafter\addtotoks@\expandafter{\expandafter{\xypostSIDES@}}%
+ \ifx\xypolyALIGN@\empty
+ \ifnum\xypolyNUMSIDES@>12\addtotoks@{{0}}\fi
+ \else
+ \expandafter\addtotoks@\expandafter{\expandafter{\xypolyALIGN@}}%
+ \fi
+ \expandafter\DN@\expandafter{\expandafter\endgroup\the\toks@ }%
+ \next@}
+\DOCMODE)
+
+Note how |\endgroup| closes the grouping.
+All the information for the layout of the polygon is contained in
+|\xypolyNUMSIDES@| and the specific polygon macro
+contained in the final |\next@|.
+
+\medskip
+
+Here is where the polygons are defined, individually.
+
+\DOCMODE(
+\xydef@\xytriangle@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(0,1)#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(-\cosPIon6, -.5)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\cosPIon6,-.5)#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#33"#6"#31"#7#8\relax }
+
+\xydef@\xysquare@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(\halfroottwo,\halfroottwo)#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(-\halfroottwo,\halfroottwo)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\halfroottwo,\halfroottwo)#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(-\halfroottwo,\halfroottwo)#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#34"#6"#31"#7#8\relax }
+
+\xydef@\xypentagon@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(\cosPIon{10},\sinPIon{10})#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(0,1)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(-\cosPIon{10},\sinPIon{10})#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon5,\cosPIon5)#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon5,-\cosPIon5)#2="#35"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#34"#6"#35"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#35"#6"#31"#7#8\relax }
+
+\xydef@\xyhexagon@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(1,0)#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(.5,\halfrootthree)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(-.5,\halfrootthree)#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(1,0)#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(.5,\halfrootthree)#2="#35"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#34"#6"#35"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(-.5,\halfrootthree)#2="#36"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#35"#6"#36"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#36"#6"#31"#7#8\relax }
+
+\xydef@\xyheptagon@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(\sinTwoPIon7,\cosTwoPIon7)#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(0,1)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(-\sinTwoPIon7,\cosTwoPIon7)#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinThreePIon7,\cosThreePIon7)#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon7,\cosPIon7)#2="#35"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#34"#6"#35"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon7,-\cosPIon7)#2="#36"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#35"#6"#36"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinThreePIon7,-\cosThreePIon7)#2="#37"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#36"#6"#37"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#37"#6"#31"#7#8\relax }
+
+\xydef@\xyoctagon@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(\cosPIon8,\sinPIon8)#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(\sinPIon8,\cosPIon8)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon8,-\cosPIon8)#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\cosPIon8,-\sinPIon8)#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\cosPIon8,\sinPIon8)#2="#35"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#34"#6"#35"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon8,\cosPIon8)#2="#36"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#35"#6"#36"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon8,-\cosPIon8)#2="#37"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#36"#6"#37"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\cosPIon8,-\sinPIon8)#2="#38"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#37"#6"#38"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#38"#6"#31"#7#8\relax }
+
+\xydef@\xynonagon@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(\sinFourPIon9,\cosFourPIon9)#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(\sinTwoPIon9,\cosTwoPIon9)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(0,1)#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(-\sinTwoPIon9,\cosTwoPIon9)#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(-\sinFourPIon9,\cosFourPIon9)#2="#35"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#34"#6"#35"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\cosPIon6,\sinPIon6)#2="#36"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#35"#6"#36"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon9,\cosPIon9)#2="#37"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#36"#6"#37"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon9,-\cosPIon9)#2="#38"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#37"#6"#38"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\cosPIon6,-\sinPIon6)#2="#39"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#38"#6"#39"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#39"#6"#31"#7#8\relax }
+
+\xydef@\xydecagon@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(1,0)#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(\cosPIon5,\sinPIon5)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon{10},\cosPIon{10})#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon{10},-\cosPIon{10})#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\cosPIon5,-\sinPIon5)#2="#35"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#34"#6"#35"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(1,0)#2="#36"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#35"#6"#36"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\cosPIon5,\sinPIon5)#2="#37"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#36"#6"#37"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon{10},\cosPIon{10})#2="#38"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#37"#6"#38"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon{10},-\cosPIon{10})#2="#39"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#38"#6"#39"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\cosPIon5,-\sinPIon5)#2="#310"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#39"#6"#310"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#310"#6"#31"#7#8\relax }
+
+\xydef@\xyundecagon@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(\sinFourPIon{11},\cosFourPIon{11})#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(\sinTwoPIon{11},\cosTwoPIon{11})#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(0,1)#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(-\sinTwoPIon{11},\cosTwoPIon{11})#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(-\sinFourPIon{11},\cosFourPIon{11})#2="#35"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#34"#6"#35"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinFivePIon{11},\cosFivePIon{11})#2="#36"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#35"#6"#36"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinThreePIon{11},\cosThreePIon{11})#2="#37"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#36"#6"#37"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon{11},\cosPIon{11})#2="#38"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#37"#6"#38"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon{11},-\cosPIon{11})#2="#39"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#38"#6"#39"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinThreePIon{11},-\cosThreePIon{11})#2="#310"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#39"#6"#310"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinFivePIon{11},-\cosFivePIon{11})#2="#311"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#310"#6"#311"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#311"#6"#31"#7#8\relax }
+
+\xydef@\xydodecagon@@#1#2#3#4#5#6#7#8{%
+ \xy@@{\xypolynode@=\@ne}%
+ \POS#1"#30"+(\cosPIon{12},\sinPIon{12})#2="#31"#4#5\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#30"#1"#30"+(\halfroottwo,\halfroottwo)#2="#32"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#31"#6"#32"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon{12},\cosPIon{12})#2="#33"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#32"#6"#33"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon{12},-\cosPIon{12})#2="#34"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#33"#6"#34"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\halfroottwo,-\halfroottwo)#2="#35"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#34"#6"#35"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\cosPIon{12},-\sinPIon{12})#2="#36"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#35"#6"#36"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\cosPIon{12},\sinPIon{12})#2="#37"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#36"#6"#37"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\halfroottwo,\halfroottwo)#2="#38"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#37"#6"#38"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"-(\sinPIon{12},\cosPIon{12})#2="#39"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#38"#6"#39"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\sinPIon{12},-\cosPIon{12})#2="#310"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#39"#6"#310"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\halfroottwo,-\halfroottwo)#2="#311"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#310"#6"#311"#7#8\relax
+ \xy@@{\advance\xypolynode@\tw@}%
+ \POS"#30"#1"#30"+(\cosPIon{12},-\sinPIon{12})#2="#312"#4#5\relax
+ \xy@@{\advance\xypolynode@\m@ne}%
+ \POS"#311"#6"#312"#7#8\relax
+ \xy@@{\advance\xypolynode@\@ne}%
+ \POS"#312"#6"#31"#7#8\relax }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xylargePolygon@#1#2{%
+ \dimen@=#1\p@
+ \xyPolygon@@@\xypolygon@@}
+% \xyerror@{Sorry, polygons with #2 sides are not implemented; maximum 12.}{}}
+\DOCMODE)
+
+We need a looping construction that will not interfere with others used
+at a high level.
+
+\DOCMODE(
+\xydef@\xypolyrepeat@{\fi}
+\xydef@\xypolybody@{}
+\xydef@\xypolyiterate@{\xypolybody@\expandafter\xypolyiterate@\else\fi}
+\xydef@\xypolyloop@#1\xypolyrepeat@{\def\xypolybody@{#1}\xypolyiterate@}
+\DOCMODE)
+
+The counter |\xypolynode@| keeps track of the current vertex, spoke and side.
+Since the user may choose to place another |\xypolygon| along any such
+piece, it is necessary to calculate the angle for each vertex afresh,
+using only information passed via the parameters |#1|,\dots,|#9|.
+
+\DOCMODE(
+\xydef@\xypolygon@@#1#2#3#4#5#6#7#8#9{\save
+ \vfromcartesianangle@{#9}\edef\next@{\the\X@c,\the\Y@c\addGT@\empty}%
+ \xy@@{\xypolynode@=\@ne}%
+ \toks@={\POS#1"#30"+}%
+ \expandafter\expandafter\expandafter\addtotoks@\expandafter
+ \expandafter\expandafter{\addLT@\empty}%
+ \expandafter\addtotoks@\expandafter{\next@#2="#31"#4#5\relax}%
+ \xy@@\dontleave@ \the\toks@
+%
+ \xypolyloop@
+ \dimen@=360\p@ \count@@=\xypolyNUMSIDES@\relax \advance\dimen@ .5\count@@
+ \divide\dimen@ \xypolyNUMSIDES@ \relax
+ \multiply\dimen@\xypolynode@ \relax \advance\dimen@ #9\p@
+ \edef\tmp@{%
+ \noexpand\vfromcartesianangle@{\expandafter\removePT@\the\dimen@}}%
+ \tmp@ \edef\next@{\the\X@c,\the\Y@c\addGT@\empty}%
+ \xy@@{\advance\xypolynode@\@ne}\count@=\xypolynode@
+ \toks@={\POS"#30"#1"#30"+}\edef\nextii@{\the\count@}%
+ \expandafter\expandafter\expandafter\addtotoks@\expandafter
+ \expandafter\expandafter{\addLT@\space}%
+ \expandafter\addtotoks@\expandafter{\next@#2="#3}%
+ \expandafter\addtotoks@\expandafter{\nextii@"#4#5\relax}%
+ \the\toks@
+%
+ \count@=\xypolynode@ \xy@@{\advance\xypolynode@\m@ne}%
+ \toks@={\POS"#3}\expandafter\addtotoks@\expandafter{\the\xypolynode@"#6"#3}%
+ \expandafter\addtotoks@\expandafter{\the\count@"#7#8\relax}%
+ \the\toks@
+ \xy@@{\advance\xypolynode@\@ne}\count@=\xypolyNUMSIDES@ \relax
+ \ifnum\xypolynode@<\count@ \relax \xypolyrepeat@
+%
+ \toks@={\POS"#3}%
+ \expandafter\addtotoks@\expandafter{\xypolyNUMSIDES@"#6"#31"#7#8\relax}%
+ \the\toks@ \restore }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+
+\xyendinput
+
+% $Log: xypoly.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 09:28:35 ross
+% cosmetic changes in documentation
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.12 1994/10/25 03:01:14 ross
+% Final 3beta release [bug fixes & AMS-LaTeX fitting].
+%
+% Created by Ross Moore, September 1994.
+
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-c.doc b/Master/texmf-dist/source/generic/xypic/xyps-c.doc
new file mode 100644
index 00000000000..4c3857ceb0c
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-c.doc
@@ -0,0 +1,187 @@
+%% $Id: xyps-c.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Colour extension'' PostScript backend support.
+%% Copyright (c) 1993-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\expandafter\ifx\csname xyps-cloaded\endcsname\empty
+ \message{not reloaded}\endinput \fi
+\expandafter\let\csname xyps-cloaded\endcsname=\empty \xycatcodes
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Colour}
+
+The included file |xyps-c.tex| (version \stripRCS$Revision: 3.7 $) provides
+\PS\ support for the effects defined in the |color| extension
+in~\S??g[:color].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The \PS\ style methods are required, so ensure that they are loaded.
+
+\DOCMODE(
+\expandafter\ifx \csname xyps-sloaded\endcsname\empty\else
+ \xyinputorelse@{xyps-s}{\xyerror@{Could not load xyps-s}{}}%
+ \xycatcodes\fi
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This file is loaded and its effects are activated automatically whenever
+|\xyoption{color}| is requested and the current <driver> supports
+colours using \PS. Should there be any need to turn off this support,
+the following commands are available; they obey usual \TeX\ groupings.
+%
+\begin{defs}
+|\NoPScolor| & remove \PS\ support\kern-50pt\cr
+|\UsePScolor| & reinstate \PS.
+\end{defs}
+%
+Without \PS\ support some drivers may still be able to provide some
+support for colours. These commands are not guaranteed to work adequately
+with all drivers. They are provided primarily for testing and
+trouble-shooting; \eg~with <driver> configurations untested by the
+authors of \Xy-pic, who should be notified of any difficulties.
+
+\DOCMODE(
+\xydef@\UsePScolor{\installPScolor@}
+\xydef@\NoPScolor{\UnloadColor@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Installation}
+
+Installation consists of rebinding the macros |\xycolor@| and |\newxycolor@|
+and of reloading the standard colours to include a description for \PS.
+This installation should be delayed till after |color| and |ps| themselves
+have been installed.
+
+\DOCMODE(
+\xydef@\installPScolor@{\installPSstyle@
+ \let\xymath@=\xyPSmath@ \let\xynomath@=\xyPSnomath@
+ \let\checkxyPScolor@=\checkxyPScolor@@
+ \let\xycolor@@=\xyPScolor@@
+ \xystandardcolors@
+ \xyuncatcodes }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+All effects defined in the |color| extension can
+be implemented using the \PS\ dictionary, loaded by |xyps-ps|.
+This file provides ``generic'' \PS\ code which is known to work
+correctly with most drivers. No attempt is made to provide special
+code for particular drivers; for driver-specific variations, consult
+the appropriate |xy|<driver>|.doc| file.
+
+\DOCMODE(
+\xydef@\xyPSmath@{\hbox\bgroup\dimen@=.55ex \checkxyPScolor@ \xyinside@}
+\xydef@\xyPSnomath@{\hbox\bgroup\dimen@=\z@ \checkxyPScolor@ \xyinside@}
+
+\xydef@\checkxyPScolor@@{\xycolor@raw@@{}\let\checkxyPScolor@=\relax}
+\xylet@\checkxyPScolor@=\relax
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xyPSnewcolor@#1#2#3#4#5{%
+ \expandafter\DN@\expandafter{\csname shape [#1]\endcsname}%
+ \DNii@{\relax}\ifx\next@\nextii@\newxycolor{#1}{}\relax\fi
+ \DNii@{#4}\ifx\nextii@\empty
+ \expandafter\DNii@\expandafter{\csname xyPSshape@#1@\endcsname}%
+ \expandafter\def\nextii@{\xyPScolor@{#2 #3}}\else
+ \expandafter\DNii@\expandafter{\csname xyPSshape@#1@\endcsname}%
+ \expandafter\def\nextii@{\xyPScolor@{#4}}\fi
+ \ifx\nextii@\empty\expandafter\def\next@{\xyPSnotimplemented@@`#1'@@}%
+ \else
+ \edef\tmp@{\noexpand\let\expandafter\noexpand\next@
+ \expandafter\noexpand\nextii@}\expandafter\tmp@\fi }
+
+\xydef@\xyPScolor@{\ifPSspecials@\expandafter\xyPScolor@@
+ \else\expandafter\eat@\fi}
+\xydef@\xyPScolor@@#1{\bgroup \checkXyStyle@
+ \def\preStyle@@{\expandafter\addtostyletoks@\expandafter{\xyPSpre@}}%
+ \def\postStyle@@{\expandafter\addtostyletoks@\expandafter{\xyPSpost@}}%
+ \let\modPSboxz@=\modXYstyle@ \xyPS@color@@{#1}%
+ \toks@={\egroup\let\xy@style@=\relax \def\Drop@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\Drop@@}\def\Connect@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\Connect@@}}%
+ \the\toks@ }
+
+%\xydef@\xyPS@color@@#1{#1 /xycolor{#1}def }
+\xydef@\xyPS@color@@#1{\xyPSsplitPS@{{#1}cc}{}}
+\xydef@\xycolor@raw@@#1{\PSraw@@{xyc}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-c.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.3 1996/12/18 10:05:50 ross
+% minor improvements to file-loading commands
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.9 1994/06/09 14:38:56 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% Revision 2.9 1994/06/09 14:38:56 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% NEW for version 2.9 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-col.doc b/Master/texmf-dist/source/generic/xypic/xyps-col.doc
new file mode 100644
index 00000000000..886c891edf5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-col.doc
@@ -0,0 +1,165 @@
+%% $Id: xyps-col.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Crayola colour names'' PostScript colour support.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+%\xyprovide{ps-col}{Crayola Colours}{\stripRCS$Revision: 3.7 $}%
+% {Ross Moore}{ross@mpce.mq.edu.au}%
+% {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This option provides definitions for the 68 colours recognised by name by
+Tomas Rokicki's |dvips| driver~\cite{dvips}. These colours become available
+for use in \Xy-pic pictures and diagrams, as |[|<shape>|]| modifiers.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+Only makes sense to load this after |color| and with a <driver> that
+supports it. Indeed this file should only be called from a <driver>-file.
+
+\DOCMODE(
+\xyrequire{color}\xycatcodes
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The information has been copied from Rokicki's |color.pro| \PS\ prolog file:
+``There are 68 predefined colours, with names taken primarily from the
+Crayola crayon box of 64 colours''~\cite[\S16.1]{dvips}.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Different <driver>s may redefine the |\xynewcolor@| macro to set the colour
+by name or by the cmyk-values.
+
+\DOCMODE(
+\newxycolor@{GreenYellow}{0.15 0 0.69 0}{cmyk}{}{}%
+\newxycolor@{Yellow}{0 0 1. 0}{cmyk}{}{}%
+\newxycolor@{Goldenrod}{0 0.10 0.84 0}{cmyk}{}{}%
+\newxycolor@{Dandelion}{0 0.29 0.84 0}{cmyk}{}{}%
+\newxycolor@{Apricot}{0 0.32 0.52 0}{cmyk}{}{}%
+\newxycolor@{Peach}{0 0.50 0.70 0}{cmyk}{}{}%
+\newxycolor@{Melon}{0 0.46 0.50 0}{cmyk}{}{}%
+\newxycolor@{YellowOrange}{0 0.42 1. 0}{cmyk}{}{}%
+\newxycolor@{Orange}{0 0.61. 0.87 0}{cmyk}{}{}%
+\newxycolor@{BurntOrange}{0 0.51 1. 0}{cmyk}{}{}%
+\newxycolor@{Bittersweet}{0 0.75 1. 0.24}{cmyk}{}{}%
+\newxycolor@{RedOrange}{0 0.77 0.87 0}{cmyk}{}{}%
+\newxycolor@{Mahogany}{0 0.85 0.87 0.35}{cmyk}{}{}%
+\newxycolor@{Maroon}{0 0.87 0.68 0.32}{cmyk}{}{}%
+\newxycolor@{BrickRed}{0 0.89 0.94 0.28}{cmyk}{}{}%
+\newxycolor@{Red}{0 1. 1. 0}{cmyk}{}{}%
+\newxycolor@{OrangeRed}{0 1. 0.50 0}{cmyk}{}{}%
+\newxycolor@{RubineRed}{0 1. 0.13 0}{cmyk}{}{}%
+\newxycolor@{WildStrawberry}{0 0.96 0.39 0}{cmyk}{}{}%
+\newxycolor@{Salmon}{0 0.53 0.38 0}{cmyk}{}{}%
+\newxycolor@{CarnationPink}{0 0.63 0 0}{cmyk}{}{}%
+\newxycolor@{Magenta}{0 1. 0 0}{cmyk}{}{}%
+\newxycolor@{VioletRed}{0 0.81 0 0}{cmyk}{}{}%
+\newxycolor@{Rhodamine}{0 0.82 0 0}{cmyk}{}{}%
+\newxycolor@{Mulberry}{0.34 0.90 0 0.02}{cmyk}{}{}%
+\newxycolor@{RedViolet}{0.07 0.90 0 0.34}{cmyk}{}{}%
+\newxycolor@{Fuchsia}{0.47 0.91 0 0.08}{cmyk}{}{}%
+\newxycolor@{Lavender}{0 0.48 0 0}{cmyk}{}{}%
+\newxycolor@{Thistle}{0.12 0.59 0 0}{cmyk}{}{}%
+\newxycolor@{Orchid}{0.32 0.64 0 0}{cmyk}{}{}%
+\newxycolor@{DarkOrchid}{0.40 0.80 0.20 0}{cmyk}{}{}%
+\newxycolor@{Purple}{0.45 0.86 0 0}{cmyk}{}{}%
+\newxycolor@{Plum}{0.50 1. 0 0}{cmyk}{}{}%
+\newxycolor@{Violet}{0.79 0.88 0 0}{cmyk}{}{}%
+\newxycolor@{RoyalPurple}{0.75 0.90 0 0}{cmyk}{}{}%
+\newxycolor@{BlueViolet}{0.86 0.91 0 0.04}{cmyk}{}{}%
+\newxycolor@{Periwinkle}{0.57 0.55 0 0}{cmyk}{}{}%
+\newxycolor@{CadetBlue}{0.62 0.57 0.23 0}{cmyk}{}{}%
+\newxycolor@{CornflowerBlue}{0.65 0.13 0 0}{cmyk}{}{}%
+\newxycolor@{MidnightBlue}{0.98 0.13 0 0.43}{cmyk}{}{}%
+\newxycolor@{NavyBlue}{0.94 0.54 0 0}{cmyk}{}{}%
+\newxycolor@{RoyalBlue}{1. 0.50 0 0}{cmyk}{}{}%
+\newxycolor@{Blue}{1. 1. 0 0}{cmyk}{}{}%
+\newxycolor@{Cerulean}{0.94 0.11 0 0}{cmyk}{}{}%
+\newxycolor@{Cyan}{1. 0 0 0}{cmyk}{}{}%
+\newxycolor@{ProcessBlue}{0.96 0 0 0}{cmyk}{}{}%
+\newxycolor@{SkyBlue}{0.62 0 0.12 0}{cmyk}{}{}%
+\newxycolor@{Turquoise}{0.85 0 0.20 0}{cmyk}{}{}%
+\newxycolor@{TealBlue}{0.86 0 0.34 0.02}{cmyk}{}{}%
+\newxycolor@{Aquamarine}{0.82 0 0.30 0}{cmyk}{}{}%
+\newxycolor@{BlueGreen}{0.85 0 0.33 0}{cmyk}{}{}%
+\newxycolor@{Emerald}{1. 0 0.50 0}{cmyk}{}{}%
+\newxycolor@{JungleGreen}{0.99 0 0.52 0}{cmyk}{}{}%
+\newxycolor@{SeaGreen}{0.69 0 0.50 0}{cmyk}{}{}%
+\newxycolor@{Green}{1. 0 1. 0}{cmyk}{}{}%
+\newxycolor@{ForestGreen}{0.91 0 0.88 0.12}{cmyk}{}{}%
+\newxycolor@{PineGreen}{0.92 0 0.59 0.25}{cmyk}{}{}%
+\newxycolor@{LimeGreen}{0.50 0 1. 0}{cmyk}{}{}%
+\newxycolor@{YellowGreen}{0.44 0 0.74 0}{cmyk}{}{}%
+\newxycolor@{SpringGreen}{0.26 0 0.76 0}{cmyk}{}{}%
+\newxycolor@{OliveGreen}{0.64 0 0.95 0.40}{cmyk}{}{}%
+\newxycolor@{RawSienna}{0 0.72 1. 0.45}{cmyk}{}{}%
+\newxycolor@{Sepia}{0 0.83 1. 0.70}{cmyk}{}{}%
+\newxycolor@{Brown}{0 0.81 1. 0.60}{cmyk}{}{}%
+\newxycolor@{Tan}{0.14 0.42 0.56 0}{cmyk}{}{}%
+\newxycolor@{Gray}{0 0 0 0.50}{cmyk}{}{}%
+\newxycolor@{Black}{0 0 0 1.}{cmyk}{}{}%
+\newxycolor@{White}{0 0 0 0}{cmyk}{}{}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-col.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.3 1996/12/18 10:02:23 ross
+% no changes
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.12 1995/04/03 05:42:16 ross
+%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-f.doc b/Master/texmf-dist/source/generic/xypic/xyps-f.doc
new file mode 100644
index 00000000000..fc3794d5815
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-f.doc
@@ -0,0 +1,270 @@
+%% $Id: xyps-f.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Frame extension'' PostScript backend support.
+%% Copyright (c) 1995-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\expandafter\ifx\csname xyps-floaded\endcsname\empty
+ \message{not reloaded}\endinput \fi
+\expandafter\let\csname xyps-floaded\endcsname=\empty \xycatcodes
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Frames}
+
+The included file |xyps-f.tex| (version \stripRCS$Revision: 3.7 $) provides
+\PS\ support for the effects defined in the |frame| extension described
+in~\S??g[:frame]. It implements some effects otherwise unattainable.
+
+This file is loaded and its effects are activated automatically whenever
+|\xyoption{frame}| is requested and the current <driver> supports \PS\
+effects for frames. Should there be any need to turn off this support, the
+following commands are available; they obey usual \TeX\ groupings.
+%
+\begin{defs}
+|\NoPSframes| & remove \PS\ support\kern-50pt \cr
+|\UsePSframes| & reinstate \PS.
+\end{defs}
+%
+Without \PS\ support ellipses may be shown as circles and all filled
+regions may be represented as black rectangles.
+These commands are provided primarily for testing and trouble-shooting;
+\eg~with <driver> configurations untested by the authors of \Xy-pic,
+who should be notified of any difficulties.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Installation}
+
+The <driver>-file must call the following macro to rebind control sequences
+defined in |xyframe|, thereby allowing the \PS\ methods to be used.
+
+\DOCMODE(
+\xydef@\installPSframes@{%
+ \let\framed@body@@=\xyPSframed@body@
+ \let\circled@x@@=\xyPScircled@x@
+ \let\ellipsed@x@@=\xyPSellipsed@x@
+ \installPSfills@
+ \xyuncatcodes}
+
+\xydef@\UsePSframes{\installPSframes@}
+\xydef@\NoPSframes{\UnloadFrames@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Frames: solid, dotted and dashed}
+
+For solid frames use \PS\ ovals, otherwise adjust the spacing between dashes
+or dots according to the lengths, both vertical and horizontal.
+
+\DOCMODE(
+\xydef@\xyPSframed@body@{\DN@{\framed@body@}%
+ \ifx\framehfill\frm@solidh@@
+ \DN@{\xyPSframed@oval@\xyPSoval@Special}%
+% \else\ifdim\frmradius@@=\z@\else
+ \else\ifdim\R@=\z@\else
+ \ifx\framehfill\frm@dashh@@
+ \DN@{\xyPSframed@oval@\xyPSdashoval@Special}%
+ \else\ifx\framehfill\frm@doth@@
+ \DN@{\xyPSframed@oval@\xyPSdotoval@Special}%
+ \fi\fi
+ \fi\fi \next@ }
+
+\xydef@\xyPSframed@oval@#1{\vglue\U@c
+ \hbox{\hglue\L@c\xypsoval@#1\hglue\R@c}\vglue\D@c}
+
+
+\xydef@\xyPScircled@x@{\DN@{\xyPScircled@x@@\xyPScirc@Special}%
+ \ifx\framehfill\frm@doth@@
+ \DN@{\xyPScircled@x@@\xyPSdotcirc@Special}%
+ \else\ifx\framehfill\frm@dashh@@
+ \DN@{\xyPScircled@x@@\xyPSdashcirc@Special}%
+ \fi\fi \next@ }
+
+\xydef@\xyPScircled@x@@#1{\vglue2\R@
+ \hbox{\hglue2\R@\xypscircle@#1\hglue2\R@}%
+ \vglue2\R@}
+\DOCMODE)
+
+In practice the parameters |#1| and |#2| will hold <dimen>s.
+
+\DOCMODE(
+\xydef@\xyPSellipsed@x@#1#2{%
+ \DN@{\xyPSellipsed@x@@\xyPScirc@Special}%
+ \ifx\framehfill\frm@doth@@
+ \DN@{\xyPSellipsed@x@@\xyPSdotcirc@Special}%
+ \else\ifx\framehfill\frm@dashh@@
+ \DN@{\xyPSellipsed@x@@\xyPSdashcirc@Special}%
+ \fi\fi \next@{#1}{#2}}
+
+\xydef@\xyPSellipsed@x@@#1#2#3{\vglue #3\vglue #3\relax
+ \hbox{\L@c = #2\relax \R@c=\L@c \D@c = #3\relax \U@c=\D@c
+ \hglue#2\hglue#2\relax\xypsellipse@#1\hglue#2\hglue#2\relax}%
+ \vglue #3\vglue #3\relax}
+\DOCMODE)
+
+
+These may be used for dashed frames.
+
+\DOCMODE(
+\xydef@\xyPSdashhfill@{{\SemiDirectionChar=95 \Direction=3072 \xyPSdash@}}
+\xydef@\xyPSdashvfill@{{\SemiDirection=31 \Direction=1023 \xyPSdash@}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{ovals and circles}
+
+The width, height, corner-radius are available as |\dimen@i|, |\dimen@ii|
+and |\R@| respectively; we only need |\R@| here,
+since the extents hold the real information that we need.
+
+\DOCMODE(
+\xydef@\xypsoval@#1{%
+ \dimen@=\L@c \advance\dimen@\R@c
+ \dimen@ii=\U@c \advance\dimen@ii\D@c
+ \ifdim\dimen@ii<\dimen@ \relax \dimen@=\dimen@ii\fi \divide\dimen@\tw@
+% \R@=\frmradius@@
+ \ifdim\R@>\dimen@ \relax \R@=\dimen@ \fi
+ \D@c=-\D@c \L@c=-\L@c
+ \edef\tmp@{\expandafter\removePT@\the\R@
+ \space\expandafter\removePT@\the\R@c
+ \space\expandafter\removePT@\the\D@c
+ \space\expandafter\removePT@\the\L@c
+ \space\expandafter\removePT@\the\U@c }%
+ \expandafter#1\expandafter{\tmp@}}
+
+\xydef@\xypscircle@#1{\dimen@=\R@
+ \edef\tmp@{\expandafter\removePT@\the\dimen@}%
+ \expandafter#1\expandafter{\tmp@}}
+
+\xydef@\xypsellipse@#1{\edef\tmp@{%
+ \expandafter\removePT@\the\U@c \space
+ \expandafter\removePT@\the\D@c \space
+ \expandafter\removePT@\the\L@c \space
+ \expandafter\removePT@\the\R@c }%
+ \expandafter#1\expandafter{\tmp@}}
+
+\xydef@\xyPSoval@Special#1{\PSmacro@{#1 ov}}
+\xydef@\xyPScirc@Special#1{\PSmacro@{#1 ox}}
+\xydef@\xyPSdotcirc@Special#1{\PSmacro@{#1 ot}}
+\xydef@\xyPSdashcirc@Special#1{\PSmacro@{#1 od}}
+\xydef@\xyPSdotoval@Special#1{\PSmacro@{#1 vt}}
+\xydef@\xyPSdashoval@Special#1{\PSmacro@{#1 vd}}
+\DOCMODE)
+
+The \PS\ operators |ov|, |ox| etc. are defined within |xyps-pro|,
+having scope limited to |XYdict| and sub-dictionaries.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Filled regions}
+
+\DOCMODE(
+\xydef@\xyPSfilledRegion#1#2{\setboxz@h{\lower\D@c\vbox{%
+ \vglue\U@c\hbox{#1#2\empty\hglue\L@c\hglue\R@c}\vglue\D@c}}%
+ \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}
+
+\xydef@\filledRectangle@PS{%
+ \xyPSfilledRegion{\xypsoval@\xyPSfilloval@Special}}
+\xydef@\filledCircle@PS#1{{\R@c=\R@ \L@c=\R@ \U@c=\R@ \D@c=\R@
+ \xyPSfilledRegion{\xypscircle@\xyPSfillcirc@Special}#1}}
+\xydef@\filledEllipse@PS{%
+ \xyPSfilledRegion{\xypsellipse@\xyPSfillellipse@Special}}
+\xydef@\filledOval@PS{%
+ \xyPSfilledRegion{\xypsoval@\xyPSfilloval@Special}}
+
+\xydef@\frame@emph@PS#1{\filled@{#1}\relax}
+
+\xydef@\installPSfills@{%
+ \let\frame@emph@@=\frame@emph@PS
+ \let\filledRectangle@@=\filledRectangle@PS
+ \let\filledOval@@=\filledOval@PS
+ \let\filledCircle@@=\filledCircle@PS
+ \let\filledEllipse@@=\filledEllipse@PS
+}
+\DOCMODE)
+
+Rectangles are treated as a special case of ovals.
+The |#2| parameter signifies whether the outline of the object
+should also be stroked (|#2|=|\relax|) after being filled.
+Such a stroke is always in black.
+
+\DOCMODE(
+%\xydef@\xyPSfillrect@Special#1#2{%
+% \ifx#2\relax\PSmacro@{#1 sfr}%
+% \else\PSmacro@{#1 fr}\fi}
+\xydef@\xyPSfilloval@Special#1#2{%
+ \ifx#2\relax\PSmacro@{#1 sfo}%
+ \else\PSmacro@{#1 fo}\fi}
+\xydef@\xyPSfillcirc@Special#1#2{%
+ \ifx#2\relax\PSmacro@{#1 sfc}%
+ \else\PSmacro@{#1 fc}\fi}
+\xydef@\xyPSfillellipse@Special#1#2{%
+ \ifx#2\relax\PSmacro@{#1 sfe}%
+ \else\PSmacro@{#1 fe}\fi}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-f.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 10:07:22 ross
+% cosmetic changes to macro-names
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+%
+% NEW for version 3.0 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-l.doc b/Master/texmf-dist/source/generic/xypic/xyps-l.doc
new file mode 100644
index 00000000000..8dc1d1a1ae4
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-l.doc
@@ -0,0 +1,195 @@
+%% $Id: xyps-l.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Line extension'' PostScript backend support.
+%% Copyright (c) 1993-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\expandafter\ifx\csname xyps-lloaded\endcsname\empty
+ \message{not reloaded}\endinput \fi
+\expandafter\let\csname xyps-lloaded\endcsname=\empty \xycatcodes
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Line-styles}
+
+The included file |xyps-l.tex| (version \stripRCS$Revision: 3.7 $) provides
+\PS\ support for the effects defined in the |line| extension described
+in~\S??g[:line].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The \PS\ style methods are required, so ensure that they are loaded.
+
+\DOCMODE(
+\expandafter\ifx\csname xyps-sloaded\endcsname\empty\else
+ \xyinputorelse@{xyps-s}{\xyerror@{Could not load xyps-s}{}}%
+ \xycatcodes\fi
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This file is loaded and its effects are activated automatically whenever
+|\xyoption{line}| is requested and the current <driver> supports
+\PS\ line styles. Should there be any need to turn off this support,
+the following commands are available; they obey usual \TeX\ groupings.
+%
+\begin{defs}
+|\NoPSlines| & remove \PS\ support\kern-50pt\cr
+|\UsePSlines| & reinstate \PS.
+\end{defs}
+%
+Without \PS\ support lines can be expected to be displayed in the default
+style, having thickness of $.4$pt.
+These commands are provided primarily for testing and trouble-shooting;
+\eg~with <driver> configurations untested by the authors of \Xy-pic,
+who should be notified of any difficulties.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Installation}
+
+The <driver>-file must call the following macro to rebind a control sequence
+defined in |xyline|, thereby allowing the \PS\ method to be used.
+The purpose of the |\xyPSlinew@| hook is to allow the \PS\ style sequencing
+method to be used with other back-ends, changing just the contents of the
+|\special|s actually placed.
+
+\DOCMODE(
+\xydef@\installPSline@{\installPSstyle@
+ \installPSlinestyles@ \installPSpolylines@ }
+
+\xydef@\UsePSlines{\installPSline@}
+\xydef@\NoPSlines{\UnloadLine@\relax}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{widths, joins and caps}
+
+This, and the rebindings below, is all that is needed for the cleaner,
+more sophisticated way.
+
+\DOCMODE(
+\xydef@\xyPSlineSpecial@#1{\addtostyletoks@{ #1 lw}}
+\xydef@\xyPScapSpecial@#1{\addtostyletoks@{ #1 lc}}
+\xydef@\xyPSjoinSpecial@#1{\addtostyletoks@{ #1 lj}}
+\xydef@\xyPSmiterSpecial@#1{\addtostyletoks@{ #1 ml}}
+
+\xydef@\installPSlinestyles@{%
+ \let\xylinewidth@@=\xylinewidth@
+ \let\transxyline@@=\transxyline@
+ \let\xylineSpecial@@=\xyPSlineSpecial@
+ \let\resetxyline@@=\resetxyline@i
+%
+ \let\xy@linecap@@=\xy@linecap@
+ \let\xycapSpecial@@=\xyPScapSpecial@
+ \let\resetxylinecap@@=\resetxylinecap@i
+%
+ \let\xy@linejoin@@=\xy@linejoin@
+ \let\xyjoinSpecial@@=\xyPSjoinSpecial@
+ \let\resetxylinejoin@@=\resetxylinejoin@i
+%
+ \let\xy@linemiter@@=\xy@linemiter@
+ \let\xymiterSpecial@@=\xyPSmiterSpecial@
+ \let\resetxylinemiter@@=\resetxylinemiter@i
+}
+\DOCMODE)
+
+The \PS\ operators |lw|, |lc|, |lj|, |ml| are defined in |xyps-ps| to set the
+|linewidth|, |linecap|, |linejoin|, |miterlimit| graphics-state parameters,
+respectively.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Poly-lines}
+
+\DOCMODE(
+\xydef@\xypolylinePS@Special#1{\PSmacro@{#1 pl}}
+\xydef@\xypolydotPS@Special#1{\PSmacro@{#1 pt}}
+\xydef@\xypolydashPS@Special#1{\PSmacro@{#1 pd}}
+\xydef@\xypolyfillPS@Special#1{\PSmacro@{#1 pf}}
+\xydef@\xypolyeofillPS@Special#1{\PSmacro@{#1 pe}}
+
+\xydef@\installPSpolylines@{%
+ \let\xypolyline@Special=\xypolylinePS@Special
+ \let\xypolydot@Special=\xypolydotPS@Special
+ \let\xypolydash@Special=\xypolydashPS@Special
+ \let\xypolyfill@Special=\xypolyfillPS@Special
+ \let\xypolyeofill@Special=\xypolyeofillPS@Special
+ \let\xy@polystyle@@=\xy@polystyle@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-l.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 10:05:50 ross
+% minor improvements to file-loading commands
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.9 1994/06/09 14:38:56 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% Revision 2.9 1994/06/09 14:38:56 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% NEW for version 2.9 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-pro.doc b/Master/texmf-dist/source/generic/xypic/xyps-pro.doc
new file mode 100644
index 00000000000..165e601261f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-pro.doc
@@ -0,0 +1,253 @@
+%% $Id: xyps-pro.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``PostScript Prolog'' for PostScript support.
+%% Copyright (c) 1993-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+
+%\expandafter\let\csname xyps-proloaded\endcsname=\empty %
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This included file (version \stripRCS$Revision: 3.7 $) provides the \PS\ prolog
+file. This contains the definitions of the main \PS\ programming structures
+required to support the \PS\ effects available in \Xy-pic. A separate file
+|xypsdict.doc| describes the extra \PS\ needed to support the \PS\ back-end.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\paragraph*{\PS\ Prolog}
+
+This creates the \PS\ dictionary called |XYdict| within the usual |userdict|
+or any other dictionary supplied by the specific driver.
+Commands loaded here are ones which may by used by extensions other than the
+\PS\ back-end, which loads many more commands into this dictionary using
+the code to be found in |xypsdict.tex|.
+
+\DOCMODE(
+\begingroup \xycatcodes%
+ \count@=\xydashl@\relax \count@@=\xydashw@\relax%
+ \let\firstPS@@=\relax%
+ \xyPSobeylines@@%
+%
+\PSspecialdict@@{%
+/XYdict where not{250 dict /XYdict exch def
+ /xy{mark exch XYdict begin countdictstack /xylevel exch def
+ xyopen xycolor mark xypatt xypattern stopped xyclose end
+ cleartomark}def /xyg{gsave xy}def
+ /xyf{currentfont exch xy grestore setfont}def
+ /xycc{{xychgcol}xy}def /xyc{XYdict begin xycolstore end}def
+ /xyx{/xyYpos exch def /xyXpos exch def}def
+ /xyp{currentpoint xyx}def %/xycp{currentpoint xyx}def
+ /xyd{setupDirection XYdirection 2 mul}def
+ /xyct{currentpoint xyt 2 copy 6 2 roll}def
+ /xyt{xyXpos xyYpos 2 copy translate}def /xyr{neg rotate xynt}def
+ /xyrs{neg rotate 3 -1 roll sub neg 3 1 roll sub exch moveto xynt}def
+ /xynt{neg exch neg exch translate}def /xys{scale xynt}def
+ /xyss{scale 3 -1 roll sub neg 3 1 roll sub exch moveto xynt}def
+ /xyi{0 0 transform grestore gsave itransform}def
+ }if}%
+%
+\tmp@false\def\do#1{\DN@{#1}\ifx\next@\nextii@\tmp@true\fi}%
+\DNii@{17oztex}\xydriversselected@@\iftmp@\PSspecialdict@@{%
+ /@boxy{prespecialVM restore grestore}def
+ /@eoxy{gsave /prespecialVM save def}def
+ }%
+\else \DNii@{oztex}\xydriversselected@@\iftmp@\PSspecialdict@@{%
+ /@oxy{prespecialVM restore grestore}def
+ /@oxy{gsave /prespecialVM save def}def
+ }\fi\fi%
+%
+\PSdict@@{/XYdict where pop begin XYdict begin}%
+%
+%\PSspecialdict@@{%
+\PSdict@@{%
+ /xyopen{currentdict /XYddict known{XYddict null eq{}
+ {XYddict begin xyopen}ifelse}if}def
+ /xyclose{countdictstack -1 xylevel 1 add{pop end}for}def
+ /xychgcol{/xycolor exch def}def /xysetcol{xypush xychgcol}def
+}%
+\PSdict@@{%
+ /xypush{16 dict /XYddict exch def XYddict begin}def
+ /undef where
+ {pop /xypop{countdictstack xylevel eq{}{end}ifelse
+ currentdict /XYddict undef}def}
+ {/xypop{countdictstack xylevel eq{}{end}ifelse
+ /XYddict null def}def}ifelse
+ /pu /xypush load def /pp /xypop load def}%
+%
+\PSdict@@{%
+ /xypspt{72 72.27 div dup scale}bind def /pscorrect{.85 mul}bind def
+ /gstartxy{gsave xypspt xywidth xycap xyjoin xymiter newpath 0 0 moveto}def
+% /grulexy{gsave xyrulth newpath 0 0 moveto}def
+ /xypath{gstartxy rmoveto counttomark 2 idiv -1 1{pop lineto}for}def
+ /xystroke{stroke grestore}bind def
+ /xyfill{closepath fill grestore}bind def
+ /xystfil{closepath gsave fill grestore 0 setgray
+ 0 setlinewidth xystroke}bind def
+ /xyeofill{closepath eofill grestore}bind def
+% /xyclip{closepath fill grestore}bind def
+% /xyeoclip{closepath eofill grestore}bind def
+}%
+\PSdict@@{%
+ /xypolyline{xypath xystroke}def /xypolyfill{xypath xyfill}def
+ /xydotsep{/@ currentlinewidth 2 mul def}def
+ /xypolydot{xypath xydotsep [xydt @] 0 setdash xystroke}def
+ /xypolydash{xypath xydotsep [@ @] 0 setdash xystroke}def
+ /xypolyeofill{xypath xyeofill}def /pe /xypolyeofill load def
+ /pl /xypolyline load def /pf /xypolyfill load def
+ /pt /xypolydot load def /pd /xypolydash load def }%
+%
+\PSdict@@{%
+ /arc4pop{arcto 4{pop}repeat}bind def
+ /xyoval{gstartxy oval closepath xystroke}def
+% /xycircle{gstartxy dup dup neg dup dup neg oval xystroke}def
+ /xycircle{gstartxy circle xystroke}def
+ /circle{dup 0 moveto 0 0 3 -1 roll 0 360 arc}def
+ /oval{newpath 2 copy exch 5 index add 2 div exch 3 copy 10 3 roll
+ moveto 1 index dup 5 1 roll 3 index 7 index arc4pop
+ dup dup 4 1 roll 4 index exch 6 index arc4pop
+ 1 index dup 8 1 roll 4 index 4 index arc4pop
+ arc4pop closepath}def
+ /xyellipse{gstartxy counttomark 1 gt{squarify pop pop 1}if
+ circle xystroke}def
+ /ov /xyoval load def /ox /xyellipse load def }%
+%
+\PSdict@@{%
+ /dotit{dup currentlinewidth 6 mul div round div
+ /@ exch def [xydt @] 0 setdash}def
+ /elldash{dup 4 -1 roll 10 exch div dashit}def
+ /ovdash{dup 10 dashit}def
+ /dashit{div round 2 mul div /@ exch def [@ @] 0 setdash}def
+ /dotcirc{gstartxy cirlen dotit circle xystroke}def
+ /dashcirc{gstartxy cirlen dashit circle xystroke}def
+ /dotoval{gstartxy 5 copy ovlen dotit oval xystroke}def
+ /dashoval{gstartxy 5 copy ovlen ovdash oval xystroke}def
+ /cirlen{dup 6.283185 mul}bind def
+ /ovlen{3 -1 roll sub 3 1 roll sub add exch 1.716815 mul sub}def
+ /dotellipse{gstartxy counttomark 1 gt{squarify pop pop 1}if
+ cirlen dotit circle closepath xystroke}def
+ /dashellipse{gstartxy counttomark 1 gt{squarify add 2 div 1}
+ {1 exch 1 exch}ifelse cirlen elldash circle xystroke}def
+ /ot /dotellipse load def /od /dashellipse load def
+ /vt /dotoval load def /vd /dashoval load def }%
+%
+\PSdict@@{%
+ /filloval{gstartxy oval xyfill}def
+ /stfiloval{gstartxy oval xystfil}def
+ /fillcircle{gstartxy circle xyfill}def
+ /stfilcircle{gstartxy circle xystfil}def
+ /fillellipse{gstartxy squarify pop pop 1 circle xyfill}def
+ /stfilellipse{gstartxy squarify pop pop 1 circle xystfil}def
+ /squarify{4 copy sub 2 div 3 1 roll sub 2 div translate
+ add 2 div 3 1 roll add 2 div 2 copy scale
+ 2 copy add 2 div currentlinewidth exch div setlinewidth
+ newpath}def
+ /fe /fillellipse load def /sfe /stfilellipse load def
+ /fo /filloval load def /sfo /stfiloval load def
+ /fc /fillcircle load def /sfc /stfilcircle load def }%
+%
+\PSdict@@{%
+ /xywidth{.4 pscorrect setlinewidth}bind def
+ /xydash{[] 0 setdash}bind def /xycap{1 setlinecap}bind def
+ /xyjoin{1 setlinejoin}bind def /xymiter{10 setmiterlimit}bind def
+}%
+\PSdict@@{%
+ /cc{dup exec xychgcol}def
+ /lw{dup setlinewidth /@l exch def
+ /xywidth{@l setlinewidth}bind def}def
+ /lc{dup setlinecap /@c exch def
+ /xycap{@c setlinecap}bind def}def
+ /lj{dup setlinejoin /@j exch def
+ /xyjoin{@j setlinejoin}bind def}def
+ /ml{dup setmitrelimit /@m exch def
+ /xymiter{@m setmitrelimit}bind def}def
+}%
+\PSdict@@{%
+ /setupDirection{dup -2048 lt{3072 add neg 1024 exch}
+ {dup 0 lt{1024 add neg -1024}{dup 2048 lt{1024 sub -1024 exch}
+ {3072 sub 1024}ifelse}ifelse}ifelse atan
+ dup 180 gt{360 sub}if dup /XYdirection exch def rotate}def
+ }%
+\PSdict@@{%
+ userdict begin
+ /gray{setgray}bind def /gray@{setgray}bind def
+ /rgb{setrgbcolor}bind def /rgb@{setrgbcolor}bind def
+ /hsb{sethsbcolor}bind def /hsb@{sethsbcolor}bind def
+ /setcmykcolor where{pop}{/setcmykcolor{dup 3 1 roll dup 5 1 roll
+ exch sub 1 add 5 1 roll exch sub 1 add 4 1 roll
+ exch sub 1 add 3 1 roll setrgbcolor}bind def}ifelse
+ /cmyk{setcmykcolor}bind def /cmyk@{setcmykcolor}bind def
+ /sethalftone where{/sethalftone load /tone exch def}if
+ /xycolarray 3 array def /xycolstore{currentrgbcolor 2 -1 0
+ {exch xycolarray 3 1 roll put}for}def xycolstore
+ /xycolor{0 1 2{xycolarray exch get}for setrgbcolor}def
+ /xypatt{}def /xypattern{cleartomark}bind def
+ end}%
+%
+\PSdict@@{end end}%
+%
+\endgroup%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-pro.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.3 1996/12/18 10:00:34 ross
+% requires larger PostScript dictionary
+% uses \xydriversselected@@ for optional loading with OzTeX
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+%
+% NEW for version 3.1 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-ps.doc b/Master/texmf-dist/source/generic/xypic/xyps-ps.doc
new file mode 100644
index 00000000000..c4c4bb4d35c
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-ps.doc
@@ -0,0 +1,750 @@
+%% $Id: xyps-ps.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``PS-PS'' PostScript support.
+%% Copyright (c) 1993-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\expandafter\ifx\csname xyps-psloaded\endcsname\empty
+ \message{not reloaded}\endinput \fi
+\expandafter\let\csname xyps-psloaded\endcsname=\empty \xycatcodes
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The included file |xyps-ps.tex| (version\stripRCS$Revision: 3.7 $)
+provides support for \PS\ |\special| commands used by the |ps| backend
+extension as well as \PS-based options, to produce special effects
+not available directly with \TeX.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\paragraph*{\PS\ {\tt\string\special} commands}
+
+The \PS\ |\special|s which are used by \Xy-ps fall into four broad
+classes:
+%
+\begin{enumerate}
+\item execute a piece of code, e.g. to draw some graphic object;
+\item add a new \PS\ definition to the existing dictionary of commands;
+\item change the value of some parameters, storing them for later use; and
+\item read \PS\ commands from a pre-existing file.
+\end{enumerate}
+
+Since different drivers may provide different syntax for these classes
+of command, \Xy-ps has different macros to optimize to interface to the
+different drivers. Initially these control-sequence names are bound to
+macros that do nothing. Upon specifying a driver, they will be bound
+to a macro appropriate for that driver.
+
+\DOCMODE(
+\xylet@\PSmacro@@=\eat@
+\xylet@\PSdict@@=\eat@
+\xylet@\PSspecial@@=\eat@
+\xylet@\PSread@@=\eat@
+\xylet@\PSinclude@@=\eat@
+\xylet@\PSraw@@=\eat@
+\xylet@\xyPSobeylines@@=\relax
+\xylet@\PSspecialdict@@=\eat@
+
+\xydef@\UnloadPSps@{%
+ \let\PSmacro@@=\eat@
+ \let\PSdict@@=\eat@
+ \let\PSspecial@@=\eat@
+ \let\PSread@@=\eat@
+ \let\PSinclude@@=\eat@
+ \let\PSraw@@=\eat@
+ \let\xyPSobeylines@@=\relax
+ \let\PSspecialdict@@=\eat@
+}
+\DOCMODE)
+
+Unloading \PS\ requires also turning off the \PS-backend,
+if it has been loaded.
+
+\DOCMODE(
+\xydef@\UnloadPS@{\UnloadPSps@
+ \expandafter\ifx\csname xypsloaded\endcsname\unknown\PSspecials@false
+ \else\expandafter\NoPSspecials\fi}
+\xylet@\UnloadPS@@=\UnloadPS@
+
+%\xyaddunsupport{ps}\UnloadPS@@
+\DOCMODE)
+
+\DOCMODE(
+\ifx\undefined\dvitype@\xydef@\dvitype@{null}\fi
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Some drivers, in particular versions of \Textures\ earlier than 1.7, require
+the \PS\ dictionary to be included with every page shipped out.
+We do this by providing a routine which rebinds the |\shipout| primitive to
+a macro |\xyPSshipout@| which prepends the \Xy-ps \PS\ dictionary to the box
+being shipped-out. This routine |\@PSshipout| is called, if necessary, when
+the driver has been specified.
+
+\DOCMODE(
+\xylet@\xyrealshipout@=\shipout
+\xydef@\xyPSshipout@{\setbox9=\copy\voidb@x
+ \afterassignment\xyPSshipout@i\setbox9=}
+\xydef@\xyPSshipout@i{\ifvoid9 \expandafter\aftergroup\fi\xyPSshipout@ii}
+\xydef@\xyPSshipout@ii{\xyrealshipout@\vbox{\XYpredict@@\box9}}
+
+\xydef@\@PSshipout{\global\let\shipout=\xyPSshipout@ }
+\DOCMODE)
+
+The box register |\box9| is assumed to be a scratch register, used globally
+according to \TeX\ conventions.
+
+When the \PS\ backend is loaded then we need to rebind |\shipout| to include
+the full dictionary.
+
+\DOCMODE(
+\xydef@\xyPSshipout@PSii{%
+ \ifUsePSdict@@\let\XYshipdict@=\includeXYPSdict@@
+ \else\def\XYshipdict@{\XYpredict@@\XYdict@@}\fi
+ \xyrealshipout@\vbox{\XYshipdict@\box9}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+These two control sequences are used in the DVI-driver files
+to control when the \PS\ <driver> can be altered.
+
+\DOCMODE(
+\xydef@\firstPS@{%\fixedxydriver@
+ \global\let\firstPS@@=\relax \global\let\firstPS@=\relax}
+\xylet@\firstPS@@=\firstPS@
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+\subsection{Installation}
+%
+To install use of \PS\ requires loading the \PS\ dictionary.
+However this can only be done when a <driver> is known to be able to
+support it. Hence the |\installxyps@| command should be called only from
+within a <driver>-file.
+
+Furthermore, the <driver>-file should define a value for |\installxyps@@|
+to including anything specific to that <driver>; even if only
+|\let\installxyps@@=\relax|. If |\dumpPSdict| has been specified,
+then the dictionary must be written first, so it can be used with the
+subsequent processing (see the subsection below).
+
+\DOCMODE(
+\ifx\undefined\dumpPSdict@@ \xylet@\dumpPSdict@@=\relax \fi
+
+\xydef@\installxyps@{%
+ \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}\xycatcodes
+ \installxyps@@ \installxyps@x }
+
+\xylet@\installxyps@@=\relax
+\xylet@\setupxyPS@@=\relax
+\xywithoption{ps}{\let\setupxyPS@@=\setupxyPS@}
+
+\xydef@\installxyps@x{\dumpPSdict@@
+ \ifx\xyrealshipout@\undefined \let\xyrealshipout@=\shipout\fi
+ \ifx \shipout \xyrealshipout@
+ \ifUsePSdict@@ \DN@{\includePSmessage@\includeXYPSdict@\message{>}}%
+ \else \DN@{\XYdict@\endXYdict@}\fi
+ \else \DN@{\let\xyPSshipout@ii=\xyPSshipout@PSii \@PSshipout}\fi
+ \let\firstPS@=\relax \next@
+ \let\XYpredict@=\relax
+ \setupxyPS@@ }
+
+\let\realinstallxyps@x=\installxyps@x
+\ifx\undefined\AfterBeginDocument
+ \def\installxyps@x{\xysetup@@{\realinstallxyps@x}}%
+\else
+ \def\installxyps@x{\AfterBeginDocument{\realinstallxyps@x}}%
+\fi
+\DOCMODE)
+
+In case no <driver> was known when a call to the |\installxyps@| method
+was queued, e.g. by |\dumpPSdict{}| before any |\xyoption{|<driver>|}|,
+then a check is made to see there is now a known <driver> which
+supports \PS. If so then this installation is cancelled since another
+should follow, otherwise the default <driver> of |dvips| is assumed.
+The command |\xyPSdriver#1| is provided to allow users to change this
+default <driver>. This may be necessary when multiple <driver>s are
+required and the final one specified does not support \PS.
+
+\DOCMODE(
+\xydef@\xydefaultdriver@{dvips}
+\xydef@\xyPSdriver#1{\def\xydefaultdriver@{#1}}
+
+\xydef@\installxyps@orig{\DN@{}%
+ \ifx\xydriversselected@@\empty
+ \DN@{\expandafter\defaultinstallps@\expandafter{\xydefaultdriver@}}%
+ \else \def\do##1{%
+ \expandafter\ifx\csname##1@xy@ps\endcsname\relax
+ \DN@{\defaultinstallps@{##1}}}%
+ \xydriversselected@@
+ \else \DN@##1{}\fi\fi \next@ }
+
+%\xylet@\installxyps@@=\installxyps@orig
+
+\xydef@\defaultinstallps@#1#2{%
+ \xywarning@{no driver specified, using #1 }%
+ \xyrequire{#1}\csname #1@xy@ps\endcsname{}}
+
+\xydef@\null@xy@ps{\installxyps@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection*{\PS\ escape}
+??=[postscript escape]
+
+An extra <shape> modifier key allows arbitrary \PS\ code
+to be applied to the current <object>.
+%
+\begin{defs}
+ |[!|<postscript code>|]| & for special effects\cr
+ |[psxy]| & stores current location.\cr
+\end{defs}
+
+\DOCMODE(
+\xydefcsname@{shape [!...]}#1{%\tracingall%
+ \expandafter\ifx\csname xyps-sloaded\endcsname\empty \DN@{\xyPSescapestyle@{#1}@@}%
+ \else\ifxyPSshapes@\DN@{\xyPSshapechar@{#1}@@}%
+ \else \DN@{\xyPScharwarning@}\fi\fi \next@ }
+\xydefcsname@{shape [psxy]}{\ifxyPSshapes@\DN@{\xyPSpsxy@}%
+ \else \DN@{\xyPScharwarning@}\fi \next@ }
+\DOCMODE)
+%
+\noindent
+Normally the <postscript code> will be a simple command to alter the
+\PS\ graphics state:
+e.g. |[!1 0 0 setrgbcolor]| changes the colour used to render parts of
+the <object>.
+Any number of such <shape> modifiers is allowable,
+however it is more efficient
+to combine them into a single modifier, whenever possible.
+
+It is very important that braces |{| and |}| do not
+appear explicitly in any <postscript code>, as this may upset the
+\Xy-pic <object> parsing. However it is acceptable to have a
+control sequence name here, expanding into more
+intricate \PS\ code. This will not be expanded until
+a later (safe) time.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+Due to differences within the DVI-drivers, such simple \PS\
+commands need not affect every part of an <object>.
+In particular the lines, curves and arrowheads generated
+by \Xy-pic use a different mechanism,
+which should give the same result with all drivers.
+This involves redefining some \PS\ procedures
+which are always read prior to rendering one of these objects.
+One simple way to specify a red line is as follows;
+the |xycolor| extension provides more sophisticated support for colour.
+The <shape> modifiers described in the previous section also use
+this mechanism, so should work correctly with all drivers.
+
+\begin{code}
+\def\colorxy(#1){%
+ /xycolor{#1 setrgbcolor}def}
+...
+\connect[!\colorxy(1 0 0)]\dir{-}
+...
+\end{code}
+\displaycode
+
+\noindent
+Note how the braces are inserted within the expansion of the
+control sequence |\colorxy|,
+which happens after parsing of the <connection>.
+The following table shows which graphics parameters are
+treated in this way, their default settings, and the type of
+\PS\ code needed to change them.
+%
+\begin{defs}
+colour &|/xycolor{0 setgray}def| \cr
+line-width&|/xywidth{.4 setlinewidth}def|\kern-7pt \cr
+dashing &|/xydash{[] 0 setdash}def| \cr
+line-cap &|/xycap{1 setlinecap}def| \cr
+line-join &|/xyjoin{1 setlinejoin}def|\kern-7pt \cr
+\end{defs}
+%
+\noindent
+This feature is meant primarily for modifying the rendering
+of objects specified in \TeX\ and \Xy-pic, not for drawing new objects
+within \PS. No guarantee can be given of the current location,
+or scale, which may be different with different drivers.
+However a good \PS\ programmer will be able to overcome
+such difficulties and do much more. To aid in this the special
+modifier |[psxy]| is provided to record the location where the
+reference point of the current <object> will be placed.
+Its coordinates are stored with keys |xyXpos| and |xyYpos|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+When the |\special| is placed the following registers contain important
+values:
+|\L@p| = horizontal displacement of \Xy-pic reference point from
+the \TeX\ reference point (i.e. left-hand end of the box)
+ of the initial object;
+|\D@p| = vertical displacement of \Xy-pic reference point from
+ the \TeX\ reference point (i.e. the baseline) of the initial object;
+|\R@p| = horizontal offset, resulting from <shape> modifiers;
+|\U@p| = vertical offset, initially |-\D@p| but alterable
+ by <shape> modifiers.
+
+\DOCMODE(
+\xydef@\xyPSpsxy@{%
+ \setboxz@h{\dimen@=\L@p \advance\dimen@-\R@p
+ \dimen@ii=-\U@p \raise\dimen@ii\hbox to\z@{%
+ \kern\dimen@\xyPScurrpt@\kern-\dimen@}\boxz@}}%
+
+\xydef@\xyPScurrpt@{\ifxyPSshapes@\expandafter\xyPScurrpt@@\fi}
+\DOCMODE)
+
+It is necessary to know the current \PS\ location.
+Unfortunately the |currentpoint| operator frequently has no value.
+The following code overcomes this difficulty.
+
+Some drivers may need to define this differently...
+
+\DOCMODE(
+\xydef@\xyPScurrpt@@@{\PSspecial@@{xyi}\PSraw@@{userdict begin xyx end}}
+\ifx\undefined\xyPScurrpt@@ \xylet@\xyPScurrpt@@=\xyPScurrpt@@@ \fi
+
+%\xydef@\xyPScurrpt@@@{\PSspecial@@{userdict begin
+% 0 0 transform grestore gsave itransform
+% /xyYpos exch def /xyXpos exch def end}}
+
+%\xydef@\xyPScurrpt@@@{%
+% \PSspecial@@{0 0 transform grestore gsave itransform }%
+% \PSraw@@{userdict begin /xyYpos exch def /xyXpos exch def end}}
+\DOCMODE)
+
+The \PS\ operator called |xyx| is defined below, for storing the
+location placed on the stack by |xyi|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection{Technical Note}:
+The scoping is achieved by using two |\specials| so that the
+resulting \PS\ file should ultimately look like:
+\begin{defs1}
+|... {| special code before|}| <object> |{|special code after|} ...|
+\end{defs1}
+The ``code after'' is to cancel the effect, returning the graphics
+state to what it was prior to the ``code before''.
+Not all DVI-drivers can achieve this sequencing. In particular \OzTeX\
+collects all |\specials| in the DVI-file and places their contents
+at the beginning of the \PS\ file: any effect would be cancelled
+immediately after it has been established.
+
+The user can add code to both parts by expressing the <shape> modifier
+as follows:
+%
+\begin{defs1}
+ ??c![*]\dots|!|<code before>|<>|<code after>|]|\dots\ .\cr
+\end{defs1}
+%
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Further Technical Note}:
+The ``code before'' does two things in addition to that code given
+explicitly by the user. Firstly it issues a |gsave| then it opens
+a new dictionary on the dictionary stack. The ``code after''
+contains the matching |grestore| after closing the new dictionary.
+
+Since objects can be built as |\composite|s and diagrams can be nested,
+there is the possibility of generating long chains of nested
+\PS\ dictionaries. For this reason the dictionary is kept
+small, allowing only 8 key-value pairs to be |def|ined within it.
+If more are required, the user should define a private
+dictionary to hold the extra key-value pairs, making sure that it is
+open when its entries need to be accessed.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xywarnifdefined\xyPSshapechar@
+\xywarnifdefined\xyPSsplitshape@
+
+{\xyuncatcodes \catcode`@=11
+ \gdef\xyPSshapechar@#1@@{\xyPSsplitshape@#1<><>@@}%
+ \gdef\xyPSsplitshape@#1<>#2<>#3@@{\xyPSsplitPS@{#1}{#2}}}
+
+%\xydef@\xyPSsplitPS@#1#2{%\aftergroup\show\aftergroup\relax
+% \def\xyPSpre@{#1}\def\xyPSpost@{#2}\modPSboxz@ }
+
+\xydef@\xyPSrawA@#1{\expandafter\xyPSrawAA@ #1{}}%
+\xydef@\xyPSrawAA@#1#2{\PSraw@@{{pu #1}xyg #2}%
+ \PSmessage{{pu #1}xyg #2}}%
+\xydef@\xyPSrawZ@#1{\PSraw@@{{#1 pp}xyf}\PSmessage{{#1 pp}xyf}}%
+\DOCMODE)
+
+The \PS\ operators |pu|, |pp|, |xyg| and |xyf| are defined below,
+for push/pop of the |XYddict| stack, preceded/followed by a
+|gsave|/|grestore| of the \PS\ graphics state.
+
+\DOCMODE(
+\xydef@\modPSboxz@{%
+ \expandafter\DN@\expandafter{\xyPSpre@{}}\ifx\next@\empty\else
+ \setboxz@h{\expandafter\xyPSrawA@\expandafter{\xyPSpre@{}}\boxz@
+ \expandafter\xyPSrawZ@\expandafter{\xyPSpost@}}\DN@{}\fi}%
+
+\xydef@\modPSdrop@{%
+ \expandafter\DNii@\expandafter{%
+ \expandafter\xyPSrawA@\expandafter{\xyPSpre@{}}}%
+ \DN@##1{\expandafter\def\expandafter\tmp@\expandafter{\nextii@ ##1}}%
+ \expandafter\next@\expandafter{\Drop@@}%
+ \expandafter\DNii@\expandafter{%
+ \expandafter\xyPSrawZ@\expandafter{\xyPSpost@}}%
+ \DN@##1{\expandafter\def\expandafter\Drop@@\expandafter{\tmp@ ##1}}%
+ \expandafter\next@\expandafter{\nextii@}}%
+
+\xydef@\modPSconnect@{%
+ \expandafter\DNii@\expandafter{%
+ \expandafter\xyPSrawA@\expandafter{\xyPSpre@{}}}%
+ \DN@##1{\expandafter\def\expandafter\tmp@\expandafter{\nextii@ ##1}}%
+ \expandafter\next@\expandafter{\Connect@@}%
+ \expandafter\DNii@\expandafter{%
+ \expandafter\xyPSrawZ@\expandafter{\xyPSpost@}}%
+ \DN@##1{\expandafter\def\expandafter\Connect@@\expandafter{\tmp@ ##1}}%
+ \expandafter\next@\expandafter{\nextii@}}%
+
+\xydef@\xyPSpre@{{}{}}
+\xydef@\xyPSpost@{}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Some utility macros for controlling writing to the log-file.
+
+\DOCMODE(
+\xydef@\PSmessage@#1{\W@{PS: #1, direction=\the\Direction}}
+\xydef@\PSignore@#1{}%
+\xydef@\showPSmessages{\let\PSmessage=\PSmessage@}
+\xydef@\hidePSmessages{\let\PSmessage=\PSignore@}
+\xylet@\PStracing=\showPSmessages
+\hidePSmessages
+
+\xydef@\PSmacro@#1{\PSmacro@@{#1}\PSmessage{#1}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection*{\PS\ Header file}
+
+This creates a flag to indicate whether the user wishes to get the \PS\
+dictionary from an external header file.
+
+\DOCMODE(
+\xydef@\includeXYPSdict@@{%
+ \expandafter\PSinclude@@\expandafter{\xyPSdictname}}
+\xydef@\includeXYPSdict@r{\message{PS: includeXYPSdict}\includeXYPSdict@@
+ \let\includeXYPSdict@=\relax}
+\xylet@\includeXYPSdict@\includeXYPSdict@r
+
+\xydef@\endXYdict@{}
+
+\xydef@\includePSmessage@@{\message{<xyps: including \xyPSdictname}}
+\xylet@\includePSmessage@=\includePSmessage@@
+
+\xydef@\xyPSdictknown@{%
+% \immediate\closein\xyPSdictread@
+ \immediate\closein\xyread@
+ \xywarning@{File \xyPSdictname\space already exists}
+ \message{ Do you wish to overwrite it \string? y/n }%
+ \read16 to \next
+ \DNii@{\xywarning@{You did not type Y or N -- try again please}%
+ \xyPSdictknown@}%
+ \DN@{Y }\ifx\next@\next \DNii@{\writePSdict@@}%
+ \else\DN@{y }\ifx\next@\next \DNii@{\writePSdict@@}%
+ \else\DN@{n }\ifx\next@\next \DNii@{\cancelPSdict@}%
+ \else\DN@{N }\ifx\next@\next \DNii@{\cancelPSdict@}%
+ \fi\fi\fi\fi \nextii@ }
+
+\xydef@\cancelPSdict@{%
+ \xywarning@{cancelling dump of PostScript dictionary}}
+
+\xydef@\noDictmessage@{%
+ \xywarning@{\dvitype@\space does not support the use of a header file}}
+\DOCMODE)
+
+These macros are also defined in |xyps.doc|. To avoid warning messages
+about redefinitions, that mechanism has been disabled.
+
+\DOCMODE(
+\DN@{\csname newif\endcsname\ifUsePSdict@@\DN@{}}
+ \ifx\undefined\UsePSdict@@true\else\DN@{}\fi \next@
+
+\ifx\undefined\xyPSdefaultdict
+ \xydef@\xyPSdefaultdict{%
+ \DN@##1.##2.##3@{\gdef\xyPSdictname{xy##1##2dict.pro}}%
+ \expandafter\next@\xyversion.@}%
+\fi
+
+\ifx\undefined\UsePSheader@
+ \xydef@\UsePSheader@#1{%
+ \DN@{#1}\ifx\next@\empty
+% \ifx\xyPSdictname\undefined\xyPSdefaultdict\fi
+ \else \gdef\xyPSdictname{#1}\fi
+ \ifx\xyPSdictname\undefined\xyPSdefaultdict\fi
+ \gdef\xyHeaderMessage@{%
+ It includes a reference to the PostScript file \xyPSdictname.^^J}%
+ \UsePSdict@@true}%
+ \let\UsePSheader=\UsePSheader@
+\fi
+\DOCMODE)
+
+This is used to write the dictionary to a file, suitable for inclusion
+as a resource within any \PS\ document. It is fully conforming to
+Adobe's document structuring guidelines.
+
+\DOCMODE(
+\xywarnifdefined\xyPS@@
+\xywarnifdefined\xyPS@@@
+{\catcode`|=14 \catcode`\%=12 \catcode`\<=1 \catcode`\>=2 |
+ \gdef\xyPS@@<%%>\gdef\xyPS@@@<%!>}
+
+%\xydef@\writePSdict@@{\writePSdict@ \let\writePSdict@@=\relax}
+\xydef@\writePSdict@@{\message{PS: writePSdict@@}\writePSdict@
+ \def\writePSdict@@{\message{write PS relaxed}}}
+{\catcode`|=14 \catcode`\%=12
+ \gdef\writePSdict@{{\begingroup|
+ \immediate\openout\xywrite@=\xyPSdictname \relax
+ \message{<xyps: dumping \xyPSdictname}|
+ \def\PSdict@@@##1{\immediate\write\xywrite@{##1}}|
+ \let\xyPSobeylines@@=\obeyoutlines@
+ \let\firstPS@@=\relax
+ \let\endXYdict@=\relax
+ \PSdict@@@{\xyPS@@@ PS-Adobe-3.0 Resource-procset}|
+ \PSdict@@@{\xyPS@@ Title: \xyPSdictname}|
+ \PSdict@@@{\xyPS@@ Version: REPLACEWITHVERSION}|
+ \PSdict@@@{\xyPS@@ Creator: Xy-ps backend to Xy-pic}|
+ \PSdict@@@{\xyPS@@ DocumentSuppliedProcSets: XYdict}|
+ \ifx\dvitype@\undefined
+ \PSdict@@@{\xyPS@@ For: use with Xy-pic}\else
+ \PSdict@@@{\xyPS@@ For: \dvitype@ use of Xy-pic}\fi
+ \PSdict@@@{\xyPS@@ BeginResource: procset XYdict}|
+ \def\PSspecialdict@@##1{\PSdict@@@{##1^^J}}|
+ \let\PSdict@@=\PSdict@@@ \let\xy@begindvi=\literal@|
+ \UsePSdict@@false\XYpredict@@|
+ \XYdict@@|
+ \PSdict@@@{\xyPS@@ EndResource}|
+ \immediate\closeout\xywrite@
+ \message{>}|
+ \endgroup}}}
+\DOCMODE)
+
+Within the expansion of |\XYdict@| the end-of-line tokens are still active.
+The following expansion seems to work on all systems so far tested.
+
+\DOCMODE(
+\xywarnifdefined\obeyoutlines@
+{\catcode`\^^M=\active%
+ \gdef\obeyoutlines@{\catcode`\^^M=\active \def^^M{^^J}%
+ \newlinechar=`\^^J\obeyspaces}}
+\DOCMODE)
+
+The dictionary of \PS\ commands is split into two pieces according to whether
+they are relevent to general \PS\ effects or only to the \PS\ backend.
+These pieces are generated from code within the files |xyps-pro.tex| and
+|xypsdict.tex|.
+These files have corresponding |.doc| versions for documentation.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The following commands cause the parts of the \PS\ dictionary to be read
+from the appropriate files. If |\ifUsePSdict@@| gives |\iftrue| then there
+may be no need to do anything, since the definitions will be subsequently
+loaded from the header file. Normally it is only necessary to read these
+files once, using |\XYpredict@|. However some <driver>s may need it more
+frequently, so instead call |\XYpredict@@| directly.
+
+\DOCMODE(
+\xydef@\XYpredict@@{\ifUsePSdict@@\DN@{}\else
+ \DN@{\xy@begindvi{\xyinputorelse@{xyps-pro}%
+ {\xyerror@{Could not load xyps-pro}{}}\xyuncatcodes}}%
+ \next@
+ \DN@{\xy@begindvi{\xyinputorelse@{xypspatt}%
+ {\xyerror@{Could not load xypspatt}{}}\xyuncatcodes}}\fi
+ \next@ }
+
+\xydef@\XYpredict@r{\XYpredict@@ \let\XYpredict@=\relax \installxyps@}
+\xylet@\XYpredict@\XYpredict@r
+
+\xydef@\XYdict@{\XYdict@@\def\XYdict@{\message{PS relaxed}}}%
+\xydef@\XYdict@@{\DN@{\xyinputorelse@{xypsdict}%
+ {\xyerror@{Could not load xypsdict}{}}\xyuncatcodes}%
+ \expandafter\xy@begindvi\expandafter{\next@}}
+
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This command is for use in macro-packages, providing an easy way to force
+the dictionary to load, when it has not done so using the usual mechanisms.
+
+\DOCMODE(
+
+\xydef@\forceload@XYdict{%
+ \let\includeXYPSdict@=\includeXYPSdict@r
+ \let\XYpredict@=\XYpredict@r
+ \let\XYdict@=\XYdict@@ \expandafter\installxyps@ }
+
+\DOCMODE)
+
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Extensions}
+
+Several included files handle standard \PS\ implementations of
+\Xy-pic extensions.
+
+A conditional |\ifxyPSshapes@| is used to indicate whether the special shape
+effects implemented in |xyps-r.tex| can actually be fully supported by the
+current driver. When not available, then an attempt to use these effects
+simply results in a warning message.
+After two attempts the warning message ``turns itself off'';
+subsequent attempts are simply ignored cleanly.
+
+\DOCMODE(
+\xynew@{if}\ifxyPSshapes@ \xyPSshapes@true
+
+\xydef@\xyPScharwarning@@{\xyPScharmessage@
+ \gdef\xyPScharwarning@@{\xyPScharmessage@
+ \xywarning@{...no further PostScript warnings will be given}%
+ \global\let\xyPScharwarning@@=\relax }}
+
+\xydef@\xyPScharmessage@{\xywarning@{%
+ the current <driver> does not fully support PostScript effects}}%
+\DOCMODE)
+
+\paragraph*{Allow new \PS\ effects to be defined.}
+%
+This section describes how |\newxyPSshape| is used to define a new effect
+which is available only in \PS; \ie\ having no analogue elsewhere within
+\Xy-pic.
+
+The new effect will be called via |[|<name>|]|, which gets interpreted as
+referring to |\csname xyshape@|<name>|@\endcsname|.
+Hence a control sequence of this form must first be created,
+if it does not already exist.
+Its initial expansion is simply |\xyundefinedEffect@{|<name>|}{}@@|
+which produces a warning message.
+
+\DOCMODE(
+\xydef@\newxyshape#1#2#3{%
+ \DN@{#3}\ifx\next@\empty
+ \xydefcsname@{shape [#1]}{\csname xyshape@#1@\endcsname}%
+ \else \expandafter\def\csname shape [#1]\endcsname{%
+ \csname xyshape@#1@\endcsname}\fi
+ \DN@{#2}\ifx\next@\empty
+ \expandafter\def\csname xyshape@#1@\endcsname{%
+ \xyundefinedEffect@{#1}{}@@}%
+ \else \expandafter\def\csname xyshape@#1@\endcsname{#2}\fi }
+
+\xydef@\xyundefinedEffect@#1#2@@{%
+ \xywarning@{The #1 #2 effect is not implemented with the current driver}}%
+\DOCMODE)
+
+When an implementation of the effect is available then
+|\csname xyshape@|<name>|@\endcsname| is rebound
+to |\csname xyPSshape@|<name>|@\endcsname|,
+which expands to the contents of |#2| in |\newxyPSshape#1#2|.
+If |#2| is empty then the expansion is the |\xyPSnotimplemented@@`|<name>|'@@|
+warning message, which is especially useful during development.
+
+\DOCMODE(
+\xydef@\newxyPSshape#1#2{%
+ \expandafter\DN@\expandafter{\csname shape [#1]\endcsname}%
+ \DNii@{\relax}\ifx\next@\nextii@ \newxyshape{#1}{}\relax\fi
+ \expandafter\DNii@\expandafter{\csname xyPSshape@#1@\endcsname}%
+ \expandafter\def\nextii@{#2}%
+ \ifx\nextii@\empty\expandafter\def\next@{\xyPSnotimplemented@@`#1'@@}%
+ \else
+ \edef\tmp@{\noexpand\let\expandafter\noexpand\next@
+ \expandafter\noexpand\nextii@}%
+ \expandafter\tmp@\fi }
+
+\xydef@\xyPSnotimplemented@@#1@@{%
+ \xywarning@{This PostScript effect is not implemented yet}}%
+
+\xydef@\xyPSnotfinished@@{%
+ \xywarning@{This effect is not reliable yet; box sizes may be wrong}}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-ps.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:50:08 ross
+% Maintenance release.
+%
+% Revision 3.3 1996/12/18 09:55:56 ross
+% improvements to the file-loading commands
+% more robust installation procedures
+% shorter tracing messages
+% dictionary no longer loads multiply
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+%
+% NEW for version 3.1 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-r.doc b/Master/texmf-dist/source/generic/xypic/xyps-r.doc
new file mode 100644
index 00000000000..a329cce379a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-r.doc
@@ -0,0 +1,226 @@
+%% $Id: xyps-r.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``PostScript Rotations and Scaling''.
+%% Copyright (c) 1993-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\expandafter\ifx\csname xyps-rloaded\endcsname\empty
+ \message{not reloaded}\endinput \fi
+\expandafter\let\csname xyps-rloaded\endcsname=\empty \xycatcodes
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Rotations and scaling}
+
+The included file |xyps-r.tex| (version \stripRCS$Revision: 3.7 $) provides
+\PS\ support for the effects defined in the |rotate| extension described
+in~\S??g[:rotate].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The \PS\ style methods are required, so ensure that they are loaded.
+
+\DOCMODE(
+\expandafter\ifx\csname xyps-sloaded\endcsname\empty\else
+ \xyinputorelse@{xyps-s}{\xyerror@{Could not load xyps-s}{}}%
+ \xycatcodes\fi
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This file is loaded and its effects are activated automatically whenever
+|\xyoption{rotate}| is requested and the current <driver> supports
+\PS\ rotations. Should there be any need to turn off this support,
+the following commands are available; they obey usual \TeX\ groupings.
+%
+\begin{defs}
+|\NoPSrotate| & remove \PS\ support\kern-50pt\cr
+|\UsePSrotate| & reinstate \PS.
+\end{defs}
+%
+Without \PS\ support diagrams can be expected to be displayed unrotated
+and unscaled.
+These commands are provided primarily for testing and trouble-shooting;
+\eg~with <driver> configurations untested by the authors of \Xy-pic,
+who should be notified of persistent difficulties.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Installation}
+
+Call the following macro to allow the \PS\ mechanisms to be used.
+
+\DOCMODE(
+\xydef@\installPSrotscale@{\installPSstyle@
+ \let\xyRotate@@=\xyPSrotate@@
+% \let\xySpecialRotate@@=\xyPSspecialRotate@
+ \let\doSpecialRotate@@=\doPSspecialRotate@@
+% \let\xyRotnamed@=\xyPSpsxy@
+% \let\xyRot@named@=\xyPSrot@named@@
+ \let\xyscale@@=\xyPSscale@@
+ \xyPSshapes@true
+ \xyuncatcodes }
+
+\xydef@\UsePSrotate{\installPSrotscale@}
+\xydef@\NoPSrotate{\UnloadRotate@\relax}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+All effects defined in the |rotate| extension can be implemented using a \PS\
+<driver>. However different <driver>s need not handle things in the same way;
+different \PS\ code may be required to match the specific environment used
+by the <driver>.
+
+This file provides generic \PS\ code which is known to work correctly with
+most drivers. It is written so as to indicate where modifications may be
+made to accomodate specific <driver>s. For such driver-specific variations,
+consult the appropriate <driver>-file, called |xy|<driver>|.doc|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Transform lists}
+
+\DOCMODE(
+\xydef@\xyPSpretransform@{\xyPSrawA@{\preXYtransform@@}}
+\xydef@\xyPSposttransform@{\xyPSrawZ@{\postXYtransform@@}}
+
+\let\preXYtransform@=\xyPSpretransform@
+\let\postXYtransform@=\xyPSposttransform@
+
+\xydef@\xyPSrotSplit@{%
+ \expandafter\def\expandafter\preShape@@\expandafter{\xyPSpre@}%
+ \expandafter\def\expandafter\postShape@@\expandafter{\xyPSpost@}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Rescaling}
+
+\DOCMODE(
+\xydef@\xyPSscale@@#1#2{%
+ \xyPSsplitPS@{\xyscale@start(#1,#2)}{\xyscale@end}%
+ \xyPSrotSplit@\xyPSpsxy@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Rotations}
+
+\DOCMODE(
+\xydef@\xyPSrotate@@#1{%
+ \xyPSsplitPS@{\xyrot@start(#1 xyd)}{\xyrot@end}%
+ \xyPSrotSplit@\xyPSpsxy@ }
+
+\xydef@\xyPSspecialRotate@#1{%
+ \xyPSsplitPS@{\xyrot@start(#1)}{\xyrot@end}\xyPSrotSplit@\xyPSpsxy@ }
+
+\xydef@\doPSspecialRotate@@#1@@{\xyPSspecialRotate@{#1}}
+\DOCMODE)
+
+The \PS\ operator |xyr| is defined in |xyps-ps.doc|, to store the given
+parameter as a rotation angle.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Shearing}
+
+This feature is not implemented yet.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{PostScript commands}
+
+The \PS\ codes to start the rotation or scaling are given as functions,
+|xyrot@start| and |xyscale@start| with arguments to include a specification
+of the rotation-angle or scaling factors.
+
+\DOCMODE(
+\xydef@\xyRotScale@@{%
+ \def\xyrot@start(##1){{xyt ##1\space xyr}}%
+ \def\xyscale@start(##1,##2){{xyt ##1\space##2\space xys}}%
+ \def\xyrot@end{}\def\xyscale@end{}}
+\DOCMODE)
+
+These strings are placed using |\xyPSsplitPS@| so as to correctly
+occur before and after the code for the actual <object> being typeset.
+This is always followed by |\xyPSpsxy@|, which results in \PS\ code
+to identify the current position, storing it with keys |xyXpos| and |xyYpos|
+so as to be accessible to the code for the rotation or scaling.
+
+A specific <driver> must either call |\xyRotScale@@| to use this default
+mechanism, or define its own macro to be called at installation time,
+which sets alternative expansions to |\xyrot@start(#1)|,
+|\xyscale@start(#1,#2)|, |\xyrot@end| and |\xyscale@end|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-r.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.3 1996/12/18 10:05:50 ross
+% minor improvements to file-loading commands
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.9 1994/06/09 14:38:56 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% Revision 2.9 1994/06/09 14:38:56 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% NEW for version 2.9 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-s.doc b/Master/texmf-dist/source/generic/xypic/xyps-s.doc
new file mode 100644
index 00000000000..990f03d6253
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-s.doc
@@ -0,0 +1,144 @@
+%% $Id: xyps-s.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Style extension'' PostScript support.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\expandafter\ifx\csname xyps-sloaded\endcsname\empty
+ \message{not reloaded}\endinput \fi
+\expandafter\let\csname xyps-sloaded\endcsname=\empty \xycatcodes
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This included file (version \stripRCS$Revision: 3.7 $) provides a \PS\
+interface for the effects defined in the |style| extension.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\paragraph*{\PS\ Style lists}
+
+Note: The contents of the style lists |\preXY@style@| and |\postXY@style@|
+should be `raw' \PS\ code.
+
+This prevents |\special|s from being inserted twice, once by |\Connect@@|
+and once by |\Drop@@|, with straight lines using |\xyPSstraight@|.
+
+\DOCMODE(
+\xydef@\xykillstyles@@{\Unloadstyle@}%
+%\xydef@\xykillstyles@@{%
+% \let\xypre@Style@@=\relax \let\xypost@Style@@=\relax}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{\PS\ Escape Style}
+
+\DOCMODE(
+\xywarnifdefined\xyPSescapestyle@
+\xywarnifdefined\xyPSsplitescape@
+
+{\xyuncatcodes \catcode`@=11
+ \gdef\xyPSescapestyle@#1@@{\xyPSsplitescape@#1<><>@@}%
+ \gdef\xyPSsplitescape@#1<>#2<>#3@@{\xyescape@@{#1}{#2}}}
+
+\xydef@\xyPSsplitPS@#1#2{%
+ \def\xyPSpre@{#1}\def\xyPSpost@{#2}\modPSboxz@ }
+
+\xydef@\xyescape@@#1#2{\checkXyStyle@
+ \applyFIFOstyle@\prexyescape@{#1}\postxyescape@{#2}}
+
+\xydef@\prexyescape@{\xyescapeSpecial@}
+\xydef@\postxyescape@{\xyescapeSpecial@}
+
+\xylet@\xyescapeSpecial@=\eat@
+\let\xyescapeSpecial@=\addtostyletoks@
+\DOCMODE)
+
+
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Installation}
+
+The <driver>-file must call the following macro to rebind a control sequence
+defined in |xystyle|, thereby allowing the \PS\ mechanisms to be used.
+
+\DOCMODE(
+\xydef@\installPSstyle@{%
+% \let\preXYstyle@=\xyPSprestyle@@
+% \let\postXYstyle@=\xyPSpoststyle@@
+ \def\preXYstyle@@{\xyPSpre@}%
+ \let\xydoprestyles@=\xyPSrawstyleA@
+ \let\xydopoststyles@=\xyPSrawZ@
+ \let\xykillstyles@=\xykillstyles@@
+ }
+\xydef@\xyPSrawstyleA@#1{\xyPSrawA@{{#1}{}}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-s.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.3 1996/12/18 10:07:44 ross
+% style-handling code moved to xyps-ps
+% minor improvements to file-loading commands
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.9 1994/06/09 14:38:56 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% Revision 2.9 1994/06/09 14:38:56 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% NEW for version 2.9 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps-t.doc b/Master/texmf-dist/source/generic/xypic/xyps-t.doc
new file mode 100644
index 00000000000..2140cd7e002
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps-t.doc
@@ -0,0 +1,168 @@
+%% $Id: xyps-t.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``Pattern and Tile extension'' PostScript support.
+%% Copyright (c) 1993-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\expandafter\ifx\csname xyps-tloaded\endcsname\empty
+ \message{not reloaded}\endinput \fi
+\expandafter\let\csname xyps-tloaded\endcsname=\empty \xycatcodes
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Patterns and tiles}
+
+The included file |xyps-t.tex| (version \stripRCS$Revision: 3.7 $) provides
+\PS\ support for the effects defined in the |tile| extension described
+in~\S??g[:tile].
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The \PS\ style methods are required, so ensure that they are loaded.
+
+\DOCMODE(
+\expandafter\ifx\csname xyps-sloaded\endcsname\empty\else
+ \xyinputorelse@{xyps-s}{\xyerror@{Could not load xyps-s}{}}%
+ \xycatcodes\fi
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This file is loaded and its effects are activated automatically whenever
+|\xyoption{tile}| is requested and the current <driver> supports
+\PS\ patterns. Should there be any need to turn off this support,
+the following commands are available; they obey usual \TeX\ groupings.
+%
+\begin{defs}
+|\NoPStiles| & remove \PS\ support\kern-50pt\cr
+|\UsePStiles| & reinstate \PS.
+\end{defs}
+%
+Without \PS\ support tile patterns can be expected to be displayed as
+solid black.
+These commands are provided primarily for testing and trouble-shooting;
+\eg~with <driver> configurations untested by the authors of \Xy-pic,
+who should be notified of any difficulties.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Installation}
+
+Installation consists of rebinding the macros |\xypattern@| and
+|\newxypattern@| and of reloading the standard patterns to include a
+description for \PS. This installation should be delayed till after
+|pattern| and the \PS\ <driver> have been installed.
+
+\DOCMODE(
+\xydef@\installPSpatterns@{\installPSstyle@
+ \let\xypattern@=\xyPSpattern@@
+ \let\xypatternwarning@=\relax
+ \xystandardpatterns@
+ \xyuncatcodes }
+
+\xylet@\UnloadPSpatterns@=\Unloadpattern@
+
+\xydef@\UsePStiles{\installPSpatterns@}
+\xydef@\NoPStiles{\UnloadPSpatterns@\relax}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+All effects defined in the |tile| extension can be implemented using
+the \PS\ dictionary, loaded by |xyps-ps|.
+This file provides ``generic'' \PS\ code which is known to work
+correctly with most drivers. No attempt is made to provide special
+code for particular drivers; for driver-specific variations, consult
+the appropriate |xy|<driver>|.doc| file.
+
+\DOCMODE(
+\xydef@\xyPSnewpattern@#1#2#3#4#5{%
+ \expandafter\DN@\expandafter{\csname shape [#1]\endcsname}%
+ \DNii@{\relax}\ifx\next@\nextii@\newxypattern{#1}{}\relax\fi
+ \DNii@{#4}\ifx\nextii@\empty
+ \expandafter\DNii@\expandafter{\csname xyPSshape@#1@\endcsname}%
+ \expandafter\def\nextii@{\xyPSpattern@{#2 #3}}\else
+ \expandafter\DNii@\expandafter{\csname xyPSshape@#1@\endcsname}%
+ \expandafter\def\nextii@{\xyPSpattern@{#4}}\fi
+ \ifx\nextii@\empty\expandafter\def\next@{\xyPSnotimplemented@@`#1'@@}%
+ \else
+ \edef\tmp@{\noexpand\let\expandafter\noexpand\next@
+ \expandafter\noexpand\nextii@}\expandafter\tmp@\fi }
+
+\xydef@\xyPSpattern@{\ifPSspecials@\expandafter\xyPSpattern@@
+ \else\expandafter\eat@\fi}%\xyPSpattern@@}
+
+\xydef@\xyPSpattern@@#1{\bgroup \checkXyStyle@
+ \def\preStyle@@{\expandafter\addtostyletoks@\expandafter{\xyPSpre@}}%
+ \def\postStyle@@{\expandafter\addtostyletoks@\expandafter{\xyPSpost@}}%
+ \let\modPSboxz@=\modXYstyle@ \xyPS@pattern@@{#1}%
+ \toks@={\egroup\let\xy@style@=\relax \def\Drop@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\Drop@@}\def\Connect@@}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\Connect@@}}%
+ \the\toks@ }
+
+\xydef@\xyPS@pattern@@#1{\xyPSsplitPS@{{#1}sp}{}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xyps-t.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 10:05:50 ross
+% minor improvements to file-loading commands
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.0 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyps.doc b/Master/texmf-dist/source/generic/xypic/xyps.doc
new file mode 100644
index 00000000000..b083c7250ce
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyps.doc
@@ -0,0 +1,1209 @@
+%% $Id: xyps.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``PostScript backend''.
+%% Copyright (c) 1993-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{ps}{PostScript backend}{\stripRCS$Revision: 3.7 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\Xy-ps is a `back-end' which provides \Xy-pic with the ability to produce DVI
+files that use \PS\ |\specials| for drawing rather than the \Xy-pic fonts.
+
+In particular this makes it possible to print \Xy-pic DVI files on
+systems which do not have the ability to load the special fonts. The
+penalty is that the generated DVI files will only function with one
+particular DVI driver program. Hence whenever \Xy-ps is activated it
+will warn the user:
+$$
+\xy
+ *+\txt<.8\hsize>{\Xy-pic Warning: The produced DVI file is "not
+ portable": It contains \PS\ {\tt\string\special}s for <one
+ particular> driver}
+ *\frm{-}
+\endxy
+$$
+A more complete discussion of the pros and cons of using this backend
+is included below.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+%\paragraph*{Declarations.}
+%
+%\DOCMODE(
+%\xyinputorelse@{xyps-ps}{\xydrivernoload@{xyps-ps}}
+%\DOCMODE)
+%
+%\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\paragraph*{xyps-ps.tex:}
+%??c[xyps-ps.tex]
+%\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\paragraph*{xyps-ps.doc:}
+%??c[xyps-ps.doc]
+%\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\inputdoc!{xyps-ps.doc}
+%
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Choosing the DVI-driver}
+??=[choosing DVI-driver]
+
+Including |\xyoption{ps}| within the document preamble, tells \Xy-pic that
+the \PS\ alternative to the fonts should be used, provided the means to do
+this is also specified. This is done by also specifying a dvi-driver which
+is capable of recognising and interpreting |\special| commands. Although
+the file |xyps.tex| is read when the option request is encountered, the
+macros contained therein will have no effect until an appropriate driver
+has also been loaded.
+
+With \LaTeXe\ both the backend and driver may be specified, along with other
+options, via a single |\usepackage| command,
+see~\cite[page~317]{GMS94:LaTeXC}; e.g.
+%
+\begin{defs1}
+|\usepackage[ps,textures,color,arrow]{xy}|
+\end{defs1}
+\noindent\unskip
+%
+The rebindings necessary to support \PS\ are not effected until the
+|\begin{document}| command is encountered. This means that an alternative
+driver may be selected, by another |\xyoption{|<driver>|}|, at any time
+until the |\begin{document}|. Only the macros relevant to last named
+<driver> will actually be installed.
+
+
+The following table describes available support for \PS\ drivers.
+Please consult the individual driver sections in part~??g[:drivers] for the
+exact current list.
+For each <driver> there is a corresponding file named |xy|<driver>|.tex|
+which defines the necessary macros, as well as a documentation file named
+|xy|<driver>|.doc|. The spelling is all lower-case, designed to be both
+descriptive and unique for the 1st 8 characters of the file names.
+
+\vspace{.5pc}\noindent
+\begin{tabular}{@{\hspace{1pt}}ll@{\hspace{0pt}}}
+\hline
+<driver> & \hfil Description\hfil \\
+\hline
+\tt dvips & Tomas Rokicki's \dvips \\
+\tt dvips & Karl Berry's |dvipsk| \\
+\tt dvips & Thomas Kiffe's \dvips\ for Macintosh\\
+\tt textures & Blue Sky Research's \Textures\ v1.7+ \\
+\tt 16textures & Blue Sky Research's \Textures\ v1.6 \\
+\tt oztex & Andrew Trevorrow's \OzTeX\ v1.8+ \\
+\tt 17oztex & Andrew Trevorrow's \OzTeX\ v1.7 \\
+%\tt ln & Digital Corp. printers & $-$ \\
+%\tt dvitops &James Clark's dvitops & $?$ \\
+%\tt emtex & Eberhard Matte's em-\TeX & $-$ \\
+\hline
+\end{tabular}
+\vspace{.5pc}
+%$*$ denotes full support, for all the features the driver can handle;
+%$?$ denotes that some features have not been tested, but may still work;
+%$-$ denotes no support as yet.
+
+Other DVI-drivers may also work using one of these files, if they use
+conventions similar to |dvips|, \OzTeX\ or \Textures. Alternatively
+it should not be too difficult to write the files required, using these
+as a basis indicating the type of information needed to support the
+specific |\special| commands. Anyone attempting to do this should inform
+the author and convey a successful implementation to him for inclusion
+within the \Xy-pic distribution.
+
+\NOTE: In some previous versions of \Xy-pic the \PS\ backend and driver
+were loaded simultaneously by a command of the form
+|\UsePSspecials{|<driver>|}|. For backward-compatibility these commands
+should still work, but now loading the latest version of the given
+<driver>. However their future use is discouraged in
+favour of the option-loading mechanism, via |\xyoption{|<driver>|}|.
+This latter mechanism is more flexible, both in handling upgrades of the
+actual driver support and in being extensible to support more general
+forms of |\special| commands.
+
+\medskip
+
+Once activated the \PS\ backend can be turned off and on again at will,
+using the user following commands:
+%
+\begin{defs}
+ ??c![\NoPSspecials] & cancels \PS \cr
+ ??c![\UsePSspecials{}] & restores \PS
+\end{defs}
+\noindent\unskip
+%
+These obey normal \TeX\ scoping rules for environments; hence it is
+sufficient to specify |\NoPSspecials| within an environment or grouping.
+Use of \PS\ will be restored upon exiting from the environment.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The default level of \PS\ is [4], see below.
+
+\DOCMODE(
+\xydef@\UsePSspecials{\DNii@{{[4]}}\xyFN@\UsePSspecials@i}
+\xydef@\UsePSspecials@i{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\UsePSspecials@i}%
+ \else\ifx [\next \DN@[##1]{\DNii@{{[##1]}}\xyFN@\UsePSspecials@i}%
+ \else\ifcat 5\noexpand\next \DN@##1{\DNii@{{[##1]}}\xyFN@\UsePSspecials@i}%
+ \else\ifx\bgroup\next \DN@{\expandafter\UsePS@specials\nextii@}%
+ \else \DN@{\UsePS@specials{[4]}}%
+ \fi\fi\fi\fi \next@ }
+\DOCMODE)
+
+\TODO: There is redundancy between here and |\UsePSspecials@|.
+The value of |\setupxyPS@| \PS\ level could be set here rather than later
+in |\PSspecials@|.
+
+\DOCMODE(
+\xydef@\UsePS@specials#1#2{%
+ \ifx\empty\whichPSspecials@
+ \DN@{#2}\ifx\next@\empty
+ \else
+ \expandafter\let\expandafter\next\csname#2@\endcsname
+% \ifx\next\relax \DN@{\xyerror@{PostScript specials for `#2' not supported}{}}%
+ \ifx\next\relax \DN@{\UsePSspecials@{#2}{}}%
+% \else \DN@{\expandafter\UsePSspecials@\csname#2@\endcsname#1}\fi
+ \else \DN@{\UsePSspecials@{#2}{#1}}\fi
+ \fi
+ \else
+ \DN@{#2}\ifx\next@\empty \DN@{\PSspecials@true}%
+ \else
+% \edef\next@{\expandafter\string\csname#2@\endcsname}%
+ \DN@{#2}%
+ \edef\nextii@{\expandafter\string\whichPSspecials@}%
+ \ifx\next@\nextii@\DN@{\PSspecials@true}%
+ \else
+ \ifx\firstPS@@\relax
+ \DN@{\xyerror@{Only one PS <driver> allowed: \dvitype@ already loaded}{}}%
+ \else
+ \expandafter\let\expandafter\next\csname#2@\endcsname
+ \ifx\next\relax
+ \DN@{\xyerror@{PostScript specials for `#2' not supported}{}}%
+ \else
+ \xywarning@{Changing PS <driver> to #2 }%
+% \DN@{\expandafter\UsePSspecials@\csname#2@\endcsname#1}%
+ \DN@{\UsePSspecials@{#2}{#1}}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi \next@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The following control sequences will also load the corresponding driver.
+They are retained for backwards compatibility only;
+they may be phased out of future releases:
+%
+\begin{defs}
+ |\UseDVIPSspecials| & |dvips| \cr
+ |\UsePostScriptSpecials| & |dvips|\cr
+ |\UseTexturesPSspecials| & |Textures| \cr
+ |\UseTexturesSpecials| & |Textures|
+\end{defs}
+%
+\DOCMODE(
+\xydef@\UseDVIPSspecials{\UsePSspecials@\dvips@}
+\xydef@\UseTexturesPSspecials{\UsePSspecials@\Textures@}
+\xydef@\UseTexturesSpecials{\UsePSspecials@\Textures@}
+\xydef@\UsePostScriptSpecials{\UsePSspecials@\dvips@}
+\xydef@\UseOzTeXspecials{\UsePSspecials@\OzTeX@}
+\xydef@\UseDVITOPSspecials{\UsePSspecials@\dvitops@}
+%\xylet@\UseDVIPSSpecials=\UseDVIPSspecials
+%\xylet@\UsePSspecials=\UsePostScriptSpecials
+%\xylet@\UseTeXturesPSspecials=\UseTexturesPSspecials
+%\xylet@\UseTexturesSpecials=\UseTexturesPSspecials
+%\xylet@\UseTeXturesSpecials=\UseTexturesSpecials
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\message{drivers,}
+\DOCMODE)
+
+First the driver is specified by |\UsePSspecials{|<driver>|}|.
+This causes a special driver file to be read.
+Use of fonts is restored at any point by calling |\NoPSspecials|,
+after which use of \PS\ is re-instated by simply |\UsePSspecials|,
+without need of an argument.
+The commands described above for specific drivers are simply aliases
+for |\UsePSspecials@{|<driver>|}|.
+
+Once the new bindings have been setup, then the use of |\special|s is
+governed by the value of the conditional |\ifPSspecials@|.
+
+\DOCMODE(
+\xydef@\loadPSdriver@#1#2{\xyinputorelse@{xy#1}%
+ {\xyrequire{#2}\expandafter\ifx\csname xy#2loaded\else %
+ {\xyerror@{Unable to load xy#1.tex for #2 driver}{}}\fi}}
+
+\xydef@\dvips@{\loadPSdriver@{ps-dvi}{dvips}}
+\xydef@\Textures@{\loadPSdriver@{ps-txt}{Textures}}
+\xydef@\OzTeX@{\loadPSdriver@{ps-oz}{OzTeX}}
+\xydef@\dvitops@{\loadPSdriver@{ps-dto}{dvitops}}
+\xydef@\dvipsone@{\loadPSdriver@{ps-one}{dvipsone}}
+%\xydef@\dviwindo@{\loadPSdriver@{ps-wdo}{dviwindo}}
+%\xydef@\dviwin@{\loadPSdriver@{ps-win}{dviwin}}
+%\xydef@\pubps@{\loadPSdriver@{ps-pub}{pubps}}
+\DOCMODE)
+
+The driver file contains definitions which are specific
+to the particular driver.
+Note that some drivers may not be able to support all of the \PS\
+effects that can be requested from within \Xy-pic. When an unsupported effect
+is encountered, it is simply ignored; a warning message will be produced
+unless too many such messages have already been issued.
+
+\DOCMODE(
+\global\newif\ifPSspecials@
+%\xydef@\UsePSspecials@#1{\gdef\whichPSspecials@{#1}\xyFN@\PSspecials@}
+\xydef@\UsePSspecials@#1{\def\whichPSspecials@{#1}%
+ \DN@{\Textures@}\ifx\next@\whichPSspecials@
+ \DN@##1{\xyrequire{textures}%
+ \def\whichPSspecials@{textures}\xyps@options}%
+ \else\DN@{\dvips@}\ifx\next@\whichPSspecials@
+ \DN@##1{\xyrequire{dvips}%
+ \def\whichPSspecials@{dvips}\xyps@options}%
+ \else\DN@{\OzTeX@}\ifx\next@\whichPSspecials@
+ \DN@##1{\xyrequire{oztex}%
+ \def\whichPSspecials@{oztex}\xyps@options}%
+ \else\DN@{\dvitops@}\ifx\next@\whichPSspecials@
+ \DN@##1{\xyrequire{dvitops}%
+ \def\whichPSspecials@{dvitops}\xyps@options}%
+ \else
+ \DN@##1{\xyrequire{ps}\xyrequire{#1}\xyps@options}%
+ \fi\fi\fi\fi \next@ }
+
+\xydef@\xyps@options{%
+ \xyrequire{ps}\xyrequire{line}\xyrequire{color}\xyrequire{crayon}%
+ \xyrequire{rotate}\xyrequire{tile}\xyrequire{frame}\xyuncatcodes }
+\xydef@\whichPSspecials@{}
+
+\xydef@\NoPSspecials{\xyPSwarning@{off}%
+ \PSspecials@false\aftergroup\resetPS@}
+\xydef@\resetPS@{\ifPSspecials@\xyPSwarning@{back on}\fi}
+\xydef@\UsePSspecials@x{\PSspecials@true\resetPS@}
+
+\xydef@\xyPSwarning@#1{\xywarning@{PostScript switched #1}}
+%
+%\xydef@\xyPSraw@{%
+% \ifPSspecials@\expandafter\PSraw@@\else\expandafter\eat@\fi }
+\DOCMODE)
+
+% To install the back-end requires loading the \PS\ dictionary.
+% However this can only be done when a <driver> is known to be able to
+% support it. Hence the following command should be called only from
+% within a <driver>-file.
+%
+% \DOCMODE(
+% \DN@{\csname newif\endcsname\ifUsePSdict@@\DN@{}}
+% \ifx\undefined\UsePSdict@@true\else\DN@{}\fi \next@
+% \DOCMODE)
+%
+% Furthermore, the <driver>-file should define a value for |\installxyps@@|
+% to including anything specific to that <driver>; even if only
+% |\let\installxyps@@=\relax|. If |\dumpPSdict| has been specified,
+% then the dictionary must be written first, so it can be used with the
+% subsequent processing.
+%
+% \DOCMODE(
+% \xylet@\dumpPSdict@@=\relax
+%
+% \xydef@\installxyps@{%
+% \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}\xycatcodes
+% \installxyps@@ \installxyps@x
+% \global\let\UsePSspecials=\UsePSspecials@x
+% % \let\installxyps@@=\eat@
+% \PSspecials@true }
+%
+% \xylet@\installxyps@@=\relax
+%
+% \xydef@\installxyps@x{\dumpPSdict@@
+% \ifx\xyrealshipout@\undefined \let\xyrealshipout@=\shipout\fi
+% \ifx \shipout \xyrealshipout@
+% \ifUsePSdict@@ \DN@{\includePSmessage@\includeXYPSdict@\message{>}}%
+% \else \DN@{\XYdict@\endXYdict@}\fi
+% \else \DN@{\let\xyPSshipout@ii=\xyPSshipout@PSii \@PSshipout}\fi
+% \let\firstPS@=\relax \next@
+% \let\XYpredict@=\relax \setupxyPS@ }
+% \DOCMODE)
+%
+% In case no <driver> was known when a call to the |\installxyps@| method
+% was queued, e.g. by |\dumpPSdict{}| before any |\xyoption{|<driver>|}|,
+% then a check is made to see there is now a known <driver> which
+% supports \PS. If so then this installation is cancelled since another
+% should follow, otherwise the default <driver> of |dvips| is assumed.
+% The command |\xyPSdriver#1| is provided to allow users to change this
+% default <driver>. This may be necessary when multiple <driver>s are
+% required and the final one specified does not support \PS.
+%
+% \DOCMODE(
+% \xydef@\xydefaultdriver@{dvips}
+% \xydef@\xyPSdriver#1{\def\xydefaultdriver@{#1}}
+%
+% \xydef@\installxyps@orig{%
+% \DN@{null}\ifx\next@\currentxydriver@\DN@{%
+% \expandafter\defaultinstallps@\expandafter{\xydefaultdriver@}}%
+% \else \DN@{}%
+% \expandafter\expandafter\expandafter\ifx
+% \expandafter\csname\currentxydriver@ @xy@ps\endcsname\relax
+% \DN@{\expandafter\defaultinstallps@\expandafter{\xydefaultdriver@}}%
+% \else \DN@##1{}\fi
+%\xywarning@{will install \currentxydriver@\space shortly}%}%
+% \fi \next@ }
+%
+% %\xylet@\installxyps@@=\installxyps@orig
+%
+% \xydef@\defaultinstallps@#1#2{%
+% \xywarning@{no driver specified, using #1 }%
+% \xyoption{#1}\csname #1@xy@ps\endcsname{}}
+%
+% \xydef@\null@xy@ps{\installxyps@}
+% \DOCMODE)
+
+Unloading the \PS-backend is handled by the |unload| <driver>.
+
+\DOCMODE(
+\xyaddunsupport{ps}{\csname UnloadPS@@\endcsname}
+\DOCMODE)
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{adding new drivers}
+??=[new drivers]
+
+Other drivers can be added by including an appropriate control-sequence name
+for the driver at this point. The purpose of an expansion such as
+|\xydef@\OzTeX@{\noexpand\OzTeX@}| is so that this name always refers to
+a unique token. The macro |\PSspecials@@| defined below, detects this token
+and then calls up the appropriate macro to make the necessary bindings.
+
+Thus adding a new driver involves 5 steps:
+\begin{itemize}
+\item 1
+Define a new control sequence, as just explained.
+\item 2
+Define appropriately named macros to generate the desired |\special|s.
+(See the existing ones for examples of what is needed here.)
+\item 3
+Define a macro that will perform the appropriate bindings of the
+different classes of |\special|. (See the existing ones for examples of
+what is needed here.)
+\item 4
+Determine how frequently the \Xy-ps dictionary must be included within
+the PostScript file. Once (at the beginning) is the ideal, however it
+may be necessary to include it with every page---this is the case with
+\Textures. Also if the dictionary can be loaded as a header or prolog,
+determine whether this can be done only once or must be for each page.
+Also check whether a specific name is required, as with \OzTeX.
+\item 5
+Check to see whether the |\dumpPSdict| macro correctly writes the dictionary
+to a file. The |\endlinechar| can be important here.
+\end{itemize}
+
+\Xy-ps works by rebinding existing control sequence names, in the \Xy-pic
+kernel and extensions, to have new expansions. These new expansions may
+eventually typeset nothing, or at most an empty box; instead they use a
+|\special| command to place \PS\ code directly into the |.dvi| file
+(or |DVI2| resources in the case of \Textures on the Macintosh).
+The new expansions alter the \TeX\ processing, often simplifying it
+considerably hence leading to savings in both time and memory requirement.
+
+It should not be possible to mix |\specials| intended for different drivers.
+Thus the first use of |\PSspecials@| will establish which driver is required
+then rebinds |\UsePSspecials@| so that no other driver can be used;
+subsequent attempts to use |\UsePSspecials@| simply result in the same
+driver being reinstated.
+
+\DOCMODE(
+\xydef@\PSspecials@{%
+ \ifx\next[\DN@[##1]{\setxyPSlevel@{##1}\xyFN@\PSspecials@}%
+ \else\DN@{\whichPSspecials@\PSspecials@@}%
+ \fi \next@ }%
+
+\xydef@\PSspecials@@{%
+ \ifx\und@fined\PSmessage\hidePSmessages\fi \setupxyPS@}
+\DOCMODE)
+
+An optional argument to the |\UsePSspecials| command
+allows for some control over precisely when \PS\
+|\specials| will be used.
+Similarly |\UseDVIPSspecials| and |\UseTexturesSpecials|, etc. can take an
+optional argument.
+
+For example, |\UsePSspecials[1]| replaces only font characters
+with a \PS\ drawing of the same character.
+Both the \PS\ and the bitmapped fonts should produce (virtually)
+identical printed images. This is primarily a test mode.
+
+|\UsePSspecials[2]| also only replaces font characters but such
+that the number of possible directions is 8192, so that arrowheads
+turns and hooks fit better.
+
+|\UsePSspecials[3]| draws straight and dotted lines from a
+single |\special| command, and similarly for circle segments.
+The printed output should be identical to that obtained with
+|\UsePostScriptSpecials[2]|, but the size of the |.ps| file should
+be smaller.
+
+|\UsePSspecials[4]| is the default level;
+all PostScript is turned on. Dotted curves use equally spaced dots,
+dashed curves have curved dashes; even dashed lines are better.
+
+|\UsePSspecials[0]| does no rebinding of fonts at all.
+It allows the special effects, such as rotation, scaling, colour, etc
+defined in extensions, to be implemented while using the Xy-pic fonts.
+
+\DOCMODE(
+\xydef@\setupxyPSlevelO@{\relax}
+
+\xydef@\setxyPSlevel@#1{\ifcase#1%
+ \gdef\setupxyPS@{\setupxyPSlevelO@}%
+ \or\gdef\setupxyPS@{\setupxyPSlevelA@}%
+ \or\gdef\setupxyPS@{\setupxyPSlevelB@}%
+ \or\gdef\setupxyPS@{\setupxyPSlevelC@}%
+ \or\gdef\setupxyPS@{\setupxyPSlevelD@}%
+ \else\gdef\setupxyPS@{\setupxyPSlevelD@}\fi }
+
+\xywarnifdefined\setupxyPS@
+ \gdef\setupxyPS@{\setupxyPSlevelD@ \gdef\setupxyPS@{\PSspecials@true}}
+
+\xydef@\PSincrease@#1{%
+ \xywarning@{The PS level may only increase: #1 is already active}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Why use \PS}
+??=[why PostScript]
+
+At some sites users have difficulty installing the extra fonts used by
+\Xy-pic. The |.tfm| files can always be installed locally but it may
+be necessary for the |.pk| bitmap fonts (or the |.mf| \MF\ fonts) to
+be installed globally, by the system administrator, for printing to
+work correctly. If \PS\ is available then \Xy-ps allows this
+latter step to be bypassed.
+
+\NOTE: with \Xy-ps it is still necessary to have the |.tfm| font
+metric files correctly installed, as these contain information vital
+for correct typesetting.
+
+\medskip\noindent
+Other advantages obtained from using \Xy-ps are the following:
+\begin{itemize}
+\item[$\bullet$]
+Circles and circle segments can be set for arbitrary radii.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item[$\bullet$]
+solid lines are straighter and cleaner.
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+They are no longer typeset as a
+collection of fixed-sized segments (drawn from the |xydash10| font).
+Previously special placement algorithms were required, to construct lines of
+arbitrary length in up to 8192 distinct directions, from the 128 characters
+in the font. These algorithms are no longer required, giving improved
+\TeX\ processing, as well as having smooth lines of arbitrary length and
+direction limited only by the resolution of the \PS\ device.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item[$\bullet$]
+The range of possible angles of directionals is greatly increased.
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+For arrow tips, hooks, and turns, there are now 8192 possible orientations
+rather than just the 128 contained in the |xyatip10|, |xybtip10|, and
+|xybsql10| fonts.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item[$\bullet$]
+Spline curves are smoother. True dotted and dashed versions are now
+possible, using equally spaced segments which are themselves curved.
+
+\item[$\bullet$]
+The \PS\ file produced by a driver from an \Xy-ps DVI file is in
+general significantly smaller than one produced by processing an
+`ordinary' DVI file using the same driver. One reason for this is
+that no font information for the \Xy-pic fonts is required in the
+\PS\ file; this furthermore means that the use of \Xy-pic does
+not in itself limit the \PS\ file to a particular
+resolution.\footnote{Most \TeX\ \PS\ drivers store the images of
+characters used in the text as bitmaps at a particular resolution.
+This means that the \PS\ file can only be printed without loss
+of quality (due to bitmap scaling) at exactly this resolution.}
+
+\item[$\bullet$]
+The latest version of \Xy-pic now enables special effects such as
+variable line thickness, gray-level and colour. Also, rotation of text
+and (portions of) diagrams is now supported with some drivers.
+Similarly whole diagrams can be scaled up or down to fit a given area on the
+printed page. Future versions will allow the use of regions
+filled with colour and/or patterns, as well as other attractive effects.
+
+\end{itemize}
+
+Some of the above advantages are significant, but they come at a price.
+Known disadvantages of using \Xy-ps include the following:
+
+\begin{itemize}
+
+\item[$\bullet$]
+A DVI file with specials for a particular \PS\ driver can only
+be previewed if a previewer is available that supports exactly the
+same |\special| format.
+A separate \PS\ previewer will usually be required.\par
+\smallskip
+However recent versions of |xdvi| support viewing of \PS\
+using either the GhostScript program or via ``Display PostScript''.
+The \PS\ produced by \Xy-ps can be viewed this way
+
+\item[$\bullet$]
+DVI files created using \Xy-ps in fact lose their ``device-independence''.
+So please do not distribute DVI files with \PS\ specials---send either
+the \TeX\ source code, expecting the recipient to have \Xy-pic~\smiley,
+or send a (compressed) \PS\ file.
+\end{itemize}
+
+\noindent
+The latter comment applies to files in which any special `back-end' support
+is required, not just to \PS. Of course it can be ignored when you know
+the configuration available to the intended recipient.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{\PS\ header file:}
+
+With some DVI-drivers it is more efficient to have the \PS\ commands
+that \Xy-ps needs loaded initially from a separate ``header'' file.
+To use this facility the following commands are available\dots
+\begin{defs1}
+ ??c![\UsePSheader{}] \cr
+ ??c![\UsePSheader{<filename>}] \cr
+ ??c![\dumpPSdict{<filename>}] \cr
+ ??c![\xyPSdefaultdict]
+\end{defs1}
+\xyPSdefaultdict
+Normally it is sufficient to invoke |\UsePSheader{}|, which invokes the
+default name of {\tt\xyPSdictname}, referring to the current
+version of \Xy-pic.
+The optional <filename> allows a different file to be used.
+Placing |\dumpPSdict{..}| within the document preamble causes the dictionary
+to be written to the supplied <filename>.
+
+\DOCMODE(
+\DN@{\csname newif\endcsname\ifUsePSdict@@\DN@{}}
+ \ifx\undefined\UsePSdict@@true\else\DN@{}\fi \next@
+
+\ifx\undefined\xyPSdefaultdict
+ \xydef@\xyPSdefaultdict{%
+ \DN@##1.##2.##3@{\gdef\xyPSdictname{xy##1##2dict.pro}}%
+ \expandafter\next@\xyversion.@}%
+\fi
+
+\ifx\undefined\UsePSheader@
+ \xydef@\UsePSheader@#1{%
+ \DN@{#1}\ifx\next@\empty
+% \ifx\xyPSdictname\undefined\xyPSdefaultdict\fi
+ \else \gdef\xyPSdictname{#1}\fi
+ \ifx\xyPSdictname\undefined\xyPSdefaultdict\fi
+ \gdef\xyHeaderMessage@{%
+ It includes a reference to the PostScript file \xyPSdictname.^^J}%
+ \UsePSdict@@true}%
+ \let\UsePSheader=\UsePSheader@
+\fi
+\DOCMODE)
+
+See the documentation for the specific driver to establish where the
+dictionary file should be located on any particular \TeX\ system.
+Usually it is sufficient to have a copy in the current working directory.
+Invoking the command |\dumpPSdict{}| will place a copy of the requisite
+file, having the default name, in the current directory.
+This file will be used as
+the dictionary for the current processing, provided it is on the
+correct directory path, so that the driver can locate it when needed.
+Consult your local system administrator if you experience difficulties.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The `dump' cannot be performed until a driver has been installed.
+This ensures that the correct `end-of-line' character is used.
+
+\DOCMODE(
+\xydef@\dumpPSdict#1{\DN@{#1}\ifx\next@\empty
+ \ifx\undefined\xyPSdictname\xyPSdefaultdict\fi
+ \else\gdef\xyPSdictname{#1}\fi
+ \def\dumpPSdict@@{\writePSdict@@}%
+ \ifx\xydriversselected@@\empty\DN@{\xysetup@@\null@xy@ps}%
+ \else \DN@{\installxyps@x}\fi \next@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Multiple instances of |\UsePSheader| and |\dumpPSdict| are possible, only
+the last will determine which file is used for the current document.
+The command |\xyPSdefaultdict| reverts to the default name.
+
+Allowing an arbitrary <filename> with |\UsePSheader| is for flexibility,
+to accommodate systems that may impose special requirements
+on the filenames of files to be used as \PS\ header files.
+\OzTeX\ is one such. It also caters for advanced users of \Xy-pic
+who may wish to experiment with customised \PS\ to obtain new effects.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Hooking into \Xy-pic}
+??=[hooks]
+
+\DOCMODE(
+\message{hooks,}
+\DOCMODE)
+
+This next macro streamlines the rebinding process.
+
+\DOCMODE(
+\gdef\xyPSalternative@#1#2{%
+\expandafter\global\expandafter\let\csname origxy#2@\endcsname=#1%
+ \xdef#1{\noexpand\ifPSspecials@
+ \noexpand\expandafter\expandafter\noexpand\csname xyPS#2@\endcsname
+ \noexpand\else
+ \noexpand\expandafter\expandafter\noexpand\csname origxy#2@\endcsname
+ \noexpand\fi}}%
+\DOCMODE)
+
+The commands |\setupxyPSlevelA@|, |\setupxyPSlevelB@|, |\setupxyPSlevelC@|
+and |\setupxyPSlevelD@| actually perform the rebindings.
+Each may be called precisely once, and each requires all lower levels are
+also set.
+
+\DOCMODE(
+\xydef@\setupxyPSlevelA@{\xyPStips@%
+ \xyPSalternative@{\Tip@@}{Tip}%
+ \xyPSalternative@{\Ttip@@}{Ttip}%
+ \xyPSalternative@{\Tip@@eu}{Tip@eu}%
+ \xyPSalternative@{\Ttip@@eu}{Ttip@eu}%
+ \xyPSalternative@{\hook@@}{hook}%
+ \xyPSalternative@{\ahook@@}{ahook}%
+ \xyPSalternative@{\bhook@@}{bhook}%
+ \xyPSalternative@{\aturn@@}{aturn}%
+ \xyPSalternative@{\bturn@@}{bturn}%
+ \xyPSalternative@{\squiggle@@}{squiggle}%
+ \xyPSalternative@{\stopper@@}{stopper}%
+ \xyPSalternative@{\line@@}{dash}%
+ \xyPSalternative@{\circhar@@}{circhar@}%
+% \xywithoption{cmtip}{\xyPScmtips@}%
+ \gdef\setupxyPSlevelA@{\PSincrease@{1}}%
+ \global\let\UsePSspecials=\UsePSspecials@x \PSspecials@true}
+%
+\xydef@\setupxyPSlevelB@{%
+ \let\xyPSfont@=\empty \let\xyPSsemifont@=\empty
+ \xyPSalternative@{\cirrestrict@@}{cirrest}%
+ \gdef\setupxyPSlevelB@{\PSincrease@{2}}%
+ \setupxyPSlevelA@ }
+%
+\xydef@\setupxyPSlevelC@{%
+ \xyPSalternative@{\cirbuild@}{cirbuild}%
+ \xyPSalternative@{\CIRfull@}{CIRfull}%
+ \xyPSalternative@{\solid@}{solid}%
+ \xyPSalternative@{\point@}{point}%
+ \xywithoption{curve}{%
+ \xyPSalternative@{\splinesolid@}{splinesolid}}%
+ \gdef\setupxyPSlevelC@{\PSincrease@{3}}%
+ \setupxyPSlevelB@ }%
+%
+\xydef@\setupxyPSlevelD@{%
+ \xyPSalternative@{\dash@}{dashed}%
+% \xyPSalternative@{\squiggle@}{squiggled}%
+ \xywithoption{curve}{%
+ \xyPSalternative@{\splinedashed@}{splinedashed}%
+ \xyPSalternative@{\splinedotted@}{splinedotted}}%
+ \gdef\setupxyPSlevelD@{}%\PSincrease@{4}}%
+ \setupxyPSlevelC@ }
+\DOCMODE)
+
+The bindings are not performed until |\setupxyPS@| is called.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Kernel improvements}
+??=[kernel]
+
+\subsubsection*{Directionals:}
+
+These macros standardise the way a character is described in \PS.
+First give the |\Direction| code then the operator name,
+which is just a simple character string.
+The modifiers |\xyPSfont@| and |\xyPSsemifont@| are empty in all
+but the most primitive level of \PS\ usage. When non-empty
+they restrict to using only angles corresponding to actual font
+characters.
+
+\DOCMODE(
+\xydef@\xyPSchar@#1{%
+ \PSmacro@{\the\Direction\space \xyPSfont@ #1}}
+
+\xydef@\xyPSsemichar@#1{%
+ \PSmacro@{\the\Direction\space \xyPSsemifont@ #1}}
+\DOCMODE)
+
+These macros provide \PS\ code to round a |\Direction| code to that
+corresponding to the nearest font character code, for Directional and
+semi-Directional fonts respectively.
+
+\DOCMODE(
+\xydef@\xyPSfont@{f }%{xyfont }
+\xydef@\xyPSsemifont@{fs }%{xysdfont }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Before any binding we save the original expansions of control-sequences
+whose names will be subject to rebinding. We give these first for each font.
+
+\paragraph*{tips}
+Arrow heads in |\xyatipfont| and |\xybtipfont|
+
+The tips are all set as zero-sized characters\dots
+
+\DOCMODE(
+\xydef@\xyPStip@{\xyPSchar@{t}}%{\xyPSchar@{tip}}
+%\xydef@\xyPSatip@{\xyPSchar@{a}}%{\xyPSchar@{atip}}
+%\xydef@\xyPSbtip@{\xyPSchar@{b}}%{\xyPSchar@{btip}}
+\xydef@\xyPSTip@{\xyPSchar@{/XT tt}}%{\xyPSchar@{Tip}}
+\xydef@\xyPSTtip@{\setboxz@h\bgroup
+ \reverseDirection@\line@ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@
+ \kern-\L@c \boxz@ \kern\L@c \xyPSchar@{/Xt tT}}%{\xyPSchar@{Ttip}}
+\xydef@\xyPSTip@eu@{\xyPSchar@{/ET tt}}%{\xyPSchar@{Tip}}
+\xydef@\xyPSTtip@eu@{\setboxz@h\bgroup
+ \reverseDirection@\line@ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@
+ \kern-\L@c \boxz@ \kern\L@c \xyPSchar@{/ET tT}}%{\xyPSchar@{Ttip}}
+\DOCMODE)
+
+The mechanism to handle Computer Modern tips is a little different.
+Here we must rebind |\xycm@| to avoid any calls to font names.
+When |\PSspecialstrue| then we expand a macro which will
+look at the following token to decide which type of tip
+is required after |\tip@x|.
+
+\DOCMODE(
+%\xydef@\xyPScmtips@{\xyPSalternative@{\xycm@}{cm}}%
+\xydef@\xyPScm@\tip@x{\xyFN@\xyPScm@@}%
+\xydef@\xyPScm@@{%
+ \ifx\next\tip@@ \DN@\tip@@{\tip@x\xyPScmtip@}%
+ \else\ifx\next\atip@@ \DN@\atip@@{\tip@x\xyPScmatip@}%
+ \else\ifx\next\btip@@ \DN@\btip@@{\tip@x\xyPScmbtip@}%
+ \else\DN@{}%
+ \fi\fi\fi \next@}%
+%
+\xydef@\xyPScmtip@{\xyPSchar@{ct}}%{\xyPSchar@{cmtip}}
+\xydef@\xyPScmatip@{\xyPSchar@{ca}}%{\xyPSchar@{cmatip}}
+\xydef@\xyPScmbtip@{\xyPSchar@{cb}}%{\xyPSchar@{cmbtip}}
+\DOCMODE)
+
+From version 3.3 the font coding has changed, for greater flexibility
+and consistency. In particular |\xycm@| is no longer defined.
+
+\DOCMODE(
+\xydef@\xyPStips@{%
+ \xyPSalternative@{\atip@@}{atip}%
+ \xyPSalternative@{\btip@@}{btip}%
+ \xyPSalternative@{\tip@@}{abtip}%
+}%
+
+\xydef@\xyPSatip@{\xyPSwhichatip@
+ \expandafter\xyPSchar@\expandafter{\xyPSfont@@}}%
+\xydef@\xyPSbtip@{\xyPSwhichbtip@
+ \expandafter\xyPSchar@\expandafter{\xyPSfont@@}}%
+\xydef@\xyPSabtip@{\xyPSwhichabtip@
+ \expandafter\xyPSchar@\expandafter{\xyPSfont@@}}%
+
+\xydef@\xyPSwhichatip@{\ifx\xyatipfont\xy@@atfont
+ \expandafter\xyPSatip@i \else\def\xyPSfont@@{10 /xy A}\fi }%
+\xydef@\xyPSwhichbtip@{\ifx\xybtipfont\xy@@btfont
+ \expandafter\xyPSbtip@i \else\def\xyPSfont@@{10 /xy B}\fi }%
+\xydef@\xyPSwhichabtip@{\ifx\xyatipfont\xy@@atfont
+ \expandafter\xyPSabtip@i \else\def\xyPSfont@@{10 /xy AB}\fi }%
+\xydef@\xyPSatip@i{%
+ \edef\xyPSfont@@{\tipsize@@\space/\tipfamily@@\space A}}
+\xydef@\xyPSbtip@i{%
+ \edef\xyPSfont@@{\tipsize@@\space/\tipfamily@@\space B}}
+\xydef@\xyPSabtip@i{%
+ \edef\xyPSfont@@{\tipsize@@\space/\tipfamily@@\space AB}}
+
+\xydef@\xyPSTtips@{%
+ \let\Ttip@xy=\Ttip@
+ \let\Ttip@cm=\Ttip@
+ \let\Ttip@eu=\Ttip@ }
+\DOCMODE)
+
+\paragraph*{hooks, turns and squiggles:}
+squiggles from: |\xybsqlfont|
+
+The hooks are zero-sized characters\dots
+
+\DOCMODE(
+\xydef@\xyPShook@{\xyPSchar@{h}}%{\xyPSchar@{hook}}
+\xydef@\xyPSahook@{\xyPSchar@{ha}}%{\xyPSchar@{ahook}}
+\xydef@\xyPSbhook@{\xyPSchar@{hb}}%{\xyPSchar@{bhook}}
+\DOCMODE)
+
+\dots so are the turns\dots
+
+\DOCMODE(
+\xydef@\xyPSaturn@{\xyPSchar@{ta}}%{\xyPSchar@{aturn}}
+\xydef@\xyPSbturn@{\xyPSchar@{tb}}%{\xyPSchar@{bturn}}
+\DOCMODE)
+
+This handles squiggles as individual characters.
+Squiggled connections should be handled separately, e.g. by
+ having |\xyPSsquiggle@| set the connection by something like
+ |\edef\Connect@@{\noexpand\xyPSsquiggled@ {\the\Direction}}|.
+
+\DOCMODE(
+\xydef@\xyPSsquiggle@{\xyPSchar@{g}}%{\xyPSchar@{squigl}}
+\DOCMODE)
+
+\TODO:
+define composite |\xyPSsquiggled@|
+
+\TODO:
+define composite |\xyPSdashsquiggled@|
+
+\paragraph*{dashes and stoppers:}
+using characters from: |xydashfont|
+
+A stopper contributes zero size.
+However a dash gets its size from the italic correction in the
+|xydashfont|, accessed here using |\origxyline@@|.
+
+\DOCMODE(
+\xydef@\xyPSstopper@{\xyPSchar@{st}}%{\xyPSchar@{stopper}}
+
+%\xydef@\xyPSfliptrue@{\DN@{\xyPSsemichar@{true dash}}}
+\xydef@\xyPSfliptrue@{\DN@{\xyPSsemichar@{T d}}}
+
+\xydef@\xyPSdash@{%
+% \DN@{\xyPSsemichar@{false dash}}%
+ \DN@{\xyPSsemichar@{F d}}%
+ \ifnum\SemiDirectionChar=31
+ \ifdim\d@Y<\z@
+ \ifdim\d@X<\z@ \ifx\xyPSsemifont@\empty\xyPSfliptrue@\fi\fi
+ \else
+ \ifdim\z@>\d@X
+ \ifx\xyPSsemifont@\empty\else\xyPSfliptrue@\fi
+ \else\xyPSfliptrue@\fi
+ \fi\fi
+ \next@ \setboxz@h{\origxydash@}\kern\wdz@
+ \setbox\z@=\box\voidb@x }
+\DOCMODE)
+
+\subsubsection*{Circles}
+
+full circles and circle segments: |\xycircfont|
+
+This handles the cases where a font character is called using |\circhar#1|.
+
+\DOCMODE(
+\xydef@\xyPScirchar@#1{\count@=#1\edef\tmp@{\the\count@}%
+ \ifcase#1%
+ \xyPScirchar@@@{-180}{-135}{\tmp@}\dimen@=\partroottwo\R@
+ \or\xyPScirchar@@@{-135}{-90}{\tmp@}\dimen@=\halfroottwo\R@
+ \or\xyPScirchar@@@{-90}{-45}{\tmp@}\dimen@=\halfroottwo\R@
+ \or\xyPScirchar@@@{-45}0{\tmp@}\dimen@=\partroottwo\R@
+ \or\xyPScirchar@@@0{45}{\tmp@}\dimen@=\partroottwo\R@
+ \or\xyPScirchar@@@{45}{90}{\tmp@}\dimen@=\halfroottwo\R@
+ \or\xyPScirchar@@@{90}{135}{\tmp@}\dimen@=\halfroottwo\R@
+ \or\xyPScirchar@@@{135}{180}{\tmp@}\dimen@=\partroottwo\R@
+ \fi}
+
+\xydef@\xyPScirrest@{\relax}%
+\DOCMODE)
+
+This replaces just the font character, called using |\circhar@@#1|.
+
+\DOCMODE(
+\xydef@\xyPScirchar@@#1{\relax\count@=#1\edef\tmp@{\the\count@}%
+ \expandafter\xyPScirchar@@@\ifcase#1%
+ {-180}{-135}{\tmp@}\kern\partroottwo\R@
+ \or{-135}{-90}{\tmp@}\kern\halfroottwo\R@
+ \or{-90}{-45}{\tmp@}\kern\halfroottwo\R@
+ \or{-45}0{\tmp@}\kern\partroottwo\R@
+ \or 0{45}{\tmp@}\kern\partroottwo\R@
+ \or{45}{90}{\tmp@}\kern\halfroottwo\R@
+ \or{90}{135}{\tmp@}\kern\halfroottwo\R@
+ \or{135}{180}{\tmp@}\kern\partroottwo\R@
+ \fi}
+
+\xydef@\xyPScirchar@@@#1#2#3{\edef\tmp@{#1\space#2\space
+ \expandafter\removePT@\the\R@\space #3\space c}%
+ \PSmacro@{\tmp@}}
+\DOCMODE)
+
+This next macro will allow for more general circle segments to be
+done in \PS. The two parameters are the starting angle
+and finishing angle respectively, measured anti-clockwise.
+
+\DOCMODE(
+\xydef@\xyPScirc@#1#2{\edef\tmp@{\expandafter\removePT@\the\R@}%
+% \PSmessage{\tmp@\space #1 #2 circ}\PSmacro@{\tmp@\space #1 #2 circ}}
+ \PSmacro@{\tmp@\space #1 #2 o}}
+\DOCMODE)
+
+These gives full circles and circle segments built from quarter turns.
+
+\DOCMODE(
+\xydef@\xyPSCIRfull@{\setboxz@h{\kern\R@\xyPScirc@0{360}\kern\R@}%
+ \wd\z@=\z@ \ht\z@=\R@ \dp\z@=\R@ \boxz@}%
+
+\xydef@\xyPScirbuild@{{%
+ \count@=\CIRlo@@ \count@@=\CIRhi@@
+ \multiply\count@ by45 \advance\count@-180 \relax
+ \multiply\count@@ by45 \advance\count@@-180 \relax
+ \def\tmp@{}%
+ \ifx\CIRtest@@\CIRtest@inside
+ \ifnum\count@@>\count@
+ \edef\tmp@{\noexpand\xyPScirc@{\the\count@}{\the\count@@}}\fi
+ \else\ifx\CIRtest@@\CIRtest@outside
+ \ifnum\count@>-180 \advance\count@ by360 \relax
+ \edef\tmp@{\noexpand\xyPScirc@{\the\count@@}{\the\count@}}%
+ \else
+ \ifnum\count@@<180 \relax
+ \edef\tmp@{\noexpand\xyPScirc@{\the\count@@}{180}}%
+ \fi\fi
+ \fi\fi
+ \kern\R@\tmp@\kern\R@}}
+\DOCMODE)
+
+\subsubsection*{Lines}
+solid, dashed and dotted; without using segments.
+
+This is based on |\straight@|. It is used by all three types of line,
+taking an appropriate macro as the parameter |#1|.
+
+\DOCMODE(
+\xydef@\xyPSstraight@#1{\setupDirection@
+ \edef\Creset@@{\cfromthec@ \pfromthep@ \DirectionfromtheDirection@}%
+ \DN@##1##2{\def\checkoverlap@@{%
+ \ifdim##1\X@p>##1\X@c \let\next@=\relax \fi
+ \ifdim##2\Y@p>##2\Y@c \let\next@=\relax \fi}}%
+ \edef\nextii@{{\sd@X}{\sd@Y}}\expandafter\next@\nextii@
+ \noCshavep@@
+ \edef\Cshavep@@{\pfromthep@ \noexpand\resetDirection@}%
+ \noCshavec@@
+ \edef\Cshavec@@{\cfromthec@ \noexpand\resetDirection@}%
+ \ifHidden@\else
+ \ifdim\Y@c>\Y@max \Y@max=\Y@c \fi \ifdim\Y@p>\Y@max \Y@max=\Y@p \fi
+ \ifdim\Y@c<\Y@min \Y@min=\Y@c \fi \ifdim\Y@p<\Y@min \Y@min=\Y@p \fi
+ \ifdim\X@c>\X@max \X@max=\X@c \fi \ifdim\X@p>\X@max \X@max=\X@p \fi
+ \ifdim\X@c<\X@min \X@min=\X@c \fi \ifdim\X@p<\X@min \X@min=\X@p \fi \fi
+ \ifInvisible@\let\next@=\relax \else
+ \DN@{\setboxz@h{\kern\X@c \raise\Y@c\hbox{#1}}%
+ \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ {\xykillstyles@\Drop@@}}%
+ \fi
+ \checkoverlap@@
+ \ifdim\d@X=\z@ \ifdim\d@Y=\z@ \DN@{\relax}\fi\fi \next@
+ \def\Cslidep@@{\noCslidep@@}\def\Cslidec@@{\noCslidec@@}%
+ \def\Calong@@{\noCalong@@}\Creset@@ }
+\DOCMODE)
+
+This is not needed unless styles are used, hence |xyps-s| is loaded.
+
+\DOCMODE(
+\xylet@\xykillstyles@=\relax
+\DOCMODE)
+
+Here is how solid lines are done.
+
+\DOCMODE(
+%\xydef@\xyPSsolid@{\ifInvisible@ \let\next@=\no@@
+% \else \DN@{\xyPSstraight@\xyPSsolid@@@}\fi \next@ }
+
+\xydef@\xyPSsolid@{\straight@\xyPSsolidSpread@}%
+\xydef@\xyPSsolidSpread@{\xyPSspread@{solid}{l}@@}%
+
+\xydef@\xyPSdottedSpread@{\xyPSspread@{dotted}{dt}@@}%
+
+\xydef@\xyPSdashed@{\line@ \def\Connect@@{\straight@\xyPSdashedSpread@}}
+\xydef@\xyPSdashedSpread@{\xyPSspread@{dashed}{dd}@@}%
+
+
+\xydef@\xyPSspread@#1#2@@#3\repeat@{\edef\tmp@{%
+ \expandafter\removePT@\the\d@X\space\expandafter\removePT@\the\d@Y}%
+ \setboxz@h{\kern\X@c \raise\Y@c\hbox{%
+ \PSmessage{#1 line:}\PSmacro@{\tmp@\space #2}}}%
+ \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ \boxz@}
+\DOCMODE)
+
+
+This replaces the \Xy-pic |\dash@| to give dashed lines:
+
+\DOCMODE(
+%\xydef@\xyPSdashed@{\line@ \def\Connect@@{\xyPSstraight@\xyPSdashed@@}}
+%\xydef@\xyPSdashed@@{\edef\tmp@{%
+% \expandafter\removePT@\the\d@X\space\expandafter\removePT@\the\d@Y }%
+% \PSmessage{dashed line: \tmp@}\PSmacro@{\tmp@\space dd}}
+\DOCMODE)
+
+This replaces the \Xy-pic |\point@| to give dotted lines.
+\Xy-pic defines |\zerodot| to be a small centred square
+with side length |\xydashw@|. The \PS\ substitute is
+a round dot of this radius.
+
+\DOCMODE(
+\xydef@\xyPSpoint@{\xyPSzerodot@\egroup
+ \Invisible@false \Hidden@false \def\Leftness@{.5}\def\U@pness@{.5}\ctipEdge@
+% \def\Drop@@{\styledboxz@}\def\Connect@@{\xyPSstraight@\xyPSdotted@}}
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@\xyPSdottedSpread@}}
+
+%\xydef@\xyPSdotted@{\edef\tmp@{%
+% \expandafter\removePT@\the\d@X\space\expandafter\removePT@\the\d@Y }%
+% \PSmessage{dotted line: \tmp@}\PSmacro@{\tmp@\space dt}}
+\xydef@\xyPSzerodot@{\PSmessage{dot:}\PSmacro@{p}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Frames}\leavevmode
+
+These are used for dashed frames.
+
+%\DOCMODE(
+%\xydef@\xyPSdashhfill@{{\SemiDirectionChar=95 \Direction=3072 \xyPSdash@}}
+%\xydef@\xyPSdashvfill@{{\SemiDirection=31 \Direction=1023 \xyPSdash@}}
+%\DOCMODE)
+
+This may do circular frames.
+
+%\DOCMODE(
+%\xydef@\xyPScircled@#1{{\R@=#1\relax
+% \setboxz@h{\dimen@=\X@c\advance\dimen@-\R@c\kern\dimen@
+% \raise\Y@c\hbox{\xyPSCIRfull@}}%
+% \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
+%\DOCMODE)
+
+\paragraph*{Curves}\leavevmode
+
+\DOCMODE(
+\xydef@\xyPScubic@#1{\readsplineparams@
+ \PSmessage{CUBIC:}%
+ \DN@{#1}\ifx\next@\empty\PSmacro@{mark \cubicinfo@\space bz}%
+ \else\PSmacro@{mark \cubicinfo@\space b#1}\fi}
+
+\xydef@\xyPSsquine@#1{\readsplineparams@
+ \PSmessage{SQUINE:}%
+ \DN@{#1}\ifx\next@\empty\PSmacro@{mark \squineinfo@\space q#1}%
+ \else\PSmacro@{mark \squineinfo@\space q#1}\fi}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\xyPSsplinesolid@{\ifx\splineinfo@\squineinfo@
+ \expandafter\xyPSsquine@\else\expandafter\xyPScubic@\fi{}}
+
+\xydef@\xyPSsplinedashed@{\ifx\splineinfo@\squineinfo@
+ \expandafter\xyPSsquine@\else\expandafter\xyPScubic@\fi{d}}
+
+\xydef@\xyPSsplinedotted@{\ifx\splineinfo@\squineinfo@
+ \expandafter\xyPSsquine@\else\expandafter\xyPScubic@\fi{t}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyps.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:50:08 ross
+% Maintenance release.
+%
+% Revision 3.3 1996/12/18 09:31:46 ross
+% revised interface to straight connections
+% revised interface for tips, handles arbitrary scaling
+% driver/option-loading now uses \xyrequire
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/05 22:10:30 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.12 1994/10/25 03:01:14 ross
+% Final 3beta release [bug fixes & AMS-LaTeX fitting].
+%
+% Revision 2.11 1994/07/05 06:34:32 ross
+% fixed bug with quadratic curves
+% fixed minor documentation bugs
+%
+% Revision 2.10 1994/06/15 12:46:03 ross
+% Second release 3beta.
+% Colour and line style saving works; label colouring bug fixed.
+%
+% Revision 2.9 1994/06/09 14:50:54 ross
+% Release 3beta.
+% Includes support for special effects: Rotations, Scaling, Line-width, Colour.
+% Back-ends are separated into separate files.
+% More back-ends are supported, experimentally --- needs testing.
+%
+% Revision 2.8 1994/04/08 10:36:40 ross
+% Second 3alpha release.
+%
+% Revision 2.7 1994/03/28 10:57:02 ross
+% First version.
+%
+% Initial version by Ross Moore based on XYps 2.6.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xypsdict.doc b/Master/texmf-dist/source/generic/xypic/xypsdict.doc
new file mode 100644
index 00000000000..34a63c0c4c5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xypsdict.doc
@@ -0,0 +1,375 @@
+%% $Id: xypsdict.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``PostScript backend prolog''.
+%% Copyright (c) 1995-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+
+%\let\xypsdictloaded=\empty %
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This file contains the addendum to the dictionary of \PS\ commands which
+need to be available to the \PS\ driver when the \PS\ back-end has been
+requested.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection*{\PS\ backend Dictionary}
+
+Open a group and set some constants.
+Make sure the preliminary part is also loaded, in case |\XYpredict@|
+has not been set to |\relax|.
+Then make line-ends active.
+
+\DOCMODE(
+\begingroup \xycatcodes%
+ \count@=\xydashl@\relax \count@@=\xydashw@\relax%
+ \XYpredict@\relax \xycatcodes \xyPSobeylines@@%
+%
+\PSdict@@{/XYdict where pop begin XYdict begin}%
+%
+\PSdict@@{%
+ /xysize 10 def /T true def /F false def
+% /xypspt{72 72.27 div dup scale}bind def
+ /dimendiv{65536 div}bind def
+ /xysegl \number\count@\space dimendiv def
+ /xyopp{1 -1 scale}bind def
+ /xynormwidth{\number\count@@\space dimendiv pscorrect}bind def
+ /xywidth{xynormwidth setlinewidth}bind def
+}%
+%\PSdict@@{%
+% /xy{mark exch countdictstack /xylevel exch def xyopen xycolor stopped
+% xyclose cleartomark}def
+%}%
+\PSdict@@{%
+ /xyfont{4096 add 64 div round 64 mul 4096 sub}def /xydt 0.01 def
+ /xysdfont{4096 add 32 div round 32 mul 4096 sub}def
+ /xydots{xywidth 1 setlinecap [xydt 2] 0 setdash}bind def
+ /f /xyfont load def /fs /xysdfont load def}%
+%
+\PSdict@@{%
+ /xyCheckDir{dup 8 div 3 mul 3 -1 roll sub neg exch div 360 mul
+ dup dup XYdirection sub 180 div round 180 mul XYdirection add
+ dup 3 -1 roll sub abs 10 gt not{exch}if pop}def
+}%
+\ifdim\xydashw@=0pt\xydashw@=.4pt\fi\count@@=\xydashw@\relax%
+\PSdict@@{%
+ /xyrulth{\number\count@@\space dimendiv pscorrect setlinewidth
+ 0 setlinecap}bind def
+}%
+\PSdict@@{%
+ /gsavexy{gsave xypspt XYdirection rotate xywidth newpath 0 0 moveto}def
+ /gchksavexy{gsave xypspt setupDirection xywidth newpath 0 0 moveto}def
+}%
+%
+\PSdict@@{%
+ /xyswap{XYdirection 180 add /XYdirection exch def}def
+ /xyline{gstartxy setupDirection rlineto xystroke}def
+}%
+\PSdict@@{%
+ /dash{exch gchksavexy xysegl XYdirection dup
+ -90 lt{pop neg}{90 gt{neg}if}ifelse exch{neg}if
+ 0 rlineto xystroke}def
+ /stopper{gstartxy setupDirection 0 xysegl 2 div rmoveto
+ 0 xysegl neg rlineto xystroke }def
+ /d /dash load def /st /stopper load def}%
+%
+\PSdict@@{%
+ /solid{gstartxy xydash neg exch neg exch rlineto xystroke}def
+ /dashed{gstartxy 2 copy dup mul exch dup mul add sqrt dup
+ xysegl add xysegl 2 mul div round 2 mul 1 sub div [ exch dup ] 0 setdash
+ neg exch neg exch rlineto xystroke}def
+ /l /solid load def /dd /dashed load def}%
+%
+\PSdict@@{%
+ /dot{gstartxy 2 setlinecap [xydt 2] 0 setdash
+ 1 0 rlineto xystroke}def
+ /dotted{gstartxy 2 copy dup mul exch dup mul add sqrt dup
+ 2 div round 1 add div 2 setlinecap [xydt 3 -1 roll] 0 setdash
+ neg exch neg exch rlineto 0 0 rlineto xystroke}def
+ /p /dot load def /dt /dotted load def}%
+%
+\PSdict@@{%
+ /cubic{gstartxy docubic} def
+ /docubic{chkvalid
+ {chkcubedge 8 -2 roll moveto curveto xystroke pop}
+ {cleartomark grestore}ifelse}def
+ /chkcubedge{2 copy 1.0 eq{0.0 eq{pop pop}{cubicedge}ifelse}
+ {pop cubicedge}ifelse}def
+ /bz /cubic load def}%
+%
+\PSdict@@{%
+ /dotcubic{gstartxy 1 setlinecap [xydt 2] 0 setdash docubic}def
+ /dashcubic{gstartxy [5 5] 0 setdash docubic}def
+ /bt /dotcubic load def /bd /dashcubic load def}%
+%
+\PSdict@@{%
+ /squine{gstartxy dosquine}def
+ /dosquine{chkvalid
+ {chksquedge 2 copy moveto xysq2cub curveto xystroke pop}
+ {cleartomark grestore}ifelse}def
+ /q /squine load def}%
+%
+\PSdict@@{%
+ /chkvalid{2 copy lt{dup 1 gt{false}{true}ifelse}{false}ifelse}def
+}%
+\PSdict@@{%
+ /chksquedge{2 copy 1.0 eq{0.0 eq{pop pop}{squineedge}ifelse}
+ {pop squineedge}ifelse}def
+ /xysq2cub{xysq2cubit 6 1 roll xysq2cubit 6 1 roll 3 index 3 index
+ xysq2cubit 6 1 roll xysq2cubit 6 1 roll pop pop}def
+ /xysq2cubit{2 index 2 mul add 3 div}def
+}%
+\PSdict@@{%
+ /dotsquine{gstartxy 1 setlinecap [xydt 2] 0 setdash dosquine}def
+ /dashsquine{gstartxy [5 5] 0 setdash dosquine}def
+ /qt /dotsquine load def /qd /dashsquine load def}%
+%
+\PSdict@@{%
+/xy4mul{8 copy
+ 5 -1 roll mul 5 1 roll 6 -1 roll mul 6 1 roll
+ 3 -1 roll mul exch 4 -1 roll mul 3 1 roll
+ add 3 1 roll add exch 10 2 roll
+ 7 -1 roll mul 7 1 roll 4 -1 roll mul 5 1 roll
+ 4 -1 roll mul 4 1 roll mul add 3 1 roll add
+ exch 3 -1 roll }def
+}%
+\PSdict@@{%
+ /xy44mul{4 copy 16 4 roll exch 3 1 roll 4 copy 12 4 roll
+ xy4mul 12 4 roll xy4mul 12 -4 roll 4 copy 16 4 roll
+ 8 4 roll xy4mul 12 4 roll xy4mul}def
+}%
+\PSdict@@{%
+ /cubicedge{10 2 roll exch 8 1 roll 3 -1 roll dup dup 9 2 roll
+ 5 -1 roll dup dup 9 1 roll 8 3 roll
+ 4 1 roll dup dup 5 3 roll dup dup 5 1 roll 3 -1 roll
+ 18 -2 roll 2 copy 1 sub neg 4 1 roll 1 sub neg exch 4 1 roll
+ xy444mul
+ pop pop pop 13 1 roll pop pop pop 9 1 roll 10 1 roll
+ pop 8 1 roll 7 1 roll 8 1 roll pop 5 1 roll 3 1 roll}def
+}%
+\PSdict@@{%
+ /xy444mul{4 copy 24 4 roll 12 -4 roll 16 4 roll 4 copy 16 4 roll
+ xy44mul 20 8 roll xy44mul
+ 12 -4 roll 4 -1 roll 7 1 roll exch 4 1 roll exch 6 -1 roll exch
+ 4 2 roll 16 8 roll 8 4 roll
+ 4 -1 roll 7 1 roll exch 4 1 roll exch 6 -1 roll exch 4 2 roll
+ 8 4 roll 16 4 roll 8 4 roll 20 -4 roll exch 3 1 roll
+ 4 copy 20 4 roll 4 copy 16 4 roll 4 copy 12 4 roll
+ xy4mul 28 4 roll xy4mul 20 4 roll xy4mul 12 4 roll xy4mul}def
+}%
+\PSdict@@{%
+ /squineedge{8 2 roll
+ exch 5 1 roll 3 -1 roll dup 6 2 roll 1 index exch
+ 10 -2 roll 2 copy 1 sub neg 4 1 roll 1 sub neg exch 4 1 roll
+ xy44mul 4 1 roll pop 5 1 roll 6 1 roll 3 -1 roll pop}def
+}%
+\PSdict@@{%
+ /xyshort{2 copy abs exch abs add xysegl .5 mul lt
+ {pop pop grestore}{rlineto xystroke}ifelse}def
+}%
+\PSdict@@{%
+ /tipwidth{xywidth xynormwidth dup currentlinewidth exch div
+ sqrt dup dup scale mul setlinewidth 1 setlinecap}def
+}%
+\PSdict@@{%
+ /halftip{tipwidth xysize 10 div 0 0 moveto
+ -.25 0 3 -1 roll -2.5 mul 0 xysize 2 div neg
+ dup .62 mul 2 div neg curveto}bind def
+}%
+%
+\PSdict@@{/atip{gchksavexy halftip xystroke}def
+ /btip{gchksavexy xyopp halftip xystroke}def
+ /tip{gchksavexy gsave halftip stroke grestore
+ xyopp halftip xystroke}def
+ /t /tip load def /a /atip load def /b /btip load def}%
+%
+\PSdict@@{/cmatip{gchksavexy halfcmtip xystroke}def
+ /cmbtip{gchksavexy xyopp halfcmtip xystroke}def
+ /cmtip{gchksavexy gsave halfcmtip stroke grestore
+ xyopp halfcmtip xystroke}def
+ /halfcmtip{tipwidth 0 0 moveto
+ -.1333 0 .25 neg dup .125 3 -1 roll .25 curveto}bind def
+% /cma{exch gchksavexy xyfscale cm halfxytip xystroke}def
+% /cmb{exch gchksavexy xyfscale xyopp cm halfxytip xystroke}def
+% /cmab{exch gchksavexy xyfscale gsave cm halfxytip stroke
+% grestore xyopp cm halfxytip xystroke}def
+ /ct /cmtip load def /ca /cmatip load def /cb /cmbtip load def}%
+%
+\PSdict@@{%
+% /halfxytip{xyfsize mul 2 div exch xyfsize mul neg tipwidth 0 0 moveto
+% dup dup 5 -2 roll dup dup 4 2 roll mul 5 1 roll 3 1 roll curveto}bind def
+% /eu{2 3 div 1 8 div 7 16 div}def
+% /cm{1 3 div 1 5 div 1 2 div}def
+% /XY{1 3 div 1 2 div .31}def
+% /eua{exch gchksavexy xyfscale eu halfxytip xystroke}def
+% /eub{exch gchksavexy xyfscale xyopp eu halfxytip xystroke}def
+% /euab{exch gchksavexy xyfscale gsave eu halfxytip stroke
+% grestore xyopp eu halfxytip xystroke}def
+% /xya{exch gchksavexy xyfscale XY halfxytip xystroke}def
+% /xyb{exch gchksavexy xyfscale xyopp XY halfxytip xystroke}def
+% /xyab{exch gchksavexy xyfscale gsave XY halfxytip stroke
+% grestore xyopp XY halfxytip xystroke}def
+%
+ /xyfscale{/xyfsize exch def}def /xyfsize{10}def
+ /eu{-0.0551 0.0643 -0.0976 0.1386 -0.125 0.2188}def
+ /cm{-0.105 0.0437 -0.1804 0.1380 -0.2 0.25}def
+ /XY{-0.1753 0.0181 -0.3452 0.0708 -0.5 0.155}def
+ /tipstart{3 -1 roll gchksavexy exch xyfscale tipwidth dup XYdict exch
+ known{dup /xy eq{pop /XY}if}{pop /XY}ifelse XYdict exch get}def
+ /tipend{halfxytip xystroke}def
+ /halfxytip{1 1 6{pop xyfsize mul 6 1 roll}for 0 0 moveto curveto}def
+ /A{tipstart D}def /B{tipstart C}def /C{xyopp D}def /D{exec tipend}def
+ /AB{tipstart dup gsave exec halfxytip stroke grestore C}def
+}%
+%\PSdict@@{/aTip{gchksavexy halfTip xystroke}def
+% /bTip{gchksavexy xyopp halfTip xystroke}def }
+%
+\PSdict@@{%/halfTip{360 32 div neg rotate halftip}bind def
+% /halfTtip{.31 mul 1 atan rotate halftip}bind def
+% /Tip{gchksavexy gsave halfTip stroke grestore
+% xyopp halfTip xystroke}def
+% /Ttip{gchksavexy xysegl neg 0 rlineto 0 0 moveto
+% gsave -1 halfTtip stroke grestore xyopp -1 halfTtip xystroke}def
+%
+ /Tip{exch gchksavexy /xyfsize{10}def tipwidth gsave
+ dup XYdict exch known{dup /xy eq{pop /XT}if}{pop /XT}ifelse
+ XYdict exch get dup
+ halfTip stroke grestore xyopp halfTip xystroke}def
+ /XT{360 32 div neg}def /Xt{-1 .31 mul 1 atan}def
+ /ET{360 64 div 5 mul neg}def /Et{-1 .31 mul 1 atan}def
+ /halfTip{exec rotate XY halfxytip}def /halfTtip{halfTip}def
+ /Ttip{exch gchksavexy /xyfsize{10}def tipwidth gsave
+ dup XYdict exch known{dup /xy eq{pop /Xt}if}{pop /Xt}ifelse
+ XYdict exch get dup
+ halfTtip stroke grestore xyopp halfTtip xystroke}def
+ /tt /Tip load def /tT /Ttip load def}%
+%
+\PSdict@@{/halfturn{xysegl 2 div dup dup neg exch rmoveto
+ 0 exch dup exch -180 -90 arc}bind def
+ /aturn{gchksavexy halfturn xystroke}def
+ /bturn{gchksavexy xyopp halfturn xystroke}def
+ /ta /aturn load def /tb /bturn load def}%
+%
+\dimen@=\xybsqll@\relax\count@=\dimen@%
+%
+\PSdict@@{%
+ /xysqll \the\count@\space dimendiv def
+ /squigl{gchksavexy xysqll dup neg 0 rmoveto
+ 2 div dup dup neg dup 3 -1 roll
+ 2 sqrt mul dup 5 1 roll
+ 135 45 arcn dup 3 -1 roll -135 -45 arc
+ xystroke}def
+ /g /squigl load def}%
+%
+\PSdict@@{/fullhook{0 xysegl 2 div dup -90 90 arcn}bind def
+ /halfhook{xysegl 2 div dup 0 exch 180 90 arcn}bind def
+}%
+\PSdict@@{/ahook{gchksavexy fullhook xystroke}def
+ /bhook{gchksavexy xyopp fullhook xystroke}def
+ /hook{gchksavexy gsave halfhook stroke grestore
+ xyopp halfhook xystroke}def
+ /h /hook load def /ha /ahook load def /hb /bhook load def}%
+%
+%\PSdict@@{/halfstop{90 rotate xysegl 1.4 mul 0 rlineto}bind def}
+%\PSdict@@{/astop{gsavexy halfstop xystroke}def}
+%\PSdict@@{/bstop{gsavexy xyopp halfstop xystroke}def}
+%\PSdict@@{/abstop{gsavexy 90 rotate xysegl 1.4 mul
+% dup 2 div 0 rmoveto neg 0 rlineto xystroke}def}
+%
+\PSdict@@{%
+ /xyqcirc{dup dup neg exch translate newpath
+ dup neg 0 exch moveto 0 0 3 -1 roll -90 0 arc}bind def
+}%
+%
+\PSdict@@{%
+ /circ{gstartxy
+ 3 copy pop 2 copy cos mul 3 1 roll sin mul
+ rmoveto 0 0 5 2 roll arc xystroke}bind def
+ /o /circ load def}%
+%
+\PSdict@@{%
+ /circhar{gsave dup 3 gt{7 sub neg}if dup
+ 3 eq{pop dup 2 sqrt -2 div mul}{dup 1 eq{pop dup 2 sqrt 2 div mul}
+ {0 eq{dup}{0}ifelse}ifelse}ifelse
+ 0 translate 3 1 roll circ grestore}bind def
+ /c /circhar load def}%
+%
+\PSdict@@{end end}%
+%
+\endgroup%
+\DOCMODE)
+
+Close the group and clean-up.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xypsdict.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.6 1998/03/06 01:28:05 krisrose
+% Releasing (with Y&Y fonts).
+%
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 03:50:08 ross
+% Maintenance release.
+%
+% Revision 3.3 1996/12/18 09:36:42 ross
+% PostScript support for scaling arrow-tips: CM and Euler
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+%
+% new for version 3.1.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xypspatt.doc b/Master/texmf-dist/source/generic/xypic/xypspatt.doc
new file mode 100644
index 00000000000..e26fce5181a
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xypspatt.doc
@@ -0,0 +1,182 @@
+%% $Id: xypspatt.doc,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Xy-pic ``PostScript pattern prolog''.
+%% Copyright (c) 1995-1998 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1998 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+%% As a special exception, you may use this file and all files derived
+%% from it without restrictions. This special exception was added with
+%% version 3.7 of Xy-pic.
+%%
+%\let\xypspattloaded=\empty %
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This file contains the addendum to the dictionary of \PS\ commands which
+need to be available to the \PS\ driver when patterns have been requested.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection*{\PS\ pattern support}
+
+Open a group, set the catcodes to normal and make line-ends active.
+
+\DOCMODE(
+\begingroup \xycatcodes \xyPSobeylines@@%
+%
+\PSdict@@{/XYdict where pop begin XYdict begin}%
+%
+%
+% use as: /name <data> :t to create a pattern object in XYdict
+%
+% eg <data>: /bk[1 1 1]def /fg[0 0 0]def
+% <B1B1B13030300303031B1B1BD8D8D8C0C0C00C0C0C8D8D8D> fg bk
+%
+% (be careful with setmatrix , for consistency across <driver>s
+%
+\PSdict@@{/:patt
+{XYddict begin
+14 dict begin
+/BGnd exch def % null OR color spec in rgb, as an array
+/FGnd exch def % color spec in rgb, as an array
+/PaintData exch def % pattern spec as a Hex string, 16 x 3-component
+/PatternType 1 def
+/PaintType 1 def
+/BBox[0 0 1 1]def
+/TilingType 1 def
+/XStep 1 def
+/YStep 1 def
+/PatternMtx[24 0 0 24 0 0]def
+/PaintProc BGnd null ne % defined according to BGnd and FGnd colours
+ {{begin BGnd aload pop setrgbcolor 0 0 1 1 rF
+ FGnd aload pop setrgbcolor
+ 24 24 true PatternMtx PaintData imagemask end}}
+ {{begin FGnd aload pop setrgbcolor
+ 24 24 true PatternMtx PaintData imagemask end}}
+ ifelse def
+ currentdict PatternMtx end
+ gsave patangle xyland{180 add}if % xyport not{180 add}if
+ rotate macfreq patfreq div dup neg exch scale matrix currentmatrix
+ grestore gsave setmatrix /DeviceRGB setcolorspace makepattern grestore
+ end}def}%
+%
+\PSdict@@{%
+/rF{gsave % stack: x y dx dy rF
+ newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
+ fill grestore}bind def }%
+%
+\PSdict@@{%
+ /setpatscreen{/pattstring exch store patfreq
+ patangle xyport not{90 add}if
+ {1 add 4 mul cvi pattstring exch get exch 1 add 4 mul cvi 7 sub
+ bitshift 1 and}setscreen}bind def
+ /setcolpattern{setpatscreen 64 div 1 exch sub currentrgbcolor
+ 1 1 3{pop 1 exch sub 3 index mul 1 exch sub 3 1 roll}for
+ setrgbcolor pop}def
+ /setgraypattern{setpatscreen 64 div setgray}def
+ /macfreq 9.375 def /patangle 0 def /patfreq 12.5 def}%
+%
+\PSdict@@{/checkland{%
+ /normland where{pop normland not}{false}ifelse
+ /xyland exch def
+ /por where{pop por}{/isls where{pop isls not /xyland true def}
+ {/land where{pop land not}{true}
+ ifelse}ifelse}ifelse /xyport exch def}def }%
+%
+\PSdict@@{%
+ /setpatfreq{/patfreq exch def}def
+ /setpatangle{/patangle exch def}def
+ /setbackcolor{/backcolor exch def}def
+ /setforecolor{/forecolor exch def}def
+ [1 1 1] setbackcolor xycolarray setforecolor
+ /bg /setbackcolor load def /fg /setforecolor load def
+ /pa /setpatangle load def /pq /setpatfreq load def }%
+%
+\PSdict@@{%
+ /xypattern{checkland counttomark dup 0 eq{pop}
+ {dup 1 eq{pop setpatscreen}
+ {dup 2 eq{pop setcolpattern}
+ {dup 3 eq{pop
+ /setcolorspace where { %
+ /.setcolorspace where{pop pop pop setcolpattern} %hack for Ghostscript
+ {/.buildpattern where {pop % hack for older Ghostscript
+ forecolor backcolor :patt setpattern % hack for older Ghostscript
+ }{pop pop setcolpattern}ifelse}ifelse} % hack for Ghostscript
+% pop forecolor backcolor :patt setpattern} % hack for Ghostscript
+ {pop setcolpattern}ifelse}
+ {5 eq{/setcolorspace where{ %
+ /.setcolorspace where{pop pop pop pop pop setcolpattern} % Ghostscript
+ {/.buildpattern where {pop % hack for older Ghostscript
+ :patt setpattern % hack for older Ghostscript
+ }{pop pop pop pop setcolpattern}ifelse}ifelse} %hack for Ghostscript
+% pop :patt setpattern} % hack for Ghostscript
+ {pop pop pop setcolpattern}ifelse
+ }{}ifelse}ifelse}ifelse}ifelse}ifelse cleartomark }def
+ /xysetpattern{/xypatt exch def}def
+ /sp /xysetpattern load def }%
+%
+\PSdict@@{end end}%
+%
+\endgroup%
+\DOCMODE)
+
+Close the group and clean-up.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xypspatt.doc,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.3 1996/12/18 09:38:37 ross
+% minor change to prevent multiple loading
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+%
+% new for version 3.1.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyrecat.doc b/Master/texmf-dist/source/generic/xypic/xyrecat.doc
new file mode 100644
index 00000000000..89b3c828f84
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyrecat.doc
@@ -0,0 +1,95 @@
+%% $Id: xyrecat.doc,v 3.3 1996/12/19 03:31:56 krisrose Exp $
+%%
+%% Xy-pic ``Reset Category Codes'' utility.
+%% Copyright (c) 1994-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+ However, it is possible to `repair' the problem in case any of the
+ characters |#$&'+-.<=>`| change category code:
+%
+\begin{defs1}
+|\xyresetcatcodes|
+\end{defs1}
+\noindent\unskip
+%
+ will load the file ??c![xyrecat.tex] (version
+ \stripRCS$Revision: 3.3 $) to do it.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}
+\DOCHEADER
+\noindent
+ The command is defined in |xy.doc|: the purpose of this file is to be
+ reloadable such that the characters can be reread by \TeX\ with fresh
+ catcodes.
+
+ The code redefines the special |\add|\dots|@| control sequences used
+ for parsing of just those characters, assuming |\next| is defined
+ correctly before loading it:
+
+\DOCMODE(
+%\xyreuncatcodes
+\xyuncatcodes
+
+\xyrecat @ 64 \catcode 64 11
+
+\xymakeADD@\addHASH@ # 35
+\xymakeADD@\addDOLL@ $ 36
+\xymakeADD@\addAND@ & 38
+\xymakeADD@\addRQ@ ' 39
+\xymakeADD@\addPLUS@ + 43
+\xymakeADD@\addDASH@ - 45
+\xymakeADD@\addDOT@ . 46
+\xymakeADD@\addLT@ < 60
+\xymakeADD@\addEQ@ = 61
+\xymakeADD@\addGT@ > 62
+\xymakeADD@\addLQ@ ` 96
+
+\endinput
+
+% $Log: xyrecat.doc,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% NEW file to go in version 3!
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyrefer.man b/Master/texmf-dist/source/generic/xypic/xyrefer.man
new file mode 100644
index 00000000000..6322060fd17
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyrefer.man
@@ -0,0 +1,509 @@
+%% $Id: xyrefer.man,v 3.7 1999/02/16 15:12:50 krisrose Exp $
+%%
+%% Wrapper to print ``Xy-pic Reference Manual''.
+%% Copyright (c) 1994-1998 Kristoffer H. Rose <krisrose@brics.dk>.
+%% All rights reserved.
+
+\documentclass{article}
+\usepackage{xydoc}
+\xyoption{knot}
+\xyoption{crayon}
+\xyoption{tile}
+\makeindex
+\begin{document}
+
+\title{ \Xy-pic Reference Manual }
+
+\author{
+ Kristoffer H. Rose\\<krisrose@brics.dk>\thanks{%
+ BRICS, Computer Science, Aarhus University (bld. 540),
+ Ny Munkegade, DK--8000~Aarhus C, Denmark.}
+ \and
+ Ross Moore\\<ross@mpce.mq.edu.au>\thanks{%
+ MPCE (Mathematics dept.), Macquarie University,
+ North Ryde, Sydney, Australia NSW~2109.}
+}
+\date{Version \xyversion\quad<\xydate>}
+\maketitle
+
+\begin{abstract}
+ This document summarises the capabilities of the \Xy-pic package for
+ typesetting graphs and diagrams in \TeX. For a general introduction
+ as well as availability information and conditions refer to the
+ User's Guide~\cite{R95:Xy-picUG}.
+
+ A characteristic of \Xy-pic is that it is built around a "kernel
+ drawing language" which is a concise notation for general graphics,
+ \eg,
+%
+\begin{code}
+\xy (3,0)*{A} ; (20,6)*+{B}*\cir{} **\dir{-}
+ ? *_!/3pt/\dir{)} *_!/7pt/\dir{:}
+ ?>* \dir{>} \endxy
+\end{code}
+%
+$$\docode$$
+%
+ was drawn by the \Xy-pic kernel code
+%
+\displaycode\noindent
+%
+ It is an object-oriented graphic language in the most literal sense:
+ `objects' in the picture have `methods' describing how they typeset,
+ stretch, etc. However, the syntax is rather terse.
+
+ Particular applications make use of "extensions" that enhance the
+ graphic capabilities of the kernel to handle such diagrams as
+%
+\begin{code}
+\xy *[o]=<40pt>\hbox{Round}="o"*\frm{oo},
+ +<5em,-5em>@+,
+ (46,11)*+\hbox{Square}="s" *\frm{-,},
+ -<5em,-5em>@+,
+ "o";"s" **{} ?*+\hbox{Bend}="b"*\frm{.},
+ "o";"s"."b" **\crvs{-},
+ "o"."b";"s" **\crvs{-} ?>*\dir{>}
+\endxy
+\end{code}
+\vspace{-2pc}
+$$\docode$$
+%
+ which was typeset by
+%
+\displaycode
+\noindent
+%
+ using the `curve' and `frame' extensions.
+
+ All this is made accessible through the use of "features" that provide
+ convenient notation such that users can enter special classes of
+ diagrams in an intuitive form, \eg, the diagram
+%
+\begin{code}
+\xymatrix{
+ U \ar@/_/[ddr]_y \ar[dr] \ar@/^/[drr]^x \\
+ & X \times_Z Y \ar[d]^q \ar[r]_p
+ & X \ar[d]_f \\
+ & Y \ar[r]^g & Z }
+\end{code}
+$$\docode$$
+%
+ was typeset using the `matrix' features by the \Xy-pic input lines
+%
+\displaycode
+
+ Features exist for many kinds of input; here is a knot typeset using
+ the `knots and links' feature:
+%
+\begin{code}
+\xygraph{!{0;/r1pc/:/u.7pc/::}="A"
+ "A" [u(2.5)r]!{\xcapv[-1.5]}
+ [u]!{\xcaph\xcapv[1.5]|(-.15)\khole}
+ "A" [u]!{\xcapv[-3]}
+ [u]!{\xcaph[3]>(-.035)\khole}[rr]!{\xcapv[3]}
+ "A" [ur] !{\xunderh}
+ "A" [r] !{\xcapv-} [ur] !{\xcapv}
+ "A" [dr] !{\xunderh}
+ "A" [dd] !{\xoverh} [r]!{\xoverh}
+ "A" [rddd] !{\xunderh} [r] !{\xcapv}
+ "A" [ddd] !{\xcapv-\xcaph-} [r] !{\xcaph-}}
+\end{code}
+$$\docode$$
+%
+ The current implementation is programmed entirely within
+ ``standard \TeX\ and \MF'', \ie, using \TeX\ macros (no |\special|s)
+ and with fonts designed using \MF. Optionally special `drivers' make
+ it possible to produce DVI files with `specials' for extra graphics
+ capabilities, \eg, using \PS.
+\end{abstract}
+
+\pagebreak
+\tableofcontents
+\listoffigures
+
+\begin{figure}[b]
+\hbox to\hsize{%
+ \includegraphics{kris.eps}
+ \raise2em\hbox{Kristoffer Rose}\hss
+ Ross Moore
+ \includegraphics{ross.eps}}
+\end{figure}
+
+
+\section*{Preface}
+
+ This reference manual gives concise descriptions of the modules of
+ \Xy-pic, written by the individual authors. Please direct any
+ \TeX\-nical question or suggestion for improvement directly to the
+ author of the component in question, preferably by electronic mail
+ using the indicated address. Complete documents and printed
+ technical documentation or software is most useful.
+
+ The first part documents the \Xy-pic kernel which is always loaded.
+ The remaining parts describe the three kinds of options: "extensions"
+ in part~??g[:extensions] extend the kernel graphic capabilities,
+ "features" in part~??g[:features] provide special input syntax for
+ particular diagram types, and "drivers" in part~??g[:drivers] make it
+ possible to exploit the printing capabilities supported by DVI driver
+ programs. For each option it is indicated how it should be loaded.
+ The appendices contain answers to all the exercises, a summary of the
+ compatibility with version~2, and list some reasons why \Xy-pic might
+ sometimes halt with a cryptic \TeX\ error.
+
+\paragraph*{License.}
+%
+ \Xy-pic is free software in the sense that it is available under the
+ following ??w![license]??w[copyright] conditions:
+$$
+\xy*+[F-]\txt{\Xy-pic: Graphs and Diagrams with \TeX\\
+ \copyright~1991--1998\quad Kristoffer H. Rose\\
+ \copyright~1994--1998\quad Ross Moore\hglue2.75em\hglue1bp}\endxy
+$$
+\begin{quotation}
+%
+ The \Xy-pic package is ??w![free software]; you can redistribute it
+ and/or modify it under the terms of the ??w![GNU General Public
+ License] as published by the Free Software Foundation; either version
+ 2 of the License, or (at your option) any later version.
+
+ The \Xy-pic package is distributed in the hope that it will be
+ useful, but "without any ??w![warranty]"; without even the implied
+ warranty of "merchantability" or "fitness for a particular purpose".
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%
+\end{quotation}
+%
+ In practice this means that you are free to use \Xy-pic for your
+ documents but if you distribute any part of \Xy-pic (including
+ modified versions) to someone then you are obliged to ensure that the
+ full source text of \Xy-pic is available to them (the full text of
+ the license in the file ??c![COPYING] explains this in somewhat more
+ detail~\smiley~).
+
+\paragraph*{Notational conventions.}
+%
+ We give descriptions of the "syntax" of pictures as \BNF??w[BNF]
+ rules; in explanations we will use upper case letters like $X$ and
+ $Y$ for <dimen>sions and lower case like $x$ and $y$ for <factor>s.
+
+
+
+\part{The Kernel}
+??g=[kernel]
+\subsubsection*{\noindent\rlap{\small\bf
+ Vers. \xyversion\ by Kristoffer H. Rose <krisrose@brics.dk>}}
+\def\GROUP{part}\def\FILE{part}
+\CompilePrefix{xy.doc-}
+\inputdoc!{xy.doc}
+
+
+
+\part{Extensions}
+??g=[extensions]
+\def\GROUP{part}\def\FILE{section}%
+
+ This part documents the graphic capabilities added by each standard
+ extension option. For each is indicated the described version
+ number, the author, and how it is loaded.
+
+ Many of these are only fully supported when a suitable "driver"
+ option (described in part~??g[:drivers]) is also loaded, however, all
+ added constructions are always "accepted" even when not supported.
+
+\OSECTION{xycurve.doc}
+\OSECTION{xyframe.doc}
+\OSECTION{xytips.doc}
+\OSECTION{xyline.doc}
+\OSECTION{xyrotate.doc}
+\OSECTION{xycolor.doc}
+\OSECTION{xytile.doc}
+\OSECTION{xyimport.doc}
+\OSECTION{xymovie.doc}
+\OSECTION{xyps.doc}
+\OSECTION{xytpic.doc}
+\OSECTION{xyemtex.doc}
+\OSECTION{xynecula.doc}
+
+
+
+
+\part{Features}
+??g=[features]
+\def\GROUP{part}\def\FILE{section}%
+
+ This part documents the notation added by each standard feature
+ option. For each is indicated the described version number, the
+ author, and how it is loaded.
+
+ The first two, `all' and `dummy', described in~\S\S??g[:all]
+ and~??g[:dummy], are trivial features that nevertheless prove useful
+ sometimes. The next two, `arrow' and `2cell', described
+ in~\S??g[:arrow] and~??g[:2cell], provide special commands for
+ objects that `point'. The following, `matrix' in~\S??g[:matrix],
+ `graph' in~\S??g[:graph], `poly' in~\S??g[:poly], and `knot'
+ in~\S??g[:knot], are "input modes" that support different overall
+ structuring of (parts of) \Xy-pictures.
+
+\OSECTION{xyall.doc}
+\OSECTION{xydummy.doc}
+\OSECTION{xyarrow.doc}
+\OSECTION{xy2cell.doc}
+\OSECTION{xymatrix.doc}
+\OSECTION{xygraph.doc}
+\OSECTION{xypoly.doc}
+\OSECTION{xyweb.doc}
+\OSECTION{xyarc.doc}
+\OSECTION{xyknot.doc}
+\OSECTION{xysmart.doc}
+
+
+
+\part{Drivers}
+??g=[drivers]
+\def\GROUP{part}\def\FILE{sub-section}%
+
+ This part describes `drivers' that customise the parts of the DVI
+ file generated from \Xy-pictures to exploit special capabilities of
+ particular DVI driver programs through \TeX\'s |\special| command.
+ This makes the DVI files non-portable but is needed for full support
+ of some of the \Xy-pic extensions (described in
+ part~??g[:extensions]).
+
+ Figure~??g[:f-drivers] at the end of this part summarises the
+ extensions supported by all drivers.
+
+%Alphabetically...
+\makeatletter
+\def\@listD{\leftmargin1em
+ \parsep 4\p@ \@plus2\p@ \@minus\p@
+ \topsep 4\p@ \@plus2\p@ \@minus4\p@
+ \itemsep\z@ \@plus\p@ }
+\let\@listi\@listD
+\let\PS@orig=\PS
+\def\PS{{\small\PS@orig}}
+\makeatother
+
+\section{Support for Specific Drivers}
+
+\DSECTION{xydvidrv.doc}
+\DSECTION{xydvips.doc}
+\DSECTION{xydvitops.doc}
+\DSECTION{xyoztex.doc}
+\DSECTION{xy17oztex.doc}
+\DSECTION{xytextures.doc}
+\DSECTION{xy16textures.doc}
+\DSECTION{xyxdvi.doc}
+
+\begin{figure*}[bt]
+\begin{center}
+%
+{\makeatletter \global\let\DoXXX=\xydriver@unload@support@@}
+%
+\def\beginXXX{\def\next{\otherbar c\otherbar}%
+ \def\doii##1##2{%
+ \expandafter\def\expandafter\next\expandafter{\next c\otherbar}}%
+ \DoXXX\relax
+ \def\1##1{\begin{tabular}{##1}}\expandafter\1\expandafter{\next}}
+%
+\def\ClearXXX{%
+ \def\doii##1##2{\expandafter\gdef\csname##1XXX\endcsname{-}}%
+ \DoXXX}
+%
+\def\SetXXX#1{%
+ \def\doii##1##2{\expandafter\gdef\csname##1XXX\endcsname{+}}%
+ \csname xydriver@#1@support@@\endcsname}
+%
+\def\XXXentry#1#2{#1&#2}
+\def\XXXlastentry#1#2{#1\\\hline}
+%
+\def\EchoXXX{\gdef\doii##1##2##3{%
+ \ifx##3\relax \expandafter\XXXlastentry \else \expandafter\XXXentry\fi
+ {\tt##1}{##3}}}
+%
+\def\PrintXXX{\gdef\doii##1##2##3{%
+ \ifx##3\relax \expandafter\XXXlastentry \else \expandafter\XXXentry\fi
+ {\csname##1XXX\endcsname}{##3}}}
+%
+\def\Head{\hline \EchoXXX \DRIVERvsEXTENSION &\DoXXX\relax}
+\def\do#1{\expandafter\ifx\csname xydriver@#1@support@@\endcsname\DoXXX
+ \expandafter\dontdoRow\else\expandafter\doRow\fi{#1}}
+\def\doRow#1{{\tt#1}\ClearXXX\SetXXX{#1}\PrintXXX&\DoXXX\relax}
+\def\dontdoRow#1{}
+\def\Rows{\csname xydriversloaded@@\endcsname}
+%
+\def\DRIVERvsEXTENSION{\hbox{\kern.1em %
+ \lower.25ex\hbox{\tiny<driver>}%
+ \kern-.15em$\bigm\backslash$\kern-.11em %
+ \raise.5ex\hbox{\tiny<extension>}}}
+%
+\beginXXX
+ \Head\relax\Rows
+\end{tabular}
+\end{center}
+\caption{Extension implementation replaced by use of \protect<driver\protect>
+ specials.}??g=[f-drivers]
+\end{figure*}
+
+\makeatletter
+\let\do=\eat@ \def\doii#1#2{}
+\let\xyrequire=\eat@
+\makeatother
+
+\medskip\noindent
+The following \TeX\ implementation is also supported,
+but currently uses the \dvips\ driver.
+
+\DSECTION{xycmactex.doc}
+%\DSECTION{xydvipub.doc}
+%\DSECTION{xydviwindo.doc}
+
+Other implementations not specifically mentioned here
+may well work with one of the named <driver>s, though
+perhaps not all features will actually be supported.
+
+\makeatletter
+\let\@listi\@listI
+\let\PS=\PS@orig
+\makeatother
+
+\section{Extra features using \PS\ drivers}
+
+ This section acknowledges the support for extra features available
+ when using a <driver> that supports use of |\special| commands with
+ native \PS. Extra macros are required to take advantage of this;
+ these are loaded automatically in conjunction with extensions
+ specified using the |\xyoption| command, provided a <driver> which
+ supports the extension, as indicated in ??g[:f-drivers], has also been
+ specified.
+
+ Commands are also provided to turn off/on use of these features.
+ Such switches are particularly useful when developing complicated
+ diagrams, or when the intended output device does not support \PS;
+ e.g. for on-screen display. Alternatively, when attempting to use
+ drivers for which no explicit support has been provided, some
+ features may work others may not. Please inform the authors of
+ \Xy-pic of any successes or failures of such attempts.
+
+\inputdoc!{xyps-ps.doc}
+\inputdoc!{xyps-c.doc}
+\inputdoc!{xyps-f.doc}
+\inputdoc!{xyps-l.doc}
+\inputdoc!{xyps-r.doc}
+\inputdoc!{xyps-t.doc}
+
+\section{Extra features using \TPIC\ drivers}
+
+ Similarly a few extensions are supported better when |\special|
+ commands in the \TPIC\ format are supported.
+
+\inputdoc!{xytp-f.doc}
+
+
+
+\part*{Appendices}\label{Appendices}
+\addtocontents{toc}{\protect\contentsline
+ {part}{Appendices}{\protect\pageref{Appendices}}}%
+
+\appendix
+\def\GROUP{appendices}\def\FILE{appendix}%
+
+\ANSWERS
+
+\OSECTION{xyv2.doc}
+
+\section{Common Errors}
+
+ In this appendix we describe some common cases where small mistakes
+ in \Xy-pictures result in \TeX\ error messages that may seem cryptic.
+
+\paragraph*{! Box expected.\\*%
+ ! A <box> was supposed to be here.}
+
+ This message is common when an \Xy-pic <object> is mistyped such that
+ \Xy-pic expects but does not find a \TeX\ <box> construction.
+
+\paragraph*{! LaTeX Error: Bad math environment delimiter.\\*%
+ ! File ended while scanning use of \texttt{\string\xycompiled}.\\*
+ ! Argument of \texttt{\string\codeof@} has an extra \}.}
+
+ These errors can happen while reading an incomplete compiled picture
+ (such a beast is created when \Xy-pic crashes during compilation due
+ to a syntax error or other such problem).
+
+\paragraph*{! Missing \} inserted.}
+
+ This happens when |\endxy| was left out.
+
+
+\bigskip\TODO: Also include the more obscure ones\dots
+
+
+
+\ANSWERS
+\BIBLIOGRAPHY
+\INDEX
+
+\end{document}
+
+% $Log: xyrefer.man,v $
+% Revision 3.7 1999/02/16 15:12:50 krisrose
+% Interim release (Y&Y fonts now free).
+%
+% Revision 3.5 1997/05/29 21:02:36 krisrose
+% Fixed "missing breaks"...and tidied up documentation!
+%
+% Revision 3.4 1997/05/18 04:59:43 krisrose
+% Essential bugfixes.
+% Also includes preliminary movie extension...
+%
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/05 22:21:32 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:11:01 kris
+% Release 3alpha.
+%
+% NEW for version 2.7.
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyrotate.doc b/Master/texmf-dist/source/generic/xypic/xyrotate.doc
new file mode 100644
index 00000000000..0500208b343
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyrotate.doc
@@ -0,0 +1,538 @@
+%% $Id: xyrotate.doc,v 3.3 1996/12/18 09:40:16 ross Exp $
+%%
+%% Xy-pic ``Rotate and Scale extension'' option.
+%% Copyright (c) 1993-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{rotate}{Rotate and Scale extension}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This extension provides the ability to request that any object be displayed
+rotated at any angle as well as scaled in various ways.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+These are effects which are not normally available within \TeX.
+Instead they require a suitable `back-end' option to provide the necessary
+|\special| commands, or extra fonts, together with appropriate
+commands to implement the effects. Thus
+$$
+\xy
+ *+\txt<.8\hsize>{Using this extension will have no effect on the output
+ unless used with a backend that explicitly supports it.}
+ *\frm{-}
+\endxy
+$$
+
+\DOCMODE(
+\xydef@\xyundefinedRotate@#1#2@@{%\egroup %
+ \xywarning@{The #1 #2 effect is not implemented with the current driver.}}%
+\DOCMODE)
+
+The extension provides special effects that can be used with any \Xy-pic
+<object> by defining |[|<shape>|]| modifiers.
+The modification is local to the <object> currently being built,
+so will have no effect if this object is never actually used.
+
+The following table lists the modifiers that have so far been
+defined. They come in two types -- either
+a single keyword, or a key-character with the following text treated
+as a single argument.
+%
+\begin{defs}
+ |[@]| & align with current direction\cr
+ |[@|<direction>|]| & align to <direction>\cr
+ |[@!|<number>|]| & rotate <number> degrees\cr
+% |[@=|<word>|]| & make |[|<word>|]| repeat the current transformations\cr
+% |[@*]| & use previous transformations \cr
+\noalign{\smallskip}
+ |[*|<number>|]| & scale by <number> \cr
+ |[*|<num>$_x$,<num>$_y$|]| & scale $x$ and $y$ separately \cr
+%\noalign{\smallskip}
+% |[<|<direction>|]| & shear y-axis to <direction> \cr
+\noalign{\smallskip}
+ |[left]| & rotate anticlockwise by 90$^\circ$ \cr
+ |[right]| & rotate (clockwise) by 90$^\circ$ \cr
+ |[flip]| & rotate by 180$^\circ$; same as |[*-1,-1]| \cr
+ |[dblsize]| & scale to double size \cr
+ |[halfsize]| & scale to half size \cr
+\end{defs}
+%
+These |[|<shape>|]| modifiers specify transformations of the <object>
+currently being built. If the object has a rectangle edge then the size of
+the rectangle is transformed to enclose the transformed object; with
+a circle edge the radius is altered appropriately.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\TODO:
+There should be an
+ |[@*]| form which repeats the set of transformations applied to the last
+object which has been transformed, possibly in an earlier diagram.
+Also an |[@=|<word>|]| form allowing a set of transformations to be saved
+and used later, simply by specifying |[|<word>|]|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\medskip
+
+Each successive transformation acts upon the result of all previous. One
+consequence of this is that the order of the shape modifiers can make a
+significant difference in appearance---in general, transformations do not
+commute. Even successive rotations can give different sized rectangles if
+taken in the reverse order.
+
+Sometimes this change of size is not desirable. The following commands are
+provided to modify this behaviour.
+%
+\begin{defs}
+ |\NoResizing| & prevents size adjustment \cr
+ |\UseResizing| & restores size adjustments \cr
+\end{defs}
+%
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\NoResizing{\xyNoResizing@}
+\xydef@\UseResizing{\xyUseResizing@}
+
+\xydef@\xyNoResizing@{%
+ \global\let\origxyrescale@=\xyrescale@
+ \global\let\origxyrotSizeMod@=\xyrotateSizeMod@
+ \global\let\xyNoResizing@=\xyNoResizing@@
+ \global\let\xyUseResizing@=\xyUseResizing@@
+ \xyNoResizing@@ }
+
+\xydef@\xyNoResizing@@{%
+ \global\let\xyrescale@=\xyignorescale@
+ \global\let\xyrotateSizeMod@=\xyignoreSizeMod@
+ }
+
+\xylet@\xyUseResizing@=\relax
+\xydef@\xyUseResizing@@{%
+ \global\let\xyrescale@=\origxyrescale@
+ \global\let\xyrotateSizeMod@=\origxyrotSizeMod@
+ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+The |\NoResizing| command is also useful to have at the beginning of a
+document being typeset using a driver that cannot support scaling effects,
+in particular when applied to whole diagrams. In any case an unscaled
+version will result, but now the spacing and positioning will be appropriate
+to the unscaled rather than the scaled size.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Interface}
+
+Recognize the <shape> characters and keywords.
+
+\DOCMODE(
+\xydefcsname@{shape [@...]}#1{\xyrotatechar@#1@@}%
+\xydefcsname@{shape [<...]}#1{\xyshearchar@{#1}@@}%
+\xydefcsname@{shape [*...]}#1{\xyscalechar@{#1}@@}%
+
+\xydefcsname@{shape [left]}{\xyshape@left@}
+\xydefcsname@{shape [right]}{\xyshape@right@}
+\xydefcsname@{shape [flip]}{\xyshape@flip@}
+\xydefcsname@{shape [halfsize]}{\xyshape@halfsize@}
+\xydefcsname@{shape [dblsize]}{\xyshape@dblsize@}
+\xydefcsname@{shape [vflip]}{\xyshape@vflip@}
+\xydefcsname@{shape [hflip]}{\xyshape@hflip@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Each style modifier adds code to one, or both, of two global lists.
+These contents of these lists, called |\preXYtransform@@|
+and |\postXYtransform@@|.
+An implementation must define macros which are to be bound
+to the control sequence names |\preXYtransform@| and |\postXYtransform@|,
+which are prepended and appended to the |\Drop@@| and |Connect@@| methods
+for the current <object>.
+
+Also |\Drop@@| and |\Connect@@| must be modified, if this has not already
+been done as indicated by |\xy@transform@| having expansion |\relax|.
+
+\DOCMODE(
+\xydef@\preXYtransform@{}
+\xydef@\postXYtransform@{}
+
+\xywarnifdefined\preXYtransform@@
+\xywarnifdefined\postXYtransform@@
+ \gdef\preXYtransform@@{}
+ \gdef\postXYtransform@@{}
+\xydef@\xy@transform@{}
+\xydef@\preShape@@{}
+\xydef@\postShape@@{}
+\DOCMODE)
+
+The transformations must be implemented by emulating the adjoint coordinate
+transformations. This requires that code be added to |preXYtransform@@|
+in reverse order to the order of occurrence of the <shape> modifiers.
+The code is added to |\postXYtransform@@| in natural order, so that each
+addition to |\preXYtransform@@| can be closed off, if necessary,
+in a correctly nested sequence.
+
+\DOCMODE(
+\xydef@\modXYtransform@{%
+ \ifx\xy@transform@\empty
+ \transformDrop@\transformConnect@\resetTransform@\fi
+%\show\preShape@@
+ \DN@##1{\expandafter\def\expandafter\tmp@\expandafter{##1}}%
+ \expandafter\next@\expandafter{\preShape@@}%
+ \DN@##1{\expandafter\gdef\expandafter\preXYtransform@@\expandafter{%
+ \tmp@ ##1}}\expandafter\next@\expandafter{\preXYtransform@@}%
+ \DN@##1{\expandafter\def\expandafter\tmp@\expandafter{##1}}%
+ \expandafter\next@\expandafter{\postShape@@}%
+ \DN@##1{\expandafter\gdef\expandafter\postXYtransform@@\expandafter{%
+ \postXYtransform@@ ##1}}\expandafter\next@\expandafter{\tmp@}}%
+
+\xydef@\transformDrop@{\let\xy@transform@=\relax
+ \expandafter\def\expandafter\Drop@@\expandafter{%
+ \expandafter\preXYtransform@\Drop@@\postXYtransform@}}
+
+\xydef@\transformConnect@{\let\xy@transform@=\relax
+ \expandafter\def\expandafter\Connect@@\expandafter{%
+ \expandafter\preXYtransform@\Connect@@\postXYtransform@}}
+
+\xydef@\resetTransform@{\gdef\preXYtransform@@{}\gdef\postXYtransform@@{}}
+\DOCMODE)
+
+\BUG: The reference point does not move correctly in \PS\ when a shift
+modifier has been applied before a rotation. The object prints outside
+of its bounding |\rectangleEdge|. Fix this!!
+
+Global macros are used, so that the same styles can be reused by
+successive objects without having to re-interpret <shape> modifiers,
+as described next.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Saving transformations}
+
+Once specified for an <object>, the collection of transformations can be
+assigned a name, via |[>|<name>|]|.
+The <name> here is any collection of letters
+or other characters up to the closing |]|.
+Subsequent use of |[>|<name>|]|, with the same or other <objects>s,
+will re-establish the saved transformations, acting on the new <object>
+with initial reference point appropriate to this <object>.
+
+\NOTE: Such namings are global and permanent.
+They are intended to allow a particular set of transformations to be
+easily repeated for different objects inside various pictures and diagrams
+within the same document.
+
+\DOCMODE(
+\xydef@\xynametransform@#1{%
+ \DN@{\expandafter\gdef\expandafter#1\expandafter{\the\toks@}}\next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Scaling and Scaled Text}
+
+The <shape> modifier can contain either a single scale factor, or a pair
+indicating different factors in the $x$- and $y$-directions.
+Negative values are allowed, to obtain reflections in the
+coordinate axes, but not zero.
+
+\DOCMODE(
+\xydef@\xyscalechar@#1@@{\xyscalechars@#1,#1,@@}
+
+\xydef@\xyscalechars@#1,#2,#3@@{%
+ \DN@{\xyrescale@(#1,#2)}%
+ \dimen@=#1\p@
+ \ifdim\dimen@>\z@ \else \ifdim\dimen@<\z@ \else
+ \DN@{\xywarning@{invalid scaling factors #1, #2}}%
+ \fi\fi \dimen@=#2\p@
+ \ifdim\dimen@>\z@ \else \ifdim\dimen@<\z@ \else
+ \DN@{\xywarning@{invalid scaling factors #1, #2 }}%
+ \fi\fi \next@ }
+
+\xydef@\xyrescale@(#1,#2){%
+ \setboxz@h{\xyscale@@{#1}{#2}%
+ \dimen@=\ifx-#1\R@c\advance\dimen@-\R@c \dimen@=-\dimen@
+ \else#1\L@c \advance\dimen@-\L@c\fi
+ \kern\dimen@\boxz@\kern-\dimen@}%
+ \R@c=\if-#1\L@c\else#1\R@c\fi
+ \L@c=\if-#1\R@c\else#1\L@c\fi
+ \U@c=\if-#2\D@c\else#2\U@c\fi
+ \D@c=\if-#2\U@c\else#2\D@c\fi }
+
+\xydef@\xyignorescale@(#1,#2){\xywarning@{Ignoring rescale: #1,#2}%
+ \setboxz@h{\xyscale@@{#1}{#2}\boxz@}}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Some particular scalings.
+
+\DOCMODE(
+\xydef@\xyshape@halfsize@{\xyrescale@(.5,.5)}
+\xydef@\xyshape@dblsize@{\xyrescale@(2,2)}
+\xydef@\xyshape@flip@{\xyrescale@(-1,-1)}
+\xydef@\xyshape@vflip@{\xyrescale@(1,-1)}
+\xydef@\xyshape@hflip@{\xyrescale@(-1,1)}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Rotation and Rotated Text}
+
+Within |[@...]| the |...| are parsed as a <direction> locally, based on the
+current direction. The value of count register |\Direction| contains the
+information to determine the requested direction.
+When no <direction> is parsed then |[@]| requests a rotation to align with
+the current direction.
+
+The special sequence |[@!...]| is provided to pass an angle directly to
+the back-end. The \Xy-pic size and shape of the <object> with |\rectangleEdge|
+is unchanged, even though the printed form may appear rotated.
+This is a feature that must be implemented specially by the back-end.
+For example, using the \PS\ back-end, |[@!45]| will show the object rotated
+by 45$^\circ$ inside a box of the size of the unrotated object.
+
+\DOCMODE(
+\xydef@\xyrotatechar@{\bgroup
+ \afterDIRECTIONorEMPTY{\xyrotateSizeMod@}{\xyFN@\xySpecialRotate@i}}
+
+\xydef@\xySpecialRotate@i{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\xySpecialRotate@i}%
+ \else\ifx @\next \let\next@=\xyrotateSizeMod@
+ \else\addEQ@\ifx \next
+ \addEQ@\DN@##1@@{%\transformDrop@
+ \expandafter\xynametransform@\csname shape [##1]\endcsname\egroup}%
+ \else\ifx !\next \DN@!{\egroup\getSpecialRotate@}%
+ \else\ifx *\next \DN@*@@{\egroup\transformDrop@}%
+ \else \DN@{\xySpecialRotate@@}%
+ \fi\fi\fi\fi\fi \next@ }
+
+\xydef@\getSpecialRotate@{\doSpecialRotate@@}
+\DOCMODE)
+
+\TODO: Provide example of repeated, named transformation.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Installation}
+
+Initially there is no support for the actual effects.
+They will be processed according to size/shape requirements,
+but the actual rotation or re-sizing is ommitted.
+A <driver> file is required to implement the effects.
+It need to define alternative expansions to which
+|\xyRotate@@#1|, |\xySpecialRotate@@#1@@|, |\doSpecialRotate@@#1@@|
+and |\xyscale@@#1#2| can be bound.
+
+\DOCMODE(
+\xydef@\xyRotate@#1{\xyundefinedRotate@{rotate}{#1}@@}
+\xydef@\xySpecialRotate@#1@@{\xyundefinedRotate@{rotate}{#1}@@\egroup}
+\xydef@\doSpecialRotate@#1@@{\xyundefinedRotate@{special rotate}{#1}@@}
+\xydef@\xyscale@#1#2{\xyundefinedRotate@{scale}{#1,#2}@@}
+
+\xydef@\UnloadRotate@#1{%
+ \ifx#1\relax\else\xyunload@{rotation extension}\fi
+ \let\xyRotate@@=\xyRotate@
+ \let\xySpecialRotate@@=\xySpecialRotate@
+ \let\doSpecialRotate@@=\doSpecialRotate@
+ \let\xyscale@@=\xyscale@ }
+
+\UnloadRotate@\relax
+
+\xyaddunsupport{rotate}{\UnloadRotate@\relax}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This adjusts the sizes of |\L@c|, |\R@c|, |\U@c| and |\D@c| appropriately.
+
+\DOCMODE(
+\xydef@\xyrotateSizeMod@ @@{%
+ \L@p=\L@c \R@p=\R@c \U@p=\U@c \D@p=\D@c
+ \ifdim\cosDirection\p@>\z@
+ \R@c=\cosDirection\R@p \L@c=\cosDirection\L@p
+ \U@c=\cosDirection\U@p \D@c=\cosDirection\D@p
+ \else
+ \R@c=\cosDirection\L@p \L@c=\cosDirection\R@p
+ \U@c=\cosDirection\D@p \D@c=\cosDirection\U@p
+ \fi
+ \advance\L@c \if-\sinDirection\D@p\else\sinDirection\U@p\fi
+ \advance\R@c \if-\sinDirection\U@p\else\sinDirection\D@p\fi
+ \advance\U@c \if-\sinDirection\L@p\else\sinDirection\R@p\fi
+ \advance\D@c \if-\sinDirection\R@p\else\sinDirection\L@p\fi
+ \dimen@ii=\L@c \advance\dimen@ii-\L@p
+ \edef\tmp@{\egroup \L@c=\the\L@c \R@c=\the\R@c \U@c=\the\U@c \D@c=\the\D@c
+ \dimen@ii=\the\dimen@ii \noexpand\setboxz@h\bgroup
+ \noexpand\xyRotate@@{\the\Direction}}\tmp@
+ \xydropRotated@ }
+
+\xydef@\xydropRotated@@{%
+ \kern\dimen@ii \boxz@ \kern-\dimen@ii \modXYtransform@ \egroup }
+\xylet@\xydropRotated@=\xydropRotated@@
+
+\xydef@\xyignoreSizeMod@ @@{\xywarning@{Ignoring rotation}}
+\DOCMODE)
+
+Some particular rotations.
+
+\DOCMODE(
+\xydef@\xyshape@left@{\xyrotatechar@ v(0,1)@@}
+\xydef@\xyshape@right@{\xyrotatechar@ v(0,-1)@@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Reflections}
+
+Reflections can be specified by a combination of rotation and a flip ---
+either |[hflip]| or |[vflip]|.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Shear transformations}
+
+\DOCMODE(
+\xydef@\xyshearchar@{\xyundefinedRotate@{shearing}}
+\DOCMODE)
+
+\TODO: Provide the structure to support these; then implement it in \PS.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+The following diagram requires various options to be loaded and installed.
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\xyrequire{rotate}\xyrequire{color}\xyrequire{crayon}\xyrequire{line}%
+\xyuncatcodes
+
+\paragraph*{Example}
+
+The diagram in figure~??[rotate and flips] illustrates many of the effects
+described above as well as some additional ones defined by the |color| and
+|rotate| extensions.
+
+\begin{figure*}[t]
+\begin{code}
+\UseCrayolaColors
+\xy\drop[*1.25]\xybox{\POS
+(0,0)*{A};(100,40)*{B}**{}
+ ?<<*[@_][red][o]=<5pt>{\heartsuit};
+ ?>>>*[@_][Plum][o]=<3pt>{\clubsuit}
+ **[|*][|.5pt][thicker]\dir{-},
+?(.1)*[left]!RD\txt{label 1}*[red]\frm{.}
+?(.2)*[!gsave newpath
+ xyXpos xyYpos moveto 50 dup rlineto
+ 20 setlinewidth 0 0 1 setrgbcolor stroke
+ grestore][psxy]{.},
+?(.2)*[@]\txt{label 2}*[red]\frm{.},
+?(.2)*[BurntOrange]{*},
+?(.3)*[halfsize]\txt{label 3}*[red]\frm{.}
+?(.375)*[flip]\txt{label 4}*[red]\frm{.}
+?(.5)*[dblsize]\txt{label 5}*[red]\frm{.}
+?(.5)*[WildStrawberry]{*},
+?(.7)*[hflip]\txt{label 6}*[red]\frm{.}
+?(.8)*[vflip]\txt{label 7}*[red]\frm{.}
+?(.9)*[right]!LD\txt{label 8}*[red]\frm{.}
+?(.5)*[@][*.66667]!/^30pt/
+ \txt{special effect: aligned text}
+ *[red]\frm{.}
+}\endxy
+\end{code}
+$$\docode$$
+\caption{Rotations, scalings and flips}
+??=[rotate and flips]
+\end{figure*}
+
+\begin{exercise}
+Suggest the code used by the author to typeset ??[rotate and flips].
+\answercode
+\answertext{This is how the author specified the diagram:}
+\answertext\displaycode
+\end{exercise}
+
+The actual code is given in the solution to the exercise.
+Use it as a test of the capabilities of your DVI-driver.
+The labels should fit snugly inside the accompanying rectangles,
+rotated and flipped appropriately.
+
+\BUG: This figure also uses colours, alters line-thickness and includes
+some \PS\ drawing.
+The colours may print as shades of gray,
+with the line from $A$ to $B$ being thicker than normal.
+The wider band sloping downwards may have different width and length
+according to the DVI-driver used; this depends on the coordinate system
+used by the driver, when `raw' \PS\ code is included.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyrotate.doc,v $
+% Revision 3.3 1996/12/18 09:40:16 ross
+% no changes
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% Revision 2.12 1994/10/25 03:01:14 ross
+% Final 3beta release [bug fixes & AMS-LaTeX fitting].
+%
+% Revision 2.11 1994/07/05 06:38:37 ross
+% some documentation was left out previously
+%
+% Revision 2.10 1994/06/15 12:46:03 ross
+% Second release 3beta.
+% Colour and line style saving works; label colouring bug fixed.
+%
+% Revision 2.9 1994/06/09 14:39:49 ross
+% Release 3beta.
+%
+% NEW file to go in version 2.9 by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xysmart.doc b/Master/texmf-dist/source/generic/xypic/xysmart.doc
new file mode 100644
index 00000000000..2c1cfb82077
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xysmart.doc
@@ -0,0 +1,569 @@
+%% $Id$
+%%
+%% Xy-pic ``Smart Path feature'' option.
+%% Copyright (c) 1998 George C. Necula <necula@cs.cmu.edu>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1998 Kristoffer H. Rose <krisrose@ens-lyon.fr>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{smartpath}{Smart Path option}{\stripRCS$Revision: 0.0 $}%
+ {George C. Necula}{necula@cs.cmu.edu}%
+ {School of Computer Science,
+ Carnegie Mellon University,
+ 5000 Forbes Avenue,
+ Pittsburgh, PA 15213-3891, USA}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This extends the `arrow' feature, which is therefore required, with a
+ ``smart'' <path> between two <pos>itions.
+
+\DOCMODE(
+\xyrequire{arrow}\xycatcodes
+\DOCMODE)
+
+ The <turn> syntax is extended with the construction
+%
+\begin{defs1}
+%
+ ??w![<turn>] \iss ??c![`s] <diag> |_| <diag> <turnradius>
+%
+\end{defs1}
+\noindent\unskip
+%
+ ??c![\ar]"in"|_|"out"|/5pt| which draws a connector leaving $p$ in the
+ "in" <diag>onal direction and arrives at $c$ in the "out" <diag>onal
+ direction, using |5pt| turns. The connector contains only horizontal
+ or vertical lines and $\frac18$ sectors of circles of the given
+ (optional) <turnradius>.
+
+ \BUG: Any labels are placed at the end of the connection.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+% The smart connection algorithm is as follows:
+%
+% A smart connector consists only of horizontal and vertical straight
+% segments connected with 1/4 circles. 1/8 circles might be use at the start
+% and end of the connector to reach a horizontal or a vertical.
+%
+% All possible connectors can be reduced to a series of equivalence classes,
+% where two connectors are considered equivalent if they are identical after
+% removing from each of them all the horizontal and vertical straight
+% segments. Such a connector is called a representative.
+%
+% The algorithm first computes 10 representatives that start and end in the
+% given directions and have at most one point where the orientation is
+% changed. 5 of the representatives start counter-clockwise and the other
+% 5 start clockwise. Among the counter-clockwise representatives, 1 does not
+% have any change in orientation (one arc of circle starting and ending in the
+% given directions). The other 4 are obtained by changing the orientation in
+% the four points where the circle is tangent to a horizontal or a vertical.
+%
+% For each representative the algorithm determines if it can be extended with
+% horizontal and vertical segments to reach the destination point when
+% starting in the source point (the directions are already right by
+% construction). For example, horizontal straight lines could be inserted
+% in all the points where the representative is tangent to a horizontal line.
+% In each such point a straight line segment can be inserted to extend the
+% connector horizontally but only in the same direction of the connector at
+% that point (the direction of the connetor in a point is towards the
+% destination). For example, if the horizontal distance between the source and
+% destination points is Dx and the horizontal distance between the start and
+% the end of the representative connector is dx then the distance ``Dx - dx''
+% must be covered using horizontal straight lines. This distance is
+% distributed equally among all the horizontal extension points of the right
+% direction. If no such points exist, then the representative is discarded.
+% The cost of a connector is the length of the representative plus the total
+% length of straight extension segments, i.e., |Dx-dx| + |Dy-dy|.
+%
+% The algorithm selects among all the representatives that are not discarded,
+% the one leading to the shortest connection.
+
+
+% Change the PATHturn@ to recognize `s as a smart PATH.
+\let\origPATHturn@=\PATHturn@
+\def\PATHturn@{%
+ \ifx \space@\next \expandafter\DN@\space{\xyFN@\PATHturn@}%gobble spaces
+ \else\ifx s\next
+ \let\origPATHturn@i=\PATHturn@i\let\PATHturn@i=\PATHsmartturn@i
+ \let\origPATHturn@cir=\PATHturn@cir\let\PATHturn@cir=\PATHsmartturn@cir
+ \DN@ s{\xyFN@\origPATHturn@}% Let the original routines do the parsing
+ \else
+ \DN@{\origPATHturn@}%
+ \fi\fi
+ \next@}
+
+
+% Changed PATHturn@cir to allow half or full turns
+\xydef@\PATHsmartturn@cir{%
+ \edef\next@{{\CIRin@@}{\expandafter\noexpand\CIRorient@@}{\CIRout@@}}%
+ \expandafter\PATHturn@i\next@}
+
+
+% This is the changed function for placing the turn
+\xydef@\PATHsmartturn@i#1#2#3{%
+ \DN@##1{%
+ \def\PATHinit@@{%
+ \xy@@{%
+ \def\sm@CIRin{#1}\def\sm@CIRout{#3}% The IN and OUT directions. Ignore
+ % the orientation
+ \ifx\sm@CIRout\empty %Only on direction is given. Use it as OUT and
+ %use the previous direction as IN
+ \let\sm@CIRout=\sm@CIRin
+ \let\sm@CIRin=\PATHlastout@@
+ \fi
+ ##1\relax}%
+ \xy@@{\enter@{\basefromthebase@}}%
+ \xy@@{\sm@conn}% Draw the connection
+ \xy@@{\X@p=\X@c \Y@p=\Y@c \czeroEdge@% Save the start of the segment
+ \count@=\sm@CIRout\count@=\the\count@% Move forward a dash to
+ % touch the edge
+ \dimen@=\xydashl@ \ABfromdiag@ \advance\X@c\A@ \advance\Y@c\B@
+ \edef\PATHpostpos@@{\X@c=\the\X@c \Y@c=\the\Y@c \noexpand\czeroEdge@
+ \noexpand\PATHomitslide@@true}}%
+ \xy@@{\leave@ %
+ \edef\PATHlastout@@{\sm@CIRout}% Store the last direction
+ \count@=\sm@CIRout \dimen@=\xydashl@ \Directionfromdiag@}}}%
+ \expandafter\next@\expandafter{\the\toks@}\toks@={}%
+ \let\PATHextra@@=\empty
+ \def\PATHpost@@{\xy@@\PATHpostpos@@}%
+ \let\PATHlabelsextra@@=\relax
+ \let\PATHturn@i=\origPATHturn@i
+ \let\PATHturn@cir=\origPATHturn@cir
+ \xyFN@\PATHturn@ii}
+
+
+\xydef@\sm@nil{}
+\xydef@\sm@nnil{\sm@nil}
+\xydef@\sm@maxcost{1000mm}% A very long connector
+
+% This computes and draws the connection
+\xydef@\sm@conn{
+% \xy@showthe p{Source}\xy@showthe c{Dest}%
+% \W@{Computing connector from p in \sm@CIRin\space to c in \sm@CIRout
+% .Radius is \turnradius@}%
+ %Adjust the end points to the edge of the objects in the given directions
+ \enter@{\cfromthec@ \DirectionfromtheDirection@}\cfromp@% Adjust p
+ \count@=\sm@CIRin\count@=\the\count@
+ \dimen@=\xydashl@ \ABfromdiag@ \advance\X@p\A@\advance\Y@p\B@
+ \setupDirection@ \the\Edge@c\z@ \czeroEdge@
+ \pfromc@
+ \reverseDirection@
+ % Now leave room for one dash to start with (for placing arrow tails)
+ \count@=\sm@CIRin\count@=\the\count@
+ \dimen@=\xydashl@ \ABfromdiag@
+ % Drop the arrow tail in the right place
+ \edef\tmp@{\noexpand\dir\artail@@}\expandafter\sm@drop@\tmp@
+ \X@c=\X@p\advance\X@c\A@ \Y@c=\Y@p\advance\Y@c\B@ \czeroEdge@
+ % Draw a straight connection from p to c
+ \sm@stri
+ % Set p to the end of the connection
+ \X@p=\X@c \Y@p=\Y@c
+ \leave@
+% \xy@showthe p{After adjust}%
+ \enter@{\pfromthep@ \DirectionfromtheDirection@}\pfromc@% Adjust c
+ \count@=\sm@CIRout\count@=\the\count@
+ \dimen@=\xydashl@ \ABfromdiag@ \advance\X@p-\A@\advance\Y@p-\B@
+ \setupDirection@ \the\Edge@c\z@
+ \advance\X@c-\A@\advance\Y@c-\B@% Leave room for a dash to terminate the seg
+ \czeroEdge@ % The final segment will be drawn by PATH@segment
+ % Clear the tail setting for the last segment
+ \def\PATHlabelsnext@@{}%
+ \leave@
+% \xy@showthe c{After adjust}%
+ % Set the turn radius
+ \R@=\turnradius@
+ \cirrestrict@@%Adjust the radius to fit the circles
+ % Initialize variables
+ \let\sm@circles=\sm@nil
+ \edef\sm@bestcost{\sm@maxcost}% Best so far is very bad
+ \sm@trycircles 1%Try counter clockwise first
+ \sm@trycircles{-1}%Try clockwise after
+%
+% Now check the best
+%
+ \ifdim\sm@bestcost<\sm@maxcost
+% \W@{}\W@{Best: \meaning\sm@bestconn}%
+ \cfromp@
+% \xy@showthe p{Source}%
+ \expandafter\sm@conndraw\sm@bestconn
+ \else
+ \xyerror@{Cannot draw the smart connector}{}%
+ \fi
+}
+
+% Compute and examine 5 representatives, for the orientation given
+% as #1 (1 for counter-clockwise and -1 for clockwise).
+\xydef@\sm@trycircles#1{%
+ \ifnum #1>0% Compute the opposite orientation
+ \def\sm@CIRorienti{-1}%
+ \else
+ \def\sm@CIRorienti{1}%
+ \fi
+ % Generate lists of triples (IN,ORIENT,OUT) so that OUT_1=IN_2 and
+ % IN=IN_1 and OUT=OUT_2, and such that ORIENT_1=#1m ORIENT_2=-ORIENT_1
+ % Then try each list in turn.
+ %Try one circle first (a singleton list)
+ \edef\tmp@{{{\sm@CIRin}{#1}{\sm@CIRout}}}%
+ \expandafter\sm@trycirclelist\expandafter{\tmp@\sm@nil}%
+ %Now try lists of two circles.
+ %Advance "in" so that it is a multiple of 90 degrees (that is, odd)
+ \count@@=\sm@CIRin\count@@=\the\count@@\count@=\count@@
+ \sm@roundcount@{#1}%
+ \edef\sm@savecount@{\the\count@}%
+ % See if we need to add a 1/8 starting circle
+ \ifnum\the\count@=\the\count@@ \else
+%
+ \edef\tmp@{{{\sm@CIRin}{#1}{\the\count@}}%
+ {{\the\count@}{\sm@CIRorienti}{\sm@CIRout}}}%
+ \expandafter\sm@trycirclelist\expandafter{\tmp@\sm@nil}%
+ \fi
+%
+ \count@=\sm@savecount@\count@=\the\count@
+ \sm@advancecount@ 2{#1}\edef\sm@savecount@{\the\count@}% Advance 90 deg.
+ \edef\tmp@{{{\sm@CIRin}{#1}{\the\count@}}%
+ {{\the\count@}{\sm@CIRorienti}{\sm@CIRout}}}%
+ \expandafter\sm@trycirclelist\expandafter{\tmp@\sm@nil}%
+%
+ \count@=\sm@savecount@\count@=\the\count@
+ \sm@advancecount@ 2{#1}\edef\sm@savecount@{\the\count@}% Advance 90 deg.
+ \edef\tmp@{{{\sm@CIRin}{#1}{\the\count@}}%
+ {{\the\count@}{\sm@CIRorienti}{\sm@CIRout}}}%
+ \expandafter\sm@trycirclelist\expandafter{\tmp@\sm@nil}%
+%
+ \count@=\sm@savecount@\count@=\the\count@
+ \sm@advancecount@ 2{#1}\edef\sm@savecount@{\the\count@}% Advance 90 deg.
+ \edef\tmp@{{{\sm@CIRin}{#1}{\the\count@}}%
+ {{\the\count@}{\sm@CIRorienti}{\sm@CIRout}}}%
+ \expandafter\sm@trycirclelist\expandafter{\tmp@\sm@nil}%
+}
+
+% Advance the direction in \count@ by #1 (each unit is 45deg) in the
+% dirction #2, taking care of wrap-around
+\xydef@\sm@advancecount@#1#2{%
+% \W@{Advancing count from \the\count@\space by #1\space
+% in \xy@showorient #2}%
+ \ifnum #2>0
+ \edef\tmp@{#1}%
+ \else
+ \edef\tmp@{-#1}%
+ \fi
+ \advance\count@\tmp@\count@=\the\count@
+ \ifnum\the\count@<0 \advance\count@ 8\fi
+ \ifnum\the\count@>7 \advance\count@ -8\fi
+ \count@=\the\count@
+% \W@{ Resulting count@=\the\count@}%
+}
+
+% Round counter to the next odd element (multiple of 90deg)
+% in the given direction
+\xydef@\sm@roundcount@#1{%
+ \ifcase\the\count@
+ \advance\count@ #1\or
+ \or \advance\count@ #1\or
+ \or \advance\count@ #1\or
+ \or \advance\count@ #1\fi
+ \count@=\the\count@
+ \ifnum\the\count@<0 \advance\count@ 8\fi
+ \ifnum\the\count@>7 \advance\count@ -7\fi
+ \count@=\the\count@
+}
+
+\newif\ifsm@firstseg
+\newif\ifsm@acceptable
+
+% Given a representative described as a list of triplets ending with sm@nil,
+% verify if is can be extended to the right destination
+\xydef@\sm@trycirclelist#1{%
+ \R@p=\z@\U@p=\R@p% Clear the deltas
+ \def\sm@exthp{0}\def\sm@exthm{0}%
+ \def\sm@extvp{0}\def\sm@extvm{0}% Clear the extension points
+ \def\sm@dxp{0pt}\def\sm@dxm{0pt}%
+ \def\sm@dyp{0pt}\def\sm@dym{0pt}% Reset the extensions
+ \def\sm@segs{}% % Clear the segment list
+ \sm@firstsegtrue % Mark the first segment
+ \def\sm@connlen{0pt}% % Initialize the connector length
+ \let\sm@tryclcont=\sm@trycirclelist@i
+ \sm@trycirclelist@i #1%Strip {} to expose the list elements
+%
+% The connector was processed
+%
+% Add an extra segment at then end, if ending in a multiple of 90 deg
+ \count@@=\sm@CIRout\count@@=\the\count@\count@=\the\count@
+ \sm@roundcount@{1}% Direction does not matter
+ \ifnum\count@=\count@@
+ \edef\sm@segs{\sm@segs{{\the\count@}{1}{\the\count@}}}%Accum segment
+ \fi
+% \W@{After trying CL deltax=\the\R@p, deltay=\the\U@p}%
+% \sm@showext{\space}%
+% \W@{ \space Segs: \meaning\sm@segs}%
+ %Now see if the connector can be extended enough
+ \A@=\X@p\advance\A@\R@p\advance\A@ -\X@c\A@=-\A@ % A=Dx
+ \B@=\Y@p\advance\B@\U@p\advance\B@ -\Y@c\B@=-\B@ % B=Dy
+ \sm@acceptabletrue
+% \W@{ \space Dx=\the\A@, Dy=\the\B@}%
+ \ifdim\A@>0pt
+ \ifnum\sm@exthp>0 \dimen@=\A@ \divide\dimen@\sm@exthp
+ \edef\sm@dxp{\the\dimen@}%
+ \else \sm@acceptablefalse\fi\fi
+ \ifdim\A@<0pt
+ \ifnum\sm@exthm>0 \dimen@=\A@ \divide\dimen@\sm@exthm
+ \edef\sm@dxm{\the\dimen@}%
+ \else \sm@acceptablefalse\fi
+ \A@=-\A@%Make it positive
+ \fi
+ \ifdim\B@>0pt
+ \ifnum\sm@extvp>0 \dimen@=\B@ \divide\dimen@\sm@extvp
+ \edef\sm@dyp{\the\dimen@}%
+ \else \sm@acceptablefalse\fi\fi
+ \ifdim\B@<0pt
+ \ifnum\sm@extvm>0 \dimen@=\B@ \divide\dimen@\sm@extvm
+ \edef\sm@dym{\the\dimen@}%
+ \else \sm@acceptablefalse\fi
+ \B@=-\B@
+ \fi
+ \ifsm@acceptable
+ %Compute the cost of the connector
+ \dimen@=\sm@connlen\advance\dimen@\A@\advance\dimen@\B@
+% \W@{ \space Cost is \the\dimen@}%
+ %See if it is best so far
+ \ifdim\dimen@<\sm@bestcost
+ \edef\sm@bestcost{\the\dimen@}%
+ \edef\sm@bestconn{{\sm@dxp}{\sm@dxm}{\sm@dyp}{\sm@dym}{\sm@segs}}%
+ \fi
+ \fi
+}
+
+\xydef@\sm@showext#1{%
+ \W@{#1\space hp=\sm@exthp,hm=\sm@exthm,vp=\sm@extvp
+ ,vm=\sm@extvm,len=\sm@connlen}}
+
+% Process the next element in the list that describes the representative
+%
+\xydef@\sm@trycirclelist@i#1{%
+ \def\@tmp{#1}%
+ \ifx \@tmp\sm@nnil \let\sm@tryclcont=\relax\else
+ \expandafter\sm@tryclcar\@tmp \fi
+ \sm@tryclcont}
+
+\xydef@\sm@tryclcar#1#2#3{%
+% \W@{Trying one turn in #1\space orient #2\space out #3}%
+ %Compute deltax in R@p and deltay in U@p. Move them to center first.
+ \dimen@=\ifnum #2<0 -\fi\R@
+ \count@=#1\count@=\the\count@ \ABfromdiag@
+ \advance\R@p -\B@ \advance\U@p \A@
+% \xy@showdim{ After center}%
+ % Move them to exit
+ \count@=#3\count@=\the\count@ \ABfromdiag@
+ \advance\R@p \B@ \advance\U@p -\A@
+% \xy@showdim{ After turn}%
+% \xy@showthe p{ }%
+ % Now update the extension points
+ \sm@computeext{#1}{#2}{#3}%
+}
+
+%
+% Compute the extensions
+%
+\xydef@\sm@computeext#1#2#3{%
+% \W@{Computing extents for turn in #1\space orient #2\space out #3}%
+ \ifsm@firstseg
+ \sm@accumext#1%
+ \sm@firstsegfalse
+ \fi
+ \count@@=#1\count@@=\the\count@@\count@=\count@@
+ \dimen@=\sm@connlen
+% \W@{Before rounding count@=\the\count@, count@@=\the\count@@}%
+ \sm@roundcount@{#2}%
+% \W@{After rounding count@=\the\count@, count@@=\the\count@@}%
+ \ifnum \count@=\count@@
+ \sm@advancecount@ 1{#2}% Advance by 90 degrees if odd. By 45 first
+ \advance\dimen@ 0.7854\R@% It was incremented with 1/8 circle
+ \ifnum \count@=#3% Check if done
+ \else
+ \sm@advancecount@ 1{#2}% Another 45
+ \advance\dimen@ 0.7854\R@% It was incremented with 1/8 circle
+ \fi
+ \else
+ \advance\dimen@ 0.7854\R@% It was incremented with 1/8 circle
+ \fi
+ \edef\sm@connlen{\the\dimen@}% Save the connector length
+ \sm@accumext{\the\count@}%
+ \edef\sm@segs{\sm@segs{{#1}{#2}{\the\count@}}}%Accum segment
+ \ifnum\the\count@=#3 \else
+ \edef\tmp@{{\the\count@}{#2}{#3}}%Recursive call
+ \expandafter\sm@computeext\tmp@
+ \fi
+}
+
+%
+% Accumulate the extensions
+%
+\xydef@\sm@accumext#1{%
+% \W@{Accumulating extent for #1}%
+% \sm@showext{Before accum:}%
+ \ifcase #1%
+ \or \count@@=\sm@extvm\advance\count@@ by1%
+ \edef\sm@extvm{\the\count@@}% 1 is V-
+ \or\or \count@@=\sm@exthp\advance\count@@ by1%
+ \edef\sm@exthp{\the\count@@}% 3 is H+
+ \or\or \count@@=\sm@extvp\advance\count@@ by1%
+ \edef\sm@extvp{\the\count@@}% 5 is V+
+ \or\or \count@@=\sm@exthm\advance\count@@ by1%
+ \edef\sm@exthm{\the\count@@}% 7 in H-
+ \fi
+% \sm@showext{After accum:}%
+}
+
+
+% Draw a computed connector.
+% 1,2,3,4 - dx+, dx-, dv+, dv- (lengths of straight connectors in each
+% direction)
+% 5 - a list of segments, each enclosed in a pair of braces.
+\xydef@\sm@conndraw#1#2#3#4#5{%
+ \def\sm@contlist{\sm@drawseglist}%
+ \edef\sm@dxp{#1}%
+ \edef\sm@dxm{#2}%
+ \edef\sm@dyp{#3}%
+ \edef\sm@dym{#4}%Save deltas
+ \sm@drawseglist #5\sm@nil}
+\xydef@\sm@drawseglist#1{% Get the first segment
+ \ifx #1\sm@nil \def\sm@contlist{}\else
+ \sm@drawseg #1\fi
+ \sm@contlist}
+
+%
+% Draw a segment
+%
+\xydef@\sm@drawseg#1#2#3{% A segment is CIRin+CIRorient+CIRout
+% \W@{Drawing segment in=#1\space out=\space #3}\xy@showthe c{Seg start}%
+ \def\CIRin@@{#1}\def\CIRout@@{#3}%
+ \sm@straight%See if a straight line is needed here. Insert it and
+ %reset c if needed
+ \ifnum\CIRin@@=\CIRout@@ \else
+ % Compute the center of the circle
+ \count@=\CIRin@@
+ \dimen@=\ifnum #2<0 -\fi\R@
+ \ABfromdiag@
+ \advance\X@c -\B@ \advance\Y@c \A@
+% \xy@showthe c{Center of circle}%
+% \xy@showdim{Before center}%
+ \ifnum #2>0 \def\CIRorient@@{\CIRacw@}%
+ \else \def\CIRorient@@{\CIRcw@}\fi
+ \drop@\literal@{\hbox\bgroup\cir@i}% Place the circle
+ % Now move the the end of the arc
+ \dimen@=\ifnum #2<0 -\fi\R@
+ \count@=\CIRout@@\count@=\count@%Wierd. If I remove this last assignm
+% %\count@ is not set
+ \ABfromdiag@
+% \xy@showthe c{Before advance}%
+% \xy@showdim{Before advance}%
+ \advance\X@c\B@ \advance\Y@c-\A@
+% \xy@showthe c{After circle}%
+% \xy@showdim{After circle}%
+ \fi
+}
+
+\xydef@\sm@straight{%
+ \U@c=\z@\D@c=\U@c\L@c=\U@c\R@c=\U@c
+ \pfromc@ %Set p at the beginning of the segment
+ \ifcase \CIRin@@ \or% 1 is V-
+ \A@=\sm@dym\advance \Y@c\A@ %Wierd. I have to use the temporary A@!!
+ \or\or % 3 is H+
+ \A@=\sm@dxp\advance \X@c\A@
+ \or\or % 5 is V+
+ \A@=\sm@dyp\advance \Y@c\A@
+ \or\or % 7 is H-
+ \A@=\sm@dxm\advance \X@c\A@ \fi
+ \ifdim\X@c=\X@p\ifdim\Y@c=\Y@p\else \sm@stri \fi\else \sm@stri \fi
+}
+
+\xydef@\sm@stri{%
+% \W@{Drawing straight connection}\xy@showthe p{StrSrc}\xy@showthec{StrDst}%
+ \edef\tmp@{\expandafter\noexpand\arstemprefix@@\arstem@@}%
+ \expandafter\sm@connect@\tmp@}
+\xydef@\sm@connect@#1#{%
+ \DN@##1{\connect@{#1}{##1}}\next@}
+
+\xydef@\sm@drop@#1#{%
+ \DN@##1{\drop@{#1}{##1}}\next@}
+
+% Compute and draw a connector. External interface
+% 1 - in (for p)
+% 2 - out (for c)
+% 3 - suggested radius
+\xydef@\smconn#1#2#3{%
+ \edef\sm@CIRin{#1}\edef\sm@CIRout{#2}%Memorize the directions
+ \R@=#3\R@=\the\R@
+ \sm@conn}
+
+\xyendinput
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Here is an example illustrating a smart <path> (as well as the
+% extensions of the `necula' extension of \S??[:necula]).
+%%
+%\xyuncatcodes\xyrequire{necula}\xycatcodes
+%\begin{code}
+%\def\triangle{[P:DL+/d1pc/,RC+/r1pc/,UL+/u1pc/]}%
+%\def\diamond{[P:DL,DR,RC+/r1pc/,UR,UL,LC+/l1pc/]}
+%\xy
+%\xytracing\POS
+% 0 *+<5mm>e|\triangle|[F-]\txt{Test}="one" ,
+% <2cm,1cm> *+<5mm>e|\diamond|[F.]\txt{Test}="two"
+% \ar @{>->} `sdr_d/30pt "one"
+%\endxy
+%\end{code}
+%\displaycode\noindent
+%%
+% will typeset
+%%
+%$$\docode$$
+
+ \BUG: This code should probably be merged with the `arrow' feature.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Finally the log.
+
+\DOCMODE(
+% $Log$
+% Received from George.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xytex.ini b/Master/texmf-dist/source/generic/xypic/xytex.ini
new file mode 100644
index 00000000000..48e45e20d2f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xytex.ini
@@ -0,0 +1,60 @@
+%% $Id: xytex.ini,v 3.3 1996/12/19 03:31:56 krisrose Exp $ -*-latex-*-
+%%
+%% Generate plain + Xy-pic format file.
+%% Copyright (c) 1993-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+
+% Load plain.tex
+%
+\input plain.tex
+
+% (Any other format parts should be loaded here before Xy-pic).
+
+% Load Xy-pic kernel:
+%
+\input xy
+
+% Extensions and features: You can replace this line with selective loading
+% of particular options if you like.
+%
+\xyoption{all}
+
+% Now dump the format file.
+%
+\dump
+\endinput
+
+% $Log: xytex.ini,v $
+% Revision 3.3 1996/12/19 03:31:56 krisrose
+% Maintenance release
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/06 02:56:02 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% NEW file to go in version 2.10!
diff --git a/Master/texmf-dist/source/generic/xypic/xytextures.doc b/Master/texmf-dist/source/generic/xypic/xytextures.doc
new file mode 100644
index 00000000000..3b6be2c6b40
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xytextures.doc
@@ -0,0 +1,291 @@
+%% $Id: xytextures.doc,v 3.3 1996/12/18 09:41:45 ross Exp $
+%%
+%% Xy-pic ``Textures'' driver interface option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{textures}{Textures driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This driver provides support for version 1.7+ of Blue Sky Research's
+\Textures\ application for Macintosh\footnote{Macintosh is a trademark of
+Apple Computer Inc.}. It incorporates support for colour and all of
+\Xy-pic's \PS\ effects. Earlier versions of \Textures\ should instead use
+the driver option |\xyoption{16textures}|.
+
+Notice that version 1.7 suffers from a printing bug which may cause a \PS\
+error. A fix is kludged by making sure the first page has been shown in the
+viewer before any pages with diagrams are sent to the printer.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\DOCMODE(
+\xydef@\Textures@@#1{\dvimessage@{Textures}{#1}}
+
+\newdriver{%
+ \xyaddsupport{color}\texturesColor@@
+ \xyaddsupport{crayon}\texturesCrayon@@
+ \xyaddsupport{ps}\texturesPS@@
+ \xyaddsupport{rotate}\texturesRotate@@
+ \xyaddsupport{line}\texturesLine@@
+ \xyaddsupport{frame}\texturesFrames@@
+ \xyaddsupport{tile}\texturesTiles@@
+ \xyaddsupport{cmtip}\relax
+}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Supported |\special| effects are...
+%
+\begin{itemize}
+
+\item colour, both on-screen and with \PS\
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Textures uses the colour-stack method, but it requires a separate
+|\special| to set the new colour after having pushed the previous colour
+onto the stack.
+
+\DOCMODE(
+\xydef@\TexturesColor@push#1{\special{color push}\special{color #1}}
+
+\xydef@\TexturesColours@{\texturesPStypes@
+ \let\xylocalColor@=\xystackcolor@
+ \let\xycolor@push=\TexturesColor@push
+ \def\xycolor@{\xycolor@@}%
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}%
+ \installPScolor@ }\else\DN@{}\fi \next@
+ \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi
+ \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\texturesCrayon@@{}}%
+ \else\let\next@=\xystandardcolors@ \fi \next@
+ \let\xycolorwarning@=\relax \Textures@@{color}%
+ \let\texturesColor@@=\relax
+ \let\UnloadColor@@=\NoTexturesColor@
+ }
+
+\xydef@\texturesColor@@{\TexturesColours@}
+
+\xydef@\NoTexturesColor@{%
+ \let\xylocalColor@=\xyNoColor@@
+ \let\xycolor@=\xyNoColor@
+ \let\xycolorwarning@=\xycolorwarning@@
+ \let\texturesColor@@=\TexturesColours@
+ \let\UnloadColor@@=\UnloadColor@
+ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item crayon colours.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The 68 colours are those that |dvips| recognizes by name,
+thanks to Tomas Rokicki.
+
+\DOCMODE(
+\xydef@\texturesCrayon@@{\texturesColor@@\texturesCrayon@}
+\xydef@\texturesCrayon@{\installCrayolaColors@}%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \PS\ back-end.
+
+\DOCMODE(
+\xydef@\texturesPS@@{\texturesPS@}
+\xydef@\texturesPSunload@{\UnloadPS@
+ \let\UnloadPS@@=\UnloadPS@
+ \let\texturesPS@@=\texturesPS@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Versions 1.7 and later of \Textures\ have the following kinds of |\special|,
+the first two executing in the environment defined by the dictionary
+|userdict|. In particular these versions of \Textures\ now allow the
+\PS\ dictionary to be loaded into the main working dictionary.
+
+\begin{itemize}
+\item |\special{rawpostscript #1}| puts code directly into the \PS\ file.
+\item |\special{postscript #1}| wraps the code within |sps|...|eps|,
+which involves a basis change within a |save/restore| pair.
+\item |\special{prePostScript #1}| places the \PS\ code within the header
+dictionary, called |TeXdict|.
+\end{itemize}
+Each of these has a corresponding version for reading the \PS\ commands
+from a file.
+
+\DOCMODE(
+\xydef@\texturesPStypes@{%
+ \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \ifx\PSspecial@@\TexturesSpecial@\else
+ \let\PSspecial@@=\TexturesSpecial@
+ \let\PSmacro@@=\TexturesMacro@
+ \let\PSdict@@=\TexturesDict@
+ \let\PSraw@@=\TexturesRaw@
+ \let\PSinclude@@=\TexturesInclude@
+ \let\PSspecialdict@@=\TexturesSpecialDict@
+ \let\xyPSobeylines@@=\obeyTextureslines@
+ \Textures@@{PostScript}%
+ \fi \texturesCurrpt@ \XYpredict@ }
+
+\xydef@\TexturesSpecial@#1{\firstPS@@\special{postscript #1}}
+\xydef@\TexturesMacro@#1{\special{postscript {#1}xy}}
+\xydef@\TexturesDict@#1{\special{prePostScript #1}}
+\xydef@\TexturesSpecialDict@#1{\special{prePostScript #1}}
+\xydef@\TexturesInclude@#1{\firstPS@@\special{prePostScriptfile #1}}
+\xydef@\TexturesRaw@#1{\firstPS@@\special{rawpostscript #1}}%
+
+{\catcode`\^^M=\active%
+ \gdef\next{\catcode`\^^M=\active \let^^M=\par%
+ \let\PSspecial@@=\TexturesDict@ \obeyspaces}}
+\xylet@\obeyTextureslines@=\next
+\DOCMODE)
+
+The |currentpoint| is defined for the ``raw'' specials.
+For Textures this is the same as |\xyPScurrpt@@@|, in |xyps-ps.doc|.
+
+\DOCMODE(
+\xydef@\texturesCurrpt@{\let\xyPScurrpt@@=\texturesCurrpt@@}%
+\xydef@\texturesCurrpt@@{\PSspecial@@{xyi}\PSraw@@{userdict begin xyx end}}
+
+%\xydef@\texturesCurrpt@@{\PSspecial@@{%
+% 0 0 transform grestore gsave itransform }%
+% \PSraw@@{userdict begin /xyYpos exch def /xyXpos exch def end}}
+\DOCMODE)
+
+The \PS\ operator called |xyx| is defined in |xyps-ps| for storing the
+location placed on the stack by |xyi|.
+
+\medskip
+
+This installs the \PS\ backend.
+
+\DOCMODE(
+\xydef@\texturesPS@{\texturesPStypes@
+ \let\texturesPS@@=\relax
+ \let\UnloadPS@@=\texturesPSunload@
+ \let\installxyps@@=\relax \installxyps@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item rotated/scaled diagrams and text, using \PS.
+\DOCMODE(
+\xydef@\texturesRotate@@{\texturesRotate@}
+
+\xydef@\texturesRotate@{\texturesPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
+ \xyRotScale@@ \installPSrotscale@ }%
+ \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
+ \next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item variable line-widths and poly-lines, using \PS.
+\DOCMODE(
+\xydef@\texturesLine@@{\texturesLine@}
+
+\xydef@\texturesLine@{\texturesPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}%
+ \installPSline@ }%
+ \else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item extra frames and fills, using \PS.
+\DOCMODE(
+\xydef@\texturesFrames@@{\texturesFrames@}
+
+\xydef@\texturesFrames@{\texturesPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}%
+ \installPSframes@ }%
+ \else\DN@{\xydriverfail@{frames are}\UnloadPSFrames@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item patterns and tiles, using \PS.
+\DOCMODE(
+\xydef@\texturesTiles@@{\texturesTiles@}
+
+\xydef@\texturesTiles@{\texturesPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}%
+ \installPSpatterns@ \xystandardpatterns@}%
+ \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{itemize}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xytextures.doc,v $
+% Revision 3.3 1996/12/18 09:41:45 ross
+% minor improvements to file-loading commands
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xytile.doc b/Master/texmf-dist/source/generic/xypic/xytile.doc
new file mode 100644
index 00000000000..c1509987bbb
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xytile.doc
@@ -0,0 +1,472 @@
+%% $Id: xytile.doc,v 3.4 1997/05/18 01:13:24 ross Exp $
+%%
+%% Xy-pic ``Pattern and Tile extension'' option.
+%% Copyright (c) 1993-1997 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{tile}{Pattern and Tile extension}{\stripRCS$Revision: 3.4 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This extension provides the ability to request that a filled region be
+tiled using a particular pattern.
+
+This is an effect not normally available within \TeX.
+Instead it requires a suitable <driver> option to provide the necessary
+|\special| commands, together with any extra commands needed to implement
+the effects. Thus
+$$
+\xy
+ *+\txt<.8\hsize>{Using this extension will have no effect on the output
+ unless used with a dvi-driver that explicitly supports it.}
+ *\frm{-}
+\endxy
+$$
+All effects defined in the |tile| extension can be implemented using most
+\PS\ <driver>s, loaded as |\xyoption{|<driver>|}|.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+Like using color, tiling with patterns is an instance of a special style,
+since use of a pattern has no effect on the size or shape of the <object>
+being typeset. It only affects how the <object> will appear on the printed
+page or on-screen.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\LoadAllPatterns{xymacpat}
+\def\MacPatterns{\begin{figure*}[ht]
+$$
+%
+ \newcount\R \newcount\C
+ \def\n{\advance\R1 \C0 \POS(\R,\C)}
+ \def\F##1{\advance\C1 %
+ \POS(\R,\C)*+\txt\small{\phantom{filled}\\{\phantom{pattern}}}*[thicker]\frm{-},*[##1]\frm{**},
+ +D*+!U\txt\small{##1}}
+%
+\R-1 \C0 \xy
+ 0;<0cm,-1.5cm>:<1.5cm,0cm>:: \relax
+% \n,{\C1\POS(\R,\C)}
+ \n\F{mac01}\F{mac02}\F{mac03}\F{mac04}\F{mac05}\F{mac06}\F{mac07}\F{mac08}
+ \n\F{mac09}\F{mac10}\F{mac11}\F{mac12}\F{mac13}\F{mac14}\F{mac15}\F{mac16}
+ \n\F{mac17}\F{mac18}\F{mac19}\F{mac20}\F{mac21}\F{mac22}\F{mac23}\F{mac24}
+ \n\F{mac25}\F{mac26}\F{mac27}\F{mac28}\F{mac29}\F{mac30}\F{mac31}\F{mac32}
+ \n\F{mac33}\F{mac34}\F{mac35}\F{mac36}\F{mac37}\F{mac38}
+%
+\endxy
+$$
+\caption{The 38 standard Macintosh patterns.}
+??=[f.macpats]
+\end{figure*}\let\MacPatterns=\relax}
+\MacPatterns
+
+\paragraph*{Patterns}
+Patterns are specified as a <shape> modifier, similar to the way colours
+are specified by name.
+The pattern is applied to the whole of the current <object> whether this be
+text, an \Xy-pic line, curve or arrow-tip, or a composite object such as
+a matrix or the complete picture. However some DVI-drivers may not support
+use of patterns in all cases.
+
+If the current DVI-driver cannot support patterns then a request for one
+simply produces a warning message in the log file. After two such
+messages subsequent requests are ignored completely.
+%
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xypatternwarning@@{\xypatternmessage@
+ \gdef\xypatternwarning@{\xypatternmessage@
+ \xywarning@{...no further pattern warnings will be given.}%
+ \global\let\xypatternwarning@=\relax }}
+\xylet@\xypatternwarning@=\xypatternwarning@@
+
+\xydef@\xypatternmessage@{%
+ \xywarning@{Current driver does not support patterns.}}%
+\DOCMODE)
+
+This allows new patterns to be specified from raw data.
+Make sure the usual catcodes are in place before the data is tokenised.
+
+\DOCMODE(
+\xydef@\newxypattern{\begingroup\xycatcodes\newxypattern@i}
+\xydef@\newxypattern@i#1#2{\edef\next@{\endgroup
+ \noexpand\newxyPattern{#1}{}{#2}{}}\next@}
+\xydef@\newxyPattern#1#2#3#4{\newxypattern@{#1}{#2}{#3}{#4}{}}
+\DOCMODE)
+
+Existing pattern names can be overridden using |\newxypattern@#1#2\relax|.
+
+\DOCMODE(
+\xydef@\newxypattern@#1#2#3#4#5{%
+ \expandafter\let\expandafter\next@\csname shape [#1]\endcsname
+ \ifx\next@\relax
+ \DN@{#4}\ifx\next@\empty
+ \DN@{#2}\ifx\next@\empty
+ \DN@{\newxystyle{#1}{\xylocalpattern@{}{#3}\xypattern@{#3}}}%
+ \else
+ \DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#2 #3}}}%
+ \fi
+ \else\DN@{#2#3}\ifx\next@\empty
+ \DN@{\newxystyle{#1}{\xylocalpattern@{#4}{}\xypattern@{#4}}}%
+ \else
+ \DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#4}}}%
+ \fi\fi
+ \else \def\tmp@{\relax}\DNii@{#5}%
+ \ifx\nextii@\tmp@
+ \DN@{#4}\ifx\next@\empty
+ \DN@{#2}\ifx\next@\empty
+ \DN@{\newxystyle{#1}{\xylocalpattern@{}{#3}\xypattern@{#3}}}%
+ \else
+ \DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#2 #3}}}%
+ \fi
+ \else
+ \DN@{#2#3}\ifx\next@\empty
+ \DN@{\newxystyle{#1}{\xylocalpattern@{#4}{}\xypattern@{#4}}}%
+ \else
+ \DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#4}}}%
+ \fi\fi
+ \else\DN@{}\fi\fi \next@\relax }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+\begin{defs}
+|[|<name>|]| & use named pattern \hfill \cr
+\noalign{\smallskip}
+\multispan2{??c![\newxypattern]|{|<name>|}{|<data>|}|}\cr
+&\omit specify new pattern using <data>\hfil\cr
+\noalign{\smallskip}
+\multispan2{|\UsePatternFile{|<file>|}|}\cr
+&\omit sets default file for patterns\hfil \cr
+\noalign{\smallskip}
+\multispan2{|\LoadAllPatterns{|<file>|}|}\cr
+&\omit load all patterns in <file>\hfil \cr
+\noalign{\smallskip}
+\multispan2{|\LoadPattern{|<name>|}{|<file>|}|}\cr
+&\omit load named pattern from <file> \hfil\cr
+\noalign{\smallskip}
+\multispan2{|\AliasPattern{|<alias>|}{|<name>|}{|<file>|}|}\cr
+&\omit let <alias> denote pattern from <file>.\hfil
+\end{defs}
+%
+Although pattern data may be specified directly using |\newxypattern|, it is
+more usual to load it from a <file> in which many patterns are defined by
+name, each on a separate line. By convention such files always end in |.xyp|
+(\Xy-pattern) so no extension should be specified. The pattern is then
+requested using either the name supplied in the file or by an alias. Once
+|\UsePatternFile| has been used, then a null <file> argument to the other
+commands will still find patterns in the default file. The default remains in
+effect for the current level of \TeX\ grouping.
+
+For example, the following picture
+\begin{code}
+\AliasPattern{bricks}{mac12}{xymacpat}
+\AliasPattern{bars}{mac08}{xymacpat}
+\xy *+<5pc,3.1pc>{},{*[bricks]\frm{**}}
+ ,*+<2.5pc>[o]{},*[bars]\frm{**}
+\endxy
+\end{code}
+$$\docode$$
+uses `filled' frames from the |frame| feature:
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+There are two methods, perhaps used simultaneously, for handling requests
+for a pattern. The |\xylocalpattern@| is the normal method, patterning
+whatever objects \TeX\ typesets from fonts or rules.
+The more specialized |\xypattern@| is used with a \PS\ <driver>.
+
+Thus a <driver> which supports both pattern and \PS\ must define a method to
+handle |\xylocalpattern@| but should leave alone |\xypattern@|. The latter
+method will be adjusted appropriately when a \PS\ <driver> is installed.
+
+\DOCMODE(
+\xydef@\xyNopattern@#1{}
+\xylet@\xypattern@@=\xyNopattern@
+\xydef@\xyNopattern@@#1#2{\xypatternwarning@}
+
+\xylet@\xypattern@=\xypattern@@
+\xylet@\xylocalpattern@=\xyNopattern@@
+\DOCMODE)
+
+This is to facilitate unloading patterns when the <driver> is changed
+to one that does not support this feature. This is the default state,
+until an appropriate <driver> is loaded.
+
+\DOCMODE(
+\xydef@\Unloadpattern@{%
+ \let\xylocalpattern@=\xyNopattern@@
+ \let\xypattern@=\xyNopattern@
+ \let\xypatternwarning@=\xypatternwarning@@ }
+
+\Unloadpattern@
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Pattern data}
+A region is tiled using copies of a single `cell' regularly placed so as to
+seamlessly tile the entire region. The <data> appearing as an argument to
+|\newxypattern| is ultimately passed to the dvi-driver.
+
+The simplest form of pattern data is: <num> <Hex-data>, where the data
+is a 16-character string of Hexadecimal digits; i.e. 0--9, $A$--$F$.
+Each Hex-digit equates to 4 binary bits, so this data contains 64 bits
+representing pixels in an $8\times8$ array.
+The <num> is an integer counting the number of `0's among the 64 bits.
+Taken as a fraction of 64, this number or its complement, represents the
+average density of `on' pixels within a single cell of the pattern.
+Drivers unable to provide the fine detail of a pattern may simply use this
+number, or its complement, as a gray-level or part of a colour specification
+for the whole region to be tiled.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+A desirable set of standard patterns could be specified to be always loaded.
+If such a set emerges indeed as being frequently desirable then it will be
+included here.
+
+\DOCMODE(
+\xydef@\xystandardpatterns@{}%
+\DOCMODE)
+
+\NOTE: The driver file must call |\xystandardpatterns@| before these
+patterns become accessible. This is to allow any <driver>-specific
+definitions to be active when these patterns are defined.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xynew@{read}{\xypatread@}
+\xydef@\defaultpattfile@{}
+
+\xydef@\xygetfilepatterns@#1{\DN@{#1}%
+ \ifx\next@\empty
+ \ifx\defaultpattfile@\empty \xywarning@{No pattern file specified.}%
+ \else \DN@{\expandafter\openpattfile@\expandafter{\defaultpattfile@}}\fi
+ \else \DN@{\openpattfile@{#1}}\fi \next@ }
+
+\xydef@\openpattfile@#1{\openin\xypatread@=#1.xyp %
+ \ifeof\xypatread@\xywarning@{No patterns in file: #1.xyp}%
+ \closein\xypatread@
+ \else \expandafter \xyreadpatfile@ \fi }%
+
+\xydef@\UsePatternFile#1{\def\defaultpattfile@{#1}}
+
+\xydef@\LoadAllPatterns{\let\parsepattern@=\parsepattern@@
+ \xygetfilepatterns@ }
+
+\xydef@\LoadPattern#1{\let\parsepattern@=\filepattern@@
+ \def\pattname@{#1}\xygetfilepatterns@}
+
+\xydef@\AliasPattern#1#2{\let\parsepattern@=\aliaspattern@@
+ \def\aliasname@{#1}\def\pattname@{#2}\xygetfilepatterns@}
+\DOCMODE)
+
+The character |!| is used to delimit comments within pattern-data
+files.
+
+\DOCMODE(
+\xydef@\xyreadpatfile@{%
+ \loop@ \bgroup\xycatcodes
+ \global\read\xypatread@ to\xypatline@
+ \ifeof\xypatread@ \aftergroup\endpatread@
+ \else\aftergroup\morepatread@\fi \edef\next@{%
+ \egroup\noexpand\getxypattern@{\xypatline@!!!}\relax}\next@
+ \repeat@ }
+\xydef@\endpatread@{\closein\xypatread@\iffalse}
+\xydef@\morepatread@{\iftrue}
+
+%\xydef@\getxypattern@{\futurelet\next\getxypattern@@}
+\xydef@\getxypattern@#1{\def\next{#1}\getxypattern@@}
+\xydef@\getxypattern@@{\DN@{!!!}\ifx\next\next@\DN@{}%
+ \else\DN@{\expandafter\parsepattern@\next}\fi \next@ }
+
+\xydef@\parsepattern@@#1 #2!#3\relax{\newxypattern{#1}{#2}}
+\xydef@\filepattern@@#1 #2!#3\relax{\DN@{#1}%
+ \ifx\next@\pattname@
+ \DN@{\expandafter\foundpattern@\expandafter{\pattname@}{#2}}%
+ \else\DN@{}\fi \next@ }
+\xydef@\foundpattern@#1#2{\newxypattern{#1}{#2}\endpatread@\fi
+ \expandafter\eat@}
+\xydef@\aliaspattern@@#1 #2!#3\relax{\DN@{#1}%
+ \ifx\next@\pattname@
+ \DN@{\expandafter\foundpattern@\expandafter{\aliasname@}{#2}}%
+ \else\DN@{}\fi \next@ }
+
+%\xydef@\parsepattern@#1 #2!#3\relax{\message{#1:#2}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\medskip
+\noindent
+The file |xymacpat.xyp| contains defining data for the 38 standard
+patterns available with the Macintosh Operating system.
+Figure~??[f.macpats] displays all these patterns.
+
+% Comment this line an uncomment one below, to move the patterns to a
+% later page.
+
+%\MacPatterns
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\clearpage
+\paragraph*{Rotating and Resizing Patterns}
+%
+Some implementations of patterns are sufficiently versatile to allow extra
+parameters to affect the way the pattern data is interpreted. \PS\ is one
+such implementation in which it is possible to rotate the whole pattern and
+even to expand or contract the sizes of the basic cell.
+
+Due to the raster nature of output devices, not all such requests can be
+guaranteed to produce aesthetic results on all devices. In practice only
+rotations through specific angles (e.g 30$^\circ$, 45$^\circ$, 60$^\circ$)
+and particular scaling ratios can be reliably used.
+Thus there is no sophisticated interface provided by \Xy-pic to access these
+features. However the `\PS\ escape' mechanism does allow a form of access,
+when a \PS\ <driver> is handling pattern requests.
+
+Special \PS\ operators |pa| and |pf| set the pattern angle (normally 0)
+and `frequency' measured in {\em cells per inch}. Hence, when used as an
+<object>-modifier, |[! 30 pa 18.75 pq]| rotates the pattern by 30$^\circ$
+clockwise and uses a smaller pattern cell (larger frequency).
+The default frequency of $12.5=300/(8\times3)$ means that
+each pixel in a pattern cell corresponds, on a device of resolution
+300{\small dpi}, to a $3\times3$ square of device pixels;
+on such a device $18.75$ uses $2\times2$ squares.
+
+At 300{\small dpi} a frequency of $9.375=300/(8\times4)$ uses $4\times4$
+squares. These match the natural size for pixels on a 75{\small dpi} screen
+and are pretty close for 72{\small dpi} screens.
+Though appropriate for screen displays, these are `too chunky' for high
+quality printed work. Doubling the frequency is too fine for some patterns,
+hence the intermediate choice of $12.5$ as default.
+In order for printed output to match the screen view, a \PS\ operator |macfreq|
+has been defined to facilitate requests for $9.375$, via |[!macfreq]|.
+
+The next diagram displays changes to the frequency.
+%
+$$
+ \newcount\R \newcount\C
+ \def\n{\advance\R1 \C0 \POS(\R,\C)}
+ \def\F#1#2{\advance\C1 %
+ \POS(\R,\C)*+\txt\small{filled\\pattern}*[thicker]\frm{-}
+ ,*[! #2 pq][#1]\frm{**},
+ +D*+!U\txt\small{#2}}
+%
+\R-1 \C0 \xy
+ 0;<0cm,-1.5cm>:<2.0cm,0cm>:: \relax
+% \n,{\C1\POS(\R,\C)}
+ \n\F{mac38}{9.375}\F{mac38}{12.5}\F{mac38}{18.75}\F{mac38}{37.5}
+ \n\F{mac16}{9.375}\F{mac16}{12.5}\F{mac16}{18.75}\F{mac16}{37.5}
+%
+\endxy
+$$
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+\paragraph*{Saving patterns: \ }
+%
+When styles are saved using ??c[[=]<word>|]|, see note~??g[xy.doc:define
+<shape>] of \S??g[xy.doc:object], then the current pattern (if any) is also
+saved. Subsequent use of |[|<word>|]| recovers the pattern as well as colour
+and line-style settings. This includes any explicit variations applied using
+the ``Style Escape'' mechanism.
+
+Here is a variation of an earlier example, with extra effects.
+\begin{code}
+\UsePatternFile{xymacpat}
+\AliasPattern{bricks}{mac12}{}
+\LoadPattern{mac28}{}\LoadPattern{mac05}{}
+\xy *=0[! macfreq -45 pa][mac28][|=Bars]{}
+,*+<12pc,4pc>{}*[bricks]\frm{**}
+,-<3.5pc,0pt>,*+<2.65pc>[o]{},*[Bars]\frm{**}
+,*[thicker]\frm{o},+<6pc,0pt>
+,*+<5pc, 2.7pc>{},*[mac05]\frm{**},*\frm{-,}
+,*[white]\txt\Large\bf\sf{Kilroy\\was here}
+\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Add this extension to the driver-tables as ``unload'',
+unless an already-loaded driver can support it:
+
+\DOCMODE(
+\DN@{\xyaddunsupport{tile}\Unloadpattern@}%
+\ifx\xyeverywithoption@tile@\undefined
+\else\ifx\xyeverywithoption@tile@\empty
+\else
+ \DN@{\xysetup@@{\xywithoption{tile}{\xyeverywithoption@tile@\xydriversloaded@@}}}%
+\fi\fi \next@
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Uncomment this to move the patterns to a later page.
+
+%\MacPatterns
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xytile.doc,v $
+% Revision 3.4 1997/05/18 01:13:24 ross
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/18 09:43:06 ross
+% documentation change
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+%
+% NEW for version 3.0 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xytips.doc b/Master/texmf-dist/source/generic/xypic/xytips.doc
new file mode 100644
index 00000000000..93136a7e92f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xytips.doc
@@ -0,0 +1,239 @@
+%% $Id: xytips.doc,v 3.3 1996/12/19 04:12:13 krisrose Exp $
+%%
+%% Xy-pic ``More Tips'' extension.
+%% Copyright (c) 1992-1996 Kristoffer H. Rose <kris@diku.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <kris@diku.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{tips}{More Tips extension}{\stripRCS$Revision: 3.3 $}%
+ {Kristoffer H.~Rose}{kris@diku.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This extension provides several additional styles of `tips' for use
+ (primarily) as arrow heads, and makes it possible to define
+ customised tips. This is used to support tips that mimic the style
+ of the Computer Modern fonts\footnote{This function was earlier
+ supported by the |cmtip| extension which is still included in the
+ distribution but is now obsolete.} by Knuth~(see
+ \cite{K86:ComputerMT} and \cite[appendix~F]{K84:TeXbook}) and of the
+ Euler math fonts distributed by the \AMS.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+ First save the \Xy-commands that may need restoring.
+
+\DOCMODE(
+\xylet@\tip@xy=\tip@
+\xylet@\atip@xy=\atip@
+\xylet@\btip@xy=\btip@
+
+\xylet@\Tip@xy=\Tip@
+\xylet@\Ttip@xy=\Ttip@
+
+\xylet@\tipjot@xy=\tipjot@
+\DOCMODE)
+
+ Next declare the fonts (initially the original |cm| style).
+
+\DOCMODE(
+\xyfont@\xy@@atfont=xycmat10
+\xyfont@\xy@@btfont=xycmbt10
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Font selection is done with the command
+%
+\begin{defs1}
+??c![\SelectTips] |{|<family>|}| |{|<size>|}|
+\end{defs1}
+%
+\DOCMODE(
+\xydef@\tipfamily@@{cm}
+\xydef@\tipsize@@{10}
+
+\xydef@\SelectTips#1#2{%
+ \DN@{#1}\ifx\next@\empty\else \def\tipfamily@@{#1}\fi
+ \DN@{#2}\ifx\next@\empty\else \def\tipsize@@{#2}\fi
+ \csname tipfamily \tipfamily@@\endcsname \ignorespaces}
+\DOCMODE)
+\noindent\unskip
+%
+ where the <family> and <size> should be selected from the following
+ table.
+%
+\begin{center}
+\def\TIPS#1#2{\hbox{\SelectTips{#1}{#2}\UseTips
+ $\xy;/r1pc/**{}?>*@{>}**{-}\endxy~
+ \xy;/r1pc/**{}?>*@2{>}**@2{-}\endxy~
+ \xy;/r1pc/**{}?>*@3{>}**@3{-}\endxy$}}%
+\leavevmode
+\begin{tabular}{\otherbar c\otherbar c\otherbar c\otherbar c\otherbar}
+\hline
+ Family & ??c![10] & ??c![11] & ??c![12] \\
+\hline
+ {}??c![xy] &{}\TIPS{xy}{10} &{}\TIPS{xy}{11} &{}\TIPS{xy}{12} \\
+ {}??c![cm] &{}\TIPS{cm}{10} &{}\TIPS{cm}{11} &{}\TIPS{cm}{12} \\
+ {}??c![eu] &{}\TIPS{eu}{10} &{}\TIPS{eu}{11} &{}\TIPS{eu}{12} \\
+\hline
+\end{tabular}
+\end{center}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The table is really encoded in control sequences
+ |\tipfamily|~<family> that look very much alike since all the
+ currently existing combinations are merely alternative fonts. This
+ is likely to change, however, \dots\smiley
+
+ First |cm|, \ie, computer modern: these are simplified by the fact
+ that we can use the normal double arrows.
+
+\DOCMODE(
+\xydefcsname@{tipfamily cm}{\loadtipfonts@
+ \let\tip@=\tip@cm \let\atip@=\atip@cm \let\btip@=\btip@cm
+ \let\Tip@=\Tip@xy \let\Ttip@=\Ttip@xy \def\tipjot@{.2em}}
+
+\xydef@\loadtipfonts@{\edef\next##1##2{##1=xy\tipfamily@@##2\tipsize@@}%
+ \next{\font\xy@@atfont}{at}
+ \next{\font\xy@@btfont}{bt}
+}
+
+\xydef@\tip@cm{\activatetips@ \tip@x\tip@@}
+\xydef@\atip@cm{\activatetips@ \tip@x\atip@@}
+\xydef@\btip@cm{\activatetips@ \tip@x\btip@@}
+
+\xydef@\activatetips@{\let\xyatipfont=\xy@@atfont \let\xybtipfont=\xy@@btfont}
+\DOCMODE)
+
+ Next Euler tips: the single tips merely reuse the |cm| code except
+ for the sligtly smaller distance between double tips; the double
+ arrows have to be recoded to mimic the steeper Euler appearance.
+
+\DOCMODE(
+\xydefcsname@{tipfamily eu}{\loadtipfonts@
+ \let\tip@=\tip@cm \let\atip@=\atip@cm \let\btip@=\btip@cm
+ \let\Tip@=\Tip@eu \let\Ttip@=\Ttip@eu \def\tipjot@{.15em}}
+
+\xydef@\Tip@eu{\kern1.5pt \vrule height1.5pt depth1.5pt width\z@
+ \Tip@@eu \kern1.5pt \egroup
+ \U@c=1.5pt \D@c=1.5pt \L@c=1.5pt \R@c=1.5pt \Edge@c={\circleEdge}%
+ \Invisible@false \Hidden@false \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@{\dottedSpread@\jot}}}
+
+\xydef@\Tip@@eu{\count@=\DirectionChar
+ \advance\count@-10 \ifnum\count@<\z@ \advance\count@128 \fi
+ \xyatipfont\char\count@
+ \advance\count@ 20 \ifnum127<\count@ \advance\count@-128 \fi
+ \xybtipfont\char\count@}
+
+\xydef@\Ttip@eu{\kern2.4pt \vrule height2.4pt depth2.4pt width\z@
+ \Ttip@@eu \kern2.4pt \egroup
+ \U@c=2.4pt \D@c=2.4pt \L@c=2.4pt \R@c=2.4pt \Edge@c={\circleEdge}%
+ \Invisible@false \Hidden@false
+ \def\Leftness@{.5}\def\Upness@{.5}%
+ \def\Drop@@{\styledboxz@}\def\Connect@@{\straight@{\dottedSpread@\jot}}}
+
+\xydef@\Ttip@@eu{%
+ \setboxz@h\bgroup\reverseDirection@\line@ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@
+ \kern-\L@c \boxz@ \kern\L@c \Tip@@eu}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Once a selection is made, the following commands are available:
+%
+\begin{defs}
+??c![\UseTips] & activate selected tips\cr
+??c![\NoTips] & deactivate\cr
+\end{defs}
+%
+\DOCMODE(
+\xydef@\UseTips{\csname tipfamily \tipfamily@@\endcsname}
+
+\xydef@\NoTips{\let\tip@=\tip@xy \let\atip@=\atip@xy \let\btip@=\btip@xy
+ \let\Tip@=\Tip@xy \let\Ttip@=\Ttip@xy \let\tipjot@=\tipjot@xy}
+\DOCMODE)
+\noindent\unskip
+%
+ They are local and thus can be switched on and/or off for individual
+ pictures using the \TeX\ grouping mechanism, \eg,
+%
+\begin{code}
+\SelectTips{cm}{10}
+\xy*{} \ar
+ @{*{\UseTips\dir_{<<}}-*{\NoTips\dir{>}}}
+ (20,5)*{} \endxy
+\end{code}
+\displaycode
+\noindent
+%
+ will typeset
+$$
+\docode
+$$
+ regardless of which tips are used otherwise in the document.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{End \& log}
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xytips.doc,v $
+% Revision 3.3 1996/12/19 04:12:13 krisrose
+% New for this maintenance release.
+%
+% Generalisation of xycmtip.doc,v 3.1 1995/09/05 20:31:32 kris Exp krisrose
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.6 1993/10/21 20:36:09 kris
+% NEW file to go in version 2.7!
+%
+% Extracted from xypic.doc 2.6.1.1.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs how we are formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xytp-f.doc b/Master/texmf-dist/source/generic/xypic/xytp-f.doc
new file mode 100644
index 00000000000..ed15b6fff6b
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xytp-f.doc
@@ -0,0 +1,306 @@
+%% $Id: xytp-f.doc,v 3.3 1996/12/18 09:49:07 ross Exp $
+%%
+%% Xy-pic ``Frame extension'' TPIC backend support.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xytpfloaded\empty \message{not reloaded}\endinput \fi
+\let\xytpfloaded=\empty \xycatcodes
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{frames.}
+
+The included file |xytp-f.tex|
+(version \stripRCS$Revision: 3.3 $) provides \TPIC\ support
+for some of the effects defined in the |frame| extension.
+This file is loaded and its effects are activated automatically whenever
+|\xyoption{frame}| is requested and the current <driver> supports both
+\TPIC\ and frames. Should there be any need to turn off this support,
+the following commands are available; they obey usual \TeX\ groupings.
+%
+\begin{defs}
+|\NoTPICframes| & remove \TPIC\ support\kern-50pt \cr
+|\UseTPICframes| & reinstate \TPIC.
+\end{defs}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Installation}
+
+The <driver>-file must call the following macro to rebind control sequences
+defined in |xyframe|, thereby allowing the \TPIC\ methods to be used.
+
+\DOCMODE(
+\xydef@\installTPICframes@{%
+ \let\framed@body@@=\xyTPICframed@body@
+ \let\circled@x@@=\xyTPICcircled@x@
+ \let\ellipsed@x@@=\xyTPICellipsed@x@
+ \installTPICfills@
+ \xyuncatcodes}
+
+\xydef@\UseTPICframes{\installTPICframes@}
+\xydef@\NoTPICframes{\UnloadFrames@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Frames: solid, dotted and dashed}
+
+\DOCMODE(
+\xydef@\xyTPICframed@body@{\DN@{\framed@body@}%
+ \ifdim\R@=\z@
+ \ifx\framehfill\frm@solidh@@
+ \DN@{\xyTPICframed@rect@i\xytpic@solid@@}%
+ \else\ifx\framehfill\frm@dashh@@
+ \DN@{\xyTPICframed@rect@i\xytpic@dashed@@}%
+ \else\ifx\framehfill\frm@doth@@
+ \DN@{\xyTPICframed@rect@i\xytpic@dotted@@}%
+ \fi\fi\fi\fi \next@ }
+
+\xydef@\xyTPICframed@rect@i#1{\vglue\U@c
+ \hbox{\hglue\L@c\xyTPICrect@{#1}\hglue\R@c}\vglue\D@c}
+
+%\xydef@\xyTPICframed@oval@#1{\vglue\U@c
+% \hbox{\hglue\L@c\xyTPICoval@{}\hglue\R@c}\vglue\D@c}
+\DOCMODE)
+
+Dotted and dashed circles have no particular support, whereas
+solid circles and ellipses can use |\xyTPICfullcircle@|.
+
+\DOCMODE(
+\xydef@\xyTPICcircled@x@{\DN@{\xyTPICcircled@xx{}}%
+ \ifx\framehfill\frm@doth@@ \DN@{\xyTPICdotcirc@}%
+ \else\ifx\framehfill\frm@dashh@@\DN@{\xyTPICdashcirc@}%
+ \fi\fi \next@ }
+
+\xydef@\xyTPICcircled@xx#1{\vglue2\R@
+ \hbox{\hglue2\R@\xyTPICfullcircle@#1\hglue2\R@}\vglue2\R@}
+
+\xydef@\xyTPICdotcirc@{\let\zerodot=\framezerodot@@
+ \L@=\R@ \circled@x@@ }
+\xydef@\xyTPICdashcirc@{\L@=\R@ \circled@x@@ }
+
+\xydef@\xyTPICdotellip@{\ellipsed@x@@ }
+\xydef@\xyTPICdashellip@{\ellipsed@x@@ }
+\DOCMODE)
+
+In practice the parameters |#1| and |#2| will hold <dimen>s.
+
+\DOCMODE(
+\xydef@\xyTPICellipsed@x@#1#2{\DN@{\xyTPICellipsed@xx{}}%
+ \ifx\framehfill\frm@doth@@\DN@{\xyTPICdotellip@}%
+ \else\ifx\framehfill\frm@dashh@@\DN@{\xyTPICdashellip@}%
+ \fi\fi \next@{#1}{#2}}
+
+\xydef@\xyTPICellipsed@xx#1#2#3{\vglue #3\vglue #3\relax
+ \hbox{\L@c = #2\relax \R@c=\L@c \D@c = #3\relax \U@c=\D@c
+ \hglue#2\hglue#2\relax \R@=#2\relax \L@=#3\relax
+ \xyTPICfullcircle@#1\hglue#2\hglue#2\relax}%
+ \vglue #3\vglue #3\relax}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xyTPICrect@#1{\DNii@{\relax}\DN@{#1}\toks@={}%
+ \ifx\next@\nextii@ \xytpic@pn0\relax\xytpic@bk
+ \def\xytpic@style@@{\xytpic@fp}%
+ \else\DNii@{\empty}%
+ \ifx\next@\nextii@\def\xytpic@style@@{\xytpic@ip}\xytpic@bk
+ \else\ifx\next@\empty\def\xytpic@style@@{\xytpic@ip}\xytpic@bk
+ \else#1\fi\fi\fi
+ \xytpic@pt\R@c
+ \expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}%
+ \xytpic@pt\D@c
+ \expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}%
+ \xytpic@pt{\L@c}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}%
+ \xytpic@pt{\U@c}%
+ \expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}%
+ \expandafter\xyTPICrect@x\the\toks@
+ \DNii@{\relax}\DN@{#1}\ifx\next@\nextii@
+ \def\xytpic@style@@{\xytpic@fp}\expandafter\xyTPICrect@x\the\toks@\fi }
+
+\xydef@\xyTPICrect@x#1#2#3#4{\xyTPIC@special{pa -#3 -#4}%
+ \xyTPIC@special{pa -#3 #2}\xyTPIC@special{pa #1 #2}%
+ \xyTPIC@special{pa #1 -#4}\xyTPIC@special{pa -#3 -#4}%
+ \xytpic@style@@ }
+
+\xydef@\xyTPICoval@#1{\DN@{#1}\DNii@{\relax}%
+ \ifx\next@\nextii@ \DN@{\xyTPICfilledoval@\relax}%
+ \else\DNii@{\empty}\ifx\next@\nextii@ \DN@{\xyTPICfilledoval@\empty}%
+ \else\DN@{\xyTPICoval@i{#1}}\fi\fi \next@ }
+
+%\xydef@\xyTPICoval@i#1{\bgroup
+% \let\framehfill=\frm@solidh@@
+% \let\framevfill=\frm@solidv@@
+% \let\framed@body@@=\framed@body@
+% \edef\tmp@{{\R@}}\expandafter\framed@@\tmp@
+% \egroup }
+\xylet@\xyTPICoval@i=\eat@
+
+\xydef@\xyTPICfilledoval@#1{%
+ {\advance\L@c-\R@ \advance\R@c-\R@ \xyTPICrect@{\empty}}%
+ {\advance\U@c-\R@ \advance\D@c-\R@ \xyTPICrect@{\empty}}%
+ \L@=\R@ \bgroup
+ \dimen@=-\U@c \advance\dimen@\R@ \xytpic@pt\dimen@
+ \edef\tmp@{\the\count@}%
+ \dimen@=-\L@c \advance\dimen@\R@ \xytpic@pt\dimen@
+ \edef\tmp@{\noexpand\toks@={{\the\count@}{\tmp@}}}%
+ \setTPICcircstyle@ \xyTPICcircle@{\tmp@}\egroup
+ \bgroup
+ \dimen@=-\U@c \advance\dimen@\R@ \xytpic@pt\dimen@
+ \edef\tmp@{\the\count@}%
+ \dimen@=\R@c \advance\dimen@-\R@ \xytpic@pt\dimen@
+ \edef\tmp@{\noexpand\toks@={{\the\count@}{\tmp@}}}%
+ \setTPICcircstyle@ \xyTPICcircle@{\tmp@}\egroup
+ \bgroup
+ \dimen@=\D@c \advance\dimen@-\R@ \xytpic@pt\dimen@
+ \edef\tmp@{\the\count@}%
+ \dimen@=-\L@c \advance\dimen@\R@ \xytpic@pt\dimen@
+ \edef\tmp@{\noexpand\toks@={{\the\count@}{\tmp@}}}%
+ \setTPICcircstyle@ \xyTPICcircle@{\tmp@}\egroup
+ \bgroup
+ \dimen@=\D@c \advance\dimen@-\R@ \xytpic@pt\dimen@
+ \edef\tmp@{\the\count@}%
+ \dimen@=\R@c \advance\dimen@-\R@ \xytpic@pt\dimen@
+ \edef\tmp@{\noexpand\toks@={{\the\count@}{\tmp@}}}%
+ \setTPICcircstyle@ \xyTPICcircle@{\tmp@}\egroup
+ \DN@{#1}\DNii@{\relax}\ifx\next@\nextii@
+ \def\tmp@{{\xytpic@pn0\def\xytpic@style@@{\xytpic@fp}}}%
+ \DN@{\expandafter\xyTPICoval@i\tmp@}%
+ \else\DN@{}\fi \next@ }
+
+%\xylet@\xyTPICoval@=\xyTPICrect@
+
+\xydef@\setTPICcircstyle@{%
+ \def\xytpic@circstyle@@{\xytpic@ia}\xytpic@bk}
+
+\xydef@\xyTPICcircle@#1{\DNii@{\relax}%
+ \DN@{#1}\toks@={00}\ifx\next@\nextii@
+ \xytpic@pn0\relax\xytpic@bk \def\xytpic@circstyle@@{\xytpic@ar}%
+ \else\DNii@{\empty}%
+ \ifx\next@\nextii@ \setTPICcircstyle@
+ \else\ifx\next@\empty \setTPICcircstyle@
+ \else#1\fi\fi\fi
+%
+ \xytpic@pt\R@
+ \expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}%
+ \xytpic@pt\L@
+ \expandafter\addtotoks@\expandafter{\expandafter{\the\count@}}%
+ \expandafter\xytpic@circstyle@@\the\toks@ 0\twoPi@}
+
+\xydef@\xyTPICellipse@{%
+ \X@p=\R@c \advance\X@p-\L@c \divide\X@p\tw@ \R@=\R@c \advance\R@-\X@p
+ \Y@p=\D@c \advance\Y@p-\U@c \divide\Y@p\tw@ \L@=\D@c \advance\L@-\Y@p
+ \xyTPICcircle@}
+
+\xydef@\xyTPICrect@Special#1#2#3#4{\TPICmacro@@{#1 fp}}
+\xydef@\xyTPICdotrect@Special#1{\TPICmacro@@{#1 fp}}
+\xydef@\xyTPICdashrect@Special#1{\TPICmacro@@{#1 fp}}
+\xydef@\xyTPICcirc@Special#1{\TPICmacro@@{#1 ar}}
+\xydef@\xyTPICdotcirc@Special#1{\TPICmacro@@{#1 ar}}
+\xydef@\xyTPICdashcirc@Special#1{\TPICmacro@@{#1 ar}}
+%\xydef@\xyTPICoval@Special#1{\TPICmacro@@{#1 fp}}
+%\xydef@\xyTPICdotoval@Special#1{\TPICmacro@@{#1 fp}}
+%\xydef@\xyTPICdashoval@Special#1{\TPICmacro@@{#1 fp}}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{Filled regions}
+
+\DOCMODE(
+\xydef@\xyTPICfilledRegion#1#2{\vglue\U@c
+ \hbox{\hglue\L@c#1#2\empty\hglue\R@c}\vglue\D@c}
+
+\xydef@\filledRectangle@TPIC@@{%\W@{tp:\the\R@}%
+ \ifdim\R@=\z@ \DN@{\xyTPICfilledRegion\xyTPICrect@}%
+ \else \DN@{\xyTPICfilledRegion\xyTPICoval@}%
+ \fi \next@ }
+\xydef@\filledCircle@TPIC@@#1{{\R@c=\R@ \L@c=\R@ \U@c=\R@ \D@c=\R@
+ \xyTPICfilledRegion\xyTPICcircle@#1{}}}
+\xydef@\filledEllipse@TPIC@@{\xyTPICfilledRegion\xyTPICellipse@}
+\xydef@\filledOval@TPIC@@{\xyTPICfilledRegion\xyTPICoval@}
+
+\xydef@\installTPICfills@{%
+ \let\filledRectangle@@=\filledRectangle@TPIC@@
+ \let\filledOval@@=\filledOval@TPIC@@
+ \let\filledCircle@@=\filledCircle@TPIC@@
+ \let\filledEllipse@@=\filledEllipse@TPIC@@
+}
+\DOCMODE)
+
+Rectangles are treated as a special case of ovals.
+The |#2| parameter signifies whether the outline of the object
+should also be stroked (|#2|=|\relax|) after being filled.
+Such a stroke is always in black.
+
+\DOCMODE(
+\xydef@\xyTPICfillrect@Special#1#2{%
+ \ifx#2\relax\TPICmacro@@{#1 fp}%
+ \else\TPICmacro@@{#1 ip}\fi}
+\xydef@\xyTPICfilloval@Special#1#2{%
+ \ifx#2\relax\TPICmacro@@{#1 fp}%
+ \else\TPICmacro@@{#1 ip}\fi}
+\xydef@\xyTPICfillcirc@Special#1#2{%
+ \ifx#2\relax\TPICmacro@@{#1 ar}%
+ \else\TPICmacro@@{#1 ai}\fi}
+\xydef@\xyTPICfillellipse@Special#1#2{%
+ \ifx#2\relax\TPICmacro@@{#1 ar}%
+ \else\TPICmacro@@{#1 ai}\fi}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\endinput
+
+% $Log: xytp-f.doc,v $
+% Revision 3.3 1996/12/18 09:49:07 ross
+% cosmetic changes to macro names
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+%
+% NEW for version 3.0 by by Ross Moore.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xytpic.doc b/Master/texmf-dist/source/generic/xypic/xytpic.doc
new file mode 100644
index 00000000000..02cddcb977f
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xytpic.doc
@@ -0,0 +1,472 @@
+%% $Id: xytpic.doc,v 3.3 1996/12/18 09:50:38 ross Exp $
+%%
+%% Xy-pic ``tpic'' TPIC backend, for lines, curves and fills.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{tpic}{TPIC backend}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifx\undefined\TPIC \def\TPIC{{\smc tpic}}\fi
+This option allows the \Xy-pic fonts to be replaced by \TPIC\ |\special|s,
+when used with a dvi-driver capable of supporting them. Extra capabilities
+include smoother lines, evenly spaced dotted/dashed curves, variable
+line-widths, gray-scale fills of circles, ellipses and polygonal regions.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Use of \TPIC\ |\special|s offers an alternative to the \Xy-pic fonts. However
+they require a dvi-driver that is capable of recognizing and interpreting
+them. One such viewer is |xdvik|, Karl Berry's modification to the |xdvi|
+viewer on \unix\ systems running X-windows or a derivative. |dvipsk|, Karl
+Berry's modification to |dvips| also handles \TPIC\ |\special|s, so
+|xdvik|/|dvipsk| is an good combination for quality screen-display and
+\PS\ printing.
+
+Once loaded using |\xyoption{tpic}|, with an appropriate <driver> also
+specified either already or subsequently, the following commands are
+available to turn the \TPIC\ backend off/on.
+%
+\begin{defs}
+|\NoTPICspecials| & turns off \TPIC\ specials.\kern-50pt\cr
+|\UseTPICspecials| & reinstates \TPIC\ specials.\kern-30pt
+\end{defs}
+
+\DOCMODE(
+\xynew@{if}\ifTPICspecials@
+\xydef@\UseTPICspecials{\TPICspecials@true}
+\xydef@\NoTPICspecials{\TPICspecials@false}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+There is a limit to the number of points allowable in a path. For paths
+constructed by \Xy-pic, which includes spline curves, when the limit
+is reached the path is automatically flushed and a new path commenced.
+The following command can be used to customise this limit---initially
+set at $300$ for use with \xdvi---to suit alternative <driver>s.
+%
+\begin{defs}
+|\maxTPICpoints{|<num>|}| & set maximum for paths
+\end{defs}
+
+\DOCMODE(
+\xynew@{count}\xytpic@cnt
+\xydef@\xytpic@max{300}
+\xydef@\maxTPICpoints#1{\count@=#1 \relax
+ \ifnum\count@>\tw@ \edef\xytpic@max{\the\count@}%
+ \else\expandafter\xyTPICmaxwarning@\expandafter{\the\count@}\fi}
+\xydef@\xyTPICmaxwarning@#1{max points must be at least 2, #1 invalid}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Each object involving \TPIC\ |\special|s must set the style, using
+|\xytpic@set@| to store a macro as the expansion of |\xytpic@style@@|.
+Currently this is global, since a \TPIC\ object must be completed once
+it has been started --- perhaps this is not necessary.
+
+Note that |\xytpic@set@| uses |\xdef|, but has a |\noexpand| in its
+expansion; this forces expansion of the argument, when there is one,
+to the control sequence passed as the first token following |\xytpic@set@|.
+
+\DOCMODE(
+\xydef@\xytpic@style@@{\xytpic@fp}
+\xydef@\xytpic@reset@{\gdef\xytpic@style@@{\xytpic@fp}%
+ \global\xytpic@cnt=\z@ }
+\xydef@\xytpic@set@#1{\xdef\xytpic@style@@{\noexpand#1}}
+\DOCMODE)
+
+Here are the actual |\specials| that get placed in the dvi-file.
+
+\DOCMODE(
+\xydef@\xytpic@pn#1{\xyTPIC@special{pn #1}}
+\xydef@\xytpic@pa#1#2{\global\advance\xytpic@cnt\@ne\relax
+ \ifnum\xytpic@cnt=\xytpic@max\relax \xyTPIC@special{pa #1 #2}%
+ \kern-\X@c\raise-\Y@c\hbox{\xytpic@style@@}\kern\X@c
+% \xytpic@ip
+ \global\xytpic@cnt=\@ne \relax\fi \xyTPIC@special{pa #1 #2}}
+\xydef@\xytpic@fp{\xyTPIC@special{fp}}
+\xydef@\xytpic@ip{\xyTPIC@special{ip}}
+\xydef@\xytpic@da#1{\xyTPIC@special{da #1}}
+\xydef@\xytpic@dt#1{\xyTPIC@special{dt #1}}
+\xydef@\xytpic@sp#1{\xyTPIC@special{sp #1}}
+\xydef@\xytpic@ar#1#2#3#4#5#6{\xyTPIC@special{ar #1 #2 #3 #4 #5 #6}}
+\xydef@\xytpic@ia#1#2#3#4#5#6{\xyTPIC@special{ia #1 #2 #3 #4 #5 #6}}
+\xydef@\xytpic@sh#1{\xyTPIC@special{sh #1}}
+%\xydef@\xytpic@psb#1{\xyTPIC@special{:[begin] #1}}
+%\xydef@\xytpic@pse#1{\xyTPIC@special{:[end]}}
+%
+\xydef@\xytpic@wh{\xyTPIC@special{sh 0}} % obsolete
+\xydef@\xytpic@bk{\xyTPIC@special{sh 1}} % obsolete
+
+\xydef@\xyTPIC@special#1{\special{#1}}
+\xydef@\xyTPIC@noisy#1{\W@{TPIC: #1}\special{#1}}
+\xydef@\NoisyTPIC{\let\xyTPIC@special=\xyTPIC@noisy}
+\DOCMODE)
+
+Some effects may require a \TPIC\ |\special| to be placed both
+before and after the <object>.
+
+\DOCMODE(
+\xydef@\xyTPICsplit@#1#2{\setboxz@h{#1\boxz@#2}}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\TPIC\ uses units of `milli-inches' for coordinates,
+but inches for dot-separations and dash-length.
+
+\DOCMODE(
+\xydef@\xytpic@pt#1{\dimen@=#1\divide\dimen@ by72 %
+ \multiply\dimen@ by 1000 \advance\dimen@.5\p@
+ \count@=\dimen@ \divide\count@\p@ }
+\xydef@\xytpic@in#1{\dimen@=#1\divide\dimen@ by72 %
+ \edef\next@{\expandafter\removePT@\the\dimen@}}%
+\DOCMODE)
+
+The \TPIC\ location is calculated relative to the current \TeX\ reference
+point. Hence most \TPIC\ objects start at the $(0,0)$ location.
+
+\DOCMODE(
+\xydef@\xytpic@dot@@{\xytpic@pa00}
+\xydef@\xytpic@width@{\xytpic@pt{\xylinethick@}%
+ \expandafter\xytpic@pn\expandafter{\the\count@}}
+%\xylet@\xytpic@width@=\relax
+
+\xydef@\xytpic@line{%
+ \xytpic@dot@@ \xytpic@pt{-\d@X}\count@@=\count@
+ \xytpic@pt\d@Y \edef\next@{{\the\count@@}{\the\count@}}%
+ \expandafter\xytpic@pa\next@ \xytpic@style@@ \xytpic@reset@ }
+
+\xydef@\xytpic@solid@@{\xytpic@set@\xytpic@fp}
+\xydef@\xytpic@dashed@@{\xytpic@in\xydashl@ \xytpic@dad}
+\xydef@\xytpic@dotted@@{\dimen@=.5\xydashl@ \xytpic@in\dimen@ \xytpic@dtd}
+\xydef@\xytpic@dad{\expandafter\xytpic@set@\expandafter{%
+ \expandafter\xytpic@da\expandafter{\next@}}}
+\xydef@\xytpic@dtd{\expandafter\xytpic@set@\expandafter{%
+ \expandafter\xytpic@dt\expandafter{\next@}}}
+
+\xydef@\xytpic@polysolid@{\xytpic@set@\xytpic@fp}
+\xydef@\xytpic@polydashed@#1{\count@=#1 \xytpic@dad}
+\xydef@\xytpic@polydotted@#1{\count@=#1 \xytpic@dtd}
+\xydef@\xytpic@postpoly@{\xytpic@style@@ \xytpic@reset@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{re-bindings}
+
+This is similar to the mechanism used by the \PS\ back-end to rebind
+``hooks'' to incorporate a switch according to the current value of
+|\ifTPICspecials@|.
+
+\DOCMODE(
+\xydef@\TPICalternative@#1#2{%
+\expandafter\global\expandafter\let\csname origxy#2@\endcsname=#1%
+ \xdef#1{\noexpand\ifTPICspecials@
+ \noexpand\expandafter\expandafter\noexpand\csname xytpic@#2@\endcsname
+ \noexpand\else
+ \noexpand\expandafter\expandafter\noexpand\csname origxy#2@\endcsname
+ \noexpand\fi}}%
+\DOCMODE)
+
+Allow only one instance of |\setupxyTPIC@|; thereafter simply do
+|\reloadxyTPIC@| to turn on anything that has been turned off.
+
+\DOCMODE(
+\xydef@\setupxyTPIC@{\xywarning@{using TPIC specials}%
+ \TPICalternative@{\solid@}{solid}%
+ \TPICalternative@{\dash@}{dashed}%
+ \TPICalternative@{\point@}{point}%
+ \TPICalternative@{\circhar@@}{circhar}%
+ \TPICalternative@{\splinesolid@}{splinesolid}%
+% \TPICalternative@{\splinedashed@}{splinedashed}%
+% \TPICalternative@{\splinedotted@}{splinedotted}%
+ \xywithoption{frame}{\xyinputorelse@{xytp-f}{}\xyuncatcodes}%
+ \let\setupxyTPIC@=\reloadxyTPIC@
+ \activateTPIC@ }
+
+\xydef@\xyunloadTPIC@{\xywarning@{TPIC specials turned off}%
+ \xywithoption{curve}{\xysetup@@\uninstallTPICcurves@ }%
+ \xywithoption{line}{\xysetup@@\uninstallTPICline@ }%
+ \xywithoption{frame}{\xysetup@@\uninstallTPICframes@ }%
+ \TPICspecials@false
+ \let\setupxyTPIC@=\reloadxyTPIC@ }
+
+\xydef@\activateTPIC@{%
+ \xywithoption{line}{\xysetup@@\installTPICline@}%
+ \xywithoption{curve}{\xysetup@@\installTPICcurves@}%
+ \xywithoption{frame}{\xysetup@@\installTPICframes@}%
+ \TPICspecials@true }
+
+\xydef@\reloadxyTPIC@{\xywarning@{TPIC specials back on}\activateTPIC@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{straight lines}
+
+\DOCMODE(
+\xydef@\xytpic@solid@{%
+ \ifInvisible@ \let\next@=\no@@
+ \else \DN@{\xyTPICstraight@{\xytpic@solid@@ \xytpic@line}}\fi
+ \next@ }
+
+\xydef@\xytpic@dashed@{\line@
+ \def\Connect@@{\xyTPICstraight@{\xytpic@dashed@@ \xytpic@line}}}
+
+\xydef@\xytpic@point@{\xytpic@dot@@\xytpic@fp\egroup
+ \Invisible@false \Hidden@false \def\Leftness@{.5}\def\Upness@{.5}\ctipEdge@
+ \def\Drop@@{\styledboxz@}%
+ \def\Connect@@{\xyTPICstraight@{\xytpic@dotted@@ \xytpic@line}}}
+
+\xydef@\xyTPICstraight@#1{\setupDirection@
+ \edef\Creset@@{\cfromthec@ \pfromthep@ \DirectionfromtheDirection@}%
+ \DN@##1##2{\def\checkoverlap@@{%
+ \ifdim##1\X@p>##1\X@c \let\next@=\relax \fi
+ \ifdim##2\Y@p>##2\Y@c \let\next@=\relax \fi}}%
+ \edef\nextii@{{\sd@X}{\sd@Y}}\expandafter\next@\nextii@
+ \noCshavep@@ \edef\Cshavep@@{\pfromthep@ \noexpand\resetDirection@}%
+ \noCshavec@@ \edef\Cshavec@@{\cfromthec@ \noexpand\resetDirection@}%
+ \ifHidden@\else
+ \ifdim\Y@c>\Y@max \Y@max=\Y@c \fi \ifdim\Y@p>\Y@max \Y@max=\Y@p \fi
+ \ifdim\Y@c<\Y@min \Y@min=\Y@c \fi \ifdim\Y@p<\Y@min \Y@min=\Y@p \fi
+ \ifdim\X@c>\X@max \X@max=\X@c \fi \ifdim\X@p>\X@max \X@max=\X@p \fi
+ \ifdim\X@c<\X@min \X@min=\X@c \fi \ifdim\X@p<\X@min \X@min=\X@p \fi \fi
+ \ifInvisible@\let\next@=\relax \else
+ \DN@{\setboxz@h{\kern\X@c \raise\Y@c\hbox{#1}}%
+ \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ {\Drop@@}}%
+ \fi
+ \checkoverlap@@
+ \ifdim\d@X=\z@ \ifdim\d@Y=\z@ \DN@{\relax}\fi\fi \next@
+ \def\Cslidep@@{\noCslidep@@}\def\Cslidec@@{\noCslidec@@}%
+ \def\Calong@@{\noCalong@@}\Creset@@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{spline curves}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+Of the curves defined in the |xycurve| extension, only solid spline curves
+are supported. This is done by treating the spline as a polygon (poly-line)
+with many segments. The dotted or dashed variants do not work correctly.
+
+Implementations of \TPIC\ draw dashed polygons such that the start and
+finish of each segment is solid. Since these segments can be very short,
+the effect is simply to create a solid line. Similarly the shortness of the
+segments tends to give nothing at all for large portions of a dotted curve.
+What is needed is an implementation whereby the on/off nature of a dashed
+or dotted polygon is determined by the accumulated length, not the length
+along just the current segment.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xydef@\xytpic@splinesolid@{\xyTPICspline@\xytpic@fp }
+\xydef@\xytpic@splinedashed@{\xytpic@in\xydashl@\expandafter\xyTPICspline@
+ \expandafter{\expandafter\xytpic@da\expandafter{\next@}}}
+\xydef@\xytpic@splinedotted@{\xytpic@in{.5\xydashl@}\expandafter\xyTPICspline@
+ \expandafter{\expandafter\xytpic@dt\expandafter{\next@}}}
+
+\xydef@\xyTPICspline@#1{\setbox\splinebox@=\copy\voidb@x %\zerodot
+ \SloppyCurves %\splinetol@=\xydashl@ % \xytpic@ip
+ \global\xytpic@cnt=\@ne \xytpic@set@{#1}%
+ \def\splineextra@@{\xyTPICspline@dot}%
+ \def\xycrvdrop@{ }\def\xycrvconn@{}\splineset@@ \xytpic@style@@}
+
+\xydef@\xyTPICspline@dot{\xytpic@pt{\X@c}\count@@=\count@
+ \xytpic@pt{-\Y@c}\edef\next@{{\the\count@@}{\the\count@}}%
+ \expandafter\xytpic@pa\next@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{line width}
+
+\DOCMODE(
+\xydef@\xyTPIClinewidth@#1{\xytpic@pt{#1}\edef\next@{\the\count@}}
+
+\xydef@\installTPICline@{%
+ \let\xylinewidth@@=\xylinewidth@
+ \let\xylineSpecial@@=\xytpic@pn
+ \let\transxyline@@=\xyTPIClinewidth@ }
+
+\xydef@\uninstallTPICline@{\UnloadLine@}%
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{circles and ellipses}
+
+Here we catch circles and ellipses specified using the |\xycircle| command
+from the |xycurve| extension. Since TPIC supports only solid circles,
+we catch it only when the <style> is either |{}| or |{-}|.
+
+\DOCMODE(
+\xydef@\xydoTPICcircle@#1{\DN@{#1}%
+ \ifx\next@\empty\DN@{\xyTPICfullcircle@}%
+ \else\expandafter\DNii@\expandafter{\addDASH@{}}%
+ \ifx\next@\nextii@\DN@{\L@=\R@ \xyTPICfullcircle@}%
+ \else\DN@{\dosolidcircle@{#1}}\fi\fi \next@ }
+
+\xydef@\xyTPICfullcircle@{\xyTPICpartcircle@{00}0\twoPi@}%
+
+\xydef@\xyTPICpartcircle@#1#2#3{%
+ \xytpic@pt{\R@}\expandafter\DNii@\expandafter{\the\count@}%
+ \xytpic@pt{\L@}\edef\next@{#1{\nextii@}{\the\count@}{#2}{#3}}%
+ \expandafter\xytpic@ar\next@ }
+
+\xydef@\qartPi@{0.7853981}
+\xydef@\tartPi@{2.3561944}
+\DOCMODE)
+
+This replaces just the font character, called using |\circhar@@#1|.
+
+\DOCMODE(
+\xydef@\xytpic@circhar@#1{\xytpic@width@\ifcase#1%
+ \xytpic@pt{\R@}\edef\next@{{{\the\count@}0}}%
+ \expandafter\xyTPICcirchar@i\next@{\tartPi@}{\fullPi@}\kern\partroottwo\R@
+ \or
+ \xytpic@pt{\halfroottwo\R@}\edef\next@{{{\the\count@}0}}%
+ \expandafter\xyTPICcirchar@i\next@{\halfPi@}{\tartPi@}\kern\halfroottwo\R@
+ \or
+ \xytpic@pt{\z@}\edef\next@{{{\the\count@}0}}%
+ \expandafter\xyTPICcirchar@i\next@{\qartPi@}{\halfPi@}\kern\halfroottwo\R@
+ \or
+ \xytpic@pt{-\halfroottwo\R@}\edef\next@{{{\the\count@}0}}%
+ \expandafter\xyTPICcirchar@i\next@0{\qartPi@}\kern\partroottwo\R@
+ \or
+ \xytpic@pt{-\halfroottwo\R@}\edef\next@{{{\the\count@}0}}%
+ \expandafter\xyTPICcirchar@i\next@{-\qartPi@}0\kern\partroottwo\R@
+ \or
+ \xytpic@pt{\z@}\edef\next@{{{\the\count@}0}}%
+ \expandafter\xyTPICcirchar@i\next@{-\halfPi@}{-\qartPi@}\kern\halfroottwo\R@
+ \or
+ \xytpic@pt{\halfroottwo\R@}\edef\next@{{{\the\count@}0}}%
+ \expandafter\xyTPICcirchar@i\next@{-\tartPi@}{-\halfPi@}\kern\halfroottwo\R@
+ \or
+ \xytpic@pt{\R@}\edef\next@{{{\the\count@}0}}%
+ \expandafter\xyTPICcirchar@i\next@{-\fullPi@}{-\tartPi@}\kern\partroottwo\R@
+ \fi}
+
+\xydef@\xyTPICcirchar@i#1#2#3{\L@=\R@ \xyTPICpartcircle@{#1}{#2}{#3}}
+\DOCMODE)
+
+\paragraph*{quadratic splines}
+
+\DOCMODE(
+\xydef@\xyTPIC@spline@ii@{\DN@{\xy@spline@ii}%
+ \ifx\splineSTYLE@\empty\DN@{\xyTPICqspline@{0}}%
+ \else\expandafter\DNii@\expandafter{\addDASH@{}}%
+ \ifx\splineSTYLE@\nextii@\DN@{\xyTPICqspline@{0}}%
+ \else\expandafter\DNii@\expandafter{\addDOT@{}}%
+ \ifx\splineSTYLE@\nextii@\DN@{\xyTPICqspline@{-.5}}%
+ \else\expandafter\expandafter\expandafter\DNii@\expandafter\expandafter
+ \expandafter{\expandafter\addDASH@\addDASH@{}}%
+ \ifx\splineSTYLE@\nextii@\DN@{\xyTPICqspline@{}}%
+ \fi\fi\fi\fi
+ \next@ }%
+
+\xydef@\xyTPIC@accumulate{\xytpic@pt\X@c \count@@=\count@
+ \xytpic@pt{-\Y@c}\edef\next@{{\the\count@@}{\the\count@}}%
+ \expandafter\xytpic@pa\next@ }
+
+\xydef@\xyTPICqspline@#1{\xytpic@width@
+ \xytpic@in{#1\xydashl@}\expandafter\gdef\expandafter\xytpic@style@@
+ \expandafter{\expandafter\xytpic@sp\expandafter{\next@}}%
+ \save@ \cfromp@ \xyTPIC@accumulate
+ \edef\smapp@@{\s@bot}\smapxy@i{\xyTPIC@accumulate}%
+ \leave@ \xyTPIC@accumulate \xytpic@style@@ \xytpic@reset@
+ \enter@{}\xy@spline@x }
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\installTPICcurves@{%
+ \let\dosolidcircle@@=\xydoTPICcircle@
+ \let\xy@spline@ii@@=\xyTPIC@spline@ii@
+ }
+\xydef@\uninstallTPICcurves@{%
+ \let\dosolidcircle@@=\dosolidcircle@
+ \let\xy@spline@ii@@=\xy@spline@ii }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{frames}
+\DOCMODE(
+ \xywithoption{frame}{\xyinputorelse@{xytp-f}{}}
+\DOCMODE)
+
+Implement color fills by reading from a |\TPICfillcolor|.
+Implement pattern fills by reading from a |\TPICfillpatt|.
+Read these whenever a fill is requested.
+
+
+\DOCMODE(
+\xydef@\uninstallTPICframes@{\UnloadFrames@}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xytpic.doc,v $
+% Revision 3.3 1996/12/18 09:50:38 ross
+% adjusted Drop@@ for styles
+% minor improvements to file-loading commands
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.1 by Ross Moore 1995/03/18.
+% replaces xyps-col.doc
+%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% fill-prefix:""
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyv2.doc b/Master/texmf-dist/source/generic/xypic/xyv2.doc
new file mode 100644
index 00000000000..aa237e4c2e5
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyv2.doc
@@ -0,0 +1,868 @@
+%% $Id: xyv2.doc,v 3.4 1997/05/18 01:14:25 krisrose Exp $
+%%
+%% Xy-pic ``Version 2 compatibility'' feature.
+%% Copyright (c) 1993-1995 Kristoffer H. Rose <kris@diku.dk>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1995 Kristoffer H. Rose <kris@diku.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{v2}{Version 2 Compatibility}{\stripRCS$Revision: 3.4 $}%
+ {Kristoffer H.~Rose}{krisrose@brics.dk}%
+ {BRICS/Computer Science, University of Aarhus, Ny Munkegade, building 540,
+ DK--8000 Aarhus~C}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ This \FILE\ describes the special backwards compatibility with
+ \Xy-pic version~2: diagrams written according to the ``Typesetting
+ diagrams with \Xy-pic: User's Manual''~\cite{R92:TypesettingDXUM}
+ should typeset correctly with this loaded. The compatibility is
+ available either as an \Xy-option or through the special files
+ |xypic.sty| and |xypic.tex| described below.
+
+ There are a few exceptions to the compatibility: the features described
+ in~\S??[unsupported] below are not provided because they are not as
+ useful as the author originally thought and thus virtually never
+ used. And one extra command is provided to speed up typesetting of
+ documents with \Xy-pic version~2 diagrams by allowing the new
+ compilation functionality with old diagrams.
+
+ The remaining sections list all the obsolete commands and suggest
+ ways to achieve the same things using \Xy-pic \xyversion, \ie,
+ without the use of this option. They are grouped as to what part of
+ \Xy-pic replaces them; the compilation command is described last.
+
+ \NOTE: ``version 2'' is meant to cover all public releases of \Xy-pic
+ in 1991 and 1992, \ie, version 1.40 and versions~2.1 through~2.6.
+ The published manual cited above (for version 2.6) is the reference
+ in case of variations between these versions, and only things
+ documented in that manual will be supported by this
+ option!\footnote{In addition a few of the experimental facilities
+ supported in v2.7--2.12 are also supported.}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+ Before we start, the old name macro.
+
+\DOCMODE(
+\xylet@\XY=\Xy
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Unsupported incompatibilities}
+??=[unsupported]
+
+ Here is a list of known incompatibilities with version 2 even when
+ the |v2| option is loaded.
+%
+\begin{itemize}
+\item
+ Automatic `shortening' of arrow tails using ??c![|<<] breaks was a
+ bug and has been `fixed' so it does not work any more.
+ Put a |||<\hole| break before it.
+\item
+ The version~2.6 ??c![*] position operator is not available. The
+ version 2.6 construction $t_0|;|t_1|*(|x|,|y|)|$ should be replaced by
+ the rather long but equivalent construction
+$$
+\begin{array}{r@{}l}
+ |{|\,t_0\,|;p+/r/:|\,t_1\,|=|&|"1";p+/u/,x;(0,0);:|\\
+ &|"1";p+/r/,y;(0,0);::|\,|(|x|,|y|)}|
+\end{array}
+$$
+ In most cases $t_0|;|t_1|**{}?(|x|)|$,
+ possibly with a trailing $|+/^|\dots|/|$, suffices instead.
+\item
+ Using $t_0|;|t_1|:(|x|,|y|)|$ as the target of an arrow command does
+ not work. Enclose it in braces, \ie, write
+$$
+ |{|\,t_0\,|;|\,t_1\,|:(|x|,|y|)}|
+$$
+\item
+ The older ??c![\pit], ??c![\apit], and ??c![\bpit] commands are not
+ defined. Use |\dir{>}| (or |\tip|) with variants and rotation.
+\item
+ The even older notation where an argument in braces to |\rto| and the
+ others was automatically taken to be a `tail' is not supported. Use
+ the supported |||<|\dots\ notation.
+\end{itemize}
+%
+ If you do not use these features then your version~2 (and earlier)
+ diagrams should typeset the same with this option loaded except that
+ sometimes the spacing with version~3 is slightly different from that
+ of version~2.6 which had some spacing bugs.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Obsolete kernel features}
+??=[kernel]
+
+ The following things are added to the kernel by this option and
+ described here: idioms, obsolete positions, obsolete connections, and
+ obsolete objects. For each we show the suggested way of doing the
+ same thing without this option:
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Removed \protect\AMS-\TeX\ idioms}
+
+ Some idioms from \AMS-\TeX\ are no longer used by \Xy-pic: the
+ definition commands ??c![\define] and ??c![\redefine], and the size
+ commands ??c![\dsize], ??c![\tsize], ??c![\ssize], and ??c![\sssize].
+ Please use the commands recommended for your format---for plain \TeX\
+ these are |\def| for the first two and |\displaystyle|, |\textstyle|,
+ |\scriptstyle|, and |\scriptscriptstyle| for the rest. The |v2|
+ option ensures that they are available anyway.
+
+\DOCMODE(
+\ifx\redefine\undefined \let\redefine=\def \fi
+\ifx\define\undefined \let\define=\xydef@ \fi
+
+\ifx\dsize\undefined \let\dsize=\displaystyle \fi
+\ifx\tsize\undefined \let\dsize=\textstyle \fi
+\ifx\ssize\undefined \let\ssize=\scriptstyle \fi
+\ifx\sssize\undefined \let\sssize=\scriptscriptstyle \fi
+\DOCMODE)
+
+ Version also 2 used the \AMS-\TeX\ ??c![\text] and a (non-object) box
+ construction ??c![\Text] which are emulated---|\text| is only defined
+ if not already defined, however, using the native one (of \AMS-\TeX\
+ or \AMS-\LaTeX\ or whatever) if possible. Please use the |\txt|
+ object construction described in~\S??g[xy.doc:objectlib.text]
+ directly since it is more general and much more efficient!
+
+\DOCMODE(
+\ifx\text\undefined
+ \def\text{\relax\textC}%
+ \xydef@\textC#1{\relax
+ \ifmmode\mathchoice
+ {\hbox{\the\textfont0\relax#1}}%
+ {\hbox{\the\textfont0\relax#1}}%
+ {\hbox{\the\scriptfont0\relax#1}}%
+ {\hbox{\the\scriptscriptfont0\relax#1}}%
+ \else{\relax#1}\fi}
+\fi
+
+\xydef@\Text{\relax\xyFN@\Text@}
+
+\xydef@\TextC{\relax\textC}%
+
+\xydef@\Text@{%
+ \addLT@\ifx\next \addGT@{\addLT@\DN@##1}{\A@=##1\Text@i}%
+ \else \DN@{\A@=\maxdimen \Text@i}\fi \next@}
+
+\xydef@\Text@i#1{%
+ \ifmmode \mathchoice
+ {\expandafter\Text@ii\the\textfont0{#1}}%
+ {\expandafter\Text@ii\the\textfont0{#1}}%
+ {\expandafter\Text@ii\the\scriptfont0{#1}}%
+ {\expandafter\Text@ii\the\scriptscriptfont0{#1}}%
+ \else
+ \leavevmode \expandafter\Text@ii\the\textfont0{#1}%
+ \fi\ignorespaces}
+
+\xydef@\Text@ii{\hbox\bgroup \txt@i}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Obsolete state}
+
+ Upto version 2.6 users could access the state variables ??c![\cL],
+ ??c![\cR], ??c![\cH], and ??c![\cD], which are defined.
+
+\DOCMODE(
+\xylet@\cL=\L@c
+\xylet@\cR=\R@c
+\xylet@\cD=\D@c
+\xylet@\cH=\U@c
+\DOCMODE)
+
+ From v2.7 to 2.12 users could use the names of the state |\dimen|
+ registers ??c![\Xmin], ??c![\Xmax], ??c![\Ymin], and ??c![\Ymax];
+ ??c![\Xp], ??c![\Yp] ??c![\Dp], ??c![\Up], ??c![\Lp], and ??c![\Rp];
+ ??c![\Xc], ??c![\Yc] ??c![\Dc], ??c![\Uc], ??c![\Lc], and ??c![\Rc];
+ ??c![\Xorigin], ??c![\Yorigin], ??c![\Xxbase], ??c![\Yxbase],
+ ??c![\Xybase], and ??c![\Yybase]. Now the same effect can be
+ achieved using <corner>s but |v2| defines the aliases.
+
+\DOCMODE(
+\xylet@\Xc=\X@c
+\xylet@\Yc=\Y@c
+\xylet@\Uc=\U@c
+\xylet@\Dc=\D@c
+\xylet@\Lc=\L@c
+\xylet@\Rc=\R@c
+
+\xylet@\Xp=\X@p
+\xylet@\Yp=\Y@p
+\xylet@\Up=\U@p
+\xylet@\Dp=\D@p
+\xylet@\Lp=\L@p
+\xylet@\Rp=\R@p
+
+\xylet@\dX=\d@X
+\xylet@\dY=\d@Y
+
+\xylet@\Xorigin=\X@origin
+\xylet@\Yorigin=\Y@origin
+\xylet@\Xxbase =\X@xbase
+\xylet@\Yxbase =\Y@xbase
+\xylet@\Xybase =\X@ybase
+\xylet@\Yybase =\Y@ybase
+
+\xylet@\Xmin=\X@min
+\xylet@\Ymin=\Y@min
+\xylet@\Xmax=\X@max
+\xylet@\Ymax=\Y@max
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Obsolete position manipulation}
+
+ In version~2 many things were done using individual <decor> control
+ sequences that are now done using <pos> operators.
+%
+\begin{defs}
+ Version 2 positioning\hfil & Replacement \cr
+ \noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+ ??c![\go]<pos> & |\POS;p,|<pos> \cr
+ ??c![\aftergo]|{|<decor>|}|<pos> \kern-2pc \cr
+ &\kern-3pc|\afterPOS{|<decor>|};p,|<pos> \cr
+ ??c![\merge] & |\POS.p\relax| \cr
+ ??c![\swap] & |\POS;\relax| \cr
+ ??c![\Drop]|{|<text>|}| & |\drop+{|<text>|}| \cr
+\end{defs}
+%
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ The code is basically that of |xy.doc| 2.6\dots
+
+\DOCMODE(
+\xydef@\go{\aftergo{}}
+\xydef@\aftergo#1{\xy@\aftergo{\enter@\pfromthec@}\afterPOS{\xy@@\leave@#1}}
+
+\xydef@\merge{\POS.p\relax}
+
+\xydef@\swap{\xy@\swap\swap@}
+
+\xydef@\Drop{\expandafter\drop\entrymodifiers@}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Obsolete connections}
+
+ These connections are now implemented using directionals.
+%
+\begin{defs}
+ Version 2 connection\hfil & Replacement \cr
+ \noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+ ??c![\none] & |\connect h\dir{}| \cr
+ ??c![\solid] & |\connect h\dir{-}| \cr
+ ??c![\Solid] & |\connect h\dir2{-}| \cr
+ ??c![\Ssolid] & |\connect h\dir3{-}| \cr
+ ??c![\dashed] & |\connect h\dir{--}| \cr
+ ??c![\Dashed] & |\connect h\dir2{--}| \cr
+ ??c![\Ddashed] & |\connect h\dir3{--}| \cr
+ ??c![\dotted] & |\connect h\dir{.}| \cr
+ ??c![\Dotted] & |\connect h\dir2{.}| \cr
+ ??c![\Ddotted] & |\connect h\dir3{.}| \cr
+ ??c![\dottedwith]|{|<text>|}|& |\connect h{|<text>|}| \cr
+\end{defs}
+%
+ Note how the `hidden' specifier |h| should be used because version~2
+ connections did not affect the size of diagrams.
+
+\DOCMODE(
+\xydef@\none{\xy@\none{}\ignorespaces}
+
+\xydef@\solid{\connect h\dir{-}}
+\xydef@\Solid{\connect h\dir2{-}}
+\xydef@\Ssolid{\connect h\dir3{-}}
+
+\xydef@\dashed{\connect h\dir{--}}
+\xydef@\Dashed{\connect h\dir2{--}}
+\xydef@\Ddashed{\connect h\dir3{--}}
+
+\xydef@\dotted{\connect h\dir{.}}
+\xydef@\Dotted{\connect h\dir2{.}}
+\xydef@\Ddotted{\connect h\dir3{.}}
+
+\xydef@\dottedwith#1{\connect h{#1}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Obsolete tips}
+
+ These objects all have |\dir|-names now:
+%
+\begin{defs}
+ Version 2 tip\hfil & Replacement \cr
+ \noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+ ??c![\notip] & |\dir{}| \cr
+ ??c![\stop] & |\dir{||}| \cr
+ ??c![\astop] & |\dir^{||}| \cr
+ ??c![\bstop] & |\dir_{||}| \cr
+ ??c![\tip] & |\dir{>}| \cr
+ ??c![\atip] & |\dir^{>}| \cr
+ ??c![\btip] & |\dir_{>}| \cr
+ ??c![\Tip] & |\dir2{>}| \cr
+ ??c![\aTip]
+ & \kern-2pc|\object=<5pt>:(32,-1)\dir^{>}|\kern-1pc \cr
+ ??c![\bTip]
+ & \kern-2pc|\object=<5pt>:(32,+1)\dir_{>}|\kern-1pc \cr
+ ??c![\Ttip] & |\dir3{>}| \cr
+ ??c![\ahook] & |\dir^{(}| \cr
+ ??c![\bhook] & |\dir_{(}| \cr
+ ??c![\aturn] & |\dir^{'}| \cr
+ ??c![\bturn] & |\dir_{'}| \cr
+\end{defs}
+%
+\DOCMODE(
+\xydef@\notip{\dir{}}
+
+\xydef@\stop{\dir{|}}
+\xydef@\astop{\dir^{|}}
+\xydef@\bstop{\dir_{|}}
+
+\xydef@\tip{\dir{>}}
+\xydef@\atip{\dir^{>}}
+\xydef@\btip{\dir_{>}}
+
+\xydef@\Tip{\dir2{>}}
+
+\xywarnifdefined\aTip
+\xywarnifdefined\bTip
+{\xyuncatcodes
+ \gdef\aTip{\object=<5pt>:(32,-1)\dir^{>}}
+ \gdef\bTip{\object=<5pt>:(32,+1)\dir_{>}}}
+
+\xydef@\Ttip{\dir3{>}}
+
+\xydef@\ahook{\dir^{(}}
+\xydef@\bhook{\dir_{(}}
+
+\xydef@\aturn{\dir^{'}}
+\xydef@\bturn{\dir_{'}}
+\DOCMODE)
+
+ The older commands |\pit|, |\apit|, and |\bpit|, are not provided.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Obsolete object constructions}
+
+ The following object construction macros are made obsolete by the
+ enriched <object> format:
+%
+\begin{defs}
+ Version 2 object\hfil & Replacement \cr
+ \noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+ ??c![\rotate]|(|<factor>|)|<tip> \kern-4pc \cr
+ &\kern-3pc |\object:(|<factor>|,|<factor>|){|<tip>|}| \cr
+ ??c![\hole] & |\object+{}| \cr
+ ??c![\squash]<tip> & |\object=0{|<tip>|}| \cr
+ ??c![\grow]<tip> & |\object+{|<tip>|}| \cr
+ |\grow<|<dimen>|>|<tip> & |\object+<|<dimen>|>{|<tip>|}| \cr
+ ??c![\squarify]|{|<text>|}| & |\object+={|<text>|}| \cr
+ |\squarify<|<dimen>|>{|<text>|}| \kern-4pc \cr
+ &\kern-3pc |\object+=<|<dimen>|>{|<text>|}| \cr
+\end{defs}
+\noindent\unskip
+%
+ where rotation is done in a slightly different manner in
+ version~\xyversion\ (it was never accurate in version~2).
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ These are mostly just the unmodified version 2.6 code:
+
+\DOCMODE(
+\xydef@\rotate{\hbox\bgroup
+ \DN@{\ifx (\next %)
+ \DN@(####1){\rotate@ii{####1}}%
+ \else \DN@{\rotate@i}\fi\next@}\xyFN@\next@}
+
+\xydef@\rotate@i#1{\reverseDirection@ #1\OBJECT@x}
+
+\xydef@\rotate@ii#1#2{\dimen@=#1\p@
+ \ifdim \dimen@=-\p@ \aboveDirection@\xydashl@
+ \else\ifdim\dimen@= \p@ \belowDirection@\xydashl@
+ \else\ifdim\dimen@<-1.5\p@ \advance\dimen@-2\p@
+ \edef\next@{\expandafter\removePT@\the\dimen@}\vDirection@(-1,\next@){1pc}%
+ \else\ifdim\dimen@<-.5\p@ \vDirection@(#1,-1){1pc}%
+ \else\ifdim\dimen@< .5\p@ \vDirection@( 1,#1){1pc}%
+ \else\ifdim\dimen@<1.5\p@ \vDirection@(#1, 1){1pc}%
+ \else \dimen@=-\dimen@ \advance\dimen@2\p@
+ \edef\next@{\expandafter\removePT@\the\dimen@}\vDirection@(-1,\next@){1pc}%
+ \fi\fi\fi\fi\fi\fi
+ #2\OBJECT@x}
+
+\xydef@\squash#1{%
+ \ifmmode\setboxz@h{\m@th${\mathstrut}#1{\mathstrut}$}\else\setboxz@h{#1}\fi
+ \setboxz@h{\kern-.5\wdz@ \dimen@=.5\ht\z@ \advance\dimen@-.5\dp\z@
+ \lower\dimen@\boxz@}%
+ \wdz@=\z@ \ht\z@=\z@ \dp\z@=\z@ \boxz@}
+
+\xydef@\grow{%
+ \DN@{\ifx <\next \DN@<####1>{\dimen@=####1\grow@\empty}%
+ \else \DN@{\dimen@=2\p@ \grow@\empty}\fi\next@}\xyFN@\next@}
+
+\xydef@\grow@#1#{\grow@@{#1}}
+\xydef@\grow@@#1#2{\relax
+ \ifmmode \setboxz@h{\kern\dimen@ \m@th$#2$\kern\dimen@}%
+ \else \setboxz@h{\kern\dimen@ {#2}\kern\dimen@}\fi
+ \dimen@ii=\ht\z@ \advance\dimen@ii\dimen@ \ht\z@=\dimen@ii
+ \dimen@ii=\dp\z@ \advance\dimen@ii\dimen@ \dp\z@=\dimen@ii \boxz@}
+
+\xydef@\squarify{\addEQ@{\addPLUS@\object}}
+\DOCMODE)
+
+ We also reimplement the version~2 undocumented ??c![\qc] quarter
+ circle which is now called |\corn@@| of the frame extension.
+
+\DOCMODE(
+\xydef@\qc{\corn@@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Obsolete extensions \& features}
+??=[extensions]??=[features]
+
+ Version~2 had commutative diagram functionality corresponding to the
+ |frames| extension and parts of the |matrix| and |arrow| features.
+ These are therefore loaded and some extra definitions added to
+ emulate commands that have disappeared.
+
+\subsubsection*{Frames}
+
+ The version 2 frame commands are emulated using the frame extension
+ (as well as the |\dotframed|, |\dashframed|, |\rounddashframed|
+ commands comm\-unicated to some users by electronic mail):
+%
+\begin{defs}
+ Version 2 object\hfil & Replacement \cr
+ \noalign{\nobreak\smallskip\nobreak\hrule\nobreak\smallskip\nobreak}
+ ??c![\framed] & |\drop\frm{-}| \cr
+ |\framed<|<dimen>|>| & |\drop\frm<|<dimen>|>{-}| \cr
+ ??c![\Framed] & |\drop\frm{=}| \cr
+ |\Framed<|<dimen>|>| & |\drop\frm<|<dimen>|>{=}| \cr
+ ??c![\dotframed] & |\drop\frm{.}| \cr
+ ??c![\dashframed] & |\drop\frm{--}| \cr
+ ??c![\rounddashframed] & |\drop\frm{o-}| \cr
+ ??c![\circled] & |\drop\frm{o}| \cr
+ ??c![\Circled] & |\drop\frm{oo}| \cr
+\end{defs}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ For each of the above commands (and a few hidden ones) we parse the
+ above and convert to the proper format.
+
+\DOCMODE(
+\xyrequire{frame}\xycatcodes
+
+\xydef@\framed{\relax\convertframed{-}}
+\xydef@\Framed{\relax\convertframed{=}}
+
+\xydef@\circled{\relax\convertframed{o}}
+\xydef@\Circled{\relax\convertframed{oo}}
+
+\xydef@\convertframed#1{\DNii@##1@{\drop\frm##1{#1}}\xyFN@\convertframed@i}
+
+\xydef@\convertframed@i{%
+ \addLT@\ifx \next
+ \addGT@{\addLT@\DN@##1}{\addGT@{\addLT@{\nextii@}##1}@}%
+ \else \DN@{\nextii@ @}\fi \next@}
+
+\xydef@\dotframed{\relax\drop\frm{.}}
+\xydef@\dashframed{\relax\drop\frm{--}}
+\xydef@\rounddashframed{\relax\drop\frm{o-}}
+
+\xydef@\filled{\DN@{%
+ \addLT@\ifx \next
+ \addGT@{\addLT@\DN@####1}{\xy@@{\frame@fill@@{####1}}}%
+ \else \DN@{\xy@@{\frame@fill@@\z@}}%
+ \fi\next@}\xyFN@\next@}
+
+\xydef@\Filled{\DN@{%
+ \addLT@\ifx \next
+ \addGT@{\addLT@\DN@####1}{\xy@@{\frame@emph@@{####1}}}%
+ \else \DN@{\xy@@{\frame@emph@@\z@}}%
+ \fi\next@}\xyFN@\next@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Matrices}
+
+ The ??c![\diagram] <rows> ??c![\enddiagram] command is provided as an
+ alias for |\xymatrix{| <rows> |}| centered in math mode and
+ ??c![\LaTeXdiagrams] changes it to use |\begin| \dots\ |\end| syntax.
+ |v2| sets a special internal `old matrix' flag such that
+ trailing~|\\| are ignored and entries starting with~|*| are safe.
+
+\DOCMODE(
+\xyrequire{matrix}\xycatcodes
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\diagram#1\enddiagram{\relax\diagram@\diagram@@{#1}}
+
+\xydef@\diagram@{\relax
+ \ifmmode \DN@##1##2{\vcenter{\oldxymatrix@true \xy##1{\xymatrix{##2}}\endxy}}%
+ \else\DN@##1##2{{\oldxymatrix@true \xy/u.8ex/##1{\xymatrix{##2}}\endxy}}%
+ \fi \next@}
+
+\xydef@\LaTeXdiagrams{\def\diagram{\ltxdiagram@\diagram@@}%
+ \def\diagramnocompile{\ltxdiagram@\literal@}% Declared in Compiling
+ \def\diagramcompileto##1{\ltxdiagram@{\NoCompileMatrices\xycompileto{##1}}}}
+
+\xydef@\ltxdiagram@#1#2\end#3{\relax
+ \DN@{#3}\DNii@{diagram}\ifx\next@\nextii@\diagram@{#1}{#2}\end{diagram}%
+ \else\xyerr@{Put \string{\string} around \string\begin...\string\end\space
+ within diagrams}\fi}
+
+\xylet@\diagram@@=\literal@
+
+\xydef@\NoisyDiagrams{}
+\DOCMODE)
+
+ ??c![\NoisyDiagrams] is ignored because the matrix feature always
+ outputs progress messages.
+
+ Finally the version 2 ??c![\spreaddiagramrows],
+ |\spread|\-|diagramcolumns|??c[\spreaddiagramcolumns] spacing
+ commands are emulated using |\xymatrixrowsep| and |\xymatrixcolsep|:
+
+\DOCMODE(
+\xydef@\spreaddiagramrows#1{\addPLUS@\xymatrixrowsep{#1}}
+\xydef@\spreaddiagramcolumns#1{\addPLUS@\xymatrixcolsep{#1}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsubsection*{Arrows}
+
+ The main arrow commands of version 2 were the ??c![\morphism] and
+ ??c![\definemorphism] commands which now have been replaced by the
+ |\ar| command.
+
+ |v2| provides them as well as uses them to define the version~2
+ commands ??c![\xto], ??c![\xline], ??c![\xdashed], ??c![\xdotted],
+ ??c![\xdouble], and all the derived commands |\dto|, |\urto|, \dots;
+ the |\arrow| commands of the $\beta$-releases of v3 is also provided.
+
+ Instead of commands like |\rrto| and |\uldouble| you should use the
+ arrow feature replacements |\ar[rr]| and |\ar@{=}[ul]|.
+
+ The predefined turning solid arrows |\lltou|, \dots, |\tord| are
+ defined as well; these are now easy to do with <turn>s.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% translating `old' arrows into `new' ones:
+% \\\([durl][durl]*\)to \\ar[\1]
+% \\\([durl][durl]*\)line \\ar@{-}[\1]
+% \\\([durl][durl]*\)dashed \\ar@{--}[\1]
+% \\\([durl][durl]*\)dotted \\ar@{.}[\1]
+% \\\([durl][durl]*\)double \\ar@{=}[\1]
+
+\DOCMODE(
+\xyrequire{arrow}\xycatcodes
+\xylet@\arrow=\ar
+\DOCMODE)
+
+ |\morphism| is a reduced version of the |\ar| command.
+
+\DOCMODE(
+%\xyuncatcodes \catcode35=6
+% \def\next#1#2#3{\relax \PATH ~={#1} ~>{\POS?>*{#2}\relax} ~<{\POS;?<*{#3};\relax}}
+%\xycatcodes
+%\xylet@\morphism=\next
+
+{\xyuncatcodes
+ \gdef\morPHISM#1#2#3{\PATH~={\oldconnect{#1}}~<{|<*{#3}}~>{|>*{#2}}}}
+
+\xydef@\morphism{\relax\morPHISM}
+
+\xylet@\connect@iii=\connect
+\xydef@\oldconnect#1{%
+ \let\PATHlabelabove@@=\PATHlabelabove@ %KLUDGE!
+ \let\PATHlabelbelow@@=\PATHlabelbelow@
+ \let\connect=\preconnect#1\let\connect=\connect@iii}
+\DOCMODE)
+
+ \TODO: Unpack this to what |\PATH| does\dots
+
+ |\definemorphism| is essentially unchanged except we now use the
+ privacy checking commands.
+
+\DOCMODE(
+\xydef@\definemorphism#1#2#3#4{%
+ \xydefcsname@{x#1}{\morphism{#2}{#3}{#4}}%
+ \xydefcsname@{u#1}{\morphism{#2}{#3}{#4}[u]}%
+ \xydefcsname@{d#1}{\morphism{#2}{#3}{#4}[d]}%
+ \xydefcsname@{l#1}{\morphism{#2}{#3}{#4}[l]}%
+ \xydefcsname@{r#1}{\morphism{#2}{#3}{#4}[r]}%
+ \xydefcsname@{uu#1}{\morphism{#2}{#3}{#4}[uu]}%
+ \xydefcsname@{dd#1}{\morphism{#2}{#3}{#4}[dd]}%
+ \xydefcsname@{ll#1}{\morphism{#2}{#3}{#4}[ll]}%
+ \xydefcsname@{rr#1}{\morphism{#2}{#3}{#4}[rr]}%
+ \xydefcsname@{ur#1}{\morphism{#2}{#3}{#4}[ur]}%
+ \xydefcsname@{ul#1}{\morphism{#2}{#3}{#4}[ul]}%
+ \xydefcsname@{dr#1}{\morphism{#2}{#3}{#4}[dr]}%
+ \xydefcsname@{dl#1}{\morphism{#2}{#3}{#4}[dl]}%
+ \xydefcsname@{uul#1}{\morphism{#2}{#3}{#4}[uul]}%
+ \xydefcsname@{uur#1}{\morphism{#2}{#3}{#4}[uur]}%
+ \xydefcsname@{ull#1}{\morphism{#2}{#3}{#4}[ull]}%
+ \xydefcsname@{urr#1}{\morphism{#2}{#3}{#4}[urr]}%
+ \xydefcsname@{ddl#1}{\morphism{#2}{#3}{#4}[ddl]}%
+ \xydefcsname@{ddr#1}{\morphism{#2}{#3}{#4}[ddr]}%
+ \xydefcsname@{dll#1}{\morphism{#2}{#3}{#4}[dll]}%
+ \xydefcsname@{drr#1}{\morphism{#2}{#3}{#4}[drr]}%
+ \xydefcsname@{uull#1}{\morphism{#2}{#3}{#4}[uull]}%
+ \xydefcsname@{uurr#1}{\morphism{#2}{#3}{#4}[uurr]}%
+ \xydefcsname@{ddll#1}{\morphism{#2}{#3}{#4}[ddll]}%
+ \xydefcsname@{ddrr#1}{\morphism{#2}{#3}{#4}[ddrr]}}
+
+\definemorphism{to}\solid\tip\notip
+\definemorphism{line}\solid\notip\notip
+\definemorphism{dashed}\dashed\notip\notip
+\definemorphism{dotted}\dotted\notip\notip
+\definemorphism{double}\Solid\notip\notip
+\DOCMODE)
+
+ \TODO: These could be "hugely" optimised by using the |arrow| feature
+ directly\dots
+
+ Next the predefined bent morphisms of version 2. These required some
+ hacking to work; I hope this doesn't mean that the <path> semantics
+ has changed to much\dots\frowny
+
+\DOCMODE(
+\xywarnifdefined\xyviitoi
+\xywarnifdefined\xyviitoii
+
+\xydef@\XXtoY@#1#2#3#4#5{\save;[#3]\relax
+ \xy@@{%
+ \dimen@=\turnradius@ \ifdim#1<#2\relax \dimen@ii=#2\else\dimen@ii=#1\fi
+ \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi
+ \edef\xyviitoi{\the\dimen@}\leave@}%
+ \xto ~{[#3]} `#4[#3]#5/#4\xyviitoi/ `[#3]}
+
+\xydef@\toXY@#1#2#3#4#5{\xy@@{\idfromc@{@}%
+ \dimen@=\turnradius@ \dimen@ii=#1\relax
+ \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi
+ \edef\xyviitoi{\the\dimen@}%
+ \dimen@=\turnradius@ \dimen@ii=#2\relax
+ \advance\dimen@\ifdim\dimen@>\dimen@ii +\dimen@\else +\dimen@ii\fi
+ \edef\xyviitoii{\the\dimen@}}%
+ \morphism\solid{\object #4:(-1,0)\dir{>}}\notip
+ ~{`"@" "@"} `#3"@"#5/#3\xyviitoi/#5/#4\p@/ `"@"#5/#4\xyviitoii/}
+
+\xyuncatcodes \catcode64=11 %
+
+\xydef@\lltod{\XXtoY@\D@c\D@p{ll}{d}+}
+\xydef@\lltou{\XXtoY@\U@c\U@p{ll}{u}+}
+\xydef@\rrtod{\XXtoY@\D@c\D@p{rr}{d}+}
+\xydef@\rrtou{\XXtoY@\U@c\U@p{rr}{u}+}
+\xydef@\ddtol{\XXtoY@\L@c\L@p{dd}{l}+}
+\xydef@\ddtor{\XXtoY@\R@c\R@p{dd}{r}+}
+\xydef@\uutol{\XXtoY@\L@c\L@p{uu}{l}+}
+\xydef@\uutor{\XXtoY@\R@c\R@p{uu}{r}+}
+
+\xydef@\told{\toXY@\L@c\D@c{l}{d}+}
+\xydef@\tolu{\toXY@\L@c\U@c{l}{u}+}
+\xydef@\tord{\toXY@\R@c\D@c{r}{d}+}
+\xydef@\toru{\toXY@\R@c\U@c{r}{u}+}
+\xydef@\todl{\toXY@\D@c\L@c{d}{l}+}
+\xydef@\todr{\toXY@\D@c\R@c{d}{r}+}
+\xydef@\toul{\toXY@\U@c\L@c{u}{l}+}
+\xydef@\tour{\toXY@\U@c\R@c{u}{r}+}
+
+\xycatcodes
+\DOCMODE)
+
+ Finally the version 2 arrow radius default command that actually
+ never worked but some people might have hoped\dots
+
+\DOCMODE(
+\xydef@\TurnRadius{\addEQ@\turnradius}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Obsolete loading}
+??=[loading]
+
+ The v2 User's Manual says that you can load \Xy-pic with the command
+ ??c![\input xypic] and as a \LaTeX~2.09 `style option' |[xypic]|.
+ This is made synonymous with loading this option by the files
+ ??c![xypic.tex] and ??c![xypic.sty] distributed with the |v2| option.
+
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{description}
+
+\item[|xypic.tex|:]
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsubsection*{xypic.doc}
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\inputdoc!{xypic.doc}
+
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\item[|xypic.sty|:]
+ Loads |xy.sty| and the |v2| feature.
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsubsection*{xypic.sty}
+\inputdoc0{xypic.sty}
+
+\DOCMODE1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end{description}
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Compiling v2-diagrams}
+??=[compiling]
+
+ In order to make it possible to use the new compilation features even
+ on documents written with \Xy-pic v2, the following command was
+ added in v2.12:
+%
+\begin{defs1}
+|\diagramcompileto{| <name> |}| \dots\ |\enddiagram| \cr
+\end{defs1}
+\noindent\unskip
+%
+ which is like the ordinary diagram command except the result is
+ compiled (see note~??g[xy.doc:compile]). Note that compilation is
+ not quite safe in all cases!
+
+\DOCMODE(
+\xydef@\diagramcompileto#1#2\enddiagram{\relax
+ \diagram@{\NoCompileMatrices\xycompileto{#1}}{#2}}
+\DOCMODE)
+
+ There is also the following command that switches on "automatic
+ compilation" of all diagrams created with the v2 |\diagram| \dots\
+ |\enddiagram| command:
+%
+\begin{defs1}
+|\CompileAllDiagrams| |{| <prefix> |}| \cr
+|\NoCompileAllDiagrams| \cr
+|\ReCompileAllDiagrams| \cr
+\end{defs1}
+\noindent\unskip
+%
+ will apply |\xycompileto{|<prefix>$n$|}{|\dots|}| to each diagram
+ with~$n$ a sequence number starting from~1. Use |\CompileMatrices|
+ and |\CompilePrefix| instead!
+
+ If for some reason a diagram does not work when compiled then replace
+ the |\diagram| command with |\diagramnocompile| (or in case you are
+ using the \LaTeX\ form, |\begin{diagramnocompile}|).
+
+\DOCMODE(
+\xydef@\diagramnocompile#1\enddiagram{\relax\diagram@\literal@{#1}}
+\DOCMODE)
+
+\DOCMODE(
+\xydef@\CompileAllDiagrams#1{\CompilePrefix{#1}\CompileMatrices}
+\xydef@\NoCompileAllDiagrams{\NoCompileMatrices}
+\xydef@\ReCompileAllDiagrams{\CompileMatrices}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection*{End \& log}
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyv2.doc,v $
+% Revision 3.4 1997/05/18 01:14:25 krisrose
+% Essential bugfixes.
+%
+% Revision 3.3 1996/12/19 14:43:55 krisrose
+% Maintenance release.
+%
+% Revision 3.2 1995/09/19 18:22:27 kris
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:31:32 kris
+% Releasing!
+%
+% Revision 3.0 1995/07/07 20:14:21 kris
+% Major release w/new User's Guide!
+%
+% Revision 2.14 1995/07/05 22:10:12 kris
+% Buglets...
+%
+% Revision 2.13 1995/07/04 15:11:17 kris
+% Ready to release v3?
+%
+% Revision 2.12 1994/10/25 11:34:25 kris
+% Interim release just before v3 [works with AMS-LaTeX 1.2]...
+%
+% Revision 2.11 1994/07/05 10:37:32 kris
+% Third 3beta release [bug fixes].
+% Experimental graph feature included (for ECCT-94 presentation).
+%
+% Revision 2.10 1994/06/15 12:55:07 kris
+% Second 3beta release: bug fixes.
+%
+% Revision 2.9 1994/06/09 14:59:19 kris
+% Release 3beta.
+%
+% Revision 2.8 1994/04/08 04:30:00 kris
+% Second (bug fix) 3alpha release.
+%
+% Revision 2.7 1994/03/08 02:06:01 kris
+% Release 3alpha.
+%
+% Revision 2.6.9.1 1994/03/07 04:22:46 kris
+% Last internal 3alpha and pre-2.7 release.
+%
+% NEW file to go in version 2.7 (extracted from xy.doc 2.6.1.1).
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-prefix:"\t"
+% fill-column:77
+% paragraph-separate:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% paragraph-start:"^[ \t\f]*$\\|^[^\t]\\|\\\\\\\\\\|\\$\\$\\|[^\n\\\\][%&]"
+% TeX-parse-self:nil
+% LaTeX-indent-level:1
+% TeX-brace-indent-level:1
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyweb.doc b/Master/texmf-dist/source/generic/xypic/xyweb.doc
new file mode 100644
index 00000000000..06b77d7e310
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyweb.doc
@@ -0,0 +1,326 @@
+%% $Id: xyweb.doc,v 3.3 1996/12/18 09:52:11 ross Exp $
+%%
+%% Xy-pic ``Lattice and web'' feature.
+%% Copyright (c) 1994-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{web}{Lattice and web feature}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+ This feature provides macros to facilitate typesetting of arrangements
+ of points within a 2-dimensional lattice or ``web-like'' structure.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\message{lattices,}
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+We need two counters and macros to access their values.
+
+\DOCMODE(
+\xynew@{count}\lattice@A
+\xynew@{count}\lattice@B
+\xydef@\latticeA{\lattice@A}
+\xydef@\latticeB{\lattice@B}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%\subsection{Lattices}
+%\noindent
+Currently the only routines implemented with this feature are some ``quick
+and dirty'' macros for dropping objects at the points of an integer lattice.
+\TODO: More sophisticated routines will be developed for later versions of
+\Xy-pic, as the need arises.
+
+Mathematically speaking, let $\vec u$ and $\vec v$ be vectors pointing in
+independent directions within the plane. Then the lattice spanned by
+$\vec u$ and $\vec v$ is the infinite set of points $L$ given by:
+$$
+L\;=\; \bigl\{ a\,\vec u + b\,\vec v\;;\;
+\mbox{ for $a$, $b$ integers} \bigr\}\,.
+$$
+Within \Xy-pic the vectors $\vec u$ and $\vec v$ can be established
+as the current coordinate basis vectors.
+The following macros typeset a finite subset of an abstract lattice.
+%
+\begin{defs}
+|\xylattice#1#2#3#4| & points in lattice\cr
+|\croplattice#1#2#3#4#5#6#7#8|\kern-44pt&\cr
+ &\dots in specific rectangle.\cr
+\end{defs}
+%
+\noindent
+The parameters |#1| \dots |#4| are to be integers
+$a_{\min}$, $a_{\max}$, $b_{\min}$ and $b_{\max}$,
+so that the portion of the lattice to be typeset
+is that collection of vectors in $L$ for which
+$a_{\min} \le a \le a_{\max}$ and $b_{\min} \le b \le b_{\max}$.
+%
+\begin{code}
+\def\latticebody{%
+\ifnum\latticeA=1 \ifnum\latticeB=-1 %
+\else\drop{\circ}\fi\else\drop{\circ}\fi}
+\xy *\xybox{0;<1.5pc,1mm>:<1mm,1.5pc>::
+,0,{\xylattice{-4}4{-3}3}
+ ,(1,-1)="a"*{\bullet}*+<2pt>!UL{a}
+ ,(-1,1)."a"*\frm{.}}="L"
+,{"L"+L \ar "L"+R*+!L{s^{(1)}}}
+,{"L"+D \ar "L"+U*+!D{s^{(2)}}}
+\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+In the above code, notice how the basis is first established then the
+|\xylattice| typeset. Doing this within an |\xybox| allows axes
+to be sized and placed appropriately.
+Since lattice points are determined by their (integer) coordinate
+displacements, they can be revisited to add extra <object>s into
+the overall picture. More generally, the origin for lattice-coordinates
+is the current <pos> $c$, when the |\xylattice| command is encountered.
+Easy accessibility is maintained, as seen in the next example.
+
+\medskip
+
+When the basis vectors $\vec u$ and $\vec v$ are not perpendicular
+the collection of points with $a,b$ in these ranges will fill out
+a skew parallelogram. Generally it is useful to plot only those points
+lying within a fixed rectangle.
+This is the purpose of |\croplattice|, with its extra parameters
+|#5| \dots |#8| determining the `cropping' rectangle within which
+lattice points will be typeset. Other points will not be typeset
+even when $a$ and $b$ are within the specified ranges.
+Explicitly the horizontal range of the cropping rectangle is $X_{\min}$
+to $X_{\max}$, with $X_{\min}$ being the $X$-coordinate of the vector
+$|#5|\times\vec u$, where |#5| is a <number> (not necessarily an integer).
+Similarly $X_{\max}$ is the $X$-coordinate of $|#6|\times\vec u$.
+The vertical extents are $Y_{\min}$ and $Y_{\max}$, given by the
+$Y$-coordinates of $|#7|\times\vec v$ and $|#8|\times\vec v$ respectively.
+%
+\begin{code}
+\def\latticebody{%
+\ifnum\latticeA=1 \ifnum\latticeB=-1 %
+\else \drop{\circ}\fi\else
+\ifnum\latticeA=0 \ifnum\latticeB=1\else
+\drop{\circ}\fi\else\drop{\circ}\fi\fi}
+\xy +(2,2)="o",0*\xybox{%
+ 0;<3pc,1.5mm>:<0.72pc,1.65pc>::,{"o"
+ \croplattice{-4}4{-4}4{-2.6}{2.6}{-3}3}
+ ,"o"+(0,1)="a"*{\bullet}*+!D{\alpha}
+ ,"o"+(1,-1)="b"*{\bullet}*+!L{\beta}
+ ,"o"+(0,-1)="c","o"+(-1,1)="d"
+ ,"a"."c"="e",!DR*{};"a"**\dir{.}
+ ,"e",!UL*{};"c"**\dir{.}
+ ,"b"."d"="f",!DL*{};"b"**\dir{.}
+ ,"f",!UR*{};"d"**\dir{.}
+ ,"e"."f"*\frm{.}}="L","o"."L"="L"
+ ,{"L"+L \ar "L"+R*+!L{s^{(1)}}}
+ ,{"L"+D \ar "L"+U*+!D{s^{(2)}}}
+\endxy
+\end{code}
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The routines |\xylattice| and |\croplattice| simply cycle through the
+allowable range of values for |\lattice@A| and |\lattice@B|,
+with |\lattice@B| varying within the inner loop.
+
+\DOCMODE(
+\xydef@\xylattice#1#2#3#4{\xy@{LATTICE}{\xylattice@{#1}{#2}{#3}{#4}}}%
+
+\xydef@\xylattice@#1#2#3#4{%
+ \lattice@A=#1\relax
+ \loop \bgroup\lattice@B=#3\relax
+ \innerlatticeloop@{#4}%
+ \edef\tmp@{\egroup
+ \X@min=\the\X@min \X@max=\the\X@max
+ \Y@min=\the\Y@min \Y@max=\the\Y@max
+ }\tmp@ \ifnum\lattice@A<#2\relax \advance\lattice@A\@ne
+ \repeat }
+
+\xydef@\innerlatticeloop@#1{%
+ \loop \enter@{\cfromthec@}\enter@{\cplusthec@}%
+ \vfromcartesian@@ \the\lattice@A,\the\lattice@B @%
+ \edef\latticeX{\expandafter\removePT@\the\X@c}%
+ \edef\latticeY{\expandafter\removePT@\the\Y@c}%
+ \leave@ \latticebody \leave@
+ \ifnum\lattice@B<#1\relax \advance\lattice@B\@ne
+ \repeat }
+\DOCMODE)
+
+With |\xylattice| getting the picture size correct is simply
+a matter of passing |\X@min|, |X@max|, etc. outside of the inner group.
+However with |\croplattice| these are first set to correspond to the
+`cropping rectangle' then subsequently merged with their original
+values.
+
+\DOCMODE(
+\xydef@\croplattice#1#2#3#4#5#6#7#8{\xy@{LATTICE}%
+ {\xycroplattice@{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}%
+
+\xydef@\xycroplattice@#1#2#3#4#5#6#7#8{%
+ \enter@{\X@min=\the\X@min \X@max=\the\X@max
+ \Y@min=\the\Y@min \Y@max=\the\Y@max}%
+ \enter@{\cfromthec@}\enter@{\cplusthec@}%
+ \vfromcartesian@@ #5,0 @\leave@ \X@min=\X@c \leave@
+ \enter@{\cfromthec@}\enter@{\cplusthec@}%
+ \vfromcartesian@@ #6,0 @\leave@ \X@max=\X@c \leave@
+ \enter@{\cfromthec@}\enter@{\cplusthec@}%
+ \vfromcartesian@@ 0,#7 @\leave@ \Y@min=\Y@c \leave@
+ \enter@{\cfromthec@}\enter@{\cplusthec@}%
+ \vfromcartesian@@ 0,#8 @\leave@ \Y@max=\Y@c \leave@
+ \lattice@A=#1\relax
+ \loop
+ \bgroup\lattice@B=#3\relax
+ \enter@{\cfromthec@}\innercroplatticeloop@{#4}\leave@
+ \egroup
+ \ifnum\lattice@A<#2\relax \advance\lattice@A\@ne
+ \repeat \mergecropextents@ }
+
+\xydef@\innercroplatticeloop@#1{%
+ \loop
+ \enter@{\cfromthec@}\enter@{\cplusthec@}%
+ \vfromcartesian@@ \the\lattice@A,\the\lattice@B @%
+ \edef\latticeX{\expandafter\removePT@\the\X@c}%
+ \edef\latticeY{\expandafter\removePT@\the\Y@c}%
+ \leave@ \DN@{\latticebody}%
+ \ifdim\X@c<\X@min\DN@{}%
+ \else\ifdim\X@c>\X@max\DN@{}%
+ \else\ifdim\Y@c<\Y@min\DN@{}%
+ \else\ifdim\Y@c>\Y@max\DN@{}%
+ \fi\fi\fi\fi \next@ \leave@
+ \ifnum\lattice@B<#1\relax \advance\lattice@B\@ne
+ \repeat }
+
+\xydef@\mergecropextents@{%
+ \edef\tmp@{%
+ \noexpand\ifdim\X@min>\the\X@min \X@min=\the\X@min\noexpand\fi
+ \noexpand\ifdim\X@max<\the\X@max \X@max=\the\X@max\noexpand\fi
+ \noexpand\ifdim\Y@min>\the\Y@min \Y@min=\the\Y@min\noexpand\fi
+ \noexpand\ifdim\Y@max<\the\Y@max \Y@max=\the\Y@max\noexpand\fi}%
+ \leave@ \tmp@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The |\latticebody| macro.}
+At each lattice point within the specified range for $a,b$ (and within
+the cropping rectangle when |\croplattice| is used), a macro called
+|\latticebody| is expanded. This is meant to be user-definable,
+so as to be able to adapt to any specific requirement.
+It has a default expansion given by \dots
+$$
+|\def\latticebody{\drop{\bullet}}|\,.
+$$
+The following macros may be useful when specifying what to do at each
+point of the lattice.
+%
+\begin{defs}
+|\latticebody| & expanded at lattice points \cr
+|\defaultlatticebody|\kern-20pt & \kern20pt resets to default \cr
+|\latticeA| & $a$-value of lattice point\cr
+|\latticeB| & $b$-value of lattice point\cr
+|\latticeX| & $X$-coord, offset in |pt|s\dots\cr
+|\latticeY| & $Y$-coord, \dots from lattice origin.\cr
+\end{defs}
+As in the examples presented above, the object dropped at the lattice
+point can be varied according to its location, or omitted altogether.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The default |\latticebody| macro \dots
+
+\DOCMODE(
+\xydef@\deflatticebody@{\def\latticebody{\drop{\bullet}}}
+\xydef@\defaultlatticebody{\deflatticebody@}
+\deflatticebody@
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+In the final example the |\latticebody| macro
+performs a calculation to decide which lattice points
+should be emphasised:
+%
+\begin{code}
+\def\latticebody{\dimen0=\latticeX pt
+ \ifdim\dimen0>0pt \divide\dimen0 by 64
+ \dimen0=\latticeY\dimen0 \relax
+ \ifdim 0pt>\dimen0 \dimen0=-\dimen0 \fi
+ \ifdim 10pt>\dimen0 \drop{\bullet}%
+ \else\drop{.}\fi \else\drop{.}\fi}
+\xy*\xybox{0;<3pc,2.57mm>:<.83pc,2.25pc>::
+,0,{\croplattice{-3}5{-5}5
+ {-1.3}{4.5}{-3.4}{4.4}}}="L"
+,{"L"+L \ar "L"+!R*+!L{\sigma^{(1)}}}
+,{"L"+D \ar "L"+!U*+!D{\sigma^{(2)}}}
+\endxy
+\end{code}
+%\displaycode
+$$\docode$$
+\displaycode
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyweb.doc,v $
+% Revision 3.3 1996/12/18 09:52:11 ross
+% no changes
+%
+% Revision 3.1 1995/09/05 20:36:33 ross
+% Release!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/05 10:36:22 ross
+% Ready for v3 release?
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End:
diff --git a/Master/texmf-dist/source/generic/xypic/xyxdvi.doc b/Master/texmf-dist/source/generic/xypic/xyxdvi.doc
new file mode 100644
index 00000000000..0a33c52cf24
--- /dev/null
+++ b/Master/texmf-dist/source/generic/xypic/xyxdvi.doc
@@ -0,0 +1,335 @@
+%% $Id: xyxdvi.doc,v 3.3 1996/12/18 09:53:22 ross Exp $
+%%
+%% Xy-pic ``xdvi-driver'' option.
+%% Copyright (c) 1995-1996 Ross Moore <ross@mpce.mq.edu.au>
+%%
+%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
+%% See the companion README and INSTALL files for further information.
+%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
+%%
+%% The Xy-pic package is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by the
+%% Free Software Foundation; either version 2 of the License, or (at your
+%% option) any later version.
+%%
+%% The Xy-pic package is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+%% for more details.
+%%
+%% You should have received a copy of the GNU General Public License along
+%% with this package; if not, write to the Free Software Foundation, Inc.,
+%% 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\ifx\xyloaded\undefined \input xy \fi
+
+\xyprovide{xdvi}{XDVI driver}{\stripRCS$Revision: 3.3 $}%
+ {Ross Moore}{ross@mpce.mq.edu.au}%
+ {Mathematics Department, Macquarie University, NSW~2109, Australia}
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This driver provides support for extensions when using variants of the
+|xdvi| driver, by Eric Cooper, Bob Scheifler, Mark Eichin and others.
+It has been used successfully with |xdvi| patchlevel 20, by Paul Vojta,
+and |xdvik| version~18f, by Karl Berry.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Some of the supported features assume that the implementation of |xdvi| is
+linked to a \PS\ renderer; e.g. {\it Ghostscript} or {\sc Display \PS}.
+If such support is not available, then invoking |xdvi| using the command
+|xdvi -hushspecials| will suppress warning messages that might otherwise
+be produced.
+One drawback of such a setup is that much of the \PS\ is not
+rendered until after all of the font characters, etc. have been placed on
+the page. Thus text that was meant to be placed on top of a filled or
+patterned region may appear to be obscured by it. However when printed,
+using a \PS\ printer, the correct placement is obtained.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph*{Header:}\leavevmode
+\DOCHEADER
+
+\paragraph*{Driver installation}
+\DOCMODE(
+\xydef@\xdvi@@#1{\dvimessage@{xdvi}{#1}}
+
+\newdriver{%
+ \xyaddsupport{color}\xdviColor@@
+ \xyaddsupport{crayon}\xdviCrayola@@
+ \xyaddsupport{ps}\xdviPS@@
+ \xyaddsupport{rotate}\xdviRotate@@
+ \xyaddsupport{line}\xdviLine@@
+ \xyaddsupport{frame}\xdviFrames@@
+ \xyaddsupport{tile}\xdviTiles@@
+ \xyaddsupport{tpic}\xdviTPIC@
+}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Supported |\special| effects are...
+%
+\begin{itemize}
+
+\item colour, using \PS.
+
+Not all versions of |xdvi| support color |\special|s, so there is no direct
+support for colour. However parts of pictures rendered using \PS\ may
+appear coloured, due to interpretation of colour commands within the \PS.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Disable the |\xylocalColor@| but enable the |\xycolor@| for use by \PS.
+
+\DOCMODE(
+\xydef@\xdvi@Color@{\xdviPStypes@
+ \let\xylocalColor@=\xyNoColor@@
+% \let\xylocalColor@=\xystackcolor@
+% \let\xycolor@push\xycolor@push@@
+ \def\xycolor@{\xycolor@@}\let\xycolorwarning@=\relax
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}\installPScolor@ }%
+ \else\DN@{}\fi \next@
+ \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi
+ \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\xdviCrayola@{}}%
+ \else \DN@{\xystandardcolors@}\fi \next@
+ \let\xdviColor@@=\relax
+ \let\UnloadColor@@=\NoXDVIcolor@
+ }%
+
+\xydef@\xdviColor@@{\xdvi@Color@}
+
+\xydef@\NoXDVIcolor@{%
+ \def\xycolor@{\xycolor@@}%
+ \let\xycolor@@=\xyNoColor@
+ \let\xylocalColor@=\xyNoColor@@
+ \let\xycolorwarning@=\xycolorwarning@@
+ \let\xdviColor@@=\xdvi@Color@
+ \let\UnloadColor@@=\UnloadColor@
+ }
+\DOCMODE)
+
+If neither support file |colordvi.tex| nor |colordvi.sty| can be found,
+then the normal colour support will not be available. However the colour
+support for the \PS\ back-end can still be used.
+
+\DOCMODE(
+\xydef@\NoXDVIcolordvi@{\xywarning@{%
+ Neither colordvi.tex nor colordvi.sty could be found.}%
+ \xyBEcolorcheck@}%
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item crayon colours.
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The 68 colours that |xdvi| recognizes by name are not loaded unless the
+|crayon| option has been requested.
+
+\DOCMODE(
+\xydef@\xdviCrayola@@{\xdviColor@@\xdviCrayola@}
+
+\xydef@\xdviCrayola@{%
+ \let\prevxycolor@=\newxycolor@
+ \def\newxyXDVIcolor@##1##2##3{\prevxycolor@{##1}{}{##1}}%
+ \let\newxycolor@=\newxyXDVIcolor@
+ \installCrayolaColors@
+ \let\newxycolor@=\prevxycolor@ }%
+\DOCMODE)
+
+Although any order of loading options: |ps|, |xdvi|, |color| and |crayon|
+produces the desired result visually, the \PS\ code can be different
+with different loading order. The most easily readable is obtained when
+|crayon| is requested last.
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \PS\ back-end.
+\DOCMODE(
+\xydef@\xdviPS@@{\xdviPS@}
+
+\xydef@\xdviPS@unload{\UnloadPS@
+ \let\UnloadPS@@=\UnloadPS@
+ \let\xdviPS@@=\xdviPS@ }
+\DOCMODE)
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The latest versions of |xdvi| recognise most forms of |\special| command
+that are recognised by |dvips|; these are used to support \PS\ effects.
+
+\DOCMODE(
+\xydef@\xdviPStypes@{%
+ \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
+ \ifx\PSspecial@@\xdviSpecial@\else
+ \let\PSspecial@@=\xdviSpecial@
+ \let\PSmacro@@=\xdviMacro@
+ \let\PSdict@@=\xdviDict@
+ \let\PSspecialdict@@=\xdviDict@
+ \let\PSraw@@=\xdviRaw@
+ \let\PSinclude@@=\xdviInclude@
+ \let\xyPSobeylines@@=\obeyXDVIlines@
+ \let\xyPScurrpt@@=\xdviCurrpt@@
+ \xdvi@@{PostScript}%
+ \fi \XYpredict@ }
+
+\xywarnifdefined\xdviSpecial@
+\xywarnifdefined\xdviMacro@
+\xywarnifdefined\xdviDict@
+\xywarnifdefined\xdviInclude@
+\xywarnifdefined\xdviRaw@
+{\catcode`\"=11 \catcode`\!=11 \catcode`\:=11
+ \gdef\xdviSpecial@#1{\special{ps:: SDict begin #1 end}}
+ \gdef\xdviMacro@#1{\firstPS@@\special{" {#1}xy}}
+% \gdef\xdviDict@#1{\special{! mark{#1}stopped cleartomark}}
+ \gdef\xdviDict@#1{\special{! #1}}
+ \gdef\xdviInclude@#1{\special{header=#1}}
+ \gdef\xdviRaw@#1{\special{ps: SDict begin #1 end}}
+
+\catcode`\^^M=\active %
+ \gdef\next{\catcode`\^^M=\active \let^^M=\space }}%
+\xylet@\obeyXDVIlines@=\next
+\DOCMODE)
+
+All the \PS\ definitions passed to |xdvi| by reading the
+dictionary file are stored in a \PS\ dictionary which it defines,
+called |SDict|. This must be the current dictionary whenever an \Xy-ps
+command is to be executed.
+This will be the case whenever the |\special{" |{\it commands}|}| or
+|\special{! |{\it commands}|}| forms are used, but not when the
+|\special{ps:: |{\it commands}|}| form is used.
+Thus the |\xdviSpecial@| macro includes code to open |SDict| and
+close it when finished; so also does the |\xdviRaw@| type, since this
+is used with \Xy-pic\ \PS\ operators whose definitions have been placed
+within |SDict|.
+
+The |currentpoint| is defined for the ``raw'' specials.
+
+\DOCMODE(
+\xydef@\xdviCurrpt@{\let\xyPScurrpt@@=\xdviCurrpt@@}%
+\xydef@\xdviCurrpt@@{\PSraw@@{xyp}}
+\DOCMODE)
+
+The \PS\ operator called |xyp| is defined in |xyps-ps| for storing the
+location read from |currentpoint|.
+
+\medskip
+
+This installs the \PS\ backend.
+
+\DOCMODE(
+\xydef@\xdviPS@{\xdviPStypes@
+ \let\xdviPS@@=\PSspecials@true
+ \let\UnloadPS@@=\xdviPS@unload
+ \let\installxyps@@=\relax \installxyps@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item rotated/scaled diagrams and text, using \PS.
+\DOCMODE(
+\xydef@\xdviRotate@@{\xdviRotate@}
+
+\xydef@\xdviRotate@{\xdviPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
+ \xdviCurrpt@ \xdviRotScale@ \installPSrotscale@ }%
+ \else\DN@{\xydriverfail@{rotations are}UnloadRotate@\relax}\fi
+ \next@ }
+
+\xydef@\xdviRotScale@{%
+ \def\xyrot@start(##1){{xyct ##1\space xyrs }}%
+ \def\xyrot@end{}%
+ \def\xyscale@start(##1,##2){{xyct ##1\space##2\space xyss }}%
+ \def\xyscale@end{}}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item variable line-widths and poly-lines, using \PS.
+\DOCMODE(
+\xydef@\xdviLine@@{\xdviLine@}
+
+\xydef@\xdviLine@{\xdviPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
+ \else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item extra frames and fills, using \PS.
+\DOCMODE(
+\xydef@\xdviFrames@@{\xdviFrames@}
+
+\xydef@\xdviFrames@{\xdviPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
+ \else\DN@{\xydriverfail@{frames are}\UnloadFrames@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item patterns and tiles, using \PS.
+\DOCMODE(
+\xydef@\xdviTiles@@{\xdviTiles@}
+
+\xydef@\xdviTiles@{\xdviPStypes@
+ \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
+ \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@ }%
+ \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
+ \next@ }
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\item \TPIC\ drawing commands.
+\DOCMODE(
+\xydef@\xdviTPIC@@{\xdviTPIC@}
+
+\xydef@\xdviTPIC@{\setupxyTPIC@}
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\end{itemize}
+
+\DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\paragraph*{The end \& Log}\leavevmode
+
+\DOCMODE(
+\xyendinput
+
+% $Log: xyxdvi.doc,v $
+% Revision 3.3 1996/12/18 09:53:22 ross
+% minor improvements to file-loading commands
+%
+% Revision 3.2 1995/09/19 18:21:41 ross
+% Bug fix release.
+%
+% Revision 3.1 1995/09/05 20:28:57 ross
+% Releasing version 3.1!
+%
+% Revision 3.0 1995/07/07 20:13:19 ross
+% Major release w/new User's Guide!
+%
+% Revision 2.13 1995/07/04 15:04:51 ross
+% Ready for release of v3.
+%
+% NEW for version 3.
+\DOCMODE)
+
+\DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Tell Emacs that this is a LaTeX document and how it is formatted:
+% Local Variables:
+% mode:latex
+% fill-column:77
+% End: